init
@@ -0,0 +1,369 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): collapse.js and base-component.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
define([
|
||||
"jquery",
|
||||
"./util/index",
|
||||
"./dom/data",
|
||||
"./dom/event-handler",
|
||||
"./dom/manipulator",
|
||||
"./dom/selector-engine"
|
||||
], function($, Util, Data, EventHandler, Manipulator, SelectorEngine) {
|
||||
'use strict';
|
||||
|
||||
const defineJQueryPlugin = Util.defineJQueryPlugin;
|
||||
const executeAfterTransition = Util.executeAfterTransition;
|
||||
const getElement = Util.getElement;
|
||||
const getSelectorFromElement = Util.getSelectorFromElement;
|
||||
const getElementFromSelector = Util.getElementFromSelector;
|
||||
const reflow = Util.reflow;
|
||||
const typeCheckConfig = Util.typeCheckConfig;
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const VERSION = '5.1.3';
|
||||
const NAME = 'collapse';
|
||||
const DATA_KEY = 'bs.collapse';
|
||||
const EVENT_KEY = `.${DATA_KEY}`;
|
||||
const DATA_API_KEY = '.data-api';
|
||||
|
||||
const Default = {
|
||||
toggle: true,
|
||||
parent: null
|
||||
};
|
||||
|
||||
const DefaultType = {
|
||||
toggle: 'boolean',
|
||||
parent: '(null|element)'
|
||||
};
|
||||
|
||||
const EVENT_SHOW = `show${EVENT_KEY}`;
|
||||
const EVENT_SHOWN = `shown${EVENT_KEY}`;
|
||||
const EVENT_HIDE = `hide${EVENT_KEY}`;
|
||||
const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
|
||||
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`;
|
||||
|
||||
const CLASS_NAME_SHOW = 'show';
|
||||
const CLASS_NAME_COLLAPSE = 'collapse';
|
||||
const CLASS_NAME_COLLAPSING = 'collapsing';
|
||||
const CLASS_NAME_COLLAPSED = 'collapsed';
|
||||
const CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`;
|
||||
const CLASS_NAME_HORIZONTAL = 'collapse-horizontal';
|
||||
|
||||
const WIDTH = 'width';
|
||||
const HEIGHT = 'height';
|
||||
|
||||
const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing';
|
||||
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="collapse"]';
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var Collapse = function(element, config) {
|
||||
element = getElement(element);
|
||||
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._element = element;
|
||||
Data.set(this._element, DATA_KEY, this);
|
||||
|
||||
this._isTransitioning = false;
|
||||
this._config = this._getConfig(config);
|
||||
this._triggerArray = [];
|
||||
|
||||
const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE);
|
||||
|
||||
for (let i = 0, len = toggleList.length; i < len; i++) {
|
||||
const elem = toggleList[i];
|
||||
const selector = getSelectorFromElement(elem);
|
||||
const filterElement = SelectorEngine.find(selector)
|
||||
.filter(foundElem => foundElem === this._element);
|
||||
|
||||
if (selector !== null && filterElement.length) {
|
||||
this._selector = selector;
|
||||
this._triggerArray.push(elem);
|
||||
}
|
||||
}
|
||||
|
||||
this._initializeChildren();
|
||||
|
||||
if (!this._config.parent) {
|
||||
this._addAriaAndCollapsedClass(this._triggerArray, this._isShown());
|
||||
}
|
||||
|
||||
if (this._config.toggle) {
|
||||
this.toggle();
|
||||
}
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
||||
Collapse.VERSION = VERSION;
|
||||
|
||||
Collapse.Default = Default;
|
||||
|
||||
Collapse.NAME = NAME;
|
||||
|
||||
Collapse.DATA_KEY = 'bs.' + Collapse.NAME;
|
||||
|
||||
Collapse.EVENT_KEY = '.' + Collapse.DATA_KEY;
|
||||
|
||||
// Public
|
||||
|
||||
Collapse.prototype.dispose = function() {
|
||||
Data.remove(this._element, this.constructor.DATA_KEY);
|
||||
EventHandler.off(this._element, this.constructor.EVENT_KEY);
|
||||
|
||||
Object.getOwnPropertyNames(this).forEach(propertyName => {
|
||||
this[propertyName] = null;
|
||||
})
|
||||
}
|
||||
|
||||
Collapse.prototype._queueCallback = function(callback, element, isAnimated = true) {
|
||||
executeAfterTransition(callback, element, isAnimated);
|
||||
}
|
||||
|
||||
Collapse.prototype.toggle = function() {
|
||||
if (this._isShown()) {
|
||||
this.hide();
|
||||
} else {
|
||||
this.show();
|
||||
}
|
||||
}
|
||||
|
||||
Collapse.prototype.show = function() {
|
||||
if (this._isTransitioning || this._isShown()) {
|
||||
return;
|
||||
}
|
||||
|
||||
let actives = [];
|
||||
let activesData;
|
||||
|
||||
if (this._config.parent) {
|
||||
const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
|
||||
actives = SelectorEngine.find(SELECTOR_ACTIVES, this._config.parent).filter(elem => !children.includes(elem)); // remove children if greater depth
|
||||
}
|
||||
|
||||
const container = SelectorEngine.findOne(this._selector);
|
||||
if (actives.length) {
|
||||
const tempActiveData = actives.find(elem => container !== elem);
|
||||
activesData = tempActiveData ? Collapse.getInstance(tempActiveData) : null;
|
||||
|
||||
if (activesData && activesData._isTransitioning) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const startEvent = EventHandler.trigger(this._element, EVENT_SHOW);
|
||||
if (startEvent.defaultPrevented) {
|
||||
return;
|
||||
}
|
||||
|
||||
actives.forEach(elemActive => {
|
||||
if (container !== elemActive) {
|
||||
Collapse.getOrCreateInstance(elemActive, {toggle: false}).hide();
|
||||
}
|
||||
|
||||
if (!activesData) {
|
||||
Data.set(elemActive, DATA_KEY, null);
|
||||
}
|
||||
})
|
||||
|
||||
const dimension = this._getDimension();
|
||||
|
||||
this._element.classList.remove(CLASS_NAME_COLLAPSE);
|
||||
this._element.classList.add(CLASS_NAME_COLLAPSING);
|
||||
|
||||
this._element.style[dimension] = 0;
|
||||
|
||||
this._addAriaAndCollapsedClass(this._triggerArray, true);
|
||||
this._isTransitioning = true;
|
||||
|
||||
const complete = () => {
|
||||
this._isTransitioning = false;
|
||||
|
||||
this._element.classList.remove(CLASS_NAME_COLLAPSING);
|
||||
this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW);
|
||||
|
||||
this._element.style[dimension] = '';
|
||||
|
||||
EventHandler.trigger(this._element, EVENT_SHOWN);
|
||||
};
|
||||
|
||||
const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
|
||||
const scrollSize = `scroll${capitalizedDimension}`;
|
||||
|
||||
this._queueCallback(complete, this._element, true);
|
||||
this._element.style[dimension] = `${this._element[scrollSize]}px`;
|
||||
}
|
||||
|
||||
Collapse.prototype.hide = function() {
|
||||
if (this._isTransitioning || !this._isShown()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const startEvent = EventHandler.trigger(this._element, EVENT_HIDE);
|
||||
if (startEvent.defaultPrevented) {
|
||||
return;
|
||||
}
|
||||
|
||||
const dimension = this._getDimension();
|
||||
|
||||
this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`;
|
||||
|
||||
reflow(this._element);
|
||||
|
||||
this._element.classList.add(CLASS_NAME_COLLAPSING);
|
||||
this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW);
|
||||
|
||||
const triggerArrayLength = this._triggerArray.length;
|
||||
for (let i = 0; i < triggerArrayLength; i++) {
|
||||
const trigger = this._triggerArray[i];
|
||||
const elem = getElementFromSelector(trigger);
|
||||
|
||||
if (elem && !this._isShown(elem)) {
|
||||
this._addAriaAndCollapsedClass([trigger], false);
|
||||
}
|
||||
}
|
||||
|
||||
this._isTransitioning = true;
|
||||
|
||||
const complete = () => {
|
||||
this._isTransitioning = false;
|
||||
this._element.classList.remove(CLASS_NAME_COLLAPSING);
|
||||
this._element.classList.add(CLASS_NAME_COLLAPSE);
|
||||
EventHandler.trigger(this._element, EVENT_HIDDEN);
|
||||
};
|
||||
|
||||
this._element.style[dimension] = '';
|
||||
|
||||
this._queueCallback(complete, this._element, true);
|
||||
}
|
||||
|
||||
Collapse.prototype._isShown = function(element = this._element) {
|
||||
return element.classList.contains(CLASS_NAME_SHOW);
|
||||
}
|
||||
|
||||
// Private
|
||||
|
||||
Collapse.prototype._getConfig = function(config) {
|
||||
config = {
|
||||
...Default,
|
||||
...Manipulator.getDataAttributes(this._element),
|
||||
...config
|
||||
};
|
||||
config.toggle = Boolean(config.toggle); // Coerce string values
|
||||
config.parent = getElement(config.parent);
|
||||
typeCheckConfig(NAME, config, DefaultType);
|
||||
return config;
|
||||
}
|
||||
|
||||
Collapse.prototype._getDimension = function() {
|
||||
return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT;
|
||||
}
|
||||
|
||||
Collapse.prototype._initializeChildren = function() {
|
||||
if (!this._config.parent) {
|
||||
return;
|
||||
}
|
||||
|
||||
const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent);
|
||||
SelectorEngine.find(SELECTOR_DATA_TOGGLE, this._config.parent).filter(elem => !children.includes(elem))
|
||||
.forEach(element => {
|
||||
const selected = getElementFromSelector(element);
|
||||
|
||||
if (selected) {
|
||||
this._addAriaAndCollapsedClass([element], this._isShown(selected));
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Collapse.prototype._addAriaAndCollapsedClass = function(triggerArray, isOpen) {
|
||||
if (!triggerArray.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
triggerArray.forEach(elem => {
|
||||
if (isOpen) {
|
||||
elem.classList.remove(CLASS_NAME_COLLAPSED);
|
||||
} else {
|
||||
elem.classList.add(CLASS_NAME_COLLAPSED);
|
||||
}
|
||||
|
||||
elem.setAttribute('aria-expanded', isOpen);
|
||||
})
|
||||
}
|
||||
|
||||
// Static
|
||||
|
||||
Collapse.getInstance = function(element) {
|
||||
return Data.get(getElement(element), this.DATA_KEY);
|
||||
}
|
||||
|
||||
Collapse.getOrCreateInstance = function(element, config = {}) {
|
||||
return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null);
|
||||
}
|
||||
|
||||
Collapse.jQueryInterface = function(config) {
|
||||
return this.each(function () {
|
||||
const _config = {};
|
||||
if (typeof config === 'string' && /show|hide/.test(config)) {
|
||||
_config.toggle = false;
|
||||
}
|
||||
|
||||
const data = Collapse.getOrCreateInstance(this, _config);
|
||||
|
||||
if (typeof config === 'string') {
|
||||
if (typeof data[config] === 'undefined') {
|
||||
throw new TypeError(`No method named "${config}"`);
|
||||
}
|
||||
|
||||
data[config]();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||
// preventDefault only for <a> elements (which change the URL) not inside the collapsible element
|
||||
if (event.target.tagName === 'A' || (event.delegateTarget && event.delegateTarget.tagName === 'A')) {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
const selector = getSelectorFromElement(this);
|
||||
const selectorElements = SelectorEngine.find(selector);
|
||||
|
||||
selectorElements.forEach(element => {
|
||||
Collapse.getOrCreateInstance(element, {toggle: false}).toggle();
|
||||
})
|
||||
})
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
* add .Collapse to jQuery only if jQuery is present
|
||||
*/
|
||||
|
||||
defineJQueryPlugin(Collapse);
|
||||
|
||||
return Collapse;
|
||||
});
|
||||
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): dom/data.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
define([], function() {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const elementMap = new Map();
|
||||
|
||||
return {
|
||||
set: function (element, key, instance) {
|
||||
if (!elementMap.has(element)) {
|
||||
elementMap.set(element, new Map())
|
||||
}
|
||||
|
||||
const instanceMap = elementMap.get(element);
|
||||
|
||||
// make it clear we only want one instance per element
|
||||
// can be removed later when multiple key/instances are fine to be used
|
||||
if (!instanceMap.has(key) && instanceMap.size !== 0) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`)
|
||||
return
|
||||
}
|
||||
|
||||
instanceMap.set(key, instance)
|
||||
},
|
||||
|
||||
get: function (element, key) {
|
||||
if (elementMap.has(element)) {
|
||||
return elementMap.get(element).get(key) || null
|
||||
}
|
||||
|
||||
return null
|
||||
},
|
||||
|
||||
remove: function (element, key) {
|
||||
if (!elementMap.has(element)) {
|
||||
return
|
||||
}
|
||||
|
||||
const instanceMap = elementMap.get(element);
|
||||
|
||||
instanceMap.delete(key)
|
||||
|
||||
// free up element references if there are no instances left for an element
|
||||
if (instanceMap.size === 0) {
|
||||
elementMap.delete(element)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,352 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): dom/event-handler.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
define([
|
||||
"../util/index"
|
||||
], function(Util) {
|
||||
'use strict';
|
||||
|
||||
const getjQuery = Util.getjQuery;
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const namespaceRegex = /[^.]*(?=\..*)\.|.*/;
|
||||
const stripNameRegex = /\..*/;
|
||||
const stripUidRegex = /::\d+$/;
|
||||
const eventRegistry = {}; // Events storage
|
||||
let uidEvent = 1;
|
||||
const customEvents = {
|
||||
mouseenter: 'mouseover',
|
||||
mouseleave: 'mouseout'
|
||||
};
|
||||
const customEventsRegex = /^(mouseenter|mouseleave)/i;
|
||||
const nativeEvents = new Set([
|
||||
'click',
|
||||
'dblclick',
|
||||
'mouseup',
|
||||
'mousedown',
|
||||
'contextmenu',
|
||||
'mousewheel',
|
||||
'DOMMouseScroll',
|
||||
'mouseover',
|
||||
'mouseout',
|
||||
'mousemove',
|
||||
'selectstart',
|
||||
'selectend',
|
||||
'keydown',
|
||||
'keypress',
|
||||
'keyup',
|
||||
'orientationchange',
|
||||
'touchstart',
|
||||
'touchmove',
|
||||
'touchend',
|
||||
'touchcancel',
|
||||
'pointerdown',
|
||||
'pointermove',
|
||||
'pointerup',
|
||||
'pointerleave',
|
||||
'pointercancel',
|
||||
'gesturestart',
|
||||
'gesturechange',
|
||||
'gestureend',
|
||||
'focus',
|
||||
'blur',
|
||||
'change',
|
||||
'reset',
|
||||
'select',
|
||||
'submit',
|
||||
'focusin',
|
||||
'focusout',
|
||||
'load',
|
||||
'unload',
|
||||
'beforeunload',
|
||||
'resize',
|
||||
'move',
|
||||
'DOMContentLoaded',
|
||||
'readystatechange',
|
||||
'error',
|
||||
'abort',
|
||||
'scroll'
|
||||
]);
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Private methods
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
function getUidEvent(element, uid) {
|
||||
return (uid && `${uid}::${uidEvent++}`) || element.uidEvent || uidEvent++
|
||||
}
|
||||
|
||||
function getEvent(element) {
|
||||
const uid = getUidEvent(element);
|
||||
|
||||
element.uidEvent = uid
|
||||
eventRegistry[uid] = eventRegistry[uid] || {}
|
||||
|
||||
return eventRegistry[uid]
|
||||
}
|
||||
|
||||
function bootstrapHandler(element, fn) {
|
||||
return function handler(event) {
|
||||
event.delegateTarget = element
|
||||
|
||||
if (handler.oneOff) {
|
||||
EventHandler.off(element, event.type, fn)
|
||||
}
|
||||
|
||||
return fn.apply(element, [event])
|
||||
}
|
||||
}
|
||||
|
||||
function bootstrapDelegationHandler(element, selector, fn) {
|
||||
return function handler(event) {
|
||||
const domElements = element.querySelectorAll(selector);
|
||||
|
||||
for (let {target} = event; target && target !== this; target = target.parentNode) {
|
||||
for (let i = domElements.length; i--;) {
|
||||
if (domElements[i] === target) {
|
||||
event.delegateTarget = target
|
||||
|
||||
if (handler.oneOff) {
|
||||
EventHandler.off(element, event.type, selector, fn)
|
||||
}
|
||||
|
||||
return fn.apply(target, [event])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// To please ESLint
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
function findHandler(events, handler, delegationSelector = null) {
|
||||
const uidEventList = Object.keys(events);
|
||||
|
||||
for (let i = 0, len = uidEventList.length; i < len; i++) {
|
||||
const event = events[uidEventList[i]];
|
||||
|
||||
if (event.originalHandler === handler && event.delegationSelector === delegationSelector) {
|
||||
return event
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
function normalizeParams(originalTypeEvent, handler, delegationFn) {
|
||||
const delegation = typeof handler === 'string';
|
||||
const originalHandler = delegation ? delegationFn : handler;
|
||||
|
||||
let typeEvent = getTypeEvent(originalTypeEvent);
|
||||
const isNative = nativeEvents.has(typeEvent);
|
||||
|
||||
if (!isNative) {
|
||||
typeEvent = originalTypeEvent
|
||||
}
|
||||
|
||||
return [delegation, originalHandler, typeEvent]
|
||||
}
|
||||
|
||||
function addHandler(element, originalTypeEvent, handler, delegationFn, oneOff) {
|
||||
if (typeof originalTypeEvent !== 'string' || !element) {
|
||||
return
|
||||
}
|
||||
|
||||
if (!handler) {
|
||||
handler = delegationFn
|
||||
delegationFn = null
|
||||
}
|
||||
|
||||
// in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position
|
||||
// this prevents the handler from being dispatched the same way as mouseover or mouseout does
|
||||
if (customEventsRegex.test(originalTypeEvent)) {
|
||||
const wrapFn = fn => {
|
||||
return function (event) {
|
||||
if (!event.relatedTarget || (event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget))) {
|
||||
return fn.call(this, event)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (delegationFn) {
|
||||
delegationFn = wrapFn(delegationFn)
|
||||
} else {
|
||||
handler = wrapFn(handler)
|
||||
}
|
||||
}
|
||||
|
||||
const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn);
|
||||
const events = getEvent(element);
|
||||
const handlers = events[typeEvent] || (events[typeEvent] = {});
|
||||
const previousFn = findHandler(handlers, originalHandler, delegation ? handler : null);
|
||||
|
||||
if (previousFn) {
|
||||
previousFn.oneOff = previousFn.oneOff && oneOff
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
const uid = getUidEvent(originalHandler, originalTypeEvent.replace(namespaceRegex, ''));
|
||||
const fn = delegation ?
|
||||
bootstrapDelegationHandler(element, handler, delegationFn) :
|
||||
bootstrapHandler(element, handler);
|
||||
|
||||
fn.delegationSelector = delegation ? handler : null
|
||||
fn.originalHandler = originalHandler
|
||||
fn.oneOff = oneOff
|
||||
fn.uidEvent = uid
|
||||
handlers[uid] = fn
|
||||
|
||||
element.addEventListener(typeEvent, fn, delegation)
|
||||
}
|
||||
|
||||
function removeHandler(element, events, typeEvent, handler, delegationSelector) {
|
||||
const fn = findHandler(events[typeEvent], handler, delegationSelector);
|
||||
|
||||
if (!fn) {
|
||||
return
|
||||
}
|
||||
|
||||
element.removeEventListener(typeEvent, fn, Boolean(delegationSelector))
|
||||
delete events[typeEvent][fn.uidEvent]
|
||||
}
|
||||
|
||||
function removeNamespacedHandlers(element, events, typeEvent, namespace) {
|
||||
const storeElementEvent = events[typeEvent] || {};
|
||||
|
||||
Object.keys(storeElementEvent).forEach(handlerKey => {
|
||||
if (handlerKey.includes(namespace)) {
|
||||
const event = storeElementEvent[handlerKey];
|
||||
|
||||
removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function getTypeEvent(event) {
|
||||
// allow to get the native events from namespaced events ('click.bs.button' --> 'click')
|
||||
event = event.replace(stripNameRegex, '')
|
||||
return customEvents[event] || event
|
||||
}
|
||||
|
||||
return {
|
||||
on: function(element, event, handler, delegationFn) {
|
||||
addHandler(element, event, handler, delegationFn, false)
|
||||
},
|
||||
|
||||
one: function(element, event, handler, delegationFn) {
|
||||
addHandler(element, event, handler, delegationFn, true)
|
||||
},
|
||||
|
||||
off: function(element, originalTypeEvent, handler, delegationFn) {
|
||||
if (typeof originalTypeEvent !== 'string' || !element) {
|
||||
return
|
||||
}
|
||||
|
||||
const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn);
|
||||
const inNamespace = typeEvent !== originalTypeEvent;
|
||||
const events = getEvent(element);
|
||||
const isNamespace = originalTypeEvent.startsWith('.');
|
||||
|
||||
if (typeof originalHandler !== 'undefined') {
|
||||
// Simplest case: handler is passed, remove that listener ONLY.
|
||||
if (!events || !events[typeEvent]) {
|
||||
return
|
||||
}
|
||||
|
||||
removeHandler(element, events, typeEvent, originalHandler, delegation ? handler : null)
|
||||
return
|
||||
}
|
||||
|
||||
if (isNamespace) {
|
||||
Object.keys(events).forEach(elementEvent => {
|
||||
removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1))
|
||||
})
|
||||
}
|
||||
|
||||
const storeElementEvent = events[typeEvent] || {};
|
||||
Object.keys(storeElementEvent).forEach(keyHandlers => {
|
||||
const handlerKey = keyHandlers.replace(stripUidRegex, '');
|
||||
|
||||
if (!inNamespace || originalTypeEvent.includes(handlerKey)) {
|
||||
const event = storeElementEvent[keyHandlers];
|
||||
|
||||
removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
trigger: function(element, event, args) {
|
||||
if (typeof event !== 'string' || !element) {
|
||||
return null
|
||||
}
|
||||
|
||||
const $ = getjQuery();
|
||||
const typeEvent = getTypeEvent(event);
|
||||
const inNamespace = event !== typeEvent;
|
||||
const isNative = nativeEvents.has(typeEvent);
|
||||
|
||||
let jQueryEvent;
|
||||
let bubbles = true;
|
||||
let nativeDispatch = true;
|
||||
let defaultPrevented = false;
|
||||
let evt = null;
|
||||
|
||||
if (inNamespace && $) {
|
||||
jQueryEvent = $.Event(event, args)
|
||||
|
||||
$(element).trigger(jQueryEvent)
|
||||
bubbles = !jQueryEvent.isPropagationStopped()
|
||||
nativeDispatch = !jQueryEvent.isImmediatePropagationStopped()
|
||||
defaultPrevented = jQueryEvent.isDefaultPrevented()
|
||||
}
|
||||
|
||||
if (isNative) {
|
||||
evt = document.createEvent('HTMLEvents')
|
||||
evt.initEvent(typeEvent, bubbles, true)
|
||||
} else {
|
||||
evt = new CustomEvent(event, {
|
||||
bubbles,
|
||||
cancelable: true
|
||||
})
|
||||
}
|
||||
|
||||
// merge custom information in our event
|
||||
if (typeof args !== 'undefined') {
|
||||
Object.keys(args).forEach(key => {
|
||||
Object.defineProperty(evt, key, {
|
||||
get() {
|
||||
return args[key]
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
if (defaultPrevented) {
|
||||
evt.preventDefault()
|
||||
}
|
||||
|
||||
if (nativeDispatch) {
|
||||
element.dispatchEvent(evt)
|
||||
}
|
||||
|
||||
if (evt.defaultPrevented && typeof jQueryEvent !== 'undefined') {
|
||||
jQueryEvent.preventDefault()
|
||||
}
|
||||
|
||||
return evt
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): dom/manipulator.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
define([], function() {
|
||||
'use strict';
|
||||
|
||||
function normalizeData(val) {
|
||||
if (val === 'true') {
|
||||
return true
|
||||
}
|
||||
|
||||
if (val === 'false') {
|
||||
return false
|
||||
}
|
||||
|
||||
if (val === Number(val).toString()) {
|
||||
return Number(val)
|
||||
}
|
||||
|
||||
if (val === '' || val === 'null') {
|
||||
return null
|
||||
}
|
||||
|
||||
return val
|
||||
}
|
||||
|
||||
function normalizeDataKey(key) {
|
||||
return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`)
|
||||
}
|
||||
|
||||
return {
|
||||
setDataAttribute: function(element, key, value) {
|
||||
element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value)
|
||||
},
|
||||
|
||||
removeDataAttribute: function(element, key) {
|
||||
element.removeAttribute(`data-bs-${normalizeDataKey(key)}`)
|
||||
},
|
||||
|
||||
getDataAttributes: function(element) {
|
||||
if (!element) {
|
||||
return {}
|
||||
}
|
||||
|
||||
const attributes = {};
|
||||
|
||||
Object.keys(element.dataset)
|
||||
.filter(key => key.startsWith('bs'))
|
||||
.forEach(key => {
|
||||
let pureKey = key.replace(/^bs/, '');
|
||||
pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length)
|
||||
attributes[pureKey] = normalizeData(element.dataset[key])
|
||||
})
|
||||
|
||||
return attributes
|
||||
},
|
||||
|
||||
getDataAttribute: function(element, key) {
|
||||
return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`))
|
||||
},
|
||||
|
||||
offset: function(element) {
|
||||
const rect = element.getBoundingClientRect();
|
||||
|
||||
return {
|
||||
top: rect.top + window.pageYOffset,
|
||||
left: rect.left + window.pageXOffset
|
||||
}
|
||||
},
|
||||
|
||||
position: function(element) {
|
||||
return {
|
||||
top: element.offsetTop,
|
||||
left: element.offsetLeft
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,97 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): dom/selector-engine.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
define([
|
||||
"../util/index"
|
||||
], function(Util) {
|
||||
'use strict';
|
||||
|
||||
const isDisabled = Util.isDisabled;
|
||||
const isVisible = Util.isVisible;
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const NODE_TEXT = 3;
|
||||
|
||||
return {
|
||||
find: function(selector, element = document.documentElement) {
|
||||
return [].concat(...Element.prototype.querySelectorAll.call(element, selector))
|
||||
},
|
||||
|
||||
findOne: function(selector, element = document.documentElement) {
|
||||
return Element.prototype.querySelector.call(element, selector)
|
||||
},
|
||||
|
||||
children: function(element, selector) {
|
||||
return [].concat(...element.children)
|
||||
.filter(child => child.matches(selector))
|
||||
},
|
||||
|
||||
parents: function(element, selector) {
|
||||
const parents = [];
|
||||
|
||||
let ancestor = element.parentNode;
|
||||
|
||||
while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
|
||||
if (ancestor.matches(selector)) {
|
||||
parents.push(ancestor)
|
||||
}
|
||||
|
||||
ancestor = ancestor.parentNode
|
||||
}
|
||||
|
||||
return parents
|
||||
},
|
||||
|
||||
prev: function(element, selector) {
|
||||
let previous = element.previousElementSibling;
|
||||
|
||||
while (previous) {
|
||||
if (previous.matches(selector)) {
|
||||
return [previous]
|
||||
}
|
||||
|
||||
previous = previous.previousElementSibling
|
||||
}
|
||||
|
||||
return []
|
||||
},
|
||||
|
||||
next: function(element, selector) {
|
||||
let next = element.nextElementSibling;
|
||||
|
||||
while (next) {
|
||||
if (next.matches(selector)) {
|
||||
return [next]
|
||||
}
|
||||
|
||||
next = next.nextElementSibling
|
||||
}
|
||||
|
||||
return []
|
||||
},
|
||||
|
||||
focusableChildren: function(element) {
|
||||
const focusables = [
|
||||
'a',
|
||||
'button',
|
||||
'input',
|
||||
'textarea',
|
||||
'select',
|
||||
'details',
|
||||
'[tabindex]',
|
||||
'[contenteditable="true"]'
|
||||
].map(selector => `${selector}:not([tabindex^="-"])`).join(', ');
|
||||
|
||||
return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el))
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,264 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): tab.js and base-component.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
define([
|
||||
"./util/index",
|
||||
"./dom/event-handler",
|
||||
"./dom/selector-engine"
|
||||
], function(Util, EventHandler, SelectorEngine) {
|
||||
'use strict';
|
||||
|
||||
const defineJQueryPlugin = Util.defineJQueryPlugin;
|
||||
const executeAfterTransition = Util.executeAfterTransition;
|
||||
const getElement = Util.getElement;
|
||||
const getElementFromSelector = Util.getElementFromSelector;
|
||||
const isDisabled = Util.isDisabled;
|
||||
const reflow = Util.reflow;
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const VERSION = '5.1.3';
|
||||
const NAME = 'tab';
|
||||
const DATA_KEY = 'bs.tab';
|
||||
const EVENT_KEY = `.${DATA_KEY}`;
|
||||
const DATA_API_KEY = '.data-api';
|
||||
|
||||
const EVENT_HIDE = `hide${EVENT_KEY}`;
|
||||
const EVENT_HIDDEN = `hidden${EVENT_KEY}`;
|
||||
const EVENT_SHOW = `show${EVENT_KEY}`;
|
||||
const EVENT_SHOWN = `shown${EVENT_KEY}`;
|
||||
const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`;
|
||||
|
||||
const CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu';
|
||||
const CLASS_NAME_ACTIVE = 'active';
|
||||
const CLASS_NAME_FADE = 'fade';
|
||||
const CLASS_NAME_SHOW = 'show';
|
||||
|
||||
const SELECTOR_DROPDOWN = '.dropdown';
|
||||
const SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';
|
||||
const SELECTOR_ACTIVE = '.active';
|
||||
const SELECTOR_ACTIVE_UL = ':scope > li > .active';
|
||||
const SELECTOR_DATA_TOGGLE = '[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]';
|
||||
const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
|
||||
const SELECTOR_DROPDOWN_ACTIVE_CHILD = ':scope > .dropdown-menu .active';
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
function Tab(element) {
|
||||
element = getElement(element);
|
||||
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._element = element;
|
||||
Data.set(this._element, DATA_KEY, this);
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
||||
Tab.VERSION = VERSION;
|
||||
|
||||
Tab.NAME = NAME;
|
||||
|
||||
Tab.DATA_KEY = 'bs.' + Tab.NAME;
|
||||
|
||||
Tab.EVENT_KEY = '.' + Tab.DATA_KEY;
|
||||
|
||||
// Public
|
||||
|
||||
Tab.prototype.dispose = function() {
|
||||
Data.remove(this._element, this.constructor.DATA_KEY);
|
||||
EventHandler.off(this._element, this.constructor.EVENT_KEY);
|
||||
|
||||
Object.getOwnPropertyNames(this).forEach(propertyName => {
|
||||
this[propertyName] = null;
|
||||
})
|
||||
}
|
||||
|
||||
Tab.prototype._queueCallback = function(callback, element, isAnimated = true) {
|
||||
executeAfterTransition(callback, element, isAnimated);
|
||||
}
|
||||
|
||||
Tab.prototype.show = function() {
|
||||
if ((this._element.parentNode &&
|
||||
this._element.parentNode.nodeType === Node.ELEMENT_NODE &&
|
||||
this._element.classList.contains(CLASS_NAME_ACTIVE))) {
|
||||
return;
|
||||
}
|
||||
|
||||
let previous;
|
||||
const target = getElementFromSelector(this._element);
|
||||
const listElement = this._element.closest(SELECTOR_NAV_LIST_GROUP);
|
||||
|
||||
if (listElement) {
|
||||
const itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE;
|
||||
previous = SelectorEngine.find(itemSelector, listElement);
|
||||
previous = previous[previous.length - 1];
|
||||
}
|
||||
|
||||
const hideEvent = previous ?
|
||||
EventHandler.trigger(previous, EVENT_HIDE, {
|
||||
relatedTarget: this._element
|
||||
}) :
|
||||
null;
|
||||
|
||||
const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, {
|
||||
relatedTarget: previous
|
||||
});
|
||||
|
||||
if (showEvent.defaultPrevented || (hideEvent !== null && hideEvent.defaultPrevented)) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._activate(this._element, listElement);
|
||||
|
||||
const complete = () => {
|
||||
EventHandler.trigger(previous, EVENT_HIDDEN, {
|
||||
relatedTarget: this._element
|
||||
});
|
||||
EventHandler.trigger(this._element, EVENT_SHOWN, {
|
||||
relatedTarget: previous
|
||||
});
|
||||
};
|
||||
|
||||
if (target) {
|
||||
this._activate(target, target.parentNode, complete);
|
||||
} else {
|
||||
complete();
|
||||
}
|
||||
}
|
||||
|
||||
// Private
|
||||
|
||||
Tab.prototype._activate = function(element, container, callback) {
|
||||
const activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ?
|
||||
SelectorEngine.find(SELECTOR_ACTIVE_UL, container) :
|
||||
SelectorEngine.children(container, SELECTOR_ACTIVE);
|
||||
|
||||
const active = activeElements[0];
|
||||
const isTransitioning = callback && (active && active.classList.contains(CLASS_NAME_FADE));
|
||||
|
||||
const complete = () => this._transitionComplete(element, active, callback);
|
||||
|
||||
if (active && isTransitioning) {
|
||||
active.classList.remove(CLASS_NAME_SHOW);
|
||||
this._queueCallback(complete, element, true);
|
||||
} else {
|
||||
complete();
|
||||
}
|
||||
}
|
||||
|
||||
Tab.prototype._transitionComplete = function(element, active, callback) {
|
||||
if (active) {
|
||||
active.classList.remove(CLASS_NAME_ACTIVE);
|
||||
|
||||
const dropdownChild = SelectorEngine.findOne(SELECTOR_DROPDOWN_ACTIVE_CHILD, active.parentNode);
|
||||
|
||||
if (dropdownChild) {
|
||||
dropdownChild.classList.remove(CLASS_NAME_ACTIVE);
|
||||
}
|
||||
|
||||
if (active.getAttribute('role') === 'tab') {
|
||||
active.setAttribute('aria-selected', false);
|
||||
}
|
||||
}
|
||||
|
||||
element.classList.add(CLASS_NAME_ACTIVE);
|
||||
if (element.getAttribute('role') === 'tab') {
|
||||
element.setAttribute('aria-selected', true);
|
||||
}
|
||||
|
||||
reflow(element);
|
||||
|
||||
if (element.classList.contains(CLASS_NAME_FADE)) {
|
||||
element.classList.add(CLASS_NAME_SHOW);
|
||||
}
|
||||
|
||||
let parent = element.parentNode;
|
||||
if (parent && parent.nodeName === 'LI') {
|
||||
parent = parent.parentNode;
|
||||
}
|
||||
|
||||
if (parent && parent.classList.contains(CLASS_NAME_DROPDOWN_MENU)) {
|
||||
const dropdownElement = element.closest(SELECTOR_DROPDOWN);
|
||||
|
||||
if (dropdownElement) {
|
||||
SelectorEngine.find(SELECTOR_DROPDOWN_TOGGLE, dropdownElement)
|
||||
.forEach(dropdown => dropdown.classList.add(CLASS_NAME_ACTIVE));
|
||||
}
|
||||
|
||||
element.setAttribute('aria-expanded', true);
|
||||
}
|
||||
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
|
||||
// Static
|
||||
|
||||
Tab.getInstance = function(element) {
|
||||
return Data.get(getElement(element), this.DATA_KEY);
|
||||
}
|
||||
|
||||
Tab.getOrCreateInstance = function(element, config = {}) {
|
||||
return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null);
|
||||
}
|
||||
|
||||
Tab.jQueryInterface = function(config) {
|
||||
return this.each(function () {
|
||||
const data = Tab.getOrCreateInstance(this);
|
||||
|
||||
if (typeof config === 'string') {
|
||||
if (typeof data[config] === 'undefined') {
|
||||
throw new TypeError(`No method named "${config}"`);
|
||||
}
|
||||
|
||||
data[config]();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
|
||||
if (['A', 'AREA'].includes(this.tagName)) {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
if (isDisabled(this)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const data = Tab.getOrCreateInstance(this);
|
||||
data.show();
|
||||
})
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
* add .Tab to jQuery only if jQuery is present
|
||||
*/
|
||||
|
||||
defineJQueryPlugin(Tab);
|
||||
|
||||
return Tab;
|
||||
});
|
||||
@@ -0,0 +1,341 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.1.3): util/index.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
define([
|
||||
"jquery",
|
||||
'domReady!'
|
||||
], function() {
|
||||
'use strict';
|
||||
|
||||
const MAX_UID = 1000000;
|
||||
const MILLISECONDS_MULTIPLIER = 1000;
|
||||
const TRANSITION_END = 'transitionend';
|
||||
|
||||
// Shoutout AngusCroll (https://goo.gl/pxwQGp)
|
||||
const toType = obj => {
|
||||
if (obj === null || obj === undefined) {
|
||||
return `${obj}`
|
||||
}
|
||||
|
||||
return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase()
|
||||
};
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Public Util Api
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const getUID = prefix => {
|
||||
do {
|
||||
prefix += Math.floor(Math.random() * MAX_UID)
|
||||
} while (document.getElementById(prefix))
|
||||
|
||||
return prefix
|
||||
};
|
||||
|
||||
const getSelector = element => {
|
||||
let selector = element.getAttribute('data-bs-target');
|
||||
|
||||
if (!selector || selector === '#') {
|
||||
let hrefAttr = element.getAttribute('href');
|
||||
|
||||
// The only valid content that could double as a selector are IDs or classes,
|
||||
// so everything starting with `#` or `.`. If a "real" URL is used as the selector,
|
||||
// `document.querySelector` will rightfully complain it is invalid.
|
||||
// See https://github.com/twbs/bootstrap/issues/32273
|
||||
if (!hrefAttr || (!hrefAttr.includes('#') && !hrefAttr.startsWith('.'))) {
|
||||
return null
|
||||
}
|
||||
|
||||
// Just in case some CMS puts out a full URL with the anchor appended
|
||||
if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {
|
||||
hrefAttr = `#${hrefAttr.split('#')[1]}`
|
||||
}
|
||||
|
||||
selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null
|
||||
}
|
||||
|
||||
return selector
|
||||
};
|
||||
|
||||
const getSelectorFromElement = element => {
|
||||
const selector = getSelector(element);
|
||||
|
||||
if (selector) {
|
||||
return document.querySelector(selector) ? selector : null
|
||||
}
|
||||
|
||||
return null
|
||||
};
|
||||
|
||||
const getElementFromSelector = element => {
|
||||
const selector = getSelector(element);
|
||||
|
||||
return selector ? document.querySelector(selector) : null
|
||||
};
|
||||
|
||||
const getTransitionDurationFromElement = element => {
|
||||
if (!element) {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Get transition-duration of the element
|
||||
let {transitionDuration, transitionDelay} = window.getComputedStyle(element);
|
||||
|
||||
const floatTransitionDuration = Number.parseFloat(transitionDuration);
|
||||
const floatTransitionDelay = Number.parseFloat(transitionDelay);
|
||||
|
||||
// Return 0 if element or transition duration is not found
|
||||
if (!floatTransitionDuration && !floatTransitionDelay) {
|
||||
return 0
|
||||
}
|
||||
|
||||
// If multiple durations are defined, take the first
|
||||
transitionDuration = transitionDuration.split(',')[0]
|
||||
transitionDelay = transitionDelay.split(',')[0]
|
||||
|
||||
return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER
|
||||
};
|
||||
|
||||
const triggerTransitionEnd = element => {
|
||||
element.dispatchEvent(new Event(TRANSITION_END))
|
||||
};
|
||||
|
||||
const isElement = obj => {
|
||||
if (!obj || typeof obj !== 'object') {
|
||||
return false
|
||||
}
|
||||
|
||||
if (typeof obj.jquery !== 'undefined') {
|
||||
obj = obj[0]
|
||||
}
|
||||
|
||||
return typeof obj.nodeType !== 'undefined'
|
||||
};
|
||||
|
||||
const getElement = obj => {
|
||||
if (isElement(obj)) { // it's a jQuery object or a node element
|
||||
return obj.jquery ? obj[0] : obj
|
||||
}
|
||||
|
||||
if (typeof obj === 'string' && obj.length > 0) {
|
||||
return document.querySelector(obj)
|
||||
}
|
||||
|
||||
return null
|
||||
};
|
||||
|
||||
const typeCheckConfig = (componentName, config, configTypes) => {
|
||||
Object.keys(configTypes).forEach(property => {
|
||||
const expectedTypes = configTypes[property];
|
||||
const value = config[property];
|
||||
const valueType = value && isElement(value) ? 'element' : toType(value);
|
||||
|
||||
if (!new RegExp(expectedTypes).test(valueType)) {
|
||||
throw new TypeError(
|
||||
`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`
|
||||
)
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
const isVisible = element => {
|
||||
if (!isElement(element) || element.getClientRects().length === 0) {
|
||||
return false
|
||||
}
|
||||
|
||||
return getComputedStyle(element).getPropertyValue('visibility') === 'visible'
|
||||
};
|
||||
|
||||
const isDisabled = element => {
|
||||
if (!element || element.nodeType !== Node.ELEMENT_NODE) {
|
||||
return true
|
||||
}
|
||||
|
||||
if (element.classList.contains('disabled')) {
|
||||
return true
|
||||
}
|
||||
|
||||
if (typeof element.disabled !== 'undefined') {
|
||||
return element.disabled
|
||||
}
|
||||
|
||||
return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false'
|
||||
};
|
||||
|
||||
const findShadowRoot = element => {
|
||||
if (!document.documentElement.attachShadow) {
|
||||
return null
|
||||
}
|
||||
|
||||
// Can find the shadow root otherwise it'll return the document
|
||||
if (typeof element.getRootNode === 'function') {
|
||||
const root = element.getRootNode();
|
||||
return root instanceof ShadowRoot ? root : null
|
||||
}
|
||||
|
||||
if (element instanceof ShadowRoot) {
|
||||
return element
|
||||
}
|
||||
|
||||
// when we don't find a shadow root
|
||||
if (!element.parentNode) {
|
||||
return null
|
||||
}
|
||||
|
||||
return findShadowRoot(element.parentNode)
|
||||
};
|
||||
|
||||
const noop = () => {};
|
||||
|
||||
/**
|
||||
* Trick to restart an element's animation
|
||||
*
|
||||
* @param {HTMLElement} element
|
||||
* @return void
|
||||
*
|
||||
* @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation
|
||||
*/
|
||||
const reflow = element => {
|
||||
// eslint-disable-next-line no-unused-expressions
|
||||
element.offsetHeight
|
||||
};
|
||||
|
||||
const getjQuery = () => {
|
||||
const {jQuery} = window;
|
||||
|
||||
if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
|
||||
return jQuery
|
||||
}
|
||||
|
||||
return null
|
||||
};
|
||||
|
||||
const DOMContentLoadedCallbacks = [];
|
||||
|
||||
const onDOMContentLoaded = callback => {
|
||||
if (document.readyState === 'loading') {
|
||||
// add listener on the first call when the document is in loading state
|
||||
if (!DOMContentLoadedCallbacks.length) {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
DOMContentLoadedCallbacks.forEach(callback => callback())
|
||||
})
|
||||
}
|
||||
|
||||
DOMContentLoadedCallbacks.push(callback)
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
};
|
||||
|
||||
const isRTL = () => document.documentElement.dir === 'rtl';
|
||||
|
||||
const defineJQueryPlugin = plugin => {
|
||||
onDOMContentLoaded(() => {
|
||||
const $ = getjQuery();
|
||||
/* istanbul ignore if */
|
||||
if ($) {
|
||||
const name = plugin.NAME;
|
||||
const JQUERY_NO_CONFLICT = $.fn[name];
|
||||
$.fn[name] = plugin.jQueryInterface
|
||||
$.fn[name].Constructor = plugin
|
||||
$.fn[name].noConflict = () => {
|
||||
$.fn[name] = JQUERY_NO_CONFLICT
|
||||
return plugin.jQueryInterface
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
const execute = callback => {
|
||||
if (typeof callback === 'function') {
|
||||
callback()
|
||||
}
|
||||
};
|
||||
|
||||
const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {
|
||||
if (!waitForTransition) {
|
||||
execute(callback)
|
||||
return
|
||||
}
|
||||
|
||||
const durationPadding = 5;
|
||||
const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding;
|
||||
|
||||
let called = false;
|
||||
|
||||
const handler = ({ target }) => {
|
||||
if (target !== transitionElement) {
|
||||
return
|
||||
}
|
||||
|
||||
called = true
|
||||
transitionElement.removeEventListener(TRANSITION_END, handler)
|
||||
execute(callback)
|
||||
};
|
||||
|
||||
transitionElement.addEventListener(TRANSITION_END, handler)
|
||||
setTimeout(() => {
|
||||
if (!called) {
|
||||
triggerTransitionEnd(transitionElement)
|
||||
}
|
||||
}, emulatedDuration)
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the previous/next element of a list.
|
||||
*
|
||||
* @param {array} list The list of elements
|
||||
* @param activeElement The active element
|
||||
* @param shouldGetNext Choose to get next or previous element
|
||||
* @param isCycleAllowed
|
||||
* @return {Element|elem} The proper element
|
||||
*/
|
||||
const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => {
|
||||
let index = list.indexOf(activeElement);
|
||||
|
||||
// if the element does not exist in the list return an element depending on the direction and if cycle is allowed
|
||||
if (index === -1) {
|
||||
return list[!shouldGetNext && isCycleAllowed ? list.length - 1 : 0]
|
||||
}
|
||||
|
||||
const listLength = list.length;
|
||||
|
||||
index += shouldGetNext ? 1 : -1
|
||||
|
||||
if (isCycleAllowed) {
|
||||
index = (index + listLength) % listLength
|
||||
}
|
||||
|
||||
return list[Math.max(0, Math.min(index, listLength - 1))]
|
||||
};
|
||||
|
||||
return {
|
||||
getElement,
|
||||
getUID,
|
||||
getSelectorFromElement,
|
||||
getElementFromSelector,
|
||||
getTransitionDurationFromElement,
|
||||
triggerTransitionEnd,
|
||||
isElement,
|
||||
typeCheckConfig,
|
||||
isVisible,
|
||||
isDisabled,
|
||||
findShadowRoot,
|
||||
noop,
|
||||
getNextActiveElement,
|
||||
reflow,
|
||||
getjQuery,
|
||||
onDOMContentLoaded,
|
||||
isRTL,
|
||||
defineJQueryPlugin,
|
||||
execute,
|
||||
executeAfterTransition
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,161 @@
|
||||
.colorpicker {
|
||||
width: 356px;
|
||||
height: 176px;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
background: url(../images/colorpicker_background.png);
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
display: none;
|
||||
}
|
||||
.colorpicker_color {
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
left: 14px;
|
||||
top: 13px;
|
||||
position: absolute;
|
||||
background: #f00;
|
||||
overflow: hidden;
|
||||
cursor: crosshair;
|
||||
}
|
||||
.colorpicker_color div {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
background: url(../images/colorpicker_overlay.png);
|
||||
}
|
||||
.colorpicker_color div div {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 11px;
|
||||
height: 11px;
|
||||
overflow: hidden;
|
||||
background: url(../images/colorpicker_select.gif);
|
||||
margin: -5px 0 0 -5px;
|
||||
}
|
||||
.colorpicker_hue {
|
||||
position: absolute;
|
||||
top: 13px;
|
||||
left: 171px;
|
||||
width: 35px;
|
||||
height: 150px;
|
||||
cursor: n-resize;
|
||||
}
|
||||
.colorpicker_hue div {
|
||||
position: absolute;
|
||||
width: 35px;
|
||||
height: 9px;
|
||||
overflow: hidden;
|
||||
background: url(../images/colorpicker_indic.gif) left top;
|
||||
margin: -4px 0 0 0;
|
||||
left: 0px;
|
||||
}
|
||||
.colorpicker_new_color {
|
||||
position: absolute;
|
||||
width: 60px;
|
||||
height: 30px;
|
||||
left: 213px;
|
||||
top: 13px;
|
||||
background: #f00;
|
||||
}
|
||||
.colorpicker_current_color {
|
||||
position: absolute;
|
||||
width: 60px;
|
||||
height: 30px;
|
||||
left: 283px;
|
||||
top: 13px;
|
||||
background: #f00;
|
||||
}
|
||||
.colorpicker input {
|
||||
background-color: transparent;
|
||||
border: 1px solid transparent;
|
||||
position: absolute;
|
||||
font-size: 10px;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
color: #898989;
|
||||
top: 4px;
|
||||
right: 11px;
|
||||
text-align: right;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 11px;
|
||||
}
|
||||
.colorpicker_hex {
|
||||
position: absolute;
|
||||
width: 72px;
|
||||
height: 22px;
|
||||
background: url(../images/colorpicker_hex.png) top;
|
||||
left: 212px;
|
||||
top: 142px;
|
||||
}
|
||||
.colorpicker_hex input {
|
||||
right: 6px;
|
||||
}
|
||||
.colorpicker_field {
|
||||
height: 22px;
|
||||
width: 62px;
|
||||
background-position: top;
|
||||
position: absolute;
|
||||
}
|
||||
.colorpicker_field span {
|
||||
position: absolute;
|
||||
width: 12px;
|
||||
height: 22px;
|
||||
overflow: hidden;
|
||||
top: 0;
|
||||
right: 0;
|
||||
cursor: n-resize;
|
||||
}
|
||||
.colorpicker_rgb_r {
|
||||
background-image: url(../images/colorpicker_rgb_r.png);
|
||||
top: 52px;
|
||||
left: 212px;
|
||||
}
|
||||
.colorpicker_rgb_g {
|
||||
background-image: url(../images/colorpicker_rgb_g.png);
|
||||
top: 82px;
|
||||
left: 212px;
|
||||
}
|
||||
.colorpicker_rgb_b {
|
||||
background-image: url(../images/colorpicker_rgb_b.png);
|
||||
top: 112px;
|
||||
left: 212px;
|
||||
}
|
||||
.colorpicker_hsb_h {
|
||||
background-image: url(../images/colorpicker_hsb_h.png);
|
||||
top: 52px;
|
||||
left: 282px;
|
||||
}
|
||||
.colorpicker_hsb_s {
|
||||
background-image: url(../images/colorpicker_hsb_s.png);
|
||||
top: 82px;
|
||||
left: 282px;
|
||||
}
|
||||
.colorpicker_hsb_b {
|
||||
background-image: url(../images/colorpicker_hsb_b.png);
|
||||
top: 112px;
|
||||
left: 282px;
|
||||
}
|
||||
.colorpicker_submit {
|
||||
position: absolute;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
background: url(../images/colorpicker_submit.png) top;
|
||||
left: 322px;
|
||||
top: 142px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.colorpicker_focus {
|
||||
background-position: center;
|
||||
}
|
||||
.colorpicker_hex.colorpicker_focus {
|
||||
background-position: bottom;
|
||||
}
|
||||
.colorpicker_submit.colorpicker_focus {
|
||||
background-position: bottom;
|
||||
}
|
||||
.colorpicker_slider {
|
||||
background-position: bottom;
|
||||
}
|
||||
|
After Width: | Height: | Size: 43 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 338 B |
|
After Width: | Height: | Size: 714 B |
|
After Width: | Height: | Size: 702 B |
|
After Width: | Height: | Size: 756 B |
|
After Width: | Height: | Size: 85 B |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 714 B |
|
After Width: | Height: | Size: 787 B |
|
After Width: | Height: | Size: 738 B |
|
After Width: | Height: | Size: 70 B |
|
After Width: | Height: | Size: 750 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 326 B |
|
After Width: | Height: | Size: 757 B |
|
After Width: | Height: | Size: 694 B |
|
After Width: | Height: | Size: 829 B |
|
After Width: | Height: | Size: 85 B |
|
After Width: | Height: | Size: 709 B |
|
After Width: | Height: | Size: 757 B |
|
After Width: | Height: | Size: 716 B |
|
After Width: | Height: | Size: 791 B |
|
After Width: | Height: | Size: 253 B |
|
After Width: | Height: | Size: 305 B |
|
After Width: | Height: | Size: 235 B |
@@ -0,0 +1,487 @@
|
||||
/**
|
||||
*
|
||||
* Color picker
|
||||
* Author: Stefan Petre www.eyecon.ro
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses
|
||||
*
|
||||
*/
|
||||
|
||||
define([
|
||||
"jquery",
|
||||
], function ($) {
|
||||
var ColorPicker = function () {
|
||||
var
|
||||
ids = {},
|
||||
inAction,
|
||||
charMin = 65,
|
||||
visible,
|
||||
tpl = '<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>',
|
||||
defaults = {
|
||||
eventName: 'click',
|
||||
onShow: function () {},
|
||||
onBeforeShow: function(){},
|
||||
onHide: function () {},
|
||||
onChange: function () {},
|
||||
onSubmit: function () {},
|
||||
color: 'ff0000',
|
||||
livePreview: true,
|
||||
flat: false
|
||||
},
|
||||
fillRGBFields = function (hsb, cal) {
|
||||
var rgb = HSBToRGB(hsb);
|
||||
$(cal).data('colorpicker').fields
|
||||
.eq(1).val(rgb.r).end()
|
||||
.eq(2).val(rgb.g).end()
|
||||
.eq(3).val(rgb.b).end();
|
||||
},
|
||||
fillHSBFields = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').fields
|
||||
.eq(4).val(hsb.h).end()
|
||||
.eq(5).val(hsb.s).end()
|
||||
.eq(6).val(hsb.b).end();
|
||||
},
|
||||
fillHexFields = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').fields
|
||||
.eq(0).val(HSBToHex(hsb)).end();
|
||||
},
|
||||
setSelector = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100}));
|
||||
$(cal).data('colorpicker').selectorIndic.css({
|
||||
left: parseInt(150 * hsb.s/100, 10),
|
||||
top: parseInt(150 * (100-hsb.b)/100, 10)
|
||||
});
|
||||
},
|
||||
setHue = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10));
|
||||
},
|
||||
setCurrentColor = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb));
|
||||
},
|
||||
setNewColor = function (hsb, cal) {
|
||||
$(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb));
|
||||
},
|
||||
keyDown = function (ev) {
|
||||
var pressedKey = ev.charCode || ev.keyCode || -1;
|
||||
if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) {
|
||||
return false;
|
||||
}
|
||||
var cal = $(this).parent().parent();
|
||||
if (cal.data('colorpicker').livePreview === true) {
|
||||
change.apply(this);
|
||||
}
|
||||
},
|
||||
change = function (ev) {
|
||||
var cal = $(this).parent().parent(), col;
|
||||
if (this.parentNode.className.indexOf('_hex') > 0) {
|
||||
cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value));
|
||||
} else if (this.parentNode.className.indexOf('_hsb') > 0) {
|
||||
cal.data('colorpicker').color = col = fixHSB({
|
||||
h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10),
|
||||
s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10),
|
||||
b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10)
|
||||
});
|
||||
} else {
|
||||
cal.data('colorpicker').color = col = RGBToHSB(fixRGB({
|
||||
r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10),
|
||||
g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10),
|
||||
b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10)
|
||||
}));
|
||||
}
|
||||
if (ev) {
|
||||
fillRGBFields(col, cal.get(0));
|
||||
fillHexFields(col, cal.get(0));
|
||||
fillHSBFields(col, cal.get(0));
|
||||
}
|
||||
setSelector(col, cal.get(0));
|
||||
setHue(col, cal.get(0));
|
||||
setNewColor(col, cal.get(0));
|
||||
cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]);
|
||||
},
|
||||
blur = function (ev) {
|
||||
var cal = $(this).parent().parent();
|
||||
cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus');
|
||||
},
|
||||
focus = function () {
|
||||
charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65;
|
||||
$(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus');
|
||||
$(this).parent().addClass('colorpicker_focus');
|
||||
},
|
||||
downIncrement = function (ev) {
|
||||
var field = $(this).parent().find('input').focus();
|
||||
var current = {
|
||||
el: $(this).parent().addClass('colorpicker_slider'),
|
||||
max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255),
|
||||
y: ev.pageY,
|
||||
field: field,
|
||||
val: parseInt(field.val(), 10),
|
||||
preview: $(this).parent().parent().data('colorpicker').livePreview
|
||||
};
|
||||
$(document).bind('mouseup', current, upIncrement);
|
||||
$(document).bind('mousemove', current, moveIncrement);
|
||||
},
|
||||
moveIncrement = function (ev) {
|
||||
ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10))));
|
||||
if (ev.data.preview) {
|
||||
change.apply(ev.data.field.get(0), [true]);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
upIncrement = function (ev) {
|
||||
change.apply(ev.data.field.get(0), [true]);
|
||||
ev.data.el.removeClass('colorpicker_slider').find('input').focus();
|
||||
$(document).unbind('mouseup', upIncrement);
|
||||
$(document).unbind('mousemove', moveIncrement);
|
||||
return false;
|
||||
},
|
||||
downHue = function (ev) {
|
||||
var current = {
|
||||
cal: $(this).parent(),
|
||||
y: $(this).offset().top
|
||||
};
|
||||
current.preview = current.cal.data('colorpicker').livePreview;
|
||||
$(document).bind('mouseup', current, upHue);
|
||||
$(document).bind('mousemove', current, moveHue);
|
||||
},
|
||||
moveHue = function (ev) {
|
||||
change.apply(
|
||||
ev.data.cal.data('colorpicker')
|
||||
.fields
|
||||
.eq(4)
|
||||
.val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10))
|
||||
.get(0),
|
||||
[ev.data.preview]
|
||||
);
|
||||
return false;
|
||||
},
|
||||
upHue = function (ev) {
|
||||
fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
||||
fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
||||
$(document).unbind('mouseup', upHue);
|
||||
$(document).unbind('mousemove', moveHue);
|
||||
return false;
|
||||
},
|
||||
downSelector = function (ev) {
|
||||
var current = {
|
||||
cal: $(this).parent(),
|
||||
pos: $(this).offset()
|
||||
};
|
||||
current.preview = current.cal.data('colorpicker').livePreview;
|
||||
$(document).bind('mouseup', current, upSelector);
|
||||
$(document).bind('mousemove', current, moveSelector);
|
||||
},
|
||||
moveSelector = function (ev) {
|
||||
change.apply(
|
||||
ev.data.cal.data('colorpicker')
|
||||
.fields
|
||||
.eq(6)
|
||||
.val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10))
|
||||
.end()
|
||||
.eq(5)
|
||||
.val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10))
|
||||
.get(0),
|
||||
[ev.data.preview]
|
||||
);
|
||||
return false;
|
||||
},
|
||||
upSelector = function (ev) {
|
||||
fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
||||
fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
|
||||
$(document).unbind('mouseup', upSelector);
|
||||
$(document).unbind('mousemove', moveSelector);
|
||||
return false;
|
||||
},
|
||||
enterSubmit = function (ev) {
|
||||
$(this).addClass('colorpicker_focus');
|
||||
},
|
||||
leaveSubmit = function (ev) {
|
||||
$(this).removeClass('colorpicker_focus');
|
||||
},
|
||||
clickSubmit = function (ev) {
|
||||
var cal = $(this).parent();
|
||||
var col = cal.data('colorpicker').color;
|
||||
cal.data('colorpicker').origColor = col;
|
||||
setCurrentColor(col, cal.get(0));
|
||||
cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el);
|
||||
},
|
||||
show = function (ev) {
|
||||
var cal = $('#' + $(this).data('colorpickerId'));
|
||||
cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]);
|
||||
var pos = $(this).offset();
|
||||
var viewPort = getViewport();
|
||||
var top = pos.top + this.offsetHeight;
|
||||
var left = pos.left;
|
||||
if (top + 176 > viewPort.t + viewPort.h) {
|
||||
top -= this.offsetHeight + 176;
|
||||
}
|
||||
if (left + 356 > viewPort.l + viewPort.w) {
|
||||
left -= 356;
|
||||
}
|
||||
cal.css({left: left + 'px', top: top + 'px'});
|
||||
if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) {
|
||||
cal.show();
|
||||
}
|
||||
$(document).bind('mousedown', {cal: cal}, hide);
|
||||
return false;
|
||||
},
|
||||
hide = function (ev) {
|
||||
if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) {
|
||||
if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
|
||||
ev.data.cal.hide();
|
||||
}
|
||||
$(document).unbind('mousedown', hide);
|
||||
}
|
||||
},
|
||||
isChildOf = function(parentEl, el, container) {
|
||||
if (parentEl == el) {
|
||||
return true;
|
||||
}
|
||||
if (parentEl.contains) {
|
||||
return parentEl.contains(el);
|
||||
}
|
||||
if ( parentEl.compareDocumentPosition ) {
|
||||
return !!(parentEl.compareDocumentPosition(el) & 16);
|
||||
}
|
||||
var prEl = el.parentNode;
|
||||
while(prEl && prEl != container) {
|
||||
if (prEl == parentEl)
|
||||
return true;
|
||||
prEl = prEl.parentNode;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
getViewport = function () {
|
||||
var m = document.compatMode == 'CSS1Compat';
|
||||
return {
|
||||
l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
|
||||
t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop),
|
||||
w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth),
|
||||
h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight)
|
||||
};
|
||||
},
|
||||
fixHSB = function (hsb) {
|
||||
return {
|
||||
h: Math.min(360, Math.max(0, hsb.h)),
|
||||
s: Math.min(100, Math.max(0, hsb.s)),
|
||||
b: Math.min(100, Math.max(0, hsb.b))
|
||||
};
|
||||
},
|
||||
fixRGB = function (rgb) {
|
||||
return {
|
||||
r: Math.min(255, Math.max(0, rgb.r)),
|
||||
g: Math.min(255, Math.max(0, rgb.g)),
|
||||
b: Math.min(255, Math.max(0, rgb.b))
|
||||
};
|
||||
},
|
||||
fixHex = function (hex) {
|
||||
var len = 6 - hex.length;
|
||||
if (len > 0) {
|
||||
var o = [];
|
||||
for (var i=0; i<len; i++) {
|
||||
o.push('0');
|
||||
}
|
||||
o.push(hex);
|
||||
hex = o.join('');
|
||||
}
|
||||
return hex;
|
||||
},
|
||||
HexToRGB = function (hex) {
|
||||
var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
|
||||
return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};
|
||||
},
|
||||
HexToHSB = function (hex) {
|
||||
return RGBToHSB(HexToRGB(hex));
|
||||
},
|
||||
RGBToHSB = function (rgb) {
|
||||
var hsb = {
|
||||
h: 0,
|
||||
s: 0,
|
||||
b: 0
|
||||
};
|
||||
var min = Math.min(rgb.r, rgb.g, rgb.b);
|
||||
var max = Math.max(rgb.r, rgb.g, rgb.b);
|
||||
var delta = max - min;
|
||||
hsb.b = max;
|
||||
if (max != 0) {
|
||||
|
||||
}
|
||||
hsb.s = max != 0 ? 255 * delta / max : 0;
|
||||
if (hsb.s != 0) {
|
||||
if (rgb.r == max) {
|
||||
hsb.h = (rgb.g - rgb.b) / delta;
|
||||
} else if (rgb.g == max) {
|
||||
hsb.h = 2 + (rgb.b - rgb.r) / delta;
|
||||
} else {
|
||||
hsb.h = 4 + (rgb.r - rgb.g) / delta;
|
||||
}
|
||||
} else {
|
||||
hsb.h = -1;
|
||||
}
|
||||
hsb.h *= 60;
|
||||
if (hsb.h < 0) {
|
||||
hsb.h += 360;
|
||||
}
|
||||
hsb.s *= 100/255;
|
||||
hsb.b *= 100/255;
|
||||
return hsb;
|
||||
},
|
||||
HSBToRGB = function (hsb) {
|
||||
var rgb = {};
|
||||
var h = Math.round(hsb.h);
|
||||
var s = Math.round(hsb.s*255/100);
|
||||
var v = Math.round(hsb.b*255/100);
|
||||
if(s == 0) {
|
||||
rgb.r = rgb.g = rgb.b = v;
|
||||
} else {
|
||||
var t1 = v;
|
||||
var t2 = (255-s)*v/255;
|
||||
var t3 = (t1-t2)*(h%60)/60;
|
||||
if(h==360) h = 0;
|
||||
if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3}
|
||||
else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3}
|
||||
else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3}
|
||||
else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3}
|
||||
else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3}
|
||||
else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3}
|
||||
else {rgb.r=0; rgb.g=0; rgb.b=0}
|
||||
}
|
||||
return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)};
|
||||
},
|
||||
RGBToHex = function (rgb) {
|
||||
var hex = [
|
||||
rgb.r.toString(16),
|
||||
rgb.g.toString(16),
|
||||
rgb.b.toString(16)
|
||||
];
|
||||
$.each(hex, function (nr, val) {
|
||||
if (val.length == 1) {
|
||||
hex[nr] = '0' + val;
|
||||
}
|
||||
});
|
||||
return hex.join('');
|
||||
},
|
||||
HSBToHex = function (hsb) {
|
||||
return RGBToHex(HSBToRGB(hsb));
|
||||
},
|
||||
restoreOriginal = function () {
|
||||
var cal = $(this).parent();
|
||||
var col = cal.data('colorpicker').origColor;
|
||||
cal.data('colorpicker').color = col;
|
||||
fillRGBFields(col, cal.get(0));
|
||||
fillHexFields(col, cal.get(0));
|
||||
fillHSBFields(col, cal.get(0));
|
||||
setSelector(col, cal.get(0));
|
||||
setHue(col, cal.get(0));
|
||||
setNewColor(col, cal.get(0));
|
||||
};
|
||||
return {
|
||||
init: function (opt) {
|
||||
opt = $.extend({}, defaults, opt||{});
|
||||
if (typeof opt.color == 'string') {
|
||||
opt.color = HexToHSB(opt.color);
|
||||
} else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) {
|
||||
opt.color = RGBToHSB(opt.color);
|
||||
} else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) {
|
||||
opt.color = fixHSB(opt.color);
|
||||
} else {
|
||||
return this;
|
||||
}
|
||||
return this.each(function () {
|
||||
if (!$(this).data('colorpickerId')) {
|
||||
var options = $.extend({}, opt);
|
||||
options.origColor = opt.color;
|
||||
var id = 'collorpicker_' + parseInt(Math.random() * 1000);
|
||||
$(this).data('colorpickerId', id);
|
||||
var cal = $(tpl).attr('id', id);
|
||||
if (options.flat) {
|
||||
cal.appendTo(this).show();
|
||||
} else {
|
||||
cal.appendTo(document.body);
|
||||
}
|
||||
options.fields = cal
|
||||
.find('input')
|
||||
.bind('keyup', keyDown)
|
||||
.bind('change', change)
|
||||
.bind('blur', blur)
|
||||
.bind('focus', focus);
|
||||
cal
|
||||
.find('span').bind('mousedown', downIncrement).end()
|
||||
.find('>div.colorpicker_current_color').bind('click', restoreOriginal);
|
||||
options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector);
|
||||
options.selectorIndic = options.selector.find('div div');
|
||||
options.el = this;
|
||||
options.hue = cal.find('div.colorpicker_hue div');
|
||||
cal.find('div.colorpicker_hue').bind('mousedown', downHue);
|
||||
options.newColor = cal.find('div.colorpicker_new_color');
|
||||
options.currentColor = cal.find('div.colorpicker_current_color');
|
||||
cal.data('colorpicker', options);
|
||||
cal.find('div.colorpicker_submit')
|
||||
.bind('mouseenter', enterSubmit)
|
||||
.bind('mouseleave', leaveSubmit)
|
||||
.bind('click', clickSubmit);
|
||||
fillRGBFields(options.color, cal.get(0));
|
||||
fillHSBFields(options.color, cal.get(0));
|
||||
fillHexFields(options.color, cal.get(0));
|
||||
setHue(options.color, cal.get(0));
|
||||
setSelector(options.color, cal.get(0));
|
||||
setCurrentColor(options.color, cal.get(0));
|
||||
setNewColor(options.color, cal.get(0));
|
||||
if (options.flat) {
|
||||
cal.css({
|
||||
position: 'relative',
|
||||
display: 'block'
|
||||
});
|
||||
} else {
|
||||
$(this).bind(options.eventName, show);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
showPicker: function() {
|
||||
return this.each( function () {
|
||||
if ($(this).data('colorpickerId')) {
|
||||
show.apply(this);
|
||||
}
|
||||
});
|
||||
},
|
||||
hidePicker: function() {
|
||||
return this.each( function () {
|
||||
if ($(this).data('colorpickerId')) {
|
||||
$('#' + $(this).data('colorpickerId')).hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
setColor: function(col) {
|
||||
if (typeof col == 'string') {
|
||||
col = HexToHSB(col);
|
||||
} else if (col.r != undefined && col.g != undefined && col.b != undefined) {
|
||||
col = RGBToHSB(col);
|
||||
} else if (col.h != undefined && col.s != undefined && col.b != undefined) {
|
||||
col = fixHSB(col);
|
||||
} else {
|
||||
return this;
|
||||
}
|
||||
return this.each(function(){
|
||||
if ($(this).data('colorpickerId')) {
|
||||
var cal = $('#' + $(this).data('colorpickerId'));
|
||||
cal.data('colorpicker').color = col;
|
||||
cal.data('colorpicker').origColor = col;
|
||||
fillRGBFields(col, cal.get(0));
|
||||
fillHSBFields(col, cal.get(0));
|
||||
fillHexFields(col, cal.get(0));
|
||||
setHue(col, cal.get(0));
|
||||
setSelector(col, cal.get(0));
|
||||
setCurrentColor(col, cal.get(0));
|
||||
setNewColor(col, cal.get(0));
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}();
|
||||
$.fn.extend({
|
||||
ColorPicker: ColorPicker.init,
|
||||
ColorPickerHide: ColorPicker.hidePicker,
|
||||
ColorPickerShow: ColorPicker.showPicker,
|
||||
ColorPickerSetColor: ColorPicker.setColor
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,49 @@
|
||||
// Import every plugin under the sun. Bad for performance,
|
||||
// but prevents the store from breaking in situations
|
||||
// where a dependency was missed during the migration from
|
||||
// a monolith build of jQueryUI to a modular one
|
||||
|
||||
define([
|
||||
'jquery-ui-modules/core',
|
||||
'jquery-ui-modules/accordion',
|
||||
'jquery-ui-modules/autocomplete',
|
||||
'jquery-ui-modules/button',
|
||||
'jquery-ui-modules/datepicker',
|
||||
'jquery-ui-modules/dialog',
|
||||
'jquery-ui-modules/draggable',
|
||||
'jquery-ui-modules/droppable',
|
||||
'jquery-ui-modules/effect-blind',
|
||||
'jquery-ui-modules/effect-bounce',
|
||||
'jquery-ui-modules/effect-clip',
|
||||
'jquery-ui-modules/effect-drop',
|
||||
'jquery-ui-modules/effect-explode',
|
||||
'jquery-ui-modules/effect-fade',
|
||||
'jquery-ui-modules/effect-fold',
|
||||
'jquery-ui-modules/effect-highlight',
|
||||
'jquery-ui-modules/effect-scale',
|
||||
'jquery-ui-modules/effect-pulsate',
|
||||
'jquery-ui-modules/effect-shake',
|
||||
'jquery-ui-modules/effect-slide',
|
||||
'jquery-ui-modules/effect-transfer',
|
||||
'jquery-ui-modules/effect',
|
||||
'jquery-ui-modules/menu',
|
||||
'jquery-ui-modules/mouse',
|
||||
'jquery-ui-modules/position',
|
||||
'jquery-ui-modules/progressbar',
|
||||
'jquery-ui-modules/resizable',
|
||||
'jquery-ui-modules/selectable',
|
||||
'jquery-ui-modules/slider',
|
||||
'jquery-ui-modules/sortable',
|
||||
'jquery-ui-modules/spinner',
|
||||
'jquery-ui-modules/tabs',
|
||||
'jquery-ui-modules/timepicker',
|
||||
'jquery-ui-modules/tooltip',
|
||||
'jquery-ui-modules/widget'
|
||||
], function() {
|
||||
console.warn(
|
||||
'Fallback to JQueryUI Compat activated. ' +
|
||||
'Your store is missing a dependency for a ' +
|
||||
'jQueryUI widget. Identifying and addressing the dependency ' +
|
||||
'will drastically improve the performance of your site.'
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,219 @@
|
||||
.mselect-list {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.mselect-list .block-footer {
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
.mselect-items-wrapper {
|
||||
min-height: 80px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.mselect-fixed {
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.mselect-list-item {
|
||||
position: relative;
|
||||
margin: 1px 0;
|
||||
}
|
||||
|
||||
.mselect-list-item:hover {
|
||||
background: #eef8fc;
|
||||
}
|
||||
|
||||
.mselect-list-item label {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.mselect-input-container {
|
||||
position: relative;
|
||||
display: none;
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.mselect-input {
|
||||
width: 99%;
|
||||
margin:0;
|
||||
}
|
||||
.mselect-list-item .mselect-checked + span {
|
||||
background: #cdecf6;
|
||||
}
|
||||
|
||||
.mselect-list-item input:checked + span {
|
||||
background: #cdecf6;
|
||||
}
|
||||
|
||||
.mselect-list-item .mselect-checked + span:before {
|
||||
color: #7ba4b1;
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 5px;
|
||||
vertical-align: baseline;
|
||||
font-family: 'MUI-Icons';
|
||||
font-style: normal;
|
||||
speak: none;
|
||||
font-weight: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
content: "\e067";
|
||||
}
|
||||
|
||||
.mselect-list-item input:checked + span:before {
|
||||
color: #7ba4b1;
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
left: 5px;
|
||||
vertical-align: baseline;
|
||||
font-family: 'MUI-Icons';
|
||||
font-style: normal;
|
||||
speak: none;
|
||||
font-weight: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
content: "\e067";
|
||||
}
|
||||
|
||||
.mselect-list-item input[type='checkbox'] {
|
||||
position: absolute;
|
||||
left: -9999px;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.mselect-list-item.mselect-disabled label span {
|
||||
color: #999;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.mselect-list-item.mselect-disabled:hover {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.mselect-list-item label > span {
|
||||
display: block;
|
||||
padding: 5px 50px 5px 20px;
|
||||
font-size: 13px;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
.mselect-list-item label span form {
|
||||
position: relative;
|
||||
margin: 0 -45px 0 -15px;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.mselect-list-item input[type='text'] {
|
||||
padding-right: 45px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.mselect-list-item input::-ms-clear {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mselect-cancel,
|
||||
.mselect-edit,
|
||||
.mselect-delete,
|
||||
.mselect-save {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
.mselect-cancel {
|
||||
right: 5px;
|
||||
top: 3px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.mselect-edit {
|
||||
top: 2px;
|
||||
right: 30px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mselect-delete {
|
||||
display: none;
|
||||
top: 2px;
|
||||
right: 5px;
|
||||
}
|
||||
|
||||
.mselect-save,
|
||||
.mselect-save:hover,
|
||||
.mselect-save:focus {
|
||||
display: block;
|
||||
top: 4px;
|
||||
right: 25px;
|
||||
border: none;
|
||||
background: none;
|
||||
filter: none;
|
||||
}
|
||||
|
||||
.mselect-cancel:before,
|
||||
.mselect-edit:before,
|
||||
.mselect-delete:before,
|
||||
.mselect-save:before {
|
||||
font-size: 16px;
|
||||
color: #666;
|
||||
color: rgba(20,20,20,0.3);
|
||||
vertical-align: baseline;
|
||||
font-family: 'MUI-Icons';
|
||||
font-style: normal;
|
||||
speak: none;
|
||||
font-weight: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
.mselect-cancel:active,
|
||||
.mselect-edit:active,
|
||||
.mselect-delete:active,
|
||||
.mselect-save:active {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.mselect-cancel:hover:before,
|
||||
.mselect-edit:hover:before,
|
||||
.mselect-delete:hover:before,
|
||||
.mselect-save:hover:before {
|
||||
color: #333;
|
||||
color: rgba(20,20,20,0.6);
|
||||
}
|
||||
|
||||
.mselect-cancel:before {
|
||||
content: "\e069"
|
||||
}
|
||||
|
||||
.mselect-edit:before {
|
||||
content: "\e05b"
|
||||
}
|
||||
|
||||
.mselect-delete:before {
|
||||
content: "\e07f"
|
||||
}
|
||||
|
||||
.mselect-save:before {
|
||||
content: "\e067";
|
||||
}
|
||||
|
||||
.mselect-list-item:hover .mselect-delete,
|
||||
.mselect-list-item:hover .mselect-edit {
|
||||
display: block;
|
||||
}
|
||||
.mselect-list-item-not-editable:hover .mselect-edit {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mselect-list-item-not-removable:hover .mselect-delete {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mselect-input-container .mselect-save {
|
||||
top: 3px;
|
||||
}
|
||||
@@ -0,0 +1,828 @@
|
||||
/**
|
||||
* @file Jeditable - jQuery in place edit plugin
|
||||
* @home https://github.com/NicolasCARPi/jquery_jeditable
|
||||
* @author Mika Tuupola, Dylan Verheul, Nicolas CARPi
|
||||
* @copyright © 2006 Mika Tuupola, Dylan Verheul, Nicolas CARPi
|
||||
* @licence MIT (see LICENCE file)
|
||||
* @name Jquery-jeditable
|
||||
* @type jQuery
|
||||
*
|
||||
* @param {String|Function} target - URL or Function to send edited content to. Can also be 'disable', 'enable', or 'destroy'
|
||||
* @param {Object} [options] - Additional options
|
||||
* @param {Object} [options.ajaxoptions] - jQuery Ajax options. See https://api.jquery.com/jQuery.ajax/
|
||||
* @param {Function} [options.before] - Function to be executed before going into edit mode
|
||||
* @param {Function} [options.callback] - function(result, settings, submitdata) Function to run after submitting edited content
|
||||
* @param {String} [options.cancel] - Cancel button value, empty means no button
|
||||
* @param {String} [options.cancelcssclass] - CSS class to apply to cancel button
|
||||
* @param {Number} [options.cols] - Number of columns if using textarea
|
||||
* @param {String} [options.cssclass] - CSS class to apply to input form; use 'inherit' to copy from parent
|
||||
* @param {String} [options.inputcssclass] - CSS class to apply to input. 'inherit' to copy from parent
|
||||
* @param {Function} [options.intercept] - Intercept the returned data so you have a chance to process it before returning it in the page
|
||||
* @param {String|Function} [options.data] - Content loaded in the form
|
||||
* @param {String} [options.event='click'] - jQuery event such as 'click' or 'dblclick'. See https://api.jquery.com/category/events/
|
||||
* @param {String} [options.formid] - Give an id to the form that is produced
|
||||
* @param {String|Number} [options.height='auto'] - Height of the element in pixels or 'auto' or 'none'
|
||||
* @param {String} [options.id='id'] - POST parameter name of edited div id
|
||||
* @param {String} [options.indicator] - Indicator html to show when saving
|
||||
* @param {String} [options.label] - Label for the form
|
||||
* @param {String} [options.list] - HTML5 attribute for text input. Will suggest from a datalist with id of the list option
|
||||
* @param {String|Function} [options.loaddata] - Extra parameters to pass when fetching content before editing
|
||||
* @param {String} [options.loadtext='Loading…'] - Text to display while loading external content
|
||||
* @param {String} [options.loadtype='GET'] - Request type for loadurl (GET or POST)
|
||||
* @param {String} [options.loadurl] - URL to fetch input content before editing
|
||||
* @param {Number} [options.max] - Maximum value for number type
|
||||
* @param {String} [options.maxlength] - The maximum number of character in the text field
|
||||
* @param {String} [options.method] - Method to use to send edited content (POST or PUT)
|
||||
* @param {Number} [options.min] - Minimum value for number type
|
||||
* @param {Boolean} [options.multiple] - Allow multiple selections in a select input
|
||||
* @param {String} [options.name='value'] - POST parameter name of edited content
|
||||
* @param {String|Function} [options.onblur='cancel'] - Use 'cancel', 'submit', 'ignore' or function. If function returns false, the form is cancelled.
|
||||
* @param {Function} [options.onedit] - function triggered upon edition; will cancel edition if it returns false
|
||||
* @param {Function} [options.onerror] - function(settings, original, xhr) { ... } called on error
|
||||
* @param {Function} [options.onreset] - function(settings, original) { ... } called before reset
|
||||
* @param {Function} [options.onsubmit] - function(settings, original) { ... } called before submit
|
||||
* @param {String} [options.pattern] - HTML5 attribute for text or URL input
|
||||
* @param {String} [options.placeholder='Click to edit'] - Placeholder text or html to insert when element is empty
|
||||
* @param {Number} [options.rows] - number of rows if using textarea
|
||||
* @param {Boolean} [options.select] - When true text is selected
|
||||
* @param {Function} [options.showfn]- Function that can animate the element when switching to edit mode
|
||||
* @param {String} [options.size] - The size of the text field
|
||||
* @param {String} [options.sortselectoptions] - Sort the options of a select form
|
||||
* @param {Number} [options.step] - Step size for number type
|
||||
* @param {String} [options.style] - Style to apply to input form; 'inherit' to copy from parent
|
||||
* @param {String} [options.submit] - submit button value, empty means no button
|
||||
* @param {String} [options.submitcssclass] - CSS class to apply to submit button
|
||||
* @param {Object|Function} [options.submitdata] - Extra parameters to send when submitting edited content. function(revert, settings, submitdata)
|
||||
* @param {String} [options.tooltip] - Tooltip text that appears on hover (via title attribute)
|
||||
* @param {String} [options.type='text'] - text, textarea, select, email, number, url (or any 3rd party input type)
|
||||
* @param {String|Number} [options.width='auto'] - The width of the element in pixels or 'auto' or 'none'
|
||||
*
|
||||
* @example <caption>Simple usage example:</caption>
|
||||
* $(".editable").editable("save.php", {
|
||||
* cancel : 'Cancel',
|
||||
* submit : 'Save',
|
||||
* tooltip : "Click to edit...",
|
||||
* });
|
||||
*/
|
||||
(function($) {
|
||||
|
||||
'use strict';
|
||||
|
||||
// Keyboard accessibility/WAI-ARIA - allow users to navigate to an editable element using TAB/Shift+TAB
|
||||
$.fn.editableAriaShim = function () {
|
||||
this.attr({
|
||||
role: 'button',
|
||||
tabindex: 0
|
||||
});
|
||||
return this; // <-- object chaining.
|
||||
};
|
||||
|
||||
// EDITABLE function
|
||||
$.fn.editable = function(target, options) {
|
||||
|
||||
if ('disable' === target) {
|
||||
$(this).data('disabled.editable', true);
|
||||
return;
|
||||
}
|
||||
if ('enable' === target) {
|
||||
$(this).data('disabled.editable', false);
|
||||
return;
|
||||
}
|
||||
if ('destroy' === target) {
|
||||
$(this)
|
||||
.off($(this).data('event.editable'))
|
||||
.removeData('disabled.editable')
|
||||
.removeData('event.editable');
|
||||
return;
|
||||
}
|
||||
var settings = $.extend({}, $.fn.editable.defaults, {target:target}, options);
|
||||
|
||||
/* setup some functions */
|
||||
var plugin = $.editable.types[settings.type].plugin || function() { };
|
||||
var submit = $.editable.types[settings.type].submit || function() { };
|
||||
var buttons = $.editable.types[settings.type].buttons || $.editable.types.defaults.buttons;
|
||||
var content = $.editable.types[settings.type].content || $.editable.types.defaults.content;
|
||||
var element = $.editable.types[settings.type].element || $.editable.types.defaults.element;
|
||||
var reset = $.editable.types[settings.type].reset || $.editable.types.defaults.reset;
|
||||
var destroy = $.editable.types[settings.type].destroy || $.editable.types.defaults.destroy;
|
||||
var callback = settings.callback || function() { };
|
||||
var intercept = settings.intercept || function(s) { return s; };
|
||||
var onedit = settings.onedit || function() { };
|
||||
var onsubmit = settings.onsubmit || function() { };
|
||||
var onreset = settings.onreset || function() { };
|
||||
var onerror = settings.onerror || reset;
|
||||
var before = settings.before || false;
|
||||
|
||||
// TOOLTIP
|
||||
if (settings.tooltip) {
|
||||
$(this).attr('title', settings.tooltip);
|
||||
}
|
||||
|
||||
return this.each(function() {
|
||||
|
||||
/* Save this to self because this changes when scope changes. */
|
||||
var self = this;
|
||||
|
||||
/* Save so it can be later used by $.editable('destroy') */
|
||||
$(this).data('event.editable', settings.event);
|
||||
|
||||
/* If element is empty add something clickable (if requested) */
|
||||
if (!$(this).html().trim()) {
|
||||
$(this).html(settings.placeholder);
|
||||
}
|
||||
|
||||
if ('destroy' === target) {
|
||||
destroy.apply($(this).find('form'), [settings, self]);
|
||||
return;
|
||||
}
|
||||
|
||||
// EVENT IS FIRED
|
||||
$(this).on(settings.event, function(e) {
|
||||
|
||||
/* Abort if element is disabled. */
|
||||
if (true === $(this).data('disabled.editable')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// do nothing if user press Tab again, just go to next element, not into edit mode
|
||||
if (e.which === 9) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Prevent throwing an exception if edit field is clicked again. */
|
||||
if (self.editing) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Abort if onedit hook returns false. */
|
||||
if (false === onedit.apply(this, [settings, self, e])) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* execute the before function if any was specified */
|
||||
if (settings.before && (typeof settings.before === 'function')) {
|
||||
settings.before(e);
|
||||
} else if (settings.before && !(typeof settings.before === 'function')) {
|
||||
throw "The 'before' option needs to be provided as a function!";
|
||||
}
|
||||
|
||||
/* Prevent default action and bubbling. */
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
/* Remove tooltip. */
|
||||
if (settings.tooltip) {
|
||||
$(self).removeAttr('title');
|
||||
}
|
||||
|
||||
/* Remove placeholder text, replace is here because of IE. */
|
||||
if ($(this).html().toLowerCase().replace(/(;|"|\/)/g, '') ===
|
||||
settings.placeholder.toLowerCase().replace(/(;|"|\/)/g, '')) {
|
||||
$(this).html('');
|
||||
}
|
||||
|
||||
self.editing = true;
|
||||
self.revert = $(self).text();
|
||||
$(self).html('');
|
||||
|
||||
/* Create the form object. */
|
||||
var form = $('<form />');
|
||||
|
||||
/* Apply css or style or both. */
|
||||
if (settings.cssclass) {
|
||||
if ('inherit' === settings.cssclass) {
|
||||
form.attr('class', $(self).attr('class'));
|
||||
} else {
|
||||
form.attr('class', settings.cssclass);
|
||||
}
|
||||
}
|
||||
|
||||
if (settings.style) {
|
||||
if ('inherit' === settings.style) {
|
||||
form.attr('style', $(self).attr('style'));
|
||||
/* IE needs the second line or display won't be inherited. */
|
||||
form.css('display', $(self).css('display'));
|
||||
} else {
|
||||
form.attr('style', settings.style);
|
||||
}
|
||||
}
|
||||
|
||||
// add a label if it exists
|
||||
if (settings.label) {
|
||||
form.append('<label>' + settings.label + '</label>');
|
||||
}
|
||||
|
||||
// add an ID to the form
|
||||
if (settings.formid) {
|
||||
form.attr('id', settings.formid);
|
||||
}
|
||||
|
||||
/* Add main input element to form and store it in input. */
|
||||
var input = element.apply(form, [settings, self]);
|
||||
|
||||
if (settings.inputcssclass) {
|
||||
if ('inherit' === settings.inputcssclass) {
|
||||
input.attr('class', $(self).attr('class'));
|
||||
} else {
|
||||
input.attr('class', settings.inputcssclass);
|
||||
}
|
||||
}
|
||||
|
||||
/* Set input content via POST, GET, given data or existing value. */
|
||||
var input_content;
|
||||
|
||||
// timeout function
|
||||
var t;
|
||||
var isSubmitting = false;
|
||||
|
||||
if (settings.loadurl) {
|
||||
t = self.setTimeout(function() {
|
||||
input.disabled = true;
|
||||
}, 100);
|
||||
$(self).html(settings.loadtext);
|
||||
|
||||
var loaddata = {};
|
||||
loaddata[settings.id] = self.id;
|
||||
if (typeof settings.loaddata === 'function') {
|
||||
$.extend(loaddata, settings.loaddata.apply(self, [self.revert, settings]));
|
||||
} else {
|
||||
$.extend(loaddata, settings.loaddata);
|
||||
}
|
||||
$.ajax({
|
||||
type : settings.loadtype,
|
||||
url : settings.loadurl,
|
||||
data : loaddata,
|
||||
async: false,
|
||||
cache : false,
|
||||
success: function(result) {
|
||||
self.clearTimeout(t);
|
||||
input_content = result;
|
||||
input.disabled = false;
|
||||
}
|
||||
});
|
||||
} else if (settings.data) {
|
||||
input_content = settings.data;
|
||||
if (typeof settings.data === 'function') {
|
||||
input_content = settings.data.apply(self, [self.revert, settings]);
|
||||
}
|
||||
} else {
|
||||
input_content = self.revert;
|
||||
}
|
||||
content.apply(form, [input_content, settings, self]);
|
||||
|
||||
input.attr('name', settings.name);
|
||||
|
||||
/* adjust the width of the element to account for the margin/padding/border */
|
||||
if (settings.width !== 'none') {
|
||||
var adj_width = settings.width - (input.outerWidth(true) - settings.width);
|
||||
input.width(adj_width);
|
||||
}
|
||||
|
||||
/* Add buttons to the form. */
|
||||
buttons.apply(form, [settings, self]);
|
||||
|
||||
/* Add created form to self. */
|
||||
if (settings.showfn && (typeof settings.showfn === 'function')) {
|
||||
form.hide();
|
||||
}
|
||||
|
||||
// clear the loadtext that we put here before
|
||||
$(self).html('');
|
||||
|
||||
$(self).append(form);
|
||||
|
||||
// execute the showfn
|
||||
if (settings.showfn && (typeof settings.showfn === 'function')) {
|
||||
settings.showfn(form);
|
||||
}
|
||||
|
||||
/* Attach 3rd party plugin if requested. */
|
||||
plugin.apply(form, [settings, self]);
|
||||
|
||||
/* Focus to first visible form element. */
|
||||
form.find(':input:visible:enabled:first').trigger('focus');
|
||||
|
||||
/* Highlight input contents when requested. */
|
||||
if (settings.select) {
|
||||
input.trigger('select');
|
||||
}
|
||||
|
||||
/* discard changes if pressing esc */
|
||||
$(this).on('keydown', function(e) {
|
||||
if (e.which === 27) {
|
||||
e.preventDefault();
|
||||
reset.apply(form, [settings, self]);
|
||||
/* allow shift+enter to submit form (required for textarea) */
|
||||
} else if (e.which == 13 && e.shiftKey){
|
||||
e.preventDefault();
|
||||
form.trigger('submit');
|
||||
}
|
||||
});
|
||||
|
||||
/* Discard, submit or nothing with changes when clicking outside. */
|
||||
/* Do nothing is usable when navigating with tab. */
|
||||
if ('cancel' === settings.onblur) {
|
||||
input.on('blur', function(e) {
|
||||
/* Prevent canceling if submit was clicked. */
|
||||
t = self.setTimeout(function() {
|
||||
reset.apply(form, [settings, self]);
|
||||
}, 500);
|
||||
});
|
||||
} else if ('submit' === settings.onblur) {
|
||||
input.on('blur', function(e) {
|
||||
/* Prevent double submit if submit was clicked. */
|
||||
t = self.setTimeout(function() {
|
||||
form.trigger('submit');
|
||||
}, 200);
|
||||
});
|
||||
} else if (typeof settings.onblur === 'function') {
|
||||
input.on('blur', function(e) {
|
||||
// reset the form if the onblur function returns false
|
||||
if (false === settings.onblur.apply(self, [input.val(), settings, form])) {
|
||||
reset.apply(form, [settings, self]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
form.on('submit', function(e) {
|
||||
|
||||
/* Do no submit. */
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
if (isSubmitting) {
|
||||
// we are already submitting! Stop right here.
|
||||
return false;
|
||||
} else {
|
||||
isSubmitting = true;
|
||||
}
|
||||
|
||||
if (t) {
|
||||
self.clearTimeout(t);
|
||||
}
|
||||
|
||||
/* Call before submit hook. */
|
||||
/* If it returns false abort submitting. */
|
||||
isSubmitting = false !== onsubmit.apply(form, [settings, self]);
|
||||
if (isSubmitting) {
|
||||
/* Custom inputs call before submit hook. */
|
||||
/* If it returns false abort submitting. */
|
||||
isSubmitting = false !== submit.apply(form, [settings, self]);
|
||||
if (isSubmitting) {
|
||||
|
||||
/* Check if given target is function */
|
||||
if (typeof settings.target === 'function') {
|
||||
/* Callback function to handle the target response */
|
||||
var responseHandler = function(value, complete) {
|
||||
isSubmitting = false;
|
||||
if (false !== complete) {
|
||||
$(self).html(value);
|
||||
self.editing = false;
|
||||
callback.apply(self, [self.innerText, settings]);
|
||||
if (!$(self).html().trim()) {
|
||||
$(self).html(settings.placeholder);
|
||||
}
|
||||
}
|
||||
};
|
||||
/* Call the user target function */
|
||||
var userTarget = settings.target.apply(self, [input.val(), settings, responseHandler]);
|
||||
/* Handle the target function return for compatibility */
|
||||
if (false !== userTarget && undefined !== userTarget) {
|
||||
responseHandler(userTarget, userTarget);
|
||||
}
|
||||
|
||||
} else {
|
||||
/* Add edited content and id of edited element to POST. */
|
||||
var submitdata = {};
|
||||
submitdata[settings.name] = input.val();
|
||||
submitdata[settings.id] = self.id;
|
||||
/* Add extra data to be POST:ed. */
|
||||
if (typeof settings.submitdata === 'function') {
|
||||
$.extend(submitdata, settings.submitdata.apply(self, [self.revert, settings, submitdata]));
|
||||
} else {
|
||||
$.extend(submitdata, settings.submitdata);
|
||||
}
|
||||
|
||||
/* Quick and dirty PUT support. */
|
||||
if ('PUT' === settings.method) {
|
||||
submitdata._method = 'put';
|
||||
}
|
||||
|
||||
// SHOW INDICATOR
|
||||
$(self).html(settings.indicator);
|
||||
|
||||
/* Defaults for ajaxoptions. */
|
||||
var ajaxoptions = {
|
||||
type : 'POST',
|
||||
complete: function (xhr, status) {
|
||||
isSubmitting = false;
|
||||
},
|
||||
data : submitdata,
|
||||
dataType: 'html',
|
||||
url : settings.target,
|
||||
success : function(result, status) {
|
||||
|
||||
// INTERCEPT
|
||||
result = intercept.apply(self, [result, status]);
|
||||
|
||||
if (ajaxoptions.dataType === 'html') {
|
||||
$(self).html(result);
|
||||
}
|
||||
self.editing = false;
|
||||
callback.apply(self, [result, settings, submitdata]);
|
||||
if (!$(self).html().trim()) {
|
||||
$(self).html(settings.placeholder);
|
||||
}
|
||||
},
|
||||
error : function(xhr, status, error) {
|
||||
onerror.apply(form, [settings, self, xhr]);
|
||||
}
|
||||
};
|
||||
|
||||
/* Override with what is given in settings.ajaxoptions. */
|
||||
$.extend(ajaxoptions, settings.ajaxoptions);
|
||||
$.ajax(ajaxoptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Show tooltip again. */
|
||||
$(self).attr('title', settings.tooltip);
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
// PRIVILEGED METHODS
|
||||
|
||||
// RESET
|
||||
self.reset = function(form) {
|
||||
/* Prevent calling reset twice when blurring. */
|
||||
if (self.editing) {
|
||||
/* Before reset hook, if it returns false abort resetting. */
|
||||
if (false !== onreset.apply(form, [settings, self])) {
|
||||
$(self).text(self.revert);
|
||||
self.editing = false;
|
||||
if (!$(self).html().trim()) {
|
||||
$(self).html(settings.placeholder);
|
||||
}
|
||||
/* Show tooltip again. */
|
||||
if (settings.tooltip) {
|
||||
$(self).attr('title', settings.tooltip);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// DESTROY
|
||||
self.destroy = function(form) {
|
||||
$(self)
|
||||
.off($(self).data('event.editable'))
|
||||
.removeData('disabled.editable')
|
||||
.removeData('event.editable');
|
||||
|
||||
self.clearTimeouts();
|
||||
|
||||
if (self.editing) {
|
||||
reset.apply(form, [settings, self]);
|
||||
}
|
||||
};
|
||||
|
||||
// CLEARTIMEOUT
|
||||
self.clearTimeout = function(t) {
|
||||
var timeouts = $(self).data('timeouts');
|
||||
clearTimeout(t);
|
||||
if(timeouts) {
|
||||
var i = timeouts.indexOf(t);
|
||||
if(i > -1) {
|
||||
timeouts.splice(i, 1);
|
||||
if(timeouts.length <= 0) {
|
||||
$(self).removeData('timeouts');
|
||||
}
|
||||
} else {
|
||||
console.warn('jeditable clearTimeout could not find timeout '+t);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// CLEAR ALL TIMEOUTS
|
||||
self.clearTimeouts = function () {
|
||||
var timeouts = $(self).data('timeouts');
|
||||
if(timeouts) {
|
||||
for(var i = 0, n = timeouts.length; i < n; ++i) {
|
||||
clearTimeout(timeouts[i]);
|
||||
}
|
||||
timeouts.length = 0;
|
||||
$(self).removeData('timeouts');
|
||||
}
|
||||
};
|
||||
|
||||
// SETTIMEOUT
|
||||
self.setTimeout = function(callback, time) {
|
||||
var timeouts = $(self).data('timeouts');
|
||||
var t = setTimeout(function() {
|
||||
callback();
|
||||
self.clearTimeout(t);
|
||||
}, time);
|
||||
if(!timeouts) {
|
||||
timeouts = [];
|
||||
$(self).data('timeouts', timeouts);
|
||||
}
|
||||
timeouts.push(t);
|
||||
return t;
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
var _supportInType = function (type) {
|
||||
var i = document.createElement('input');
|
||||
i.setAttribute('type', type);
|
||||
return i.type !== 'text' ? type : 'text';
|
||||
};
|
||||
|
||||
|
||||
$.editable = {
|
||||
types: {
|
||||
defaults: {
|
||||
element : function(settings, original) {
|
||||
var input = $('<input type="hidden"></input>');
|
||||
$(this).append(input);
|
||||
return(input);
|
||||
},
|
||||
content : function(string, settings, original) {
|
||||
$(this).find(':input:first').val(string);
|
||||
},
|
||||
reset : function(settings, original) {
|
||||
original.reset(this);
|
||||
},
|
||||
destroy: function(settings, original) {
|
||||
original.destroy(this);
|
||||
},
|
||||
buttons : function(settings, original) {
|
||||
var form = this;
|
||||
var submit;
|
||||
if (settings.submit) {
|
||||
/* If given html string use that. */
|
||||
if (settings.submit.match(/>$/)) {
|
||||
submit = $(settings.submit).on('click', function() {
|
||||
if (submit.attr('type') !== 'submit') {
|
||||
form.trigger('submit');
|
||||
}
|
||||
});
|
||||
/* Otherwise use button with given string as text. */
|
||||
} else {
|
||||
submit = $('<button type="submit" />');
|
||||
submit.html(settings.submit);
|
||||
if (settings.submitcssclass) {
|
||||
submit.addClass(settings.submitcssclass);
|
||||
}
|
||||
}
|
||||
$(this).append(submit);
|
||||
}
|
||||
if (settings.cancel) {
|
||||
var cancel;
|
||||
/* If given html string use that. */
|
||||
if (settings.cancel.match(/>$/)) {
|
||||
cancel = $(settings.cancel);
|
||||
/* otherwise use button with given string as text */
|
||||
} else {
|
||||
cancel = $('<button type="cancel" />');
|
||||
cancel.html(settings.cancel);
|
||||
if (settings.cancelcssclass) {
|
||||
cancel.addClass(settings.cancelcssclass);
|
||||
}
|
||||
}
|
||||
$(this).append(cancel);
|
||||
|
||||
$(cancel).on('click', function(event) {
|
||||
var reset;
|
||||
if (typeof $.editable.types[settings.type].reset === 'function') {
|
||||
reset = $.editable.types[settings.type].reset;
|
||||
} else {
|
||||
reset = $.editable.types.defaults.reset;
|
||||
}
|
||||
reset.apply(form, [settings, original]);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
text: {
|
||||
element : function(settings, original) {
|
||||
var input = $('<input />').attr({
|
||||
autocomplete: 'off',
|
||||
list: settings.list,
|
||||
maxlength: settings.maxlength,
|
||||
pattern: settings.pattern,
|
||||
placeholder: settings.placeholder,
|
||||
tooltip: settings.tooltip,
|
||||
type: 'text'
|
||||
});
|
||||
|
||||
if (settings.width !== 'none') {
|
||||
input.css('width', settings.width);
|
||||
}
|
||||
|
||||
if (settings.height !== 'none') {
|
||||
input.css('height', settings.height);
|
||||
}
|
||||
|
||||
if (settings.size) {
|
||||
input.attr('size', settings.size);
|
||||
}
|
||||
|
||||
if (settings.maxlength) {
|
||||
input.attr('maxlength', settings.maxlength);
|
||||
}
|
||||
|
||||
$(this).append(input);
|
||||
return(input);
|
||||
}
|
||||
},
|
||||
|
||||
// TEXTAREA
|
||||
textarea: {
|
||||
element : function(settings, original) {
|
||||
var textarea = $('<textarea></textarea>');
|
||||
if (settings.rows) {
|
||||
textarea.attr('rows', settings.rows);
|
||||
} else if (settings.height !== 'none') {
|
||||
textarea.height(settings.height);
|
||||
}
|
||||
if (settings.cols) {
|
||||
textarea.attr('cols', settings.cols);
|
||||
} else if (settings.width !== 'none') {
|
||||
textarea.width(settings.width);
|
||||
}
|
||||
|
||||
if (settings.maxlength) {
|
||||
textarea.attr('maxlength', settings.maxlength);
|
||||
}
|
||||
|
||||
$(this).append(textarea);
|
||||
return(textarea);
|
||||
}
|
||||
},
|
||||
|
||||
// SELECT
|
||||
select: {
|
||||
element : function(settings, original) {
|
||||
var select = $('<select />');
|
||||
|
||||
if (settings.multiple) {
|
||||
select.attr('multiple', 'multiple');
|
||||
}
|
||||
|
||||
$(this).append(select);
|
||||
return(select);
|
||||
},
|
||||
content : function(data, settings, original) {
|
||||
var json;
|
||||
// If it is string assume it is json
|
||||
if (String === data.constructor) {
|
||||
json = JSON.parse(data);
|
||||
} else {
|
||||
// Otherwise assume it is a hash already
|
||||
json = data;
|
||||
}
|
||||
|
||||
// Create tuples for sorting
|
||||
var tuples = [];
|
||||
var key;
|
||||
|
||||
if (Array.isArray(json) && json.every(Array.isArray)) {
|
||||
// Process list of tuples
|
||||
tuples = json // JSON already contains list of [key, value]
|
||||
json = {};
|
||||
tuples.forEach(function(e) {
|
||||
json[e[0]] = e[1]; // Recreate json object to comply with following code
|
||||
});
|
||||
} else {
|
||||
// Process object
|
||||
for (key in json) {
|
||||
tuples.push([key, json[key]]); // Store: [key, value]
|
||||
}
|
||||
}
|
||||
|
||||
if (settings.sortselectoptions) {
|
||||
// sort it
|
||||
tuples.sort(function (a, b) {
|
||||
a = a[1];
|
||||
b = b[1];
|
||||
return a < b ? -1 : (a > b ? 1 : 0);
|
||||
});
|
||||
}
|
||||
// now add the options to our select
|
||||
var option;
|
||||
for (var i = 0; i < tuples.length; i++) {
|
||||
key = tuples[i][0];
|
||||
var value = tuples[i][1];
|
||||
|
||||
if (!json.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (key !== 'selected') {
|
||||
option = $('<option />').val(key).append(value);
|
||||
|
||||
// add the selected prop if it's the same as original or if the key is 'selected'
|
||||
if (json.selected === key || key === String.prototype.trim.call(original.revert == null ? "" : original.revert)) {
|
||||
$(option).prop('selected', 'selected');
|
||||
}
|
||||
|
||||
$(this).find('select').append(option);
|
||||
}
|
||||
}
|
||||
|
||||
// submit on change if no submit button defined
|
||||
if (!settings.submit) {
|
||||
var form = this;
|
||||
$(this).find('select').change(function() {
|
||||
form.trigger('submit');
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// NUMBER
|
||||
number: {
|
||||
element: function (settings, original) {
|
||||
var input = $('<input />').attr({
|
||||
maxlength: settings.maxlength,
|
||||
placeholder: settings.placeholder,
|
||||
min : settings.min,
|
||||
max : settings.max,
|
||||
step: settings.step,
|
||||
tooltip: settings.tooltip,
|
||||
type: _supportInType('number')
|
||||
});
|
||||
if (settings.width !== 'none') {
|
||||
input.css('width', settings.width);
|
||||
}
|
||||
$(this).append(input);
|
||||
return input;
|
||||
}
|
||||
},
|
||||
|
||||
// EMAIL
|
||||
email: {
|
||||
element: function (settings, original) {
|
||||
var input = $('<input />').attr({
|
||||
maxlength: settings.maxlength,
|
||||
placeholder: settings.placeholder,
|
||||
tooltip: settings.tooltip,
|
||||
type: _supportInType('email')
|
||||
});
|
||||
if (settings.width !== 'none') {
|
||||
input.css('width', settings.width);
|
||||
}
|
||||
$(this).append(input);
|
||||
return input;
|
||||
}
|
||||
},
|
||||
|
||||
// URL
|
||||
url: {
|
||||
element: function (settings, original) {
|
||||
var input = $('<input />').attr({
|
||||
maxlength: settings.maxlength,
|
||||
pattern: settings.pattern,
|
||||
placeholder: settings.placeholder,
|
||||
tooltip: settings.tooltip,
|
||||
type: _supportInType('url')
|
||||
});
|
||||
if (settings.width !== 'none') {
|
||||
input.css('width', settings.width);
|
||||
}
|
||||
$(this).append(input);
|
||||
return input;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// add new input type
|
||||
addInputType: function(name, input) {
|
||||
$.editable.types[name] = input;
|
||||
}
|
||||
};
|
||||
|
||||
/* Publicly accessible defaults. */
|
||||
$.fn.editable.defaults = {
|
||||
name : 'value',
|
||||
id : 'id',
|
||||
type : 'text',
|
||||
width : 'auto',
|
||||
height : 'auto',
|
||||
// Keyboard accessibility - use mouse click OR press any key to enable editing
|
||||
event : 'click.editable keydown.editable',
|
||||
onblur : 'cancel',
|
||||
tooltip : 'Click to edit',
|
||||
loadtype : 'GET',
|
||||
loadtext : 'Loading...',
|
||||
placeholder: 'Click to edit',
|
||||
sortselectoptions: false,
|
||||
loaddata : {},
|
||||
submitdata : {},
|
||||
ajaxoptions: {}
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,193 @@
|
||||
define([
|
||||
"jquery"
|
||||
], function($){
|
||||
|
||||
/*
|
||||
* jQuery.multiselect plugin
|
||||
*
|
||||
* Form control: allow select several values from list and add new value(s) to list
|
||||
*
|
||||
* Licensed under the BSD License:
|
||||
* http://www.opensource.org/licenses/bsd-license
|
||||
*
|
||||
* Version: 0.9.0
|
||||
*
|
||||
* @author Dmitry (dio) Levashov, dio@std42.ru
|
||||
* @example
|
||||
* html: <select name="my-select" multiple="on"><option .... </select>
|
||||
* js : $('select[name="my-select"]').multiselect()
|
||||
* or
|
||||
* var opts = { ... };
|
||||
* $('select[name="my-select"]').multiselect(opts);
|
||||
*/
|
||||
$.fn.multiselect = function(opts) {
|
||||
var o = $.extend({
|
||||
mselectHiddenClass: 'mselect-hidden',
|
||||
mselectItemNotEditableClass: 'mselect-list-item-not-editable',
|
||||
mselectItemNotRemovableClass: 'mselect-list-item-not-removable',
|
||||
mselectListClass: 'mselect-list',
|
||||
mselectItemsWrapperClass: 'mselect-items-wrapper',
|
||||
mselectButtonAddClass: 'mselect-button-add',
|
||||
mselectInputContainerClass: 'mselect-input-container',
|
||||
mselectInputClass: 'mselect-input',
|
||||
mselectButtonCancelClass: 'mselect-cancel',
|
||||
mselectButtonSaveClass: 'mselect-save',
|
||||
mselectListItemClass: 'mselect-list-item',
|
||||
mselectItemsWrapperOverflowClass: 'mselect-fixed',
|
||||
mselectDisabledClass: 'mselect-disabled',
|
||||
mselectCheckedClass: 'mselect-checked',
|
||||
layout: '<section class="block %mselectListClass%">'
|
||||
+'<div class="block-content"><div class="%mselectItemsWrapperClass%">'
|
||||
+'%items%'
|
||||
+'</div></div>'
|
||||
+'<footer class="block-footer">'
|
||||
+'<span class="action-add %mselectButtonAddClass%">%addText%</span>'
|
||||
+'</footer>'
|
||||
+'<div class="%mselectInputContainerClass%">'
|
||||
+'<input type="text" class="%mselectInputClass%" title="%inputTitle%"/>'
|
||||
+'<span class="%mselectButtonCancelClass%" title="%cancelText%"></span>'
|
||||
+'<span class="%mselectButtonSaveClass%" title="Add"></span>'
|
||||
+'</div>'
|
||||
+'</section>',
|
||||
item : '<div class="%mselectListItemClass% %mselectDisabledClass% %iseditable% %isremovable%"><label><input type="checkbox" class="%mselectCheckedClass%" value="%value%" %checked% %disabled% /><span>%label%</span></label>' +
|
||||
'<span class="mselect-edit" title="Edit">Edit</span>' +
|
||||
'<span class="mselect-delete" title="Delete">Delete</span> ' +
|
||||
'</div>',
|
||||
addText: 'Add new value',
|
||||
cancelText: 'Cancel',
|
||||
inputTitle: 'Enter new option',
|
||||
size: 5,
|
||||
keyCodes: {
|
||||
Enter: 13,
|
||||
Esc: 27
|
||||
},
|
||||
toggleAddButton: true,
|
||||
// New option for callback
|
||||
mselectInputSubmitCallback: null,
|
||||
parse : function(v) { return v.split(/\s*,\s*/); }
|
||||
}, opts||{});
|
||||
|
||||
return this.filter('select[multiple]:not(.' + o.mselectHiddenClass + ')').each(function() {
|
||||
var select = $(this).addClass(o.mselectHiddenClass).hide(),
|
||||
size = select.attr('size') > 0 ? select.attr('size') : o.size,
|
||||
items = (function() {
|
||||
var str = '';
|
||||
|
||||
select.children('option').each(function(i, option) {
|
||||
option = $(option);
|
||||
|
||||
str += o.item
|
||||
.replace(/%value%/gi, option.val())
|
||||
.replace(/%checked%/gi, option.prop('selected') ? 'checked' : '')
|
||||
.replace(/%mselectCheckedClass%/gi, option.prop('selected') ? ''+o.mselectCheckedClass+'' : '')
|
||||
.replace(/%disabled%/gi, option.prop('disabled') ? 'disabled' : '')
|
||||
.replace(/%mselectDisabledClass%/gi, option.prop('disabled') ? ''+o.mselectDisabledClass+'' : '')
|
||||
.replace(/%mselectListItemClass%/gi, o.mselectListItemClass)
|
||||
.replace(/%iseditable%/gi, option.attr('data-is-editable') ? ''+o.mselectItemNotEditableClass+'' : '')
|
||||
.replace(/%isremovable%/i, option.attr('data-is-removable') ? ''+o.mselectItemNotRemovableClass+'' : '')
|
||||
.replace(/%label%/gi, option.html());
|
||||
});
|
||||
|
||||
return str;
|
||||
})(),
|
||||
html = o.layout
|
||||
.replace(/%items%/gi, items)
|
||||
.replace(/%mselectListClass%/gi, o.mselectListClass)
|
||||
.replace(/%mselectButtonAddClass%/gi, o.mselectButtonAddClass)
|
||||
.replace(/%mselectButtonSaveClass%/gi, o.mselectButtonSaveClass)
|
||||
.replace(/%mselectButtonCancelClass%/gi, o.mselectButtonCancelClass)
|
||||
.replace(/%mselectItemsWrapperClass%/gi, o.mselectItemsWrapperClass)
|
||||
.replace(/%mselectInputContainerClass%/gi, o.mselectInputContainerClass)
|
||||
.replace(/%mselectInputClass%/gi, o.mselectInputClass)
|
||||
.replace(/%addText%/gi, o.addText)
|
||||
.replace(/%cancelText%/gi, o.cancelText)
|
||||
.replace(/%inputTitle%/gi, o.inputTitle),
|
||||
widget = $(html)
|
||||
.insertAfter(this)
|
||||
.on('change.mselectCheck', '[type=checkbox]', function() {
|
||||
var checkbox = $(this),
|
||||
index = checkbox.closest('.' + o.mselectListItemClass + '').index();
|
||||
|
||||
select.find('option').eq(index).prop('selected', !!checkbox.prop('checked'));
|
||||
}),
|
||||
list = widget.find('.' + o.mselectItemsWrapperClass + ''),
|
||||
buttonAdd = widget.find('.' + o.mselectButtonAddClass + '')
|
||||
.on('click.mselectAdd', function(e) {
|
||||
e.preventDefault();
|
||||
o.toggleAddButton && buttonAdd.hide();
|
||||
container.show();
|
||||
input.trigger('focus');
|
||||
if (input.parents(o.mselectListClass).length) {
|
||||
list.scrollTop(list.height());
|
||||
}
|
||||
}),
|
||||
container = widget.find('.' + o.mselectInputContainerClass + ''),
|
||||
input = container.find('[type=text].' + o.mselectInputClass + '')
|
||||
.on('blur.mselectReset', function() {
|
||||
reset();
|
||||
})
|
||||
.on('keydown.mselectAddNewOption', function(e) {
|
||||
var c = e.keyCode;
|
||||
|
||||
if (c == o.keyCodes.Enter || c == o.keyCodes.Esc) {
|
||||
e.preventDefault();
|
||||
c == o.keyCodes.Enter ? append(input.val()) : reset();
|
||||
}
|
||||
}),
|
||||
buttonSave = container.find('.' + o.mselectButtonSaveClass + '')
|
||||
.on('mousedown.mselectSave', function(e) {
|
||||
append(input.val());
|
||||
}),
|
||||
buttonCancel = container.find('.' + o.mselectButtonCancelClass + '')
|
||||
.on('mousedown.mdelectCancel', function(e) {
|
||||
input.val('');
|
||||
}),
|
||||
append = function(v) {
|
||||
// Add ability to define custom handler for adding new values
|
||||
if ($.isFunction(o.mselectInputSubmitCallback)) {
|
||||
o.mselectInputSubmitCallback(v, o);
|
||||
return;
|
||||
}
|
||||
// end of callback implementation
|
||||
$.each(typeof(o.parse) == 'function' ? o.parse(v) : [$.trim(v)], function(i, v) {
|
||||
var item;
|
||||
|
||||
if (v && !select.children('[value="' + v + '"]').length) {
|
||||
item = $(o.item.replace(/%value%|%label%/gi, v)
|
||||
.replace(/%mselectDisabledClass%|%iseditable%|%isremovable%/gi,'')
|
||||
.replace(/%mselectListItemClass%/gi,o.mselectListItemClass))
|
||||
.find('[type=checkbox]')
|
||||
.addClass(o.mselectCheckedClass)
|
||||
.prop('checked', true)
|
||||
.end();
|
||||
|
||||
list.children('.' + o.mselectListItemClass + '').length
|
||||
? list.children('.' + o.mselectListItemClas ).last().after(item)
|
||||
: list.prepend(item);
|
||||
|
||||
select.append('<option value="' + v + '" selected="selected">' + v + '</option>');
|
||||
}
|
||||
});
|
||||
|
||||
reset();
|
||||
list.scrollTop(list.height());
|
||||
},
|
||||
reset = function() {
|
||||
var ch = select.children();
|
||||
|
||||
input.val('');
|
||||
container.hide();
|
||||
buttonAdd.show();
|
||||
list[list.children().length ? 'show' : 'hide']();
|
||||
|
||||
if (ch.length >= size && !list.hasClass(o.mselectItemsWrapperOverflowClass)) {
|
||||
list.height(list.children('.' + o.mselectListItemClass)
|
||||
.first()
|
||||
.outerHeight(true) * size)
|
||||
.addClass(o.mselectItemsWrapperOverflowClass);
|
||||
}
|
||||
};
|
||||
reset();
|
||||
}).end();
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,68 @@
|
||||
@charset "UTF-8";
|
||||
/*
|
||||
* jQuery File Upload UI Plugin CSS
|
||||
* https://github.com/blueimp/jQuery-File-Upload
|
||||
*
|
||||
* Copyright 2010, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
.progress-animated .progress-bar,
|
||||
.progress-animated .bar {
|
||||
background: url('../img/progressbar.gif') !important;
|
||||
filter: none;
|
||||
}
|
||||
.fileupload-process {
|
||||
float: right;
|
||||
display: none;
|
||||
}
|
||||
.fileupload-processing .fileupload-process,
|
||||
.files .processing .preview {
|
||||
display: block;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
background: url('../img/loading.gif') center no-repeat;
|
||||
background-size: contain;
|
||||
}
|
||||
.files audio,
|
||||
.files video {
|
||||
max-width: 300px;
|
||||
}
|
||||
.files .name {
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: anywhere;
|
||||
-webkit-hyphens: auto;
|
||||
hyphens: auto;
|
||||
}
|
||||
.files button {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.toggle[type='checkbox'] {
|
||||
transform: scale(2);
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.fileupload-buttonbar .btn {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.fileupload-buttonbar .delete,
|
||||
.fileupload-buttonbar .toggle,
|
||||
.files .toggle,
|
||||
.files .btn span {
|
||||
display: none;
|
||||
}
|
||||
.files audio,
|
||||
.files video {
|
||||
max-width: 80px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.files .image td:nth-child(2) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'js-cookie/cookie-wrapper'
|
||||
], function () {
|
||||
|
||||
});
|
||||
@@ -0,0 +1,164 @@
|
||||
/*
|
||||
* Metadata - jQuery plugin for parsing metadata from elements
|
||||
*
|
||||
* Copyright (c) 2006 John Resig, Yehuda Katz, J�örn Zaefferer, Paul McLanahan
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* Revision: $Id: jquery.metadata.js 3640 2007-10-11 18:34:38Z pmclanahan $
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Sets the type of metadata to use. Metadata is encoded in JSON, and each property
|
||||
* in the JSON will become a property of the element itself.
|
||||
*
|
||||
* There are four supported types of metadata storage:
|
||||
*
|
||||
* attr: Inside an attribute. The name parameter indicates *which* attribute.
|
||||
*
|
||||
* class: Inside the class attribute, wrapped in curly braces: { }
|
||||
*
|
||||
* elem: Inside a child element (e.g. a script tag). The
|
||||
* name parameter indicates *which* element.
|
||||
* html5: Values are stored in data-* attributes.
|
||||
*
|
||||
* The metadata for an element is loaded the first time the element is accessed via jQuery.
|
||||
*
|
||||
* As a result, you can define the metadata type, use $(expr) to load the metadata into the elements
|
||||
* matched by expr, then redefine the metadata type and run another $(expr) for other elements.
|
||||
*
|
||||
* @name $.metadata.setType
|
||||
*
|
||||
* @example <p id="one" class="some_class {item_id: 1, item_label: 'Label'}">This is a p</p>
|
||||
* @before $.metadata.setType("class")
|
||||
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
|
||||
* @desc Reads metadata from the class attribute
|
||||
*
|
||||
* @example <p id="one" class="some_class" data="{item_id: 1, item_label: 'Label'}">This is a p</p>
|
||||
* @before $.metadata.setType("attr", "data")
|
||||
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
|
||||
* @desc Reads metadata from a "data" attribute
|
||||
*
|
||||
* @example <p id="one" class="some_class"><script>{item_id: 1, item_label: 'Label'}</script>This is a p</p>
|
||||
* @before $.metadata.setType("elem", "script")
|
||||
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
|
||||
* @desc Reads metadata from a nested script element
|
||||
*
|
||||
* @example <p id="one" class="some_class" data-item_id="1" data-item_label="Label">This is a p</p>
|
||||
* @before $.metadata.setType("html5")
|
||||
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
|
||||
* @desc Reads metadata from a series of data-* attributes
|
||||
*
|
||||
* @param String type The encoding type
|
||||
* @param String name The name of the attribute to be used to get metadata (optional)
|
||||
* @cat Plugins/Metadata
|
||||
* @descr Sets the type of encoding to be used when loading metadata for the first time
|
||||
* @type undefined
|
||||
* @see metadata()
|
||||
*/
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(["jquery"], factory);
|
||||
} else {
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
|
||||
|
||||
$.extend({
|
||||
metadata : {
|
||||
defaults : {
|
||||
type: 'class',
|
||||
name: 'metadata',
|
||||
cre: /({.*})/,
|
||||
single: 'metadata',
|
||||
meta:'validate'
|
||||
},
|
||||
setType: function( type, name ){
|
||||
this.defaults.type = type;
|
||||
this.defaults.name = name;
|
||||
},
|
||||
get: function( elem, opts ){
|
||||
var settings = $.extend({},this.defaults,opts);
|
||||
// check for empty string in single property
|
||||
if (!settings.single.length) {
|
||||
settings.single = 'metadata';
|
||||
}
|
||||
if (!settings.meta.length) {
|
||||
settings.meta = 'validate';
|
||||
}
|
||||
|
||||
var data = $.data(elem, settings.single);
|
||||
// returned cached data if it already exists
|
||||
if ( data ) return data;
|
||||
|
||||
data = "{}";
|
||||
|
||||
var getData = function(data) {
|
||||
if(typeof data != "string") return data;
|
||||
|
||||
if( data.indexOf('{') < 0 ) {
|
||||
data = eval("(" + data + ")");
|
||||
}
|
||||
}
|
||||
|
||||
var getObject = function(data) {
|
||||
if(typeof data != "string") return data;
|
||||
|
||||
data = eval("(" + data + ")");
|
||||
return data;
|
||||
}
|
||||
|
||||
if ( settings.type == "html5" ) {
|
||||
var object = {};
|
||||
$( elem.attributes ).each(function() {
|
||||
var name = this.nodeName;
|
||||
if (name.indexOf('data-' + settings.meta) === 0) {
|
||||
name = name.replace(/^data-/, '');
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
object[name] = getObject(this.value);
|
||||
});
|
||||
} else {
|
||||
if ( settings.type == "class" ) {
|
||||
var m = settings.cre.exec( elem.className );
|
||||
if ( m )
|
||||
data = m[1];
|
||||
} else if ( settings.type == "elem" ) {
|
||||
if( !elem.getElementsByTagName ) return;
|
||||
var e = elem.getElementsByTagName(settings.name);
|
||||
if ( e.length )
|
||||
data = $.trim(e[0].innerHTML);
|
||||
} else if ( elem.getAttribute != undefined ) {
|
||||
var attr = elem.getAttribute( settings.name );
|
||||
if ( attr )
|
||||
data = attr;
|
||||
}
|
||||
object = getObject(data.indexOf("{") < 0 ? "{" + data + "}" : data);
|
||||
}
|
||||
|
||||
$.data( elem, settings.single, object );
|
||||
return object;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns the metadata object for the first member of the jQuery object.
|
||||
*
|
||||
* @name metadata
|
||||
* @descr Returns element's metadata object
|
||||
* @param Object opts An object contianing settings to override the defaults
|
||||
* @type jQuery
|
||||
* @cat Plugins/Metadata
|
||||
*/
|
||||
$.fn.metadata = function( opts ){
|
||||
return $.metadata.get( this[0], opts );
|
||||
};
|
||||
|
||||
}));
|
||||
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* Copyright (c) 2010 Conrad Irwin <conrad@rapportive.com> MIT license.
|
||||
* Based loosely on original: Copyright (c) 2008 mkmanning MIT license.
|
||||
*
|
||||
* Parses CGI query strings into javascript objects.
|
||||
*
|
||||
* See the README for details.
|
||||
**/
|
||||
define([
|
||||
"jquery"
|
||||
], function($){
|
||||
$.parseQuery = function (options) {
|
||||
|
||||
var config = {query: window.location.search || ""},
|
||||
params = {};
|
||||
|
||||
if (typeof options === 'string') {
|
||||
options = {query: options};
|
||||
}
|
||||
$.extend(config, $.parseQuery, options);
|
||||
config.query = config.query.replace(/^\?/, '');
|
||||
|
||||
if (config.query.length > 0) {
|
||||
$.each(config.query.split(config.separator), function (i, param) {
|
||||
var pair = param.split('='),
|
||||
key = config.decode(pair.shift(), null).toString(),
|
||||
value = config.decode(pair.length ? pair.join('=') : null, key);
|
||||
|
||||
if (config.array_keys.test ? config.array_keys.test(key) : config.array_keys(key)) {
|
||||
params[key] = params[key] || [];
|
||||
params[key].push(value);
|
||||
} else {
|
||||
params[key] = value;
|
||||
}
|
||||
});
|
||||
}
|
||||
return params;
|
||||
};
|
||||
$.parseQuery.decode = $.parseQuery.default_decode = function (string) {
|
||||
return decodeURIComponent((string || "").replace(/\+/g, ' '));
|
||||
};
|
||||
$.parseQuery.array_keys = function () {
|
||||
return false;
|
||||
};
|
||||
$.parseQuery.separator = "&";
|
||||
});
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
define([
|
||||
"jquery",
|
||||
"jquery/bootstrap/tab",
|
||||
"jquery/bootstrap/collapse",
|
||||
], function () {
|
||||
|
||||
});
|
||||
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,23 @@
|
||||
// This file is deprecated in 1.12.0 to be removed in 1.14
|
||||
( function() {
|
||||
"use strict";
|
||||
|
||||
define( [
|
||||
"jquery",
|
||||
"./data",
|
||||
"./disable-selection",
|
||||
"./focusable",
|
||||
"./form",
|
||||
"./ie",
|
||||
"./keycode",
|
||||
"./labels",
|
||||
"./jquery-patch",
|
||||
"./plugin",
|
||||
"./safe-active-element",
|
||||
"./safe-blur",
|
||||
"./scroll-parent",
|
||||
"./tabbable",
|
||||
"./unique-id",
|
||||
"./version"
|
||||
] );
|
||||
} )();
|
||||
@@ -0,0 +1,43 @@
|
||||
/*!
|
||||
* jQuery UI :data 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
|
||||
//>>label: :data Selector
|
||||
//>>group: Core
|
||||
//>>description: Selects elements which have data stored under the specified key.
|
||||
//>>docs: http://api.jqueryui.com/data-selector/
|
||||
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "jquery", "./version" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery );
|
||||
}
|
||||
} )( function( $ ) {
|
||||
"use strict";
|
||||
|
||||
return $.extend( $.expr.pseudos, {
|
||||
data: $.expr.createPseudo ?
|
||||
$.expr.createPseudo( function( dataName ) {
|
||||
return function( elem ) {
|
||||
return !!$.data( elem, dataName );
|
||||
};
|
||||
} ) :
|
||||
|
||||
// Support: jQuery <1.8
|
||||
function( elem, i, match ) {
|
||||
return !!$.data( elem, match[ 3 ] );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
@@ -0,0 +1,49 @@
|
||||
/*!
|
||||
* jQuery UI Disable Selection 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
|
||||
//>>label: disableSelection
|
||||
//>>group: Core
|
||||
//>>description: Disable selection of text content within the set of matched elements.
|
||||
//>>docs: http://api.jqueryui.com/disableSelection/
|
||||
|
||||
// This file is deprecated
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "jquery", "./version" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery );
|
||||
}
|
||||
} )( function( $ ) {
|
||||
"use strict";
|
||||
|
||||
return $.fn.extend( {
|
||||
disableSelection: ( function() {
|
||||
var eventType = "onselectstart" in document.createElement( "div" ) ?
|
||||
"selectstart" :
|
||||
"mousedown";
|
||||
|
||||
return function() {
|
||||
return this.on( eventType + ".ui-disableSelection", function( event ) {
|
||||
event.preventDefault();
|
||||
} );
|
||||
};
|
||||
} )(),
|
||||
|
||||
enableSelection: function() {
|
||||
return this.off( ".ui-disableSelection" );
|
||||
}
|
||||
} );
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,971 @@
|
||||
/*!
|
||||
* jQuery UI Effects 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
|
||||
//>>label: Effects Core
|
||||
//>>group: Effects
|
||||
/* eslint-disable max-len */
|
||||
//>>description: Extends the internal jQuery effects. Includes morphing and easing. Required by all other effects.
|
||||
/* eslint-enable max-len */
|
||||
//>>docs: http://api.jqueryui.com/category/effects-core/
|
||||
//>>demos: http://jqueryui.com/effect/
|
||||
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [
|
||||
"jquery",
|
||||
"./jquery-var-for-color",
|
||||
"./vendor/jquery-color/jquery.color",
|
||||
"./version"
|
||||
], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery );
|
||||
}
|
||||
} )( function( $ ) {
|
||||
"use strict";
|
||||
|
||||
var dataSpace = "ui-effects-",
|
||||
dataSpaceStyle = "ui-effects-style",
|
||||
dataSpaceAnimated = "ui-effects-animated";
|
||||
|
||||
$.effects = {
|
||||
effect: {}
|
||||
};
|
||||
|
||||
/******************************************************************************/
|
||||
/****************************** CLASS ANIMATIONS ******************************/
|
||||
/******************************************************************************/
|
||||
( function() {
|
||||
|
||||
var classAnimationActions = [ "add", "remove", "toggle" ],
|
||||
shorthandStyles = {
|
||||
border: 1,
|
||||
borderBottom: 1,
|
||||
borderColor: 1,
|
||||
borderLeft: 1,
|
||||
borderRight: 1,
|
||||
borderTop: 1,
|
||||
borderWidth: 1,
|
||||
margin: 1,
|
||||
padding: 1
|
||||
};
|
||||
|
||||
$.each(
|
||||
[ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ],
|
||||
function( _, prop ) {
|
||||
$.fx.step[ prop ] = function( fx ) {
|
||||
if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
|
||||
jQuery.style( fx.elem, prop, fx.end );
|
||||
fx.setAttr = true;
|
||||
}
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
function camelCase( string ) {
|
||||
return string.replace( /-([\da-z])/gi, function( all, letter ) {
|
||||
return letter.toUpperCase();
|
||||
} );
|
||||
}
|
||||
|
||||
function getElementStyles( elem ) {
|
||||
var key, len,
|
||||
style = elem.ownerDocument.defaultView ?
|
||||
elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
|
||||
elem.currentStyle,
|
||||
styles = {};
|
||||
|
||||
if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
|
||||
len = style.length;
|
||||
while ( len-- ) {
|
||||
key = style[ len ];
|
||||
if ( typeof style[ key ] === "string" ) {
|
||||
styles[ camelCase( key ) ] = style[ key ];
|
||||
}
|
||||
}
|
||||
|
||||
// Support: Opera, IE <9
|
||||
} else {
|
||||
for ( key in style ) {
|
||||
if ( typeof style[ key ] === "string" ) {
|
||||
styles[ key ] = style[ key ];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return styles;
|
||||
}
|
||||
|
||||
function styleDifference( oldStyle, newStyle ) {
|
||||
var diff = {},
|
||||
name, value;
|
||||
|
||||
for ( name in newStyle ) {
|
||||
value = newStyle[ name ];
|
||||
if ( oldStyle[ name ] !== value ) {
|
||||
if ( !shorthandStyles[ name ] ) {
|
||||
if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
|
||||
diff[ name ] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return diff;
|
||||
}
|
||||
|
||||
// Support: jQuery <1.8
|
||||
if ( !$.fn.addBack ) {
|
||||
$.fn.addBack = function( selector ) {
|
||||
return this.add( selector == null ?
|
||||
this.prevObject : this.prevObject.filter( selector )
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
$.effects.animateClass = function( value, duration, easing, callback ) {
|
||||
var o = $.speed( duration, easing, callback );
|
||||
|
||||
return this.queue( function() {
|
||||
var animated = $( this ),
|
||||
baseClass = animated.attr( "class" ) || "",
|
||||
applyClassChange,
|
||||
allAnimations = o.children ? animated.find( "*" ).addBack() : animated;
|
||||
|
||||
// Map the animated objects to store the original styles.
|
||||
allAnimations = allAnimations.map( function() {
|
||||
var el = $( this );
|
||||
return {
|
||||
el: el,
|
||||
start: getElementStyles( this )
|
||||
};
|
||||
} );
|
||||
|
||||
// Apply class change
|
||||
applyClassChange = function() {
|
||||
$.each( classAnimationActions, function( i, action ) {
|
||||
if ( value[ action ] ) {
|
||||
animated[ action + "Class" ]( value[ action ] );
|
||||
}
|
||||
} );
|
||||
};
|
||||
applyClassChange();
|
||||
|
||||
// Map all animated objects again - calculate new styles and diff
|
||||
allAnimations = allAnimations.map( function() {
|
||||
this.end = getElementStyles( this.el[ 0 ] );
|
||||
this.diff = styleDifference( this.start, this.end );
|
||||
return this;
|
||||
} );
|
||||
|
||||
// Apply original class
|
||||
animated.attr( "class", baseClass );
|
||||
|
||||
// Map all animated objects again - this time collecting a promise
|
||||
allAnimations = allAnimations.map( function() {
|
||||
var styleInfo = this,
|
||||
dfd = $.Deferred(),
|
||||
opts = $.extend( {}, o, {
|
||||
queue: false,
|
||||
complete: function() {
|
||||
dfd.resolve( styleInfo );
|
||||
}
|
||||
} );
|
||||
|
||||
this.el.animate( this.diff, opts );
|
||||
return dfd.promise();
|
||||
} );
|
||||
|
||||
// Once all animations have completed:
|
||||
$.when.apply( $, allAnimations.get() ).done( function() {
|
||||
|
||||
// Set the final class
|
||||
applyClassChange();
|
||||
|
||||
// For each animated element,
|
||||
// clear all css properties that were animated
|
||||
$.each( arguments, function() {
|
||||
var el = this.el;
|
||||
$.each( this.diff, function( key ) {
|
||||
el.css( key, "" );
|
||||
} );
|
||||
} );
|
||||
|
||||
// This is guarnteed to be there if you use jQuery.speed()
|
||||
// it also handles dequeuing the next anim...
|
||||
o.complete.call( animated[ 0 ] );
|
||||
} );
|
||||
} );
|
||||
};
|
||||
|
||||
$.fn.extend( {
|
||||
addClass: ( function( orig ) {
|
||||
return function( classNames, speed, easing, callback ) {
|
||||
return speed ?
|
||||
$.effects.animateClass.call( this,
|
||||
{ add: classNames }, speed, easing, callback ) :
|
||||
orig.apply( this, arguments );
|
||||
};
|
||||
} )( $.fn.addClass ),
|
||||
|
||||
removeClass: ( function( orig ) {
|
||||
return function( classNames, speed, easing, callback ) {
|
||||
return arguments.length > 1 ?
|
||||
$.effects.animateClass.call( this,
|
||||
{ remove: classNames }, speed, easing, callback ) :
|
||||
orig.apply( this, arguments );
|
||||
};
|
||||
} )( $.fn.removeClass ),
|
||||
|
||||
toggleClass: ( function( orig ) {
|
||||
return function( classNames, force, speed, easing, callback ) {
|
||||
if ( typeof force === "boolean" || force === undefined ) {
|
||||
if ( !speed ) {
|
||||
|
||||
// Without speed parameter
|
||||
return orig.apply( this, arguments );
|
||||
} else {
|
||||
return $.effects.animateClass.call( this,
|
||||
( force ? { add: classNames } : { remove: classNames } ),
|
||||
speed, easing, callback );
|
||||
}
|
||||
} else {
|
||||
|
||||
// Without force parameter
|
||||
return $.effects.animateClass.call( this,
|
||||
{ toggle: classNames }, force, speed, easing );
|
||||
}
|
||||
};
|
||||
} )( $.fn.toggleClass ),
|
||||
|
||||
switchClass: function( remove, add, speed, easing, callback ) {
|
||||
return $.effects.animateClass.call( this, {
|
||||
add: add,
|
||||
remove: remove
|
||||
}, speed, easing, callback );
|
||||
}
|
||||
} );
|
||||
|
||||
} )();
|
||||
|
||||
/******************************************************************************/
|
||||
/*********************************** EFFECTS **********************************/
|
||||
/******************************************************************************/
|
||||
|
||||
( function() {
|
||||
|
||||
if ( $.expr && $.expr.pseudos && $.expr.pseudos.animated ) {
|
||||
$.expr.pseudos.animated = ( function( orig ) {
|
||||
return function( elem ) {
|
||||
return !!$( elem ).data( dataSpaceAnimated ) || orig( elem );
|
||||
};
|
||||
} )( $.expr.pseudos.animated );
|
||||
}
|
||||
|
||||
if ( $.uiBackCompat !== false ) {
|
||||
$.extend( $.effects, {
|
||||
|
||||
// Saves a set of properties in a data storage
|
||||
save: function( element, set ) {
|
||||
var i = 0, length = set.length;
|
||||
for ( ; i < length; i++ ) {
|
||||
if ( set[ i ] !== null ) {
|
||||
element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Restores a set of previously saved properties from a data storage
|
||||
restore: function( element, set ) {
|
||||
var val, i = 0, length = set.length;
|
||||
for ( ; i < length; i++ ) {
|
||||
if ( set[ i ] !== null ) {
|
||||
val = element.data( dataSpace + set[ i ] );
|
||||
element.css( set[ i ], val );
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
setMode: function( el, mode ) {
|
||||
if ( mode === "toggle" ) {
|
||||
mode = el.is( ":hidden" ) ? "show" : "hide";
|
||||
}
|
||||
return mode;
|
||||
},
|
||||
|
||||
// Wraps the element around a wrapper that copies position properties
|
||||
createWrapper: function( element ) {
|
||||
|
||||
// If the element is already wrapped, return it
|
||||
if ( element.parent().is( ".ui-effects-wrapper" ) ) {
|
||||
return element.parent();
|
||||
}
|
||||
|
||||
// Wrap the element
|
||||
var props = {
|
||||
width: element.outerWidth( true ),
|
||||
height: element.outerHeight( true ),
|
||||
"float": element.css( "float" )
|
||||
},
|
||||
wrapper = $( "<div></div>" )
|
||||
.addClass( "ui-effects-wrapper" )
|
||||
.css( {
|
||||
fontSize: "100%",
|
||||
background: "transparent",
|
||||
border: "none",
|
||||
margin: 0,
|
||||
padding: 0
|
||||
} ),
|
||||
|
||||
// Store the size in case width/height are defined in % - Fixes #5245
|
||||
size = {
|
||||
width: element.width(),
|
||||
height: element.height()
|
||||
},
|
||||
active = document.activeElement;
|
||||
|
||||
// Support: Firefox
|
||||
// Firefox incorrectly exposes anonymous content
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=561664
|
||||
try {
|
||||
// eslint-disable-next-line no-unused-expressions
|
||||
active.id;
|
||||
} catch ( e ) {
|
||||
active = document.body;
|
||||
}
|
||||
|
||||
element.wrap( wrapper );
|
||||
|
||||
// Fixes #7595 - Elements lose focus when wrapped.
|
||||
if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
|
||||
$( active ).trigger( "focus" );
|
||||
}
|
||||
|
||||
// Hotfix for jQuery 1.4 since some change in wrap() seems to actually
|
||||
// lose the reference to the wrapped element
|
||||
wrapper = element.parent();
|
||||
|
||||
// Transfer positioning properties to the wrapper
|
||||
if ( element.css( "position" ) === "static" ) {
|
||||
wrapper.css( { position: "relative" } );
|
||||
element.css( { position: "relative" } );
|
||||
} else {
|
||||
$.extend( props, {
|
||||
position: element.css( "position" ),
|
||||
zIndex: element.css( "z-index" )
|
||||
} );
|
||||
$.each( [ "top", "left", "bottom", "right" ], function( i, pos ) {
|
||||
props[ pos ] = element.css( pos );
|
||||
if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
|
||||
props[ pos ] = "auto";
|
||||
}
|
||||
} );
|
||||
element.css( {
|
||||
position: "relative",
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: "auto",
|
||||
bottom: "auto"
|
||||
} );
|
||||
}
|
||||
element.css( size );
|
||||
|
||||
return wrapper.css( props ).show();
|
||||
},
|
||||
|
||||
removeWrapper: function( element ) {
|
||||
var active = document.activeElement;
|
||||
|
||||
if ( element.parent().is( ".ui-effects-wrapper" ) ) {
|
||||
element.parent().replaceWith( element );
|
||||
|
||||
// Fixes #7595 - Elements lose focus when wrapped.
|
||||
if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
|
||||
$( active ).trigger( "focus" );
|
||||
}
|
||||
}
|
||||
|
||||
return element;
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
$.extend( $.effects, {
|
||||
version: "1.13.2",
|
||||
|
||||
define: function( name, mode, effect ) {
|
||||
if ( !effect ) {
|
||||
effect = mode;
|
||||
mode = "effect";
|
||||
}
|
||||
|
||||
$.effects.effect[ name ] = effect;
|
||||
$.effects.effect[ name ].mode = mode;
|
||||
|
||||
return effect;
|
||||
},
|
||||
|
||||
scaledDimensions: function( element, percent, direction ) {
|
||||
if ( percent === 0 ) {
|
||||
return {
|
||||
height: 0,
|
||||
width: 0,
|
||||
outerHeight: 0,
|
||||
outerWidth: 0
|
||||
};
|
||||
}
|
||||
|
||||
var x = direction !== "horizontal" ? ( ( percent || 100 ) / 100 ) : 1,
|
||||
y = direction !== "vertical" ? ( ( percent || 100 ) / 100 ) : 1;
|
||||
|
||||
return {
|
||||
height: element.height() * y,
|
||||
width: element.width() * x,
|
||||
outerHeight: element.outerHeight() * y,
|
||||
outerWidth: element.outerWidth() * x
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
clipToBox: function( animation ) {
|
||||
return {
|
||||
width: animation.clip.right - animation.clip.left,
|
||||
height: animation.clip.bottom - animation.clip.top,
|
||||
left: animation.clip.left,
|
||||
top: animation.clip.top
|
||||
};
|
||||
},
|
||||
|
||||
// Injects recently queued functions to be first in line (after "inprogress")
|
||||
unshift: function( element, queueLength, count ) {
|
||||
var queue = element.queue();
|
||||
|
||||
if ( queueLength > 1 ) {
|
||||
queue.splice.apply( queue,
|
||||
[ 1, 0 ].concat( queue.splice( queueLength, count ) ) );
|
||||
}
|
||||
element.dequeue();
|
||||
},
|
||||
|
||||
saveStyle: function( element ) {
|
||||
element.data( dataSpaceStyle, element[ 0 ].style.cssText );
|
||||
},
|
||||
|
||||
restoreStyle: function( element ) {
|
||||
element[ 0 ].style.cssText = element.data( dataSpaceStyle ) || "";
|
||||
element.removeData( dataSpaceStyle );
|
||||
},
|
||||
|
||||
mode: function( element, mode ) {
|
||||
var hidden = element.is( ":hidden" );
|
||||
|
||||
if ( mode === "toggle" ) {
|
||||
mode = hidden ? "show" : "hide";
|
||||
}
|
||||
if ( hidden ? mode === "hide" : mode === "show" ) {
|
||||
mode = "none";
|
||||
}
|
||||
return mode;
|
||||
},
|
||||
|
||||
// Translates a [top,left] array into a baseline value
|
||||
getBaseline: function( origin, original ) {
|
||||
var y, x;
|
||||
|
||||
switch ( origin[ 0 ] ) {
|
||||
case "top":
|
||||
y = 0;
|
||||
break;
|
||||
case "middle":
|
||||
y = 0.5;
|
||||
break;
|
||||
case "bottom":
|
||||
y = 1;
|
||||
break;
|
||||
default:
|
||||
y = origin[ 0 ] / original.height;
|
||||
}
|
||||
|
||||
switch ( origin[ 1 ] ) {
|
||||
case "left":
|
||||
x = 0;
|
||||
break;
|
||||
case "center":
|
||||
x = 0.5;
|
||||
break;
|
||||
case "right":
|
||||
x = 1;
|
||||
break;
|
||||
default:
|
||||
x = origin[ 1 ] / original.width;
|
||||
}
|
||||
|
||||
return {
|
||||
x: x,
|
||||
y: y
|
||||
};
|
||||
},
|
||||
|
||||
// Creates a placeholder element so that the original element can be made absolute
|
||||
createPlaceholder: function( element ) {
|
||||
var placeholder,
|
||||
cssPosition = element.css( "position" ),
|
||||
position = element.position();
|
||||
|
||||
// Lock in margins first to account for form elements, which
|
||||
// will change margin if you explicitly set height
|
||||
// see: http://jsfiddle.net/JZSMt/3/ https://bugs.webkit.org/show_bug.cgi?id=107380
|
||||
// Support: Safari
|
||||
element.css( {
|
||||
marginTop: element.css( "marginTop" ),
|
||||
marginBottom: element.css( "marginBottom" ),
|
||||
marginLeft: element.css( "marginLeft" ),
|
||||
marginRight: element.css( "marginRight" )
|
||||
} )
|
||||
.outerWidth( element.outerWidth() )
|
||||
.outerHeight( element.outerHeight() );
|
||||
|
||||
if ( /^(static|relative)/.test( cssPosition ) ) {
|
||||
cssPosition = "absolute";
|
||||
|
||||
placeholder = $( "<" + element[ 0 ].nodeName + ">" ).insertAfter( element ).css( {
|
||||
|
||||
// Convert inline to inline block to account for inline elements
|
||||
// that turn to inline block based on content (like img)
|
||||
display: /^(inline|ruby)/.test( element.css( "display" ) ) ?
|
||||
"inline-block" :
|
||||
"block",
|
||||
visibility: "hidden",
|
||||
|
||||
// Margins need to be set to account for margin collapse
|
||||
marginTop: element.css( "marginTop" ),
|
||||
marginBottom: element.css( "marginBottom" ),
|
||||
marginLeft: element.css( "marginLeft" ),
|
||||
marginRight: element.css( "marginRight" ),
|
||||
"float": element.css( "float" )
|
||||
} )
|
||||
.outerWidth( element.outerWidth() )
|
||||
.outerHeight( element.outerHeight() )
|
||||
.addClass( "ui-effects-placeholder" );
|
||||
|
||||
element.data( dataSpace + "placeholder", placeholder );
|
||||
}
|
||||
|
||||
element.css( {
|
||||
position: cssPosition,
|
||||
left: position.left,
|
||||
top: position.top
|
||||
} );
|
||||
|
||||
return placeholder;
|
||||
},
|
||||
|
||||
removePlaceholder: function( element ) {
|
||||
var dataKey = dataSpace + "placeholder",
|
||||
placeholder = element.data( dataKey );
|
||||
|
||||
if ( placeholder ) {
|
||||
placeholder.remove();
|
||||
element.removeData( dataKey );
|
||||
}
|
||||
},
|
||||
|
||||
// Removes a placeholder if it exists and restores
|
||||
// properties that were modified during placeholder creation
|
||||
cleanUp: function( element ) {
|
||||
$.effects.restoreStyle( element );
|
||||
$.effects.removePlaceholder( element );
|
||||
},
|
||||
|
||||
setTransition: function( element, list, factor, value ) {
|
||||
value = value || {};
|
||||
$.each( list, function( i, x ) {
|
||||
var unit = element.cssUnit( x );
|
||||
if ( unit[ 0 ] > 0 ) {
|
||||
value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
|
||||
}
|
||||
} );
|
||||
return value;
|
||||
}
|
||||
} );
|
||||
|
||||
// Return an effect options object for the given parameters:
|
||||
function _normalizeArguments( effect, options, speed, callback ) {
|
||||
|
||||
// Allow passing all options as the first parameter
|
||||
if ( $.isPlainObject( effect ) ) {
|
||||
options = effect;
|
||||
effect = effect.effect;
|
||||
}
|
||||
|
||||
// Convert to an object
|
||||
effect = { effect: effect };
|
||||
|
||||
// Catch (effect, null, ...)
|
||||
if ( options == null ) {
|
||||
options = {};
|
||||
}
|
||||
|
||||
// Catch (effect, callback)
|
||||
if ( typeof options === "function" ) {
|
||||
callback = options;
|
||||
speed = null;
|
||||
options = {};
|
||||
}
|
||||
|
||||
// Catch (effect, speed, ?)
|
||||
if ( typeof options === "number" || $.fx.speeds[ options ] ) {
|
||||
callback = speed;
|
||||
speed = options;
|
||||
options = {};
|
||||
}
|
||||
|
||||
// Catch (effect, options, callback)
|
||||
if ( typeof speed === "function" ) {
|
||||
callback = speed;
|
||||
speed = null;
|
||||
}
|
||||
|
||||
// Add options to effect
|
||||
if ( options ) {
|
||||
$.extend( effect, options );
|
||||
}
|
||||
|
||||
speed = speed || options.duration;
|
||||
effect.duration = $.fx.off ? 0 :
|
||||
typeof speed === "number" ? speed :
|
||||
speed in $.fx.speeds ? $.fx.speeds[ speed ] :
|
||||
$.fx.speeds._default;
|
||||
|
||||
effect.complete = callback || options.complete;
|
||||
|
||||
return effect;
|
||||
}
|
||||
|
||||
function standardAnimationOption( option ) {
|
||||
|
||||
// Valid standard speeds (nothing, number, named speed)
|
||||
if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Invalid strings - treat as "normal" speed
|
||||
if ( typeof option === "string" && !$.effects.effect[ option ] ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Complete callback
|
||||
if ( typeof option === "function" ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Options hash (but not naming an effect)
|
||||
if ( typeof option === "object" && !option.effect ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Didn't match any standard API
|
||||
return false;
|
||||
}
|
||||
|
||||
$.fn.extend( {
|
||||
effect: function( /* effect, options, speed, callback */ ) {
|
||||
var args = _normalizeArguments.apply( this, arguments ),
|
||||
effectMethod = $.effects.effect[ args.effect ],
|
||||
defaultMode = effectMethod.mode,
|
||||
queue = args.queue,
|
||||
queueName = queue || "fx",
|
||||
complete = args.complete,
|
||||
mode = args.mode,
|
||||
modes = [],
|
||||
prefilter = function( next ) {
|
||||
var el = $( this ),
|
||||
normalizedMode = $.effects.mode( el, mode ) || defaultMode;
|
||||
|
||||
// Sentinel for duck-punching the :animated pseudo-selector
|
||||
el.data( dataSpaceAnimated, true );
|
||||
|
||||
// Save effect mode for later use,
|
||||
// we can't just call $.effects.mode again later,
|
||||
// as the .show() below destroys the initial state
|
||||
modes.push( normalizedMode );
|
||||
|
||||
// See $.uiBackCompat inside of run() for removal of defaultMode in 1.14
|
||||
if ( defaultMode && ( normalizedMode === "show" ||
|
||||
( normalizedMode === defaultMode && normalizedMode === "hide" ) ) ) {
|
||||
el.show();
|
||||
}
|
||||
|
||||
if ( !defaultMode || normalizedMode !== "none" ) {
|
||||
$.effects.saveStyle( el );
|
||||
}
|
||||
|
||||
if ( typeof next === "function" ) {
|
||||
next();
|
||||
}
|
||||
};
|
||||
|
||||
if ( $.fx.off || !effectMethod ) {
|
||||
|
||||
// Delegate to the original method (e.g., .show()) if possible
|
||||
if ( mode ) {
|
||||
return this[ mode ]( args.duration, complete );
|
||||
} else {
|
||||
return this.each( function() {
|
||||
if ( complete ) {
|
||||
complete.call( this );
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
function run( next ) {
|
||||
var elem = $( this );
|
||||
|
||||
function cleanup() {
|
||||
elem.removeData( dataSpaceAnimated );
|
||||
|
||||
$.effects.cleanUp( elem );
|
||||
|
||||
if ( args.mode === "hide" ) {
|
||||
elem.hide();
|
||||
}
|
||||
|
||||
done();
|
||||
}
|
||||
|
||||
function done() {
|
||||
if ( typeof complete === "function" ) {
|
||||
complete.call( elem[ 0 ] );
|
||||
}
|
||||
|
||||
if ( typeof next === "function" ) {
|
||||
next();
|
||||
}
|
||||
}
|
||||
|
||||
// Override mode option on a per element basis,
|
||||
// as toggle can be either show or hide depending on element state
|
||||
args.mode = modes.shift();
|
||||
|
||||
if ( $.uiBackCompat !== false && !defaultMode ) {
|
||||
if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
|
||||
|
||||
// Call the core method to track "olddisplay" properly
|
||||
elem[ mode ]();
|
||||
done();
|
||||
} else {
|
||||
effectMethod.call( elem[ 0 ], args, done );
|
||||
}
|
||||
} else {
|
||||
if ( args.mode === "none" ) {
|
||||
|
||||
// Call the core method to track "olddisplay" properly
|
||||
elem[ mode ]();
|
||||
done();
|
||||
} else {
|
||||
effectMethod.call( elem[ 0 ], args, cleanup );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Run prefilter on all elements first to ensure that
|
||||
// any showing or hiding happens before placeholder creation,
|
||||
// which ensures that any layout changes are correctly captured.
|
||||
return queue === false ?
|
||||
this.each( prefilter ).each( run ) :
|
||||
this.queue( queueName, prefilter ).queue( queueName, run );
|
||||
},
|
||||
|
||||
show: ( function( orig ) {
|
||||
return function( option ) {
|
||||
if ( standardAnimationOption( option ) ) {
|
||||
return orig.apply( this, arguments );
|
||||
} else {
|
||||
var args = _normalizeArguments.apply( this, arguments );
|
||||
args.mode = "show";
|
||||
return this.effect.call( this, args );
|
||||
}
|
||||
};
|
||||
} )( $.fn.show ),
|
||||
|
||||
hide: ( function( orig ) {
|
||||
return function( option ) {
|
||||
if ( standardAnimationOption( option ) ) {
|
||||
return orig.apply( this, arguments );
|
||||
} else {
|
||||
var args = _normalizeArguments.apply( this, arguments );
|
||||
args.mode = "hide";
|
||||
return this.effect.call( this, args );
|
||||
}
|
||||
};
|
||||
} )( $.fn.hide ),
|
||||
|
||||
toggle: ( function( orig ) {
|
||||
return function( option ) {
|
||||
if ( standardAnimationOption( option ) || typeof option === "boolean" ) {
|
||||
return orig.apply( this, arguments );
|
||||
} else {
|
||||
var args = _normalizeArguments.apply( this, arguments );
|
||||
args.mode = "toggle";
|
||||
return this.effect.call( this, args );
|
||||
}
|
||||
};
|
||||
} )( $.fn.toggle ),
|
||||
|
||||
cssUnit: function( key ) {
|
||||
var style = this.css( key ),
|
||||
val = [];
|
||||
|
||||
$.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
|
||||
if ( style.indexOf( unit ) > 0 ) {
|
||||
val = [ parseFloat( style ), unit ];
|
||||
}
|
||||
} );
|
||||
return val;
|
||||
},
|
||||
|
||||
cssClip: function( clipObj ) {
|
||||
if ( clipObj ) {
|
||||
return this.css( "clip", "rect(" + clipObj.top + "px " + clipObj.right + "px " +
|
||||
clipObj.bottom + "px " + clipObj.left + "px)" );
|
||||
}
|
||||
return parseClip( this.css( "clip" ), this );
|
||||
},
|
||||
|
||||
transfer: function( options, done ) {
|
||||
var element = $( this ),
|
||||
target = $( options.to ),
|
||||
targetFixed = target.css( "position" ) === "fixed",
|
||||
body = $( "body" ),
|
||||
fixTop = targetFixed ? body.scrollTop() : 0,
|
||||
fixLeft = targetFixed ? body.scrollLeft() : 0,
|
||||
endPosition = target.offset(),
|
||||
animation = {
|
||||
top: endPosition.top - fixTop,
|
||||
left: endPosition.left - fixLeft,
|
||||
height: target.innerHeight(),
|
||||
width: target.innerWidth()
|
||||
},
|
||||
startPosition = element.offset(),
|
||||
transfer = $( "<div class='ui-effects-transfer'></div>" );
|
||||
|
||||
transfer
|
||||
.appendTo( "body" )
|
||||
.addClass( options.className )
|
||||
.css( {
|
||||
top: startPosition.top - fixTop,
|
||||
left: startPosition.left - fixLeft,
|
||||
height: element.innerHeight(),
|
||||
width: element.innerWidth(),
|
||||
position: targetFixed ? "fixed" : "absolute"
|
||||
} )
|
||||
.animate( animation, options.duration, options.easing, function() {
|
||||
transfer.remove();
|
||||
if ( typeof done === "function" ) {
|
||||
done();
|
||||
}
|
||||
} );
|
||||
}
|
||||
} );
|
||||
|
||||
function parseClip( str, element ) {
|
||||
var outerWidth = element.outerWidth(),
|
||||
outerHeight = element.outerHeight(),
|
||||
clipRegex = /^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,
|
||||
values = clipRegex.exec( str ) || [ "", 0, outerWidth, outerHeight, 0 ];
|
||||
|
||||
return {
|
||||
top: parseFloat( values[ 1 ] ) || 0,
|
||||
right: values[ 2 ] === "auto" ? outerWidth : parseFloat( values[ 2 ] ),
|
||||
bottom: values[ 3 ] === "auto" ? outerHeight : parseFloat( values[ 3 ] ),
|
||||
left: parseFloat( values[ 4 ] ) || 0
|
||||
};
|
||||
}
|
||||
|
||||
$.fx.step.clip = function( fx ) {
|
||||
if ( !fx.clipInit ) {
|
||||
fx.start = $( fx.elem ).cssClip();
|
||||
if ( typeof fx.end === "string" ) {
|
||||
fx.end = parseClip( fx.end, fx.elem );
|
||||
}
|
||||
fx.clipInit = true;
|
||||
}
|
||||
|
||||
$( fx.elem ).cssClip( {
|
||||
top: fx.pos * ( fx.end.top - fx.start.top ) + fx.start.top,
|
||||
right: fx.pos * ( fx.end.right - fx.start.right ) + fx.start.right,
|
||||
bottom: fx.pos * ( fx.end.bottom - fx.start.bottom ) + fx.start.bottom,
|
||||
left: fx.pos * ( fx.end.left - fx.start.left ) + fx.start.left
|
||||
} );
|
||||
};
|
||||
|
||||
} )();
|
||||
|
||||
/******************************************************************************/
|
||||
/*********************************** EASING ***********************************/
|
||||
/******************************************************************************/
|
||||
|
||||
( function() {
|
||||
|
||||
// Based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
|
||||
|
||||
var baseEasings = {};
|
||||
|
||||
$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
|
||||
baseEasings[ name ] = function( p ) {
|
||||
return Math.pow( p, i + 2 );
|
||||
};
|
||||
} );
|
||||
|
||||
$.extend( baseEasings, {
|
||||
Sine: function( p ) {
|
||||
return 1 - Math.cos( p * Math.PI / 2 );
|
||||
},
|
||||
Circ: function( p ) {
|
||||
return 1 - Math.sqrt( 1 - p * p );
|
||||
},
|
||||
Elastic: function( p ) {
|
||||
return p === 0 || p === 1 ? p :
|
||||
-Math.pow( 2, 8 * ( p - 1 ) ) * Math.sin( ( ( p - 1 ) * 80 - 7.5 ) * Math.PI / 15 );
|
||||
},
|
||||
Back: function( p ) {
|
||||
return p * p * ( 3 * p - 2 );
|
||||
},
|
||||
Bounce: function( p ) {
|
||||
var pow2,
|
||||
bounce = 4;
|
||||
|
||||
while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
|
||||
return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
|
||||
}
|
||||
} );
|
||||
|
||||
$.each( baseEasings, function( name, easeIn ) {
|
||||
$.easing[ "easeIn" + name ] = easeIn;
|
||||
$.easing[ "easeOut" + name ] = function( p ) {
|
||||
return 1 - easeIn( 1 - p );
|
||||
};
|
||||
$.easing[ "easeInOut" + name ] = function( p ) {
|
||||
return p < 0.5 ?
|
||||
easeIn( p * 2 ) / 2 :
|
||||
1 - easeIn( p * -2 + 2 ) / 2;
|
||||
};
|
||||
} );
|
||||
|
||||
} )();
|
||||
|
||||
return $.effects;
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,73 @@
|
||||
/*!
|
||||
* jQuery UI Effects Blind 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
|
||||
//>>label: Blind Effect
|
||||
//>>group: Effects
|
||||
//>>description: Blinds the element.
|
||||
//>>docs: http://api.jqueryui.com/blind-effect/
|
||||
//>>demos: http://jqueryui.com/effect/
|
||||
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [
|
||||
"jquery",
|
||||
"../version",
|
||||
"../effect"
|
||||
], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery );
|
||||
}
|
||||
} )( function( $ ) {
|
||||
"use strict";
|
||||
|
||||
return $.effects.define( "blind", "hide", function( options, done ) {
|
||||
var map = {
|
||||
up: [ "bottom", "top" ],
|
||||
vertical: [ "bottom", "top" ],
|
||||
down: [ "top", "bottom" ],
|
||||
left: [ "right", "left" ],
|
||||
horizontal: [ "right", "left" ],
|
||||
right: [ "left", "right" ]
|
||||
},
|
||||
element = $( this ),
|
||||
direction = options.direction || "up",
|
||||
start = element.cssClip(),
|
||||
animate = { clip: $.extend( {}, start ) },
|
||||
placeholder = $.effects.createPlaceholder( element );
|
||||
|
||||
animate.clip[ map[ direction ][ 0 ] ] = animate.clip[ map[ direction ][ 1 ] ];
|
||||
|
||||
if ( options.mode === "show" ) {
|
||||
element.cssClip( animate.clip );
|
||||
if ( placeholder ) {
|
||||
placeholder.css( $.effects.clipToBox( animate ) );
|
||||
}
|
||||
|
||||
animate.clip = start;
|
||||
}
|
||||
|
||||
if ( placeholder ) {
|
||||
placeholder.animate( $.effects.clipToBox( animate ), options.duration, options.easing );
|
||||
}
|
||||
|
||||
element.animate( animate, {
|
||||
queue: false,
|
||||
duration: options.duration,
|
||||
easing: options.easing,
|
||||
complete: done
|
||||
} );
|
||||
} );
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,113 @@
|
||||
/*!
|
||||
* jQuery UI Effects Bounce 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
|
||||
//>>label: Bounce Effect
|
||||
//>>group: Effects
|
||||
//>>description: Bounces an element horizontally or vertically n times.
|
||||
//>>docs: http://api.jqueryui.com/bounce-effect/
|
||||
//>>demos: http://jqueryui.com/effect/
|
||||
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [
|
||||
"jquery",
|
||||
"../version",
|
||||
"../effect"
|
||||
], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery );
|
||||
}
|
||||
} )( function( $ ) {
|
||||
"use strict";
|
||||
|
||||
return $.effects.define( "bounce", function( options, done ) {
|
||||
var upAnim, downAnim, refValue,
|
||||
element = $( this ),
|
||||
|
||||
// Defaults:
|
||||
mode = options.mode,
|
||||
hide = mode === "hide",
|
||||
show = mode === "show",
|
||||
direction = options.direction || "up",
|
||||
distance = options.distance,
|
||||
times = options.times || 5,
|
||||
|
||||
// Number of internal animations
|
||||
anims = times * 2 + ( show || hide ? 1 : 0 ),
|
||||
speed = options.duration / anims,
|
||||
easing = options.easing,
|
||||
|
||||
// Utility:
|
||||
ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
|
||||
motion = ( direction === "up" || direction === "left" ),
|
||||
i = 0,
|
||||
|
||||
queuelen = element.queue().length;
|
||||
|
||||
$.effects.createPlaceholder( element );
|
||||
|
||||
refValue = element.css( ref );
|
||||
|
||||
// Default distance for the BIGGEST bounce is the outer Distance / 3
|
||||
if ( !distance ) {
|
||||
distance = element[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3;
|
||||
}
|
||||
|
||||
if ( show ) {
|
||||
downAnim = { opacity: 1 };
|
||||
downAnim[ ref ] = refValue;
|
||||
|
||||
// If we are showing, force opacity 0 and set the initial position
|
||||
// then do the "first" animation
|
||||
element
|
||||
.css( "opacity", 0 )
|
||||
.css( ref, motion ? -distance * 2 : distance * 2 )
|
||||
.animate( downAnim, speed, easing );
|
||||
}
|
||||
|
||||
// Start at the smallest distance if we are hiding
|
||||
if ( hide ) {
|
||||
distance = distance / Math.pow( 2, times - 1 );
|
||||
}
|
||||
|
||||
downAnim = {};
|
||||
downAnim[ ref ] = refValue;
|
||||
|
||||
// Bounces up/down/left/right then back to 0 -- times * 2 animations happen here
|
||||
for ( ; i < times; i++ ) {
|
||||
upAnim = {};
|
||||
upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
|
||||
|
||||
element
|
||||
.animate( upAnim, speed, easing )
|
||||
.animate( downAnim, speed, easing );
|
||||
|
||||
distance = hide ? distance * 2 : distance / 2;
|
||||
}
|
||||
|
||||
// Last Bounce when Hiding
|
||||
if ( hide ) {
|
||||
upAnim = { opacity: 0 };
|
||||
upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
|
||||
|
||||
element.animate( upAnim, speed, easing );
|
||||
}
|
||||
|
||||
element.queue( done );
|
||||
|
||||
$.effects.unshift( element, queuelen, anims + 1 );
|
||||
} );
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,68 @@
|
||||
/*!
|
||||
* jQuery UI Effects Clip 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
|
||||
//>>label: Clip Effect
|
||||
//>>group: Effects
|
||||
//>>description: Clips the element on and off like an old TV.
|
||||
//>>docs: http://api.jqueryui.com/clip-effect/
|
||||
//>>demos: http://jqueryui.com/effect/
|
||||
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [
|
||||
"jquery",
|
||||
"../version",
|
||||
"../effect"
|
||||
], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery );
|
||||
}
|
||||
} )( function( $ ) {
|
||||
"use strict";
|
||||
|
||||
return $.effects.define( "clip", "hide", function( options, done ) {
|
||||
var start,
|
||||
animate = {},
|
||||
element = $( this ),
|
||||
direction = options.direction || "vertical",
|
||||
both = direction === "both",
|
||||
horizontal = both || direction === "horizontal",
|
||||
vertical = both || direction === "vertical";
|
||||
|
||||
start = element.cssClip();
|
||||
animate.clip = {
|
||||
top: vertical ? ( start.bottom - start.top ) / 2 : start.top,
|
||||
right: horizontal ? ( start.right - start.left ) / 2 : start.right,
|
||||
bottom: vertical ? ( start.bottom - start.top ) / 2 : start.bottom,
|
||||
left: horizontal ? ( start.right - start.left ) / 2 : start.left
|
||||
};
|
||||
|
||||
$.effects.createPlaceholder( element );
|
||||
|
||||
if ( options.mode === "show" ) {
|
||||
element.cssClip( animate.clip );
|
||||
animate.clip = start;
|
||||
}
|
||||
|
||||
element.animate( animate, {
|
||||
queue: false,
|
||||
duration: options.duration,
|
||||
easing: options.easing,
|
||||
complete: done
|
||||
} );
|
||||
|
||||
} );
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,68 @@
|
||||
/*!
|
||||
* jQuery UI Effects Clip 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
|
||||
//>>label: Clip Effect
|
||||
//>>group: Effects
|
||||
//>>description: Clips the element on and off like an old TV.
|
||||
//>>docs: http://api.jqueryui.com/clip-effect/
|
||||
//>>demos: http://jqueryui.com/effect/
|
||||
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [
|
||||
"jquery",
|
||||
"../version",
|
||||
"../effect"
|
||||
], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery );
|
||||
}
|
||||
} )( function( $ ) {
|
||||
"use strict";
|
||||
|
||||
return $.effects.define( "clip", "hide", function( options, done ) {
|
||||
var start,
|
||||
animate = {},
|
||||
element = $( this ),
|
||||
direction = options.direction || "vertical",
|
||||
both = direction === "both",
|
||||
horizontal = both || direction === "horizontal",
|
||||
vertical = both || direction === "vertical";
|
||||
|
||||
start = element.cssClip();
|
||||
animate.clip = {
|
||||
top: vertical ? ( start.bottom - start.top ) / 2 : start.top,
|
||||
right: horizontal ? ( start.right - start.left ) / 2 : start.right,
|
||||
bottom: vertical ? ( start.bottom - start.top ) / 2 : start.bottom,
|
||||
left: horizontal ? ( start.right - start.left ) / 2 : start.left
|
||||
};
|
||||
|
||||
$.effects.createPlaceholder( element );
|
||||
|
||||
if ( options.mode === "show" ) {
|
||||
element.cssClip( animate.clip );
|
||||
animate.clip = start;
|
||||
}
|
||||
|
||||
element.animate( animate, {
|
||||
queue: false,
|
||||
duration: options.duration,
|
||||
easing: options.easing,
|
||||
complete: done
|
||||
} );
|
||||
|
||||
} );
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,114 @@
|
||||
/*!
|
||||
* jQuery UI Effects Explode 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
|
||||
//>>label: Explode Effect
|
||||
//>>group: Effects
|
||||
/* eslint-disable max-len */
|
||||
//>>description: Explodes an element in all directions into n pieces. Implodes an element to its original wholeness.
|
||||
/* eslint-enable max-len */
|
||||
//>>docs: http://api.jqueryui.com/explode-effect/
|
||||
//>>demos: http://jqueryui.com/effect/
|
||||
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [
|
||||
"jquery",
|
||||
"../version",
|
||||
"../effect"
|
||||
], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery );
|
||||
}
|
||||
} )( function( $ ) {
|
||||
"use strict";
|
||||
|
||||
return $.effects.define( "explode", "hide", function( options, done ) {
|
||||
|
||||
var i, j, left, top, mx, my,
|
||||
rows = options.pieces ? Math.round( Math.sqrt( options.pieces ) ) : 3,
|
||||
cells = rows,
|
||||
element = $( this ),
|
||||
mode = options.mode,
|
||||
show = mode === "show",
|
||||
|
||||
// Show and then visibility:hidden the element before calculating offset
|
||||
offset = element.show().css( "visibility", "hidden" ).offset(),
|
||||
|
||||
// Width and height of a piece
|
||||
width = Math.ceil( element.outerWidth() / cells ),
|
||||
height = Math.ceil( element.outerHeight() / rows ),
|
||||
pieces = [];
|
||||
|
||||
// Children animate complete:
|
||||
function childComplete() {
|
||||
pieces.push( this );
|
||||
if ( pieces.length === rows * cells ) {
|
||||
animComplete();
|
||||
}
|
||||
}
|
||||
|
||||
// Clone the element for each row and cell.
|
||||
for ( i = 0; i < rows; i++ ) { // ===>
|
||||
top = offset.top + i * height;
|
||||
my = i - ( rows - 1 ) / 2;
|
||||
|
||||
for ( j = 0; j < cells; j++ ) { // |||
|
||||
left = offset.left + j * width;
|
||||
mx = j - ( cells - 1 ) / 2;
|
||||
|
||||
// Create a clone of the now hidden main element that will be absolute positioned
|
||||
// within a wrapper div off the -left and -top equal to size of our pieces
|
||||
element
|
||||
.clone()
|
||||
.appendTo( "body" )
|
||||
.wrap( "<div></div>" )
|
||||
.css( {
|
||||
position: "absolute",
|
||||
visibility: "visible",
|
||||
left: -j * width,
|
||||
top: -i * height
|
||||
} )
|
||||
|
||||
// Select the wrapper - make it overflow: hidden and absolute positioned based on
|
||||
// where the original was located +left and +top equal to the size of pieces
|
||||
.parent()
|
||||
.addClass( "ui-effects-explode" )
|
||||
.css( {
|
||||
position: "absolute",
|
||||
overflow: "hidden",
|
||||
width: width,
|
||||
height: height,
|
||||
left: left + ( show ? mx * width : 0 ),
|
||||
top: top + ( show ? my * height : 0 ),
|
||||
opacity: show ? 0 : 1
|
||||
} )
|
||||
.animate( {
|
||||
left: left + ( show ? 0 : mx * width ),
|
||||
top: top + ( show ? 0 : my * height ),
|
||||
opacity: show ? 1 : 0
|
||||
}, options.duration || 500, options.easing, childComplete );
|
||||
}
|
||||
}
|
||||
|
||||
function animComplete() {
|
||||
element.css( {
|
||||
visibility: "visible"
|
||||
} );
|
||||
$( pieces ).remove();
|
||||
done();
|
||||
}
|
||||
} );
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,50 @@
|
||||
/*!
|
||||
* jQuery UI Effects Fade 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
|
||||
//>>label: Fade Effect
|
||||
//>>group: Effects
|
||||
//>>description: Fades the element.
|
||||
//>>docs: http://api.jqueryui.com/fade-effect/
|
||||
//>>demos: http://jqueryui.com/effect/
|
||||
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [
|
||||
"jquery",
|
||||
"../version",
|
||||
"../effect"
|
||||
], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery );
|
||||
}
|
||||
} )( function( $ ) {
|
||||
"use strict";
|
||||
|
||||
return $.effects.define( "fade", "toggle", function( options, done ) {
|
||||
var show = options.mode === "show";
|
||||
|
||||
$( this )
|
||||
.css( "opacity", show ? 0 : 1 )
|
||||
.animate( {
|
||||
opacity: show ? 1 : 0
|
||||
}, {
|
||||
queue: false,
|
||||
duration: options.duration,
|
||||
easing: options.easing,
|
||||
complete: done
|
||||
} );
|
||||
} );
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,92 @@
|
||||
/*!
|
||||
* jQuery UI Effects Fold 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
|
||||
//>>label: Fold Effect
|
||||
//>>group: Effects
|
||||
//>>description: Folds an element first horizontally and then vertically.
|
||||
//>>docs: http://api.jqueryui.com/fold-effect/
|
||||
//>>demos: http://jqueryui.com/effect/
|
||||
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [
|
||||
"jquery",
|
||||
"../version",
|
||||
"../effect"
|
||||
], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery );
|
||||
}
|
||||
} )( function( $ ) {
|
||||
"use strict";
|
||||
|
||||
return $.effects.define( "fold", "hide", function( options, done ) {
|
||||
|
||||
// Create element
|
||||
var element = $( this ),
|
||||
mode = options.mode,
|
||||
show = mode === "show",
|
||||
hide = mode === "hide",
|
||||
size = options.size || 15,
|
||||
percent = /([0-9]+)%/.exec( size ),
|
||||
horizFirst = !!options.horizFirst,
|
||||
ref = horizFirst ? [ "right", "bottom" ] : [ "bottom", "right" ],
|
||||
duration = options.duration / 2,
|
||||
|
||||
placeholder = $.effects.createPlaceholder( element ),
|
||||
|
||||
start = element.cssClip(),
|
||||
animation1 = { clip: $.extend( {}, start ) },
|
||||
animation2 = { clip: $.extend( {}, start ) },
|
||||
|
||||
distance = [ start[ ref[ 0 ] ], start[ ref[ 1 ] ] ],
|
||||
|
||||
queuelen = element.queue().length;
|
||||
|
||||
if ( percent ) {
|
||||
size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ];
|
||||
}
|
||||
animation1.clip[ ref[ 0 ] ] = size;
|
||||
animation2.clip[ ref[ 0 ] ] = size;
|
||||
animation2.clip[ ref[ 1 ] ] = 0;
|
||||
|
||||
if ( show ) {
|
||||
element.cssClip( animation2.clip );
|
||||
if ( placeholder ) {
|
||||
placeholder.css( $.effects.clipToBox( animation2 ) );
|
||||
}
|
||||
|
||||
animation2.clip = start;
|
||||
}
|
||||
|
||||
// Animate
|
||||
element
|
||||
.queue( function( next ) {
|
||||
if ( placeholder ) {
|
||||
placeholder
|
||||
.animate( $.effects.clipToBox( animation1 ), duration, options.easing )
|
||||
.animate( $.effects.clipToBox( animation2 ), duration, options.easing );
|
||||
}
|
||||
|
||||
next();
|
||||
} )
|
||||
.animate( animation1, duration, options.easing )
|
||||
.animate( animation2, duration, options.easing )
|
||||
.queue( done );
|
||||
|
||||
$.effects.unshift( element, queuelen, 4 );
|
||||
} );
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,60 @@
|
||||
/*!
|
||||
* jQuery UI Effects Highlight 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
|
||||
//>>label: Highlight Effect
|
||||
//>>group: Effects
|
||||
//>>description: Highlights the background of an element in a defined color for a custom duration.
|
||||
//>>docs: http://api.jqueryui.com/highlight-effect/
|
||||
//>>demos: http://jqueryui.com/effect/
|
||||
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [
|
||||
"jquery",
|
||||
"../version",
|
||||
"../effect"
|
||||
], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery );
|
||||
}
|
||||
} )( function( $ ) {
|
||||
"use strict";
|
||||
|
||||
return $.effects.define( "highlight", "show", function( options, done ) {
|
||||
var element = $( this ),
|
||||
animation = {
|
||||
backgroundColor: element.css( "backgroundColor" )
|
||||
};
|
||||
|
||||
if ( options.mode === "hide" ) {
|
||||
animation.opacity = 0;
|
||||
}
|
||||
|
||||
$.effects.saveStyle( element );
|
||||
|
||||
element
|
||||
.css( {
|
||||
backgroundImage: "none",
|
||||
backgroundColor: options.color || "#ffff99"
|
||||
} )
|
||||
.animate( animation, {
|
||||
queue: false,
|
||||
duration: options.duration,
|
||||
easing: options.easing,
|
||||
complete: done
|
||||
} );
|
||||
} );
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,45 @@
|
||||
/*!
|
||||
* jQuery UI Effects Puff 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
|
||||
//>>label: Puff Effect
|
||||
//>>group: Effects
|
||||
//>>description: Creates a puff effect by scaling the element up and hiding it at the same time.
|
||||
//>>docs: http://api.jqueryui.com/puff-effect/
|
||||
//>>demos: http://jqueryui.com/effect/
|
||||
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [
|
||||
"jquery",
|
||||
"../version",
|
||||
"../effect",
|
||||
"./effect-scale"
|
||||
], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery );
|
||||
}
|
||||
} )( function( $ ) {
|
||||
"use strict";
|
||||
|
||||
return $.effects.define( "puff", "hide", function( options, done ) {
|
||||
var newOptions = $.extend( true, {}, options, {
|
||||
fade: true,
|
||||
percent: parseInt( options.percent, 10 ) || 150
|
||||
} );
|
||||
|
||||
$.effects.effect.scale.call( this, newOptions, done );
|
||||
} );
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,67 @@
|
||||
/*!
|
||||
* jQuery UI Effects Pulsate 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
|
||||
//>>label: Pulsate Effect
|
||||
//>>group: Effects
|
||||
//>>description: Pulsates an element n times by changing the opacity to zero and back.
|
||||
//>>docs: http://api.jqueryui.com/pulsate-effect/
|
||||
//>>demos: http://jqueryui.com/effect/
|
||||
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [
|
||||
"jquery",
|
||||
"../version",
|
||||
"../effect"
|
||||
], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery );
|
||||
}
|
||||
} )( function( $ ) {
|
||||
"use strict";
|
||||
|
||||
return $.effects.define( "pulsate", "show", function( options, done ) {
|
||||
var element = $( this ),
|
||||
mode = options.mode,
|
||||
show = mode === "show",
|
||||
hide = mode === "hide",
|
||||
showhide = show || hide,
|
||||
|
||||
// Showing or hiding leaves off the "last" animation
|
||||
anims = ( ( options.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ),
|
||||
duration = options.duration / anims,
|
||||
animateTo = 0,
|
||||
i = 1,
|
||||
queuelen = element.queue().length;
|
||||
|
||||
if ( show || !element.is( ":visible" ) ) {
|
||||
element.css( "opacity", 0 ).show();
|
||||
animateTo = 1;
|
||||
}
|
||||
|
||||
// Anims - 1 opacity "toggles"
|
||||
for ( ; i < anims; i++ ) {
|
||||
element.animate( { opacity: animateTo }, duration, options.easing );
|
||||
animateTo = 1 - animateTo;
|
||||
}
|
||||
|
||||
element.animate( { opacity: animateTo }, duration, options.easing );
|
||||
|
||||
element.queue( done );
|
||||
|
||||
$.effects.unshift( element, queuelen, anims + 1 );
|
||||
} );
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,59 @@
|
||||
/*!
|
||||
* jQuery UI Effects Scale 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
|
||||
//>>label: Scale Effect
|
||||
//>>group: Effects
|
||||
//>>description: Grows or shrinks an element and its content.
|
||||
//>>docs: http://api.jqueryui.com/scale-effect/
|
||||
//>>demos: http://jqueryui.com/effect/
|
||||
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [
|
||||
"jquery",
|
||||
"../version",
|
||||
"../effect",
|
||||
"./effect-size"
|
||||
], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery );
|
||||
}
|
||||
} )( function( $ ) {
|
||||
"use strict";
|
||||
|
||||
return $.effects.define( "scale", function( options, done ) {
|
||||
|
||||
// Create element
|
||||
var el = $( this ),
|
||||
mode = options.mode,
|
||||
percent = parseInt( options.percent, 10 ) ||
|
||||
( parseInt( options.percent, 10 ) === 0 ? 0 : ( mode !== "effect" ? 0 : 100 ) ),
|
||||
|
||||
newOptions = $.extend( true, {
|
||||
from: $.effects.scaledDimensions( el ),
|
||||
to: $.effects.scaledDimensions( el, percent, options.direction || "both" ),
|
||||
origin: options.origin || [ "middle", "center" ]
|
||||
}, options );
|
||||
|
||||
// Fade option to support puff
|
||||
if ( options.fade ) {
|
||||
newOptions.from.opacity = 1;
|
||||
newOptions.to.opacity = 0;
|
||||
}
|
||||
|
||||
$.effects.effect.size.call( this, newOptions, done );
|
||||
} );
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,77 @@
|
||||
/*!
|
||||
* jQuery UI Effects Shake 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
|
||||
//>>label: Shake Effect
|
||||
//>>group: Effects
|
||||
//>>description: Shakes an element horizontally or vertically n times.
|
||||
//>>docs: http://api.jqueryui.com/shake-effect/
|
||||
//>>demos: http://jqueryui.com/effect/
|
||||
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [
|
||||
"jquery",
|
||||
"../version",
|
||||
"../effect"
|
||||
], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery );
|
||||
}
|
||||
} )( function( $ ) {
|
||||
"use strict";
|
||||
|
||||
return $.effects.define( "shake", function( options, done ) {
|
||||
|
||||
var i = 1,
|
||||
element = $( this ),
|
||||
direction = options.direction || "left",
|
||||
distance = options.distance || 20,
|
||||
times = options.times || 3,
|
||||
anims = times * 2 + 1,
|
||||
speed = Math.round( options.duration / anims ),
|
||||
ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
|
||||
positiveMotion = ( direction === "up" || direction === "left" ),
|
||||
animation = {},
|
||||
animation1 = {},
|
||||
animation2 = {},
|
||||
|
||||
queuelen = element.queue().length;
|
||||
|
||||
$.effects.createPlaceholder( element );
|
||||
|
||||
// Animation
|
||||
animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance;
|
||||
animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2;
|
||||
animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2;
|
||||
|
||||
// Animate
|
||||
element.animate( animation, speed, options.easing );
|
||||
|
||||
// Shakes
|
||||
for ( ; i < times; i++ ) {
|
||||
element
|
||||
.animate( animation1, speed, options.easing )
|
||||
.animate( animation2, speed, options.easing );
|
||||
}
|
||||
|
||||
element
|
||||
.animate( animation1, speed, options.easing )
|
||||
.animate( animation, speed / 2, options.easing )
|
||||
.queue( done );
|
||||
|
||||
$.effects.unshift( element, queuelen, anims + 1 );
|
||||
} );
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,196 @@
|
||||
/*!
|
||||
* jQuery UI Effects Size 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
|
||||
//>>label: Size Effect
|
||||
//>>group: Effects
|
||||
//>>description: Resize an element to a specified width and height.
|
||||
//>>docs: http://api.jqueryui.com/size-effect/
|
||||
//>>demos: http://jqueryui.com/effect/
|
||||
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [
|
||||
"jquery",
|
||||
"../version",
|
||||
"../effect"
|
||||
], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery );
|
||||
}
|
||||
} )( function( $ ) {
|
||||
"use strict";
|
||||
|
||||
return $.effects.define( "size", function( options, done ) {
|
||||
|
||||
// Create element
|
||||
var baseline, factor, temp,
|
||||
element = $( this ),
|
||||
|
||||
// Copy for children
|
||||
cProps = [ "fontSize" ],
|
||||
vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ],
|
||||
hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ],
|
||||
|
||||
// Set options
|
||||
mode = options.mode,
|
||||
restore = mode !== "effect",
|
||||
scale = options.scale || "both",
|
||||
origin = options.origin || [ "middle", "center" ],
|
||||
position = element.css( "position" ),
|
||||
pos = element.position(),
|
||||
original = $.effects.scaledDimensions( element ),
|
||||
from = options.from || original,
|
||||
to = options.to || $.effects.scaledDimensions( element, 0 );
|
||||
|
||||
$.effects.createPlaceholder( element );
|
||||
|
||||
if ( mode === "show" ) {
|
||||
temp = from;
|
||||
from = to;
|
||||
to = temp;
|
||||
}
|
||||
|
||||
// Set scaling factor
|
||||
factor = {
|
||||
from: {
|
||||
y: from.height / original.height,
|
||||
x: from.width / original.width
|
||||
},
|
||||
to: {
|
||||
y: to.height / original.height,
|
||||
x: to.width / original.width
|
||||
}
|
||||
};
|
||||
|
||||
// Scale the css box
|
||||
if ( scale === "box" || scale === "both" ) {
|
||||
|
||||
// Vertical props scaling
|
||||
if ( factor.from.y !== factor.to.y ) {
|
||||
from = $.effects.setTransition( element, vProps, factor.from.y, from );
|
||||
to = $.effects.setTransition( element, vProps, factor.to.y, to );
|
||||
}
|
||||
|
||||
// Horizontal props scaling
|
||||
if ( factor.from.x !== factor.to.x ) {
|
||||
from = $.effects.setTransition( element, hProps, factor.from.x, from );
|
||||
to = $.effects.setTransition( element, hProps, factor.to.x, to );
|
||||
}
|
||||
}
|
||||
|
||||
// Scale the content
|
||||
if ( scale === "content" || scale === "both" ) {
|
||||
|
||||
// Vertical props scaling
|
||||
if ( factor.from.y !== factor.to.y ) {
|
||||
from = $.effects.setTransition( element, cProps, factor.from.y, from );
|
||||
to = $.effects.setTransition( element, cProps, factor.to.y, to );
|
||||
}
|
||||
}
|
||||
|
||||
// Adjust the position properties based on the provided origin points
|
||||
if ( origin ) {
|
||||
baseline = $.effects.getBaseline( origin, original );
|
||||
from.top = ( original.outerHeight - from.outerHeight ) * baseline.y + pos.top;
|
||||
from.left = ( original.outerWidth - from.outerWidth ) * baseline.x + pos.left;
|
||||
to.top = ( original.outerHeight - to.outerHeight ) * baseline.y + pos.top;
|
||||
to.left = ( original.outerWidth - to.outerWidth ) * baseline.x + pos.left;
|
||||
}
|
||||
delete from.outerHeight;
|
||||
delete from.outerWidth;
|
||||
element.css( from );
|
||||
|
||||
// Animate the children if desired
|
||||
if ( scale === "content" || scale === "both" ) {
|
||||
|
||||
vProps = vProps.concat( [ "marginTop", "marginBottom" ] ).concat( cProps );
|
||||
hProps = hProps.concat( [ "marginLeft", "marginRight" ] );
|
||||
|
||||
// Only animate children with width attributes specified
|
||||
// TODO: is this right? should we include anything with css width specified as well
|
||||
element.find( "*[width]" ).each( function() {
|
||||
var child = $( this ),
|
||||
childOriginal = $.effects.scaledDimensions( child ),
|
||||
childFrom = {
|
||||
height: childOriginal.height * factor.from.y,
|
||||
width: childOriginal.width * factor.from.x,
|
||||
outerHeight: childOriginal.outerHeight * factor.from.y,
|
||||
outerWidth: childOriginal.outerWidth * factor.from.x
|
||||
},
|
||||
childTo = {
|
||||
height: childOriginal.height * factor.to.y,
|
||||
width: childOriginal.width * factor.to.x,
|
||||
outerHeight: childOriginal.height * factor.to.y,
|
||||
outerWidth: childOriginal.width * factor.to.x
|
||||
};
|
||||
|
||||
// Vertical props scaling
|
||||
if ( factor.from.y !== factor.to.y ) {
|
||||
childFrom = $.effects.setTransition( child, vProps, factor.from.y, childFrom );
|
||||
childTo = $.effects.setTransition( child, vProps, factor.to.y, childTo );
|
||||
}
|
||||
|
||||
// Horizontal props scaling
|
||||
if ( factor.from.x !== factor.to.x ) {
|
||||
childFrom = $.effects.setTransition( child, hProps, factor.from.x, childFrom );
|
||||
childTo = $.effects.setTransition( child, hProps, factor.to.x, childTo );
|
||||
}
|
||||
|
||||
if ( restore ) {
|
||||
$.effects.saveStyle( child );
|
||||
}
|
||||
|
||||
// Animate children
|
||||
child.css( childFrom );
|
||||
child.animate( childTo, options.duration, options.easing, function() {
|
||||
|
||||
// Restore children
|
||||
if ( restore ) {
|
||||
$.effects.restoreStyle( child );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
}
|
||||
|
||||
// Animate
|
||||
element.animate( to, {
|
||||
queue: false,
|
||||
duration: options.duration,
|
||||
easing: options.easing,
|
||||
complete: function() {
|
||||
|
||||
var offset = element.offset();
|
||||
|
||||
if ( to.opacity === 0 ) {
|
||||
element.css( "opacity", from.opacity );
|
||||
}
|
||||
|
||||
if ( !restore ) {
|
||||
element
|
||||
.css( "position", position === "static" ? "relative" : position )
|
||||
.offset( offset );
|
||||
|
||||
// Need to save style here so that automatic style restoration
|
||||
// doesn't restore to the original styles from before the animation.
|
||||
$.effects.saveStyle( element );
|
||||
}
|
||||
|
||||
done();
|
||||
}
|
||||
} );
|
||||
|
||||
} );
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,79 @@
|
||||
/*!
|
||||
* jQuery UI Effects Slide 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
|
||||
//>>label: Slide Effect
|
||||
//>>group: Effects
|
||||
//>>description: Slides an element in and out of the viewport.
|
||||
//>>docs: http://api.jqueryui.com/slide-effect/
|
||||
//>>demos: http://jqueryui.com/effect/
|
||||
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [
|
||||
"jquery",
|
||||
"../version",
|
||||
"../effect"
|
||||
], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery );
|
||||
}
|
||||
} )( function( $ ) {
|
||||
"use strict";
|
||||
|
||||
return $.effects.define( "slide", "show", function( options, done ) {
|
||||
var startClip, startRef,
|
||||
element = $( this ),
|
||||
map = {
|
||||
up: [ "bottom", "top" ],
|
||||
down: [ "top", "bottom" ],
|
||||
left: [ "right", "left" ],
|
||||
right: [ "left", "right" ]
|
||||
},
|
||||
mode = options.mode,
|
||||
direction = options.direction || "left",
|
||||
ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
|
||||
positiveMotion = ( direction === "up" || direction === "left" ),
|
||||
distance = options.distance ||
|
||||
element[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ),
|
||||
animation = {};
|
||||
|
||||
$.effects.createPlaceholder( element );
|
||||
|
||||
startClip = element.cssClip();
|
||||
startRef = element.position()[ ref ];
|
||||
|
||||
// Define hide animation
|
||||
animation[ ref ] = ( positiveMotion ? -1 : 1 ) * distance + startRef;
|
||||
animation.clip = element.cssClip();
|
||||
animation.clip[ map[ direction ][ 1 ] ] = animation.clip[ map[ direction ][ 0 ] ];
|
||||
|
||||
// Reverse the animation if we're showing
|
||||
if ( mode === "show" ) {
|
||||
element.cssClip( animation.clip );
|
||||
element.css( ref, animation[ ref ] );
|
||||
animation.clip = startClip;
|
||||
animation[ ref ] = startRef;
|
||||
}
|
||||
|
||||
// Actually animate
|
||||
element.animate( animation, {
|
||||
queue: false,
|
||||
duration: options.duration,
|
||||
easing: options.easing,
|
||||
complete: done
|
||||
} );
|
||||
} );
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,43 @@
|
||||
/*!
|
||||
* jQuery UI Effects Transfer 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
|
||||
//>>label: Transfer Effect
|
||||
//>>group: Effects
|
||||
//>>description: Displays a transfer effect from one element to another.
|
||||
//>>docs: http://api.jqueryui.com/transfer-effect/
|
||||
//>>demos: http://jqueryui.com/effect/
|
||||
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [
|
||||
"jquery",
|
||||
"../version",
|
||||
"../effect"
|
||||
], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery );
|
||||
}
|
||||
} )( function( $ ) {
|
||||
"use strict";
|
||||
|
||||
var effect;
|
||||
if ( $.uiBackCompat !== false ) {
|
||||
effect = $.effects.define( "transfer", function( options, done ) {
|
||||
$( this ).transfer( options, done );
|
||||
} );
|
||||
}
|
||||
return effect;
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,87 @@
|
||||
/*!
|
||||
* jQuery UI Focusable 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
|
||||
//>>label: :focusable Selector
|
||||
//>>group: Core
|
||||
//>>description: Selects elements which can be focused.
|
||||
//>>docs: http://api.jqueryui.com/focusable-selector/
|
||||
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "jquery", "./version" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery );
|
||||
}
|
||||
} )( function( $ ) {
|
||||
"use strict";
|
||||
|
||||
// Selectors
|
||||
$.ui.focusable = function( element, hasTabindex ) {
|
||||
var map, mapName, img, focusableIfVisible, fieldset,
|
||||
nodeName = element.nodeName.toLowerCase();
|
||||
|
||||
if ( "area" === nodeName ) {
|
||||
map = element.parentNode;
|
||||
mapName = map.name;
|
||||
if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
|
||||
return false;
|
||||
}
|
||||
img = $( "img[usemap='#" + mapName + "']" );
|
||||
return img.length > 0 && img.is( ":visible" );
|
||||
}
|
||||
|
||||
if ( /^(input|select|textarea|button|object)$/.test( nodeName ) ) {
|
||||
focusableIfVisible = !element.disabled;
|
||||
|
||||
if ( focusableIfVisible ) {
|
||||
|
||||
// Form controls within a disabled fieldset are disabled.
|
||||
// However, controls within the fieldset's legend do not get disabled.
|
||||
// Since controls generally aren't placed inside legends, we skip
|
||||
// this portion of the check.
|
||||
fieldset = $( element ).closest( "fieldset" )[ 0 ];
|
||||
if ( fieldset ) {
|
||||
focusableIfVisible = !fieldset.disabled;
|
||||
}
|
||||
}
|
||||
} else if ( "a" === nodeName ) {
|
||||
focusableIfVisible = element.href || hasTabindex;
|
||||
} else {
|
||||
focusableIfVisible = hasTabindex;
|
||||
}
|
||||
|
||||
return focusableIfVisible && $( element ).is( ":visible" ) && visible( $( element ) );
|
||||
};
|
||||
|
||||
// Support: IE 8 only
|
||||
// IE 8 doesn't resolve inherit to visible/hidden for computed values
|
||||
function visible( element ) {
|
||||
var visibility = element.css( "visibility" );
|
||||
while ( visibility === "inherit" ) {
|
||||
element = element.parent();
|
||||
visibility = element.css( "visibility" );
|
||||
}
|
||||
return visibility === "visible";
|
||||
}
|
||||
|
||||
$.extend( $.expr.pseudos, {
|
||||
focusable: function( element ) {
|
||||
return $.ui.focusable( element, $.attr( element, "tabindex" ) != null );
|
||||
}
|
||||
} );
|
||||
|
||||
return $.ui.focusable;
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,80 @@
|
||||
/*!
|
||||
* jQuery UI Form Reset Mixin 1.13.2
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
|
||||
//>>label: Form Reset Mixin
|
||||
//>>group: Core
|
||||
//>>description: Refresh input widgets when their form is reset
|
||||
//>>docs: http://api.jqueryui.com/form-reset-mixin/
|
||||
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [
|
||||
"jquery",
|
||||
"./form",
|
||||
"./version"
|
||||
], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery );
|
||||
}
|
||||
} )( function( $ ) {
|
||||
"use strict";
|
||||
|
||||
return $.ui.formResetMixin = {
|
||||
_formResetHandler: function() {
|
||||
var form = $( this );
|
||||
|
||||
// Wait for the form reset to actually happen before refreshing
|
||||
setTimeout( function() {
|
||||
var instances = form.data( "ui-form-reset-instances" );
|
||||
$.each( instances, function() {
|
||||
this.refresh();
|
||||
} );
|
||||
} );
|
||||
},
|
||||
|
||||
_bindFormResetHandler: function() {
|
||||
this.form = this.element._form();
|
||||
if ( !this.form.length ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var instances = this.form.data( "ui-form-reset-instances" ) || [];
|
||||
if ( !instances.length ) {
|
||||
|
||||
// We don't use _on() here because we use a single event handler per form
|
||||
this.form.on( "reset.ui-form-reset", this._formResetHandler );
|
||||
}
|
||||
instances.push( this );
|
||||
this.form.data( "ui-form-reset-instances", instances );
|
||||
},
|
||||
|
||||
_unbindFormResetHandler: function() {
|
||||
if ( !this.form.length ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var instances = this.form.data( "ui-form-reset-instances" );
|
||||
instances.splice( $.inArray( this, instances ), 1 );
|
||||
if ( instances.length ) {
|
||||
this.form.data( "ui-form-reset-instances", instances );
|
||||
} else {
|
||||
this.form
|
||||
.removeData( "ui-form-reset-instances" )
|
||||
.off( "reset.ui-form-reset" );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,23 @@
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "jquery", "./version" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery );
|
||||
}
|
||||
} )( function( $ ) {
|
||||
"use strict";
|
||||
|
||||
// Support: IE8 Only
|
||||
// IE8 does not support the form attribute and when it is supplied. It overwrites the form prop
|
||||
// with a string, so we need to find the proper form.
|
||||
return $.fn._form = function() {
|
||||
return typeof this[ 0 ].form === "string" ? this.closest( "form" ) : $( this[ 0 ].form );
|
||||
};
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,40 @@
|
||||
/* Afrikaans initialisation for the jQuery UI date picker plugin. */
|
||||
/* Written by Renier Pretorius. */
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "../widgets/datepicker" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery.datepicker );
|
||||
}
|
||||
} )( function( datepicker ) {
|
||||
"use strict";
|
||||
|
||||
datepicker.regional.af = {
|
||||
closeText: "Selekteer",
|
||||
prevText: "Vorige",
|
||||
nextText: "Volgende",
|
||||
currentText: "Vandag",
|
||||
monthNames: [ "Januarie", "Februarie", "Maart", "April", "Mei", "Junie",
|
||||
"Julie", "Augustus", "September", "Oktober", "November", "Desember" ],
|
||||
monthNamesShort: [ "Jan", "Feb", "Mrt", "Apr", "Mei", "Jun",
|
||||
"Jul", "Aug", "Sep", "Okt", "Nov", "Des" ],
|
||||
dayNames: [ "Sondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrydag", "Saterdag" ],
|
||||
dayNamesShort: [ "Son", "Maa", "Din", "Woe", "Don", "Vry", "Sat" ],
|
||||
dayNamesMin: [ "So", "Ma", "Di", "Wo", "Do", "Vr", "Sa" ],
|
||||
weekHeader: "Wk",
|
||||
dateFormat: "dd/mm/yy",
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: "" };
|
||||
datepicker.setDefaults( datepicker.regional.af );
|
||||
|
||||
return datepicker.regional.af;
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,42 @@
|
||||
/* Algerian Arabic Translation for jQuery UI date picker plugin.
|
||||
/* Used in most of Maghreb countries, primarily in Algeria, Tunisia, Morocco.
|
||||
/* Mohamed Cherif BOUCHELAGHEM -- cherifbouchelaghem@yahoo.fr */
|
||||
/* Mohamed Amine HADDAD -- zatamine@gmail.com */
|
||||
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "../widgets/datepicker" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery.datepicker );
|
||||
}
|
||||
} )( function( datepicker ) {
|
||||
"use strict";
|
||||
|
||||
datepicker.regional[ "ar-DZ" ] = {
|
||||
closeText: "إغلاق",
|
||||
prevText: "<السابق",
|
||||
nextText: "التالي>",
|
||||
currentText: "اليوم",
|
||||
monthNames: [ "جانفي", "فيفري", "مارس", "أفريل", "ماي", "جوان",
|
||||
"جويلية", "أوت", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر" ],
|
||||
monthNamesShort: [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" ],
|
||||
dayNames: [ "الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت" ],
|
||||
dayNamesShort: [ "الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت" ],
|
||||
dayNamesMin: [ "ح", "ن", "ث", "ر", "خ", "ج", "س" ],
|
||||
weekHeader: "أسبوع",
|
||||
dateFormat: "dd/mm/yy",
|
||||
firstDay: 6,
|
||||
isRTL: true,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: "" };
|
||||
datepicker.setDefaults( datepicker.regional[ "ar-DZ" ] );
|
||||
|
||||
return datepicker.regional[ "ar-DZ" ];
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,42 @@
|
||||
/* Arabic Translation for jQuery UI date picker plugin. */
|
||||
/* Used in most of Arab countries, primarily in Bahrain, */
|
||||
/* Kuwait, Oman, Qatar, Saudi Arabia and the United Arab Emirates, Egypt, Sudan and Yemen. */
|
||||
/* Written by Mohammed Alshehri -- m@dralshehri.com */
|
||||
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "../widgets/datepicker" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery.datepicker );
|
||||
}
|
||||
} )( function( datepicker ) {
|
||||
"use strict";
|
||||
|
||||
datepicker.regional.ar = {
|
||||
closeText: "إغلاق",
|
||||
prevText: "<السابق",
|
||||
nextText: "التالي>",
|
||||
currentText: "اليوم",
|
||||
monthNames: [ "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو",
|
||||
"يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر" ],
|
||||
monthNamesShort: [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" ],
|
||||
dayNames: [ "الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت" ],
|
||||
dayNamesShort: [ "أحد", "اثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت" ],
|
||||
dayNamesMin: [ "ح", "ن", "ث", "ر", "خ", "ج", "س" ],
|
||||
weekHeader: "أسبوع",
|
||||
dateFormat: "dd/mm/yy",
|
||||
firstDay: 0,
|
||||
isRTL: true,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: "" };
|
||||
datepicker.setDefaults( datepicker.regional.ar );
|
||||
|
||||
return datepicker.regional.ar;
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,40 @@
|
||||
/* Azerbaijani (UTF-8) initialisation for the jQuery UI date picker plugin. */
|
||||
/* Written by Jamil Najafov (necefov33@gmail.com). */
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "../widgets/datepicker" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery.datepicker );
|
||||
}
|
||||
} )( function( datepicker ) {
|
||||
"use strict";
|
||||
|
||||
datepicker.regional.az = {
|
||||
closeText: "Bağla",
|
||||
prevText: "<Geri",
|
||||
nextText: "İrəli>",
|
||||
currentText: "Bugün",
|
||||
monthNames: [ "Yanvar", "Fevral", "Mart", "Aprel", "May", "İyun",
|
||||
"İyul", "Avqust", "Sentyabr", "Oktyabr", "Noyabr", "Dekabr" ],
|
||||
monthNamesShort: [ "Yan", "Fev", "Mar", "Apr", "May", "İyun",
|
||||
"İyul", "Avq", "Sen", "Okt", "Noy", "Dek" ],
|
||||
dayNames: [ "Bazar", "Bazar ertəsi", "Çərşənbə axşamı", "Çərşənbə", "Cümə axşamı", "Cümə", "Şənbə" ],
|
||||
dayNamesShort: [ "B", "Be", "Ça", "Ç", "Ca", "C", "Ş" ],
|
||||
dayNamesMin: [ "B", "B", "Ç", "С", "Ç", "C", "Ş" ],
|
||||
weekHeader: "Hf",
|
||||
dateFormat: "dd.mm.yy",
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: "" };
|
||||
datepicker.setDefaults( datepicker.regional.az );
|
||||
|
||||
return datepicker.regional.az;
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,40 @@
|
||||
/* Belarusian initialisation for the jQuery UI date picker plugin. */
|
||||
/* Written by Pavel Selitskas <p.selitskas@gmail.com> */
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "../widgets/datepicker" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery.datepicker );
|
||||
}
|
||||
} )( function( datepicker ) {
|
||||
"use strict";
|
||||
|
||||
datepicker.regional.be = {
|
||||
closeText: "Зачыніць",
|
||||
prevText: "←Папяр.",
|
||||
nextText: "Наст.→",
|
||||
currentText: "Сёньня",
|
||||
monthNames: [ "Студзень", "Люты", "Сакавік", "Красавік", "Травень", "Чэрвень",
|
||||
"Ліпень", "Жнівень", "Верасень", "Кастрычнік", "Лістапад", "Сьнежань" ],
|
||||
monthNamesShort: [ "Сту", "Лют", "Сак", "Кра", "Тра", "Чэр",
|
||||
"Ліп", "Жні", "Вер", "Кас", "Ліс", "Сьн" ],
|
||||
dayNames: [ "нядзеля", "панядзелак", "аўторак", "серада", "чацьвер", "пятніца", "субота" ],
|
||||
dayNamesShort: [ "ндз", "пнд", "аўт", "срд", "чцв", "птн", "сбт" ],
|
||||
dayNamesMin: [ "Нд", "Пн", "Аў", "Ср", "Чц", "Пт", "Сб" ],
|
||||
weekHeader: "Тд",
|
||||
dateFormat: "dd.mm.yy",
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: "" };
|
||||
datepicker.setDefaults( datepicker.regional.be );
|
||||
|
||||
return datepicker.regional.be;
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,41 @@
|
||||
/* Bulgarian initialisation for the jQuery UI date picker plugin. */
|
||||
/* Written by Stoyan Kyosev (http://svest.org). */
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "../widgets/datepicker" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery.datepicker );
|
||||
}
|
||||
} )( function( datepicker ) {
|
||||
"use strict";
|
||||
|
||||
datepicker.regional.bg = {
|
||||
closeText: "затвори",
|
||||
prevText: "<назад",
|
||||
nextText: "напред>",
|
||||
nextBigText: ">>",
|
||||
currentText: "днес",
|
||||
monthNames: [ "Януари", "Февруари", "Март", "Април", "Май", "Юни",
|
||||
"Юли", "Август", "Септември", "Октомври", "Ноември", "Декември" ],
|
||||
monthNamesShort: [ "Яну", "Фев", "Мар", "Апр", "Май", "Юни",
|
||||
"Юли", "Авг", "Сеп", "Окт", "Нов", "Дек" ],
|
||||
dayNames: [ "Неделя", "Понеделник", "Вторник", "Сряда", "Четвъртък", "Петък", "Събота" ],
|
||||
dayNamesShort: [ "Нед", "Пон", "Вто", "Сря", "Чет", "Пет", "Съб" ],
|
||||
dayNamesMin: [ "Не", "По", "Вт", "Ср", "Че", "Пе", "Съ" ],
|
||||
weekHeader: "Wk",
|
||||
dateFormat: "dd.mm.yy",
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: "" };
|
||||
datepicker.setDefaults( datepicker.regional.bg );
|
||||
|
||||
return datepicker.regional.bg;
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,40 @@
|
||||
/* Bosnian i18n for the jQuery UI date picker plugin. */
|
||||
/* Written by Kenan Konjo. */
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "../widgets/datepicker" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery.datepicker );
|
||||
}
|
||||
} )( function( datepicker ) {
|
||||
"use strict";
|
||||
|
||||
datepicker.regional.bs = {
|
||||
closeText: "Zatvori",
|
||||
prevText: "<",
|
||||
nextText: ">",
|
||||
currentText: "Danas",
|
||||
monthNames: [ "Januar", "Februar", "Mart", "April", "Maj", "Juni",
|
||||
"Juli", "August", "Septembar", "Oktobar", "Novembar", "Decembar" ],
|
||||
monthNamesShort: [ "Jan", "Feb", "Mar", "Apr", "Maj", "Jun",
|
||||
"Jul", "Aug", "Sep", "Okt", "Nov", "Dec" ],
|
||||
dayNames: [ "Nedelja", "Ponedeljak", "Utorak", "Srijeda", "Četvrtak", "Petak", "Subota" ],
|
||||
dayNamesShort: [ "Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub" ],
|
||||
dayNamesMin: [ "Ne", "Po", "Ut", "Sr", "Če", "Pe", "Su" ],
|
||||
weekHeader: "Wk",
|
||||
dateFormat: "dd.mm.yy",
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: "" };
|
||||
datepicker.setDefaults( datepicker.regional.bs );
|
||||
|
||||
return datepicker.regional.bs;
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,40 @@
|
||||
/* Inicialització en català per a l'extensió 'UI date picker' per jQuery. */
|
||||
/* Writers: (joan.leon@gmail.com). */
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "../widgets/datepicker" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery.datepicker );
|
||||
}
|
||||
} )( function( datepicker ) {
|
||||
"use strict";
|
||||
|
||||
datepicker.regional.ca = {
|
||||
closeText: "Tanca",
|
||||
prevText: "Anterior",
|
||||
nextText: "Següent",
|
||||
currentText: "Avui",
|
||||
monthNames: [ "gener", "febrer", "març", "abril", "maig", "juny",
|
||||
"juliol", "agost", "setembre", "octubre", "novembre", "desembre" ],
|
||||
monthNamesShort: [ "gen", "feb", "març", "abr", "maig", "juny",
|
||||
"jul", "ag", "set", "oct", "nov", "des" ],
|
||||
dayNames: [ "diumenge", "dilluns", "dimarts", "dimecres", "dijous", "divendres", "dissabte" ],
|
||||
dayNamesShort: [ "dg", "dl", "dt", "dc", "dj", "dv", "ds" ],
|
||||
dayNamesMin: [ "dg", "dl", "dt", "dc", "dj", "dv", "ds" ],
|
||||
weekHeader: "Set",
|
||||
dateFormat: "dd/mm/yy",
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: "" };
|
||||
datepicker.setDefaults( datepicker.regional.ca );
|
||||
|
||||
return datepicker.regional.ca;
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,40 @@
|
||||
/* Czech initialisation for the jQuery UI date picker plugin. */
|
||||
/* Written by Tomas Muller (tomas@tomas-muller.net). */
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "../widgets/datepicker" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery.datepicker );
|
||||
}
|
||||
} )( function( datepicker ) {
|
||||
"use strict";
|
||||
|
||||
datepicker.regional.cs = {
|
||||
closeText: "Zavřít",
|
||||
prevText: "<Dříve",
|
||||
nextText: "Později>",
|
||||
currentText: "Nyní",
|
||||
monthNames: [ "leden", "únor", "březen", "duben", "květen", "červen",
|
||||
"červenec", "srpen", "září", "říjen", "listopad", "prosinec" ],
|
||||
monthNamesShort: [ "led", "úno", "bře", "dub", "kvě", "čer",
|
||||
"čvc", "srp", "zář", "říj", "lis", "pro" ],
|
||||
dayNames: [ "neděle", "pondělí", "úterý", "středa", "čtvrtek", "pátek", "sobota" ],
|
||||
dayNamesShort: [ "ne", "po", "út", "st", "čt", "pá", "so" ],
|
||||
dayNamesMin: [ "ne", "po", "út", "st", "čt", "pá", "so" ],
|
||||
weekHeader: "Týd",
|
||||
dateFormat: "dd.mm.yy",
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: "" };
|
||||
datepicker.setDefaults( datepicker.regional.cs );
|
||||
|
||||
return datepicker.regional.cs;
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,48 @@
|
||||
/* Welsh/UK initialisation for the jQuery UI date picker plugin. */
|
||||
/* Written by William Griffiths. */
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "../widgets/datepicker" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery.datepicker );
|
||||
}
|
||||
} )( function( datepicker ) {
|
||||
"use strict";
|
||||
|
||||
datepicker.regional[ "cy-GB" ] = {
|
||||
closeText: "Done",
|
||||
prevText: "Prev",
|
||||
nextText: "Next",
|
||||
currentText: "Today",
|
||||
monthNames: [ "Ionawr", "Chwefror", "Mawrth", "Ebrill", "Mai", "Mehefin",
|
||||
"Gorffennaf", "Awst", "Medi", "Hydref", "Tachwedd", "Rhagfyr" ],
|
||||
monthNamesShort: [ "Ion", "Chw", "Maw", "Ebr", "Mai", "Meh",
|
||||
"Gor", "Aws", "Med", "Hyd", "Tac", "Rha" ],
|
||||
dayNames: [
|
||||
"Dydd Sul",
|
||||
"Dydd Llun",
|
||||
"Dydd Mawrth",
|
||||
"Dydd Mercher",
|
||||
"Dydd Iau",
|
||||
"Dydd Gwener",
|
||||
"Dydd Sadwrn"
|
||||
],
|
||||
dayNamesShort: [ "Sul", "Llu", "Maw", "Mer", "Iau", "Gwe", "Sad" ],
|
||||
dayNamesMin: [ "Su", "Ll", "Ma", "Me", "Ia", "Gw", "Sa" ],
|
||||
weekHeader: "Wy",
|
||||
dateFormat: "dd/mm/yy",
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: "" };
|
||||
datepicker.setDefaults( datepicker.regional[ "cy-GB" ] );
|
||||
|
||||
return datepicker.regional[ "cy-GB" ];
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,40 @@
|
||||
/* Danish initialisation for the jQuery UI date picker plugin. */
|
||||
/* Written by Jan Christensen ( deletestuff@gmail.com). */
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "../widgets/datepicker" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery.datepicker );
|
||||
}
|
||||
} )( function( datepicker ) {
|
||||
"use strict";
|
||||
|
||||
datepicker.regional.da = {
|
||||
closeText: "Luk",
|
||||
prevText: "<Forrige",
|
||||
nextText: "Næste>",
|
||||
currentText: "I dag",
|
||||
monthNames: [ "Januar", "Februar", "Marts", "April", "Maj", "Juni",
|
||||
"Juli", "August", "September", "Oktober", "November", "December" ],
|
||||
monthNamesShort: [ "Jan", "Feb", "Mar", "Apr", "Maj", "Jun",
|
||||
"Jul", "Aug", "Sep", "Okt", "Nov", "Dec" ],
|
||||
dayNames: [ "Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag" ],
|
||||
dayNamesShort: [ "Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør" ],
|
||||
dayNamesMin: [ "Sø", "Ma", "Ti", "On", "To", "Fr", "Lø" ],
|
||||
weekHeader: "Uge",
|
||||
dateFormat: "dd-mm-yy",
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: "" };
|
||||
datepicker.setDefaults( datepicker.regional.da );
|
||||
|
||||
return datepicker.regional.da;
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,41 @@
|
||||
/* German/Austrian initialisation for the jQuery UI date picker plugin. */
|
||||
/* Based on the de initialisation. */
|
||||
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "../widgets/datepicker" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery.datepicker );
|
||||
}
|
||||
} )( function( datepicker ) {
|
||||
"use strict";
|
||||
|
||||
datepicker.regional[ "de-AT" ] = {
|
||||
closeText: "Schließen",
|
||||
prevText: "<Zurück",
|
||||
nextText: "Vor>",
|
||||
currentText: "Heute",
|
||||
monthNames: [ "Jänner", "Februar", "März", "April", "Mai", "Juni",
|
||||
"Juli", "August", "September", "Oktober", "November", "Dezember" ],
|
||||
monthNamesShort: [ "Jän", "Feb", "Mär", "Apr", "Mai", "Jun",
|
||||
"Jul", "Aug", "Sep", "Okt", "Nov", "Dez" ],
|
||||
dayNames: [ "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag" ],
|
||||
dayNamesShort: [ "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa" ],
|
||||
dayNamesMin: [ "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa" ],
|
||||
weekHeader: "KW",
|
||||
dateFormat: "dd.mm.yy",
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: "" };
|
||||
datepicker.setDefaults( datepicker.regional[ "de-AT" ] );
|
||||
|
||||
return datepicker.regional[ "de-AT" ];
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,40 @@
|
||||
/* German initialisation for the jQuery UI date picker plugin. */
|
||||
/* Written by Milian Wolff (mail@milianw.de). */
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "../widgets/datepicker" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery.datepicker );
|
||||
}
|
||||
} )( function( datepicker ) {
|
||||
"use strict";
|
||||
|
||||
datepicker.regional.de = {
|
||||
closeText: "Schließen",
|
||||
prevText: "<Zurück",
|
||||
nextText: "Vor>",
|
||||
currentText: "Heute",
|
||||
monthNames: [ "Januar", "Februar", "März", "April", "Mai", "Juni",
|
||||
"Juli", "August", "September", "Oktober", "November", "Dezember" ],
|
||||
monthNamesShort: [ "Jan", "Feb", "Mär", "Apr", "Mai", "Jun",
|
||||
"Jul", "Aug", "Sep", "Okt", "Nov", "Dez" ],
|
||||
dayNames: [ "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag" ],
|
||||
dayNamesShort: [ "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa" ],
|
||||
dayNamesMin: [ "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa" ],
|
||||
weekHeader: "KW",
|
||||
dateFormat: "dd.mm.yy",
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: "" };
|
||||
datepicker.setDefaults( datepicker.regional.de );
|
||||
|
||||
return datepicker.regional.de;
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,40 @@
|
||||
/* Greek (el) initialisation for the jQuery UI date picker plugin. */
|
||||
/* Written by Alex Cicovic (http://www.alexcicovic.com) */
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "../widgets/datepicker" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery.datepicker );
|
||||
}
|
||||
} )( function( datepicker ) {
|
||||
"use strict";
|
||||
|
||||
datepicker.regional.el = {
|
||||
closeText: "Κλείσιμο",
|
||||
prevText: "Προηγούμενος",
|
||||
nextText: "Επόμενος",
|
||||
currentText: "Σήμερα",
|
||||
monthNames: [ "Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος",
|
||||
"Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος" ],
|
||||
monthNamesShort: [ "Ιαν", "Φεβ", "Μαρ", "Απρ", "Μαι", "Ιουν",
|
||||
"Ιουλ", "Αυγ", "Σεπ", "Οκτ", "Νοε", "Δεκ" ],
|
||||
dayNames: [ "Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο" ],
|
||||
dayNamesShort: [ "Κυρ", "Δευ", "Τρι", "Τετ", "Πεμ", "Παρ", "Σαβ" ],
|
||||
dayNamesMin: [ "Κυ", "Δε", "Τρ", "Τε", "Πε", "Πα", "Σα" ],
|
||||
weekHeader: "Εβδ",
|
||||
dateFormat: "dd/mm/yy",
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: "" };
|
||||
datepicker.setDefaults( datepicker.regional.el );
|
||||
|
||||
return datepicker.regional.el;
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,40 @@
|
||||
/* English/Australia initialisation for the jQuery UI date picker plugin. */
|
||||
/* Based on the en-GB initialisation. */
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "../widgets/datepicker" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery.datepicker );
|
||||
}
|
||||
} )( function( datepicker ) {
|
||||
"use strict";
|
||||
|
||||
datepicker.regional[ "en-AU" ] = {
|
||||
closeText: "Done",
|
||||
prevText: "Prev",
|
||||
nextText: "Next",
|
||||
currentText: "Today",
|
||||
monthNames: [ "January", "February", "March", "April", "May", "June",
|
||||
"July", "August", "September", "October", "November", "December" ],
|
||||
monthNamesShort: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
||||
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ],
|
||||
dayNames: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ],
|
||||
dayNamesShort: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ],
|
||||
dayNamesMin: [ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" ],
|
||||
weekHeader: "Wk",
|
||||
dateFormat: "dd/mm/yy",
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: "" };
|
||||
datepicker.setDefaults( datepicker.regional[ "en-AU" ] );
|
||||
|
||||
return datepicker.regional[ "en-AU" ];
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,40 @@
|
||||
/* English/UK initialisation for the jQuery UI date picker plugin. */
|
||||
/* Written by Stuart. */
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "../widgets/datepicker" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery.datepicker );
|
||||
}
|
||||
} )( function( datepicker ) {
|
||||
"use strict";
|
||||
|
||||
datepicker.regional[ "en-GB" ] = {
|
||||
closeText: "Done",
|
||||
prevText: "Prev",
|
||||
nextText: "Next",
|
||||
currentText: "Today",
|
||||
monthNames: [ "January", "February", "March", "April", "May", "June",
|
||||
"July", "August", "September", "October", "November", "December" ],
|
||||
monthNamesShort: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
||||
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ],
|
||||
dayNames: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ],
|
||||
dayNamesShort: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ],
|
||||
dayNamesMin: [ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" ],
|
||||
weekHeader: "Wk",
|
||||
dateFormat: "dd/mm/yy",
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: "" };
|
||||
datepicker.setDefaults( datepicker.regional[ "en-GB" ] );
|
||||
|
||||
return datepicker.regional[ "en-GB" ];
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,40 @@
|
||||
/* English/New Zealand initialisation for the jQuery UI date picker plugin. */
|
||||
/* Based on the en-GB initialisation. */
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "../widgets/datepicker" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery.datepicker );
|
||||
}
|
||||
} )( function( datepicker ) {
|
||||
"use strict";
|
||||
|
||||
datepicker.regional[ "en-NZ" ] = {
|
||||
closeText: "Done",
|
||||
prevText: "Prev",
|
||||
nextText: "Next",
|
||||
currentText: "Today",
|
||||
monthNames: [ "January", "February", "March", "April", "May", "June",
|
||||
"July", "August", "September", "October", "November", "December" ],
|
||||
monthNamesShort: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
||||
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ],
|
||||
dayNames: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ],
|
||||
dayNamesShort: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ],
|
||||
dayNamesMin: [ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" ],
|
||||
weekHeader: "Wk",
|
||||
dateFormat: "dd/mm/yy",
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: "" };
|
||||
datepicker.setDefaults( datepicker.regional[ "en-NZ" ] );
|
||||
|
||||
return datepicker.regional[ "en-NZ" ];
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,40 @@
|
||||
/* Esperanto initialisation for the jQuery UI date picker plugin. */
|
||||
/* Written by Olivier M. (olivierweb@ifrance.com). */
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "../widgets/datepicker" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery.datepicker );
|
||||
}
|
||||
} )( function( datepicker ) {
|
||||
"use strict";
|
||||
|
||||
datepicker.regional.eo = {
|
||||
closeText: "Fermi",
|
||||
prevText: "<Anta",
|
||||
nextText: "Sekv>",
|
||||
currentText: "Nuna",
|
||||
monthNames: [ "Januaro", "Februaro", "Marto", "Aprilo", "Majo", "Junio",
|
||||
"Julio", "Aŭgusto", "Septembro", "Oktobro", "Novembro", "Decembro" ],
|
||||
monthNamesShort: [ "Jan", "Feb", "Mar", "Apr", "Maj", "Jun",
|
||||
"Jul", "Aŭg", "Sep", "Okt", "Nov", "Dec" ],
|
||||
dayNames: [ "Dimanĉo", "Lundo", "Mardo", "Merkredo", "Ĵaŭdo", "Vendredo", "Sabato" ],
|
||||
dayNamesShort: [ "Dim", "Lun", "Mar", "Mer", "Ĵaŭ", "Ven", "Sab" ],
|
||||
dayNamesMin: [ "Di", "Lu", "Ma", "Me", "Ĵa", "Ve", "Sa" ],
|
||||
weekHeader: "Sb",
|
||||
dateFormat: "dd/mm/yy",
|
||||
firstDay: 0,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: "" };
|
||||
datepicker.setDefaults( datepicker.regional.eo );
|
||||
|
||||
return datepicker.regional.eo;
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,40 @@
|
||||
/* Inicialización en español para la extensión 'UI date picker' para jQuery. */
|
||||
/* Traducido por Vester (xvester@gmail.com). */
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "../widgets/datepicker" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery.datepicker );
|
||||
}
|
||||
} )( function( datepicker ) {
|
||||
"use strict";
|
||||
|
||||
datepicker.regional.es = {
|
||||
closeText: "Cerrar",
|
||||
prevText: "<Ant",
|
||||
nextText: "Sig>",
|
||||
currentText: "Hoy",
|
||||
monthNames: [ "enero", "febrero", "marzo", "abril", "mayo", "junio",
|
||||
"julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre" ],
|
||||
monthNamesShort: [ "ene", "feb", "mar", "abr", "may", "jun",
|
||||
"jul", "ago", "sep", "oct", "nov", "dic" ],
|
||||
dayNames: [ "domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado" ],
|
||||
dayNamesShort: [ "dom", "lun", "mar", "mié", "jue", "vie", "sáb" ],
|
||||
dayNamesMin: [ "D", "L", "M", "X", "J", "V", "S" ],
|
||||
weekHeader: "Sm",
|
||||
dateFormat: "dd/mm/yy",
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: "" };
|
||||
datepicker.setDefaults( datepicker.regional.es );
|
||||
|
||||
return datepicker.regional.es;
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,48 @@
|
||||
/* Estonian initialisation for the jQuery UI date picker plugin. */
|
||||
/* Written by Mart Sõmermaa (mrts.pydev at gmail com). */
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "../widgets/datepicker" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery.datepicker );
|
||||
}
|
||||
} )( function( datepicker ) {
|
||||
"use strict";
|
||||
|
||||
datepicker.regional.et = {
|
||||
closeText: "Sulge",
|
||||
prevText: "Eelnev",
|
||||
nextText: "Järgnev",
|
||||
currentText: "Täna",
|
||||
monthNames: [ "Jaanuar", "Veebruar", "Märts", "Aprill", "Mai", "Juuni",
|
||||
"Juuli", "August", "September", "Oktoober", "November", "Detsember" ],
|
||||
monthNamesShort: [ "Jaan", "Veebr", "Märts", "Apr", "Mai", "Juuni",
|
||||
"Juuli", "Aug", "Sept", "Okt", "Nov", "Dets" ],
|
||||
dayNames: [
|
||||
"Pühapäev",
|
||||
"Esmaspäev",
|
||||
"Teisipäev",
|
||||
"Kolmapäev",
|
||||
"Neljapäev",
|
||||
"Reede",
|
||||
"Laupäev"
|
||||
],
|
||||
dayNamesShort: [ "Pühap", "Esmasp", "Teisip", "Kolmap", "Neljap", "Reede", "Laup" ],
|
||||
dayNamesMin: [ "P", "E", "T", "K", "N", "R", "L" ],
|
||||
weekHeader: "näd",
|
||||
dateFormat: "dd.mm.yy",
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: "" };
|
||||
datepicker.setDefaults( datepicker.regional.et );
|
||||
|
||||
return datepicker.regional.et;
|
||||
|
||||
} );
|
||||
@@ -0,0 +1,39 @@
|
||||
/* Karrikas-ek itzulia (karrikas@karrikas.com) */
|
||||
( function( factory ) {
|
||||
"use strict";
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
|
||||
// AMD. Register as an anonymous module.
|
||||
define( [ "../widgets/datepicker" ], factory );
|
||||
} else {
|
||||
|
||||
// Browser globals
|
||||
factory( jQuery.datepicker );
|
||||
}
|
||||
} )( function( datepicker ) {
|
||||
"use strict";
|
||||
|
||||
datepicker.regional.eu = {
|
||||
closeText: "Egina",
|
||||
prevText: "<Aur",
|
||||
nextText: "Hur>",
|
||||
currentText: "Gaur",
|
||||
monthNames: [ "urtarrila", "otsaila", "martxoa", "apirila", "maiatza", "ekaina",
|
||||
"uztaila", "abuztua", "iraila", "urria", "azaroa", "abendua" ],
|
||||
monthNamesShort: [ "urt.", "ots.", "mar.", "api.", "mai.", "eka.",
|
||||
"uzt.", "abu.", "ira.", "urr.", "aza.", "abe." ],
|
||||
dayNames: [ "igandea", "astelehena", "asteartea", "asteazkena", "osteguna", "ostirala", "larunbata" ],
|
||||
dayNamesShort: [ "ig.", "al.", "ar.", "az.", "og.", "ol.", "lr." ],
|
||||
dayNamesMin: [ "ig", "al", "ar", "az", "og", "ol", "lr" ],
|
||||
weekHeader: "As",
|
||||
dateFormat: "yy-mm-dd",
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: "" };
|
||||
datepicker.setDefaults( datepicker.regional.eu );
|
||||
|
||||
return datepicker.regional.eu;
|
||||
|
||||
} );
|
||||