/*! * DevExtreme * Version: 14.1.9-pre * Build date: Nov 7, 2014 * * Copyright (c) 2012 - 2014 Developer Express Inc. ALL RIGHTS RESERVED * EULA: https://www.devexpress.com/Support/EULAs/DevExtreme.xml */ "use strict"; if (!window.DevExpress) { /*! Module core, file devexpress.js */ (function($, global, undefined) { (function checkjQueryVersion(version) { version = version.split("."); if (version[0] < 1 || version[0] == 1 && version[1] < 10) throw Error("Your version of jQuery is too old. Please upgrade jQuery to 1.10.0 or later."); })($.fn.jquery); var Class = function() { var wrapOverridden = function(baseProto, methodName, method) { return function() { var prevCallBase = this.callBase; this.callBase = baseProto[methodName]; try { return method.apply(this, arguments) } finally { this.callBase = prevCallBase } } }; var clonePrototype = function(obj) { var func = function(){}; func.prototype = obj.prototype; return new func }; var classImpl = function(){}; var redefine = function(members) { var that = this; if (!members) return that; var memberNames = $.map(members, function(_, k) { return k }); $.each(["toString", "toLocaleString", "valueOf"], function() { if (members[this]) memberNames.push(this) }); $.each(memberNames, function() { var overridden = $.isFunction(that.prototype[this]) && $.isFunction(members[this]); that.prototype[this] = overridden ? wrapOverridden(that.parent.prototype, this, members[this]) : members[this] }); return that }; var include = function() { var classObj = this; $.each(arguments, function() { if (this.ctor) classObj._includedCtors.push(this.ctor); for (var name in this) { if (name === "ctor") continue; if (name in classObj.prototype) throw Error("Member name collision: " + name); classObj.prototype[name] = this[name] } }); return classObj }; var subclassOf = function(parentClass) { if (this.parent === parentClass) return true; if (!this.parent || !this.parent.subclassOf) return false; return this.parent.subclassOf(parentClass) }; classImpl.inherit = function(members) { var inheritor = function() { if (!this || this === global || typeof this.constructor !== "function") throw Error("A class must be instantiated using the 'new' keyword"); var instance = this, ctor = instance.ctor; if (ctor) ctor.apply(instance, arguments); $.each(instance.constructor._includedCtors, function() { this.call(instance) }) }; inheritor.prototype = clonePrototype(this); inheritor.inherit = this.inherit; inheritor.redefine = redefine; inheritor.include = include; inheritor.subclassOf = subclassOf; inheritor.parent = this; inheritor._includedCtors = this._includedCtors ? this._includedCtors.slice(0) : []; inheritor.prototype.constructor = inheritor; inheritor.redefine(members); return inheritor }; return classImpl }(); function createQueue(discardPendingTasks) { var _tasks = [], _busy = false; function exec() { while (_tasks.length) { _busy = true; var task = _tasks.shift(), result = task(); if (result === undefined) continue; if (result.then) { $.when(result).always(exec); return } throw Error("Queued task returned unexpected result"); } _busy = false } function add(task, removeTaskCallback) { if (!discardPendingTasks) _tasks.push(task); else { if (_tasks[0] && removeTaskCallback) removeTaskCallback(_tasks[0]); _tasks = [task] } if (!_busy) exec() } function busy() { return _busy } return { add: add, busy: busy } } var parseUrl = function() { var a = document.createElement("a"), props = ["protocol", "hostname", "port", "pathname", "search", "hash"]; var normalizePath = function(value) { if (value.charAt(0) !== "/") value = "/" + value; return value }; return function(url) { a.href = url; var result = {}; $.each(props, function() { result[this] = a[this] }); result.pathname = normalizePath(result.pathname); return result } }(); global.DevExpress = global.DevExpress || {}; var enqueueAsync = function(task) { var deferred = $.Deferred(); setTimeout(function() { deferred.resolve(task()) }, 60); return deferred }; var hideTopOverlayCallback = function() { var callbacks = []; return { add: function(callback) { var indexOfCallback = $.inArray(callback, callbacks); if (indexOfCallback === -1) callbacks.push(callback) }, remove: function(callback) { var indexOfCallback = $.inArray(callback, callbacks); if (indexOfCallback !== -1) callbacks.splice(indexOfCallback, 1) }, fire: function() { var callback = callbacks.pop(), result = !!callback; if (result) callback(); return result }, hasCallback: function() { return callbacks.length > 0 }, reset: function() { callbacks = [] } } }(); var overlayTargetContainer = function() { var defaultTargetContainer = "body"; return function(targetContainer) { if (arguments.length) defaultTargetContainer = targetContainer; return defaultTargetContainer } }(); $.extend(global.DevExpress, { VERSION: "14.1.8", abstract: function() { throw Error("Not implemented"); }, Class: Class, createQueue: createQueue, enqueue: createQueue().add, enqueueAsync: enqueueAsync, parseUrl: parseUrl, hideTopOverlayCallback: hideTopOverlayCallback, hardwareBackButton: $.Callbacks(), overlayTargetContainer: overlayTargetContainer, rtlEnabled: false }) })(jQuery, this); /*! Module core, file inflector.js */ (function($, DX, undefined) { var _normalize = function(text) { if (text === undefined || text === null) return ""; return String(text) }; var _ucfirst = function(text) { return _normalize(text).charAt(0).toUpperCase() + text.substr(1) }; var _chop = function(text) { return _normalize(text).replace(/([a-z\d])([A-Z])/g, "$1 $2").split(/[\s_-]+/) }; var dasherize = function(text) { return $.map(_chop(text), function(p) { return p.toLowerCase() }).join("-") }; var underscore = function(text) { return dasherize(text).replace(/-/g, "_") }; var camelize = function(text, upperFirst) { return $.map(_chop(text), function(p, i) { p = p.toLowerCase(); if (upperFirst || i > 0) p = _ucfirst(p); return p }).join("") }; var humanize = function(text) { return _ucfirst(dasherize(text).replace(/-/g, " ")) }; var titleize = function(text) { return $.map(_chop(text), function(p) { return _ucfirst(p.toLowerCase()) }).join(" ") }; DX.inflector = { dasherize: dasherize, camelize: camelize, humanize: humanize, titleize: titleize, underscore: underscore } })(jQuery, DevExpress); /*! Module core, file utils.common.js */ (function($, DX, undefined) { var isDefined = function(object) { return object !== null && object !== undefined }; var isString = function(object) { return $.type(object) === 'string' }; var isNumber = function(object) { return typeof object === "number" && isFinite(object) || $.isNumeric(object) }; var isObject = function(object) { return $.type(object) === 'object' }; var isArray = function(object) { return $.type(object) === 'array' }; var isDate = function(object) { return $.type(object) === 'date' }; var isFunction = function(object) { return $.type(object) === 'function' }; var isExponential = function(value) { return isNumber(value) && value.toString().indexOf('e') !== -1 }; var extendFromObject = function(target, source, overrideExistingValues) { target = target || {}; for (var prop in source) if (source.hasOwnProperty(prop)) { var value = source[prop]; if (!(prop in target) || overrideExistingValues) target[prop] = value } return target }; var clone = function() { function Clone(){} return function(obj) { Clone.prototype = obj; return new Clone } }(); var executeAsync = function(action, context) { var deferred = $.Deferred(), normalizedContext = context || this; setTimeout(function() { var result = action.call(normalizedContext); if (result && result.done && $.isFunction(result.done)) result.done(function() { deferred.resolveWith(normalizedContext) }); else deferred.resolveWith(normalizedContext) }, 0); return deferred.promise() }; var stringFormat = function() { var s = arguments[0]; for (var i = 0; i < arguments.length - 1; i++) { var reg = new RegExp("\\{" + i + "\\}", "gm"); s = s.replace(reg, arguments[i + 1]) } return s }; var findBestMatches = function(targetFilter, items, mapFn) { var bestMatches = [], maxMatchCount = 0; $.each(items, function(index, itemSrc) { var matchCount = 0, item = mapFn ? mapFn(itemSrc) : itemSrc; $.each(targetFilter, function(paramName) { var value = item[paramName]; if (value === undefined) return; if (value === targetFilter[paramName]) { matchCount++; return } matchCount = -1; return false }); if (matchCount < maxMatchCount) return; if (matchCount > maxMatchCount) { bestMatches.length = 0; maxMatchCount = matchCount } bestMatches.push(itemSrc) }); return bestMatches }; var preg_quote = function(str) { return (str + "").replace(/([\+\*\?\\\.\[\^\]\$\(\)\{\}\>\<\|\=\!\:])/g, "\\$1") }; var replaceAll = function(text, searchToken, replacementToken) { return text.replace(new RegExp("(" + preg_quote(searchToken) + ")", "gi"), replacementToken) }; var splitPair = function(raw) { switch (typeof raw) { case"string": return raw.split(/\s+/, 2); case"object": return [raw.x || raw.h, raw.y || raw.v]; case"number": return [raw]; default: return raw } }; var stringPairToObject = function(raw) { var pair = splitPair(raw), x = parseInt(pair && pair[0], 10), y = parseInt(pair && pair[1], 10); if (!isFinite(x)) x = 0; if (!isFinite(y)) y = x; return { x: x, y: y } }; function icontains(elem, text) { var result = false; $.each($(elem).contents(), function(index, content) { if (content.nodeType === 3 && (content.textContent || content.nodeValue || "").toLowerCase().indexOf((text || "").toLowerCase()) > -1) { result = true; return false } }); return result } $.expr[":"].dxicontains = $.expr.createPseudo(function(text) { return function(elem) { return icontains(elem, text) } }); function deepExtendArraySafe(target, changes) { var prevValue, newValue; for (var name in changes) { prevValue = target[name]; newValue = changes[name]; if (target === newValue) continue; if ($.isPlainObject(newValue) && !(newValue instanceof $.Event)) target[name] = deepExtendArraySafe($.isPlainObject(prevValue) ? prevValue : {}, newValue); else if (newValue !== undefined) target[name] = newValue } return target } function unwrapObservable(value) { if (DX.support.hasKo) return ko.utils.unwrapObservable(value); return value } DX.utils = { isDefined: isDefined, isString: isString, isNumber: isNumber, isObject: isObject, isArray: isArray, isDate: isDate, isFunction: isFunction, isExponential: isExponential, extendFromObject: extendFromObject, clone: clone, executeAsync: executeAsync, stringFormat: stringFormat, findBestMatches: findBestMatches, replaceAll: replaceAll, deepExtendArraySafe: deepExtendArraySafe, splitPair: splitPair, stringPairToObject: stringPairToObject, unwrapObservable: unwrapObservable } })(jQuery, DevExpress); /*! Module core, file utils.console.js */ (function($, DX, undefined) { var logger = function() { var console = window.console; function info(text) { if (!console || !$.isFunction(console.info)) return; console.info(text) } function warn(text) { if (!console || !$.isFunction(console.warn)) return; console.warn(text) } function error(text) { if (!console || !$.isFunction(console.error)) return; console.error(text) } return { info: info, warn: warn, error: error } }(); var debug = function() { function assert(condition, message) { if (!condition) throw new Error(message); } function assertParam(parameter, message) { assert(parameter !== null && parameter !== undefined, message) } return { assert: assert, assertParam: assertParam } }(); $.extend(DX.utils, { logger: logger, debug: debug }) })(jQuery, DevExpress); /*! Module core, file utils.math.js */ (function($, DX, undefined) { var PI = Math.PI, LN10 = Math.LN10; var cos = Math.cos, sin = Math.sin, abs = Math.abs, log = Math.log, floor = Math.floor, ceil = Math.ceil, max = Math.max, min = Math.min, isNaN = window.isNaN, Number = window.Number, NaN = window.NaN; var isNumber = DX.utils.isNumber, isExponential = DX.utils.isExponential; var getPrecision = function(value) { var stringFraction, stringValue = value.toString(), pointIndex = stringValue.indexOf('.'), startIndex, precision; if (isExponential(value)) { precision = getDecimalOrder(value); if (precision < 0) return Math.abs(precision); else return 0 } if (pointIndex !== -1) { startIndex = pointIndex + 1; stringFraction = stringValue.substring(startIndex, startIndex + 20); return stringFraction.length } return 0 }; var getLog = function(value, base) { if (!value) return 0; return Math.log(value) / Math.log(base) }; var raiseTo = function(power, base) { return Math.pow(base, power) }; var sign = function(value) { if (value === 0) return 0; return value / abs(value) }; var normalizeAngle = function(angle) { return (angle % 360 + 360) % 360 }; var convertAngleToRendererSpace = function(angle) { return 90 - angle }; var degreesToRadians = function(value) { return PI * value / 180 }; var getCosAndSin = function(angle) { var angleInRadians = degreesToRadians(angle); return { cos: cos(angleInRadians), sin: sin(angleInRadians) } }; var DECIMAL_ORDER_THRESHOLD = 1E-14; var getDecimalOrder = function(number) { var n = abs(number), cn; if (!isNaN(n)) { if (n > 0) { n = log(n) / LN10; cn = ceil(n); return cn - n < DECIMAL_ORDER_THRESHOLD ? cn : floor(n) } return 0 } return NaN }; var getAppropriateFormat = function(start, end, count) { var order = max(getDecimalOrder(start), getDecimalOrder(end)), precision = -getDecimalOrder(abs(end - start) / count), format; if (!isNaN(order) && !isNaN(precision)) { if (abs(order) <= 4) { format = 'fixedPoint'; precision < 0 && (precision = 0); precision > 4 && (precision = 4) } else { format = 'exponential'; precision += order - 1; precision > 3 && (precision = 3) } return { format: format, precision: precision } } return null }; var getFraction = function(value) { var valueString, dotIndex; if (isNumber(value)) { valueString = value.toString(); dotIndex = valueString.indexOf('.'); if (dotIndex >= 0) if (isExponential(value)) return valueString.substr(dotIndex + 1, valueString.indexOf('e') - dotIndex - 1); else { valueString = value.toFixed(20); return valueString.substr(dotIndex + 1, valueString.length - dotIndex + 1) } } return '' }; var getSignificantDigitPosition = function(value) { var fraction = getFraction(value), i; if (fraction) for (i = 0; i < fraction.length; i++) if (fraction.charAt(i) !== '0') return i + 1; return 0 }; var adjustValue = function(value) { var fraction = getFraction(value), nextValue, i; if (fraction) for (i = 1; i <= fraction.length; i++) { nextValue = roundValue(value, i); if (nextValue !== 0 && fraction[i - 2] && fraction[i - 1] && fraction[i - 2] === fraction[i - 1]) return nextValue } return value }; var roundValue = function(value, precision) { if (precision > 20) precision = 20; if (isNumber(value)) if (isExponential(value)) return Number(value.toExponential(precision)); else return Number(value.toFixed(precision)) }; var applyPrecisionByMinDelta = function(min, delta, value) { var minPrecision = getPrecision(min), deltaPrecision = getPrecision(delta); return roundValue(value, minPrecision < deltaPrecision ? deltaPrecision : minPrecision) }; $.extend(DX.utils, { getLog: getLog, raiseTo: raiseTo, sign: sign, normalizeAngle: normalizeAngle, convertAngleToRendererSpace: convertAngleToRendererSpace, degreesToRadians: degreesToRadians, getCosAndSin: getCosAndSin, getDecimalOrder: getDecimalOrder, getAppropriateFormat: getAppropriateFormat, getFraction: getFraction, adjustValue: adjustValue, roundValue: roundValue, applyPrecisionByMinDelta: applyPrecisionByMinDelta, getSignificantDigitPosition: getSignificantDigitPosition }); DX.utils.getPrecision = getPrecision })(jQuery, DevExpress); /*! Module core, file utils.date.js */ (function($, DX, undefined) { var isObject = DX.utils.isObject, isString = DX.utils.isString, isDate = DX.utils.isDate, isDefined = DX.utils.isDefined; var dateUnitIntervals = ['millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'quarter', 'year']; var addSubValues = function(value1, value2, isSub) { return value1 + (isSub ? -1 : 1) * value2 }; var toMilliseconds = function(value) { switch (value) { case'millisecond': return 1; case'second': return toMilliseconds('millisecond') * 1000; case'minute': return toMilliseconds('second') * 60; case'hour': return toMilliseconds('minute') * 60; case'day': return toMilliseconds('hour') * 24; case'week': return toMilliseconds('day') * 7; case'month': return toMilliseconds('day') * 30; case'quarter': return toMilliseconds('month') * 3; case'year': return toMilliseconds('day') * 365; default: return 0 } }; function parseISO8601(isoString) { var result = new Date(0); var chunks = isoString.replace("Z", "").split("T"), date = String(chunks[0]).split("-"), time = String(chunks[1]).split(":"); var year, month, day, hours, minutes, seconds, milliseconds; year = Number(date[0]); month = Number(date[1]) - 1; day = Number(date[2]); result.setDate(day); result.setMonth(month); result.setFullYear(year); if (time.length) { hours = Number(time[0]); minutes = Number(time[1]); seconds = Number(String(time[2]).split(".")[0]); milliseconds = Number(String(time[2]).split(".")[1]) || 0; result.setHours(hours); result.setMinutes(minutes); result.setSeconds(seconds); result.setMilliseconds(milliseconds) } return result } function formatISO8601(date) { function pad(n) { if (n < 10) return "0".concat(n); return String(n) } return [date.getFullYear(), "-", pad(date.getMonth() + 1), "-", pad(date.getDate()), "T", pad(date.getHours()), ":", pad(date.getMinutes()), ":", pad(date.getSeconds()), "Z"].join("") } var convertMillisecondsToDateUnits = function(value) { var i, dateUnitCount, dateUnitInterval, dateUnitIntervals = ['millisecond', 'second', 'minute', 'hour', 'day', 'month', 'year'], result = {}; for (i = dateUnitIntervals.length - 1; i >= 0; i--) { dateUnitInterval = dateUnitIntervals[i]; dateUnitCount = Math.floor(value / toMilliseconds(dateUnitInterval)); if (dateUnitCount > 0) { result[dateUnitInterval + 's'] = dateUnitCount; value -= convertDateUnitToMilliseconds(dateUnitInterval, dateUnitCount) } } return result }; var convertDateTickIntervalToMilliseconds = function(tickInterval) { var milliseconds = 0; if (isObject(tickInterval)) $.each(tickInterval, function(key, value) { milliseconds += convertDateUnitToMilliseconds(key.substr(0, key.length - 1), value) }); if (isString(tickInterval)) milliseconds = convertDateUnitToMilliseconds(tickInterval, 1); return milliseconds }; var convertDateUnitToMilliseconds = function(dateUnit, count) { return toMilliseconds(dateUnit) * count }; var getDateUnitInterval = function(tickInterval) { var maxInterval = -1, i; if (isString(tickInterval)) return tickInterval; if (isObject(tickInterval)) { $.each(tickInterval, function(key, value) { for (i = 0; i < dateUnitIntervals.length; i++) if (value && (key === dateUnitIntervals[i] + 's' || key === dateUnitIntervals[i]) && maxInterval < i) maxInterval = i }); return dateUnitIntervals[maxInterval] } return '' }; var correctDateWithUnitBeginning = function(date, dateInterval) { var dayMonth, firstQuarterMonth, dateUnitInterval = getDateUnitInterval(dateInterval); switch (dateUnitInterval) { case'second': date.setMilliseconds(0); break; case'minute': date.setSeconds(0, 0); break; case'hour': date.setMinutes(0, 0, 0); break; case'year': date.setMonth(0); case'month': date.setDate(1); case'day': date.setHours(0, 0, 0, 0); break; case'week': dayMonth = date.getDate(); if (date.getDay() !== 0) dayMonth += 7 - date.getDay(); date.setDate(dayMonth); date.setHours(0, 0, 0, 0); break; case'quarter': firstQuarterMonth = DX.formatHelper.getFirstQuarterMonth(date.getMonth()); if (date.getMonth() !== firstQuarterMonth) date.setMonth(firstQuarterMonth); date.setDate(1); date.setHours(0, 0, 0, 0); break } }; var getDatesDifferences = function(date1, date2) { var differences, counter = 0; differences = { year: date1.getFullYear() !== date2.getFullYear(), month: date1.getMonth() !== date2.getMonth(), day: date1.getDate() !== date2.getDate(), hour: date1.getHours() !== date2.getHours(), minute: date1.getMinutes() !== date2.getMinutes(), second: date1.getSeconds() !== date2.getSeconds() }; $.each(differences, function(key, value) { if (value) counter++ }); differences.count = counter; return differences }; var addInterval = function(value, interval, isNegative) { var result = null, intervalObject; if (isDate(value)) { intervalObject = isString(interval) ? getDateIntervalByString(interval.toLowerCase()) : interval; result = new Date(value.getTime()); if (intervalObject.years) result.setFullYear(addSubValues(result.getFullYear(), intervalObject.years, isNegative)); if (intervalObject.quarters) result.setMonth(addSubValues(result.getMonth(), 3 * intervalObject.quarters, isNegative)); if (intervalObject.months) result.setMonth(addSubValues(result.getMonth(), intervalObject.months, isNegative)); if (intervalObject.weeks) result.setDate(addSubValues(result.getDate(), 7 * intervalObject.weeks, isNegative)); if (intervalObject.days) result.setDate(addSubValues(result.getDate(), intervalObject.days, isNegative)); if (intervalObject.hours) result.setHours(addSubValues(result.getHours(), intervalObject.hours, isNegative)); if (intervalObject.minutes) result.setMinutes(addSubValues(result.getMinutes(), intervalObject.minutes, isNegative)); if (intervalObject.seconds) result.setSeconds(addSubValues(result.getSeconds(), intervalObject.seconds, isNegative)); if (intervalObject.milliseconds) result.setMilliseconds(addSubValues(value.getMilliseconds(), intervalObject.milliseconds, isNegative)) } else result = addSubValues(value, interval, isNegative); return result }; var getDateIntervalByString = function(intervalString) { var result = {}; switch (intervalString) { case'year': result.years = 1; break; case'month': result.months = 1; break; case'quarter': result.months = 3; break; case'week': result.days = 7; break; case'day': result.days = 1; break; case'hour': result.hours = 1; break; case'minute': result.minutes = 1; break; case'second': result.seconds = 1; break; case'millisecond': result.milliseconds = 1; break } return result }; var sameMonthAndYear = function(date1, date2) { return date1 && date2 && date1.getFullYear() === date2.getFullYear() && date1.getMonth() === date2.getMonth() }; var getFirstMonthDate = function(date) { return new Date(date.getFullYear(), date.getMonth(), 1) }; var dateInRange = function(date, min, max) { return normalizeDate(date, min, max) === date }; var normalizeDate = function(date, min, max) { var normalizedDate = date; if (isDefined(min) && date < min) normalizedDate = min; if (isDefined(max) && date > max) normalizedDate = max; return normalizedDate }; var getPower = function(value) { return value.toExponential().split("e")[1] }; $.extend(DX.utils, { dateUnitIntervals: dateUnitIntervals, parseIso8601Date: parseISO8601, formatIso8601Date: formatISO8601, convertMillisecondsToDateUnits: convertMillisecondsToDateUnits, convertDateTickIntervalToMilliseconds: convertDateTickIntervalToMilliseconds, convertDateUnitToMilliseconds: convertDateUnitToMilliseconds, getDateUnitInterval: getDateUnitInterval, getDatesDifferences: getDatesDifferences, correctDateWithUnitBeginning: correctDateWithUnitBeginning, addInterval: addInterval, getDateIntervalByString: getDateIntervalByString, sameMonthAndYear: sameMonthAndYear, getFirstMonthDate: getFirstMonthDate, dateInRange: dateInRange, normalizeDate: normalizeDate, getPower: getPower }) })(jQuery, DevExpress); /*! Module core, file utils.dom.js */ (function($, DX, undefined) { var IOS_APP_BAR_HEIGHT = "20px"; var timeRedrawOnResize = 100; var createResizeHandler = function(callback) { var $window = $(window), timeout; var debug_callback = arguments[1]; var handler = function() { var width = $window.width(), height = $window.height(); clearTimeout(timeout); timeout = setTimeout(function() { $window.width() === width && $window.height() === height && callback(); debug_callback && debug_callback() }, timeRedrawOnResize) }; handler.stop = function() { clearTimeout(timeout); return this }; return handler }; var windowResizeCallbacks = function() { var prevSize, callbacks = $.Callbacks(), jqWindow = $(window), resizeEventHandlerAttached = false, originalCallbacksAdd = callbacks.add, originalCallbacksRemove = callbacks.remove; var formatSize = function() { return [jqWindow.width(), jqWindow.height()].join() }; var handleResize = function() { var now = formatSize(); if (now === prevSize) return; prevSize = now; setTimeout(callbacks.fire) }; prevSize = formatSize(); callbacks.add = function() { var result = originalCallbacksAdd.apply(callbacks, arguments); if (!resizeEventHandlerAttached && callbacks.has()) { jqWindow.on("resize", handleResize); resizeEventHandlerAttached = true } return result }; callbacks.remove = function() { var result = originalCallbacksRemove.apply(callbacks, arguments); if (!callbacks.has() && resizeEventHandlerAttached) { jqWindow.off("resize", handleResize); resizeEventHandlerAttached = false } return result }; return callbacks }(); var resetActiveElement = function() { var activeElement = document.activeElement; if (activeElement && activeElement !== document.body && activeElement.blur) activeElement.blur() }; var createMarkupFromString = function(str) { var tempElement = $("
"); if (window.WinJS) WinJS.Utilities.setInnerHTMLUnsafe(tempElement.get(0), str); else tempElement.append(str); return tempElement.contents() }; var initMobileViewport = function(options) { options = $.extend({}, options); var device = DX.devices.current(); var realDevice = DX.devices.real(); var allowZoom = options.allowZoom, allowPan = options.allowPan, allowSelection = "allowSelection" in options ? options.allowSelection : device.platform == "desktop"; DX.overlayTargetContainer(".dx-viewport"); var metaSelector = "meta[name=viewport]"; if (!$(metaSelector).length) $("").attr("name", "viewport").appendTo("head"); var metaVerbs = ["width=device-width"], msTouchVerbs = []; if (allowZoom) msTouchVerbs.push("pinch-zoom"); else metaVerbs.push("initial-scale=1.0", "maximum-scale=1.0, user-scalable=no"); if (allowPan) msTouchVerbs.push("pan-x", "pan-y"); if (!allowPan && !allowZoom) $("html, body").css({ "-ms-content-zooming": "none", "-ms-user-select": "none", overflow: "hidden" }); else $("html").css("-ms-overflow-style", "-ms-autohiding-scrollbar"); if (!allowSelection) { if (realDevice.ios) $(document).on("selectstart", function() { return false }); $(".dx-viewport").css("user-select", "none") } $(metaSelector).attr("content", metaVerbs.join()); $("html").css("-ms-touch-action", msTouchVerbs.join(" ") || "none"); if (DX.support.touch) $(document).off(".dxInitMobileViewport").on("touchmove.dxInitMobileViewport", function(e) { var count = e.originalEvent.touches.length, zoomDisabled = !allowZoom && count > 1, panDisabled = !allowPan && count === 1 && !e.isScrollingEvent; if (zoomDisabled || panDisabled) e.preventDefault() }); realDevice = DX.devices.real(); if (realDevice.ios) { var isPhoneGap = document.location.protocol === "file:"; if (!isPhoneGap) windowResizeCallbacks.add(function() { var windowWidth = $(window).width(); $("body").width(windowWidth) }); else if (realDevice.version[0] > 6) { $(".dx-viewport").css("position", "relative"); $("body").css({"box-sizing": "border-box"}); $("body").css("padding-top", IOS_APP_BAR_HEIGHT); if (realDevice.version[0] === 7 && realDevice.version[1] < 1) { var setDeviceHeight = function() { var deviceHeight = "height=device-" + (Math.abs(window.orientation) === 90 ? "width" : "height"); $(metaSelector).attr("content", metaVerbs.join() + "," + deviceHeight) }; $(window).on("orientationchange", setDeviceHeight); setDeviceHeight() } } } }; var triggerVisibilityChangeEvent = function(event) { return function(element) { $(element || "body").find(".dx-visibility-change-handler").each(function() { $(this).triggerHandler(event) }) } }; $.extend(DX.utils, { createResizeHandler: createResizeHandler, windowResizeCallbacks: windowResizeCallbacks, resetActiveElement: resetActiveElement, createMarkupFromString: createMarkupFromString, triggerShownEvent: triggerVisibilityChangeEvent("dxshown"), triggerHidingEvent: triggerVisibilityChangeEvent("dxhiding"), initMobileViewport: initMobileViewport }); DX.utils.__timeRedrawOnResize = timeRedrawOnResize })(jQuery, DevExpress); /*! Module core, file utils.graphics.js */ (function($, DX, undefined) { var isFunction = DX.utils.isFunction, iDevice = /iphone|ipad/.test(navigator.userAgent.toLowerCase()); var processSeriesTemplate = function(seriesTemplate, items) { var customizeSeries = isFunction(seriesTemplate.customizeSeries) ? seriesTemplate.customizeSeries : $.noop, nameField = seriesTemplate.nameField || 'series', generatedSeries = {}, seriesOrder = [], series; for (var i = 0, length = items.length; i < length; i++) { var data = items[i]; if (nameField in data) { series = generatedSeries[data[nameField]]; if (!series) { series = generatedSeries[data[nameField]] = { name: data[nameField], data: [] }; seriesOrder.push(series.name) } series.data.push(data) } } return $.map(seriesOrder, function(orderedName) { var group = generatedSeries[orderedName], seriesOptions = customizeSeries.call(null, group.name); return $.extend(group, seriesOptions) }) }; var getNextDefsSvgId = function() { var numDefsSvgElements = 1; return function() { return 'DevExpress_' + numDefsSvgElements++ } }(); var getRootOffset = function(renderer) { var node, result = { left: 0, top: 0 }, pointTransform, root = renderer.getRoot(); if (root) { node = root.element; if (node.getScreenCTM && !iDevice) { var ctm = node.getScreenCTM(); if (ctm) { pointTransform = node.createSVGPoint().matrixTransform(ctm); result.left = pointTransform.x + (document.body.scrollLeft || document.documentElement.scrollLeft); result.top = pointTransform.y + (document.body.scrollTop || document.documentElement.scrollTop) } else { result.left = document.body.scrollLeft || document.documentElement.scrollLeft; result.top = document.body.scrollTop || document.documentElement.scrollTop } } else result = $(node).offset() } return result }; $.extend(DX.utils, { processSeriesTemplate: processSeriesTemplate, getNextDefsSvgId: getNextDefsSvgId, getRootOffset: getRootOffset }) })(jQuery, DevExpress); /*! Module core, file utils.arrays.js */ (function($, DX, undefined) { var wrapToArray = function(entity) { return $.isArray(entity) ? entity : [entity] }; var removeDublicates = function(from, what) { if (!$.isArray(from) || from.length === 0) return []; if (!$.isArray(what) || what.length === 0) return from.slice(); var result = []; $.each(from, function(_, value) { var bIndex = $.inArray(value, what); if (bIndex === -1) result.push(value) }); return result }; $.extend(DX.utils, { wrapToArray: wrapToArray, removeDublicates: removeDublicates }) })(jQuery, DevExpress); /*! Module core, file devices.js */ (function($, DX, undefined) { var KNOWN_UA_TABLE = { iPhone: "iPhone", iPhone5: "iPhone 5", iPad: "iPad", iPadMini: "iPad Mini", androidPhone: "Android Mobile", androidTablet: "Android", win8: "MSAppHost", win8Phone: "Windows Phone 8", msSurface: "MSIE ARM Tablet PC", desktop: "desktop", tizen: "Tizen Mobile" }; var DEFAULT_DEVICE = { deviceType: "", platform: "", version: [], phone: false, tablet: false, android: false, ios: false, win8: false, tizen: false, generic: false }; var GENERIC_DEVICE = $.extend(DEFAULT_DEVICE, { platform: "generic", deviceType: "desktop", generic: true }); var uaParsers = { win8: function(userAgent) { var isPhone = /windows phone/i.test(userAgent), isTablet = !isPhone && /arm(.*)trident/i.test(userAgent), isDesktop = !isPhone && !isTablet && /msapphost/i.test(userAgent); if (!(isPhone || isTablet || isDesktop)) return; var matches = userAgent.match(/windows phone (\d+).(\d+)/i) || userAgent.match(/windows nt (\d+).(\d+)/i), version = matches ? [parseInt(matches[1], 10), parseInt(matches[2], 10)] : []; return { deviceType: isPhone ? "phone" : isTablet ? "tablet" : "desktop", platform: "win8", version: version } }, ios: function(userAgent) { if (!/ip(hone|od|ad)/i.test(userAgent)) return; var isPhone = /ip(hone|od)/i.test(userAgent); var matches = userAgent.match(/os (\d+)_(\d+)_?(\d+)?/i); var version = matches ? [parseInt(matches[1], 10), parseInt(matches[2], 10), parseInt(matches[3] || 0, 10)] : []; return { deviceType: isPhone ? "phone" : "tablet", platform: "ios", version: version } }, android: function(userAgent) { if (!/android|htc_|silk/i.test(userAgent)) return; var isPhone = /mobile/i.test(userAgent); var matches = userAgent.match(/android (\d+)\.(\d+)\.?(\d+)?/i); var version = matches ? [parseInt(matches[1], 10), parseInt(matches[2], 10), parseInt(matches[3] || 0, 10)] : []; return { deviceType: isPhone ? "phone" : "tablet", platform: "android", version: version } }, tizen: function(userAgent) { if (!/tizen/i.test(userAgent)) return; var isPhone = /mobile/i.test(userAgent); var matches = userAgent.match(/tizen (\d+)\.(\d+)/i); var version = matches ? [parseInt(matches[1], 10), parseInt(matches[2], 10)] : []; return { deviceType: isPhone ? "phone" : "tablet", platform: "tizen", version: version } } }; DX.Devices = DX.Class.inherit({ ctor: function(options) { this._window = options && options.window || window; this._realDevice = this._getDevice(); this._currentDevice = undefined; this._currentOrientation = undefined; this.orientationChanged = $.Callbacks(); this._recalculateOrientation(); DX.utils.windowResizeCallbacks.add($.proxy(this._recalculateOrientation, this)) }, current: function(deviceOrName) { if (deviceOrName) { this._currentDevice = this._getDevice(deviceOrName); DX.ui.themes.init({_autoInit: true}) } else { if (!this._currentDevice) { deviceOrName = undefined; try { deviceOrName = this._getDeviceOrNameFromWindowScope() } catch(e) { deviceOrName = this._getDeviceNameFromSessionStorage() } finally { if (!deviceOrName) deviceOrName = this._getDeviceNameFromSessionStorage() } this._currentDevice = this._getDevice(deviceOrName) } return this._currentDevice } }, real: function() { var forceDevice = arguments[0]; if ($.isPlainObject(forceDevice)) { $.extend(this._realDevice, forceDevice); return } return $.extend({}, this._realDevice) }, orientation: function() { return this._currentOrientation }, isRippleEmulator: function() { return !!this._window.tinyHippos }, attachCssClasses: function(element, device) { var realDevice = this._realDevice, $element = $(element); device = device || this.current(); if (device.deviceType) $element.addClass("dx-device-" + device.deviceType); $element.addClass("dx-device-" + realDevice.platform); if (realDevice.version && realDevice.version.length) $element.addClass("dx-device-" + realDevice.platform + "-" + realDevice.version[0]); if (DX.devices.isSimulator()) $element.addClass("dx-simulator"); if (DX.rtlEnabled) $element.addClass("dx-rtl") }, isSimulator: function() { try { return this._isSimulator || this._window.top !== this._window.self && this._window.top["dx-force-device"] || this.isRippleEmulator() } catch(e) { return false } }, forceSimulator: function() { this._isSimulator = true }, _getDevice: function(deviceName) { if (deviceName === "genericPhone") deviceName = { deviceType: "phone", platform: "generic", generic: true }; if ($.isPlainObject(deviceName)) return this._fromConfig(deviceName); else { var ua; if (deviceName) { ua = KNOWN_UA_TABLE[deviceName]; if (!ua) throw Error("Unknown device"); } else ua = navigator.userAgent; return this._fromUA(ua) } }, _getDeviceOrNameFromWindowScope: function() { var result; if (this._window.top["dx-force-device-object"] || this._window.top["dx-force-device"]) result = this._window.top["dx-force-device-object"] || this._window.top["dx-force-device"]; return result }, _getDeviceNameFromSessionStorage: function() { return this._window.sessionStorage && (sessionStorage.getItem("dx-force-device") || sessionStorage.getItem("dx-simulator-device")) }, _fromConfig: function(config) { var shortcuts = { phone: config.deviceType === "phone", tablet: config.deviceType === "tablet", android: config.platform === "android", ios: config.platform === "ios", win8: config.platform === "win8", tizen: config.platform === "tizen", generic: config.platform === "generic" }; return $.extend({}, DEFAULT_DEVICE, this._currentDevice, shortcuts, config) }, _fromUA: function(ua) { var config; $.each(uaParsers, function(platform, parser) { config = parser(ua); return !config }); if (config) return this._fromConfig(config); return GENERIC_DEVICE }, _changeOrientation: function() { var $window = $(this._window), orientation = $window.height() > $window.width() ? "portrait" : "landscape"; if (this._currentOrientation === orientation) return; this._currentOrientation = orientation; this.orientationChanged.fire({orientation: orientation}) }, _recalculateOrientation: function() { var windowWidth = $(this._window).width(); if (this._currentWidth === windowWidth) return; this._currentWidth = windowWidth; this._changeOrientation() } }); DX.devices = new DX.Devices })(jQuery, DevExpress); /*! Module core, file browser.js */ (function($, DX, global, undefined) { var webkitRegExp = /(webkit)[ \/]([\w.]+)/, operaRegExp = /(opera)(?:.*version)?[ \/]([\w.]+)/, ieRegExp = /(msie) (\d{1,2}\.\d)/, ie11RegExp = /(trident).*rv:(\d{1,2}\.\d)/, mozillaRegExp = /(mozilla)(?:.*? rv:([\w.]+))?/; var ua = navigator.userAgent.toLowerCase(); var browser = function() { var result = {}, matches = webkitRegExp.exec(ua) || operaRegExp.exec(ua) || ieRegExp.exec(ua) || ie11RegExp.exec(ua) || ua.indexOf("compatible") < 0 && mozillaRegExp.exec(ua) || [], browserName = matches[1], browserVersion = matches[2]; if (browserName === "trident") browserName = "msie"; if (browserName) { result[browserName] = true; result.version = browserVersion } return result }(); DX.browser = browser })(jQuery, DevExpress, this); /*! Module core, file support.js */ (function($, DX, window) { var cssPrefixes = ["", "Webkit", "Moz", "O", "ms"], styles = document.createElement("dx").style; var transitionEndEventNames = { WebkitTransition: 'webkitTransitionEnd', MozTransition: 'transitionend', OTransition: 'oTransitionEnd', msTransition: 'MsTransitionEnd', transition: 'transitionend' }; var styleProp = function(prop) { prop = DX.inflector.camelize(prop, true); for (var i = 0, cssPrefixesCount = cssPrefixes.length; i < cssPrefixesCount; i++) { var specific = cssPrefixes[i] + prop; if (specific in styles) return specific } }; var supportProp = function(prop) { return !!styleProp(prop) }; var isNativeScrollingSupported = function(device) { var realDevice = DX.devices.real(), realPlatform = realDevice.platform, realVersion = realDevice.version, isObsoleteAndroid = realVersion && realVersion[0] < 4 && realPlatform === "android", isNativeScrollDevice = !isObsoleteAndroid && $.inArray(realPlatform, ["ios", "android", "win8"]) > -1; return isNativeScrollDevice }; DX.support = { touch: "ontouchstart" in window || !!window.navigator.msMaxTouchPoints, pointer: window.navigator.pointerEnabled || window.navigator.msPointerEnabled, transform3d: supportProp("transform"), transition: supportProp("transition"), transitionEndEventName: transitionEndEventNames[styleProp("transition")], animation: supportProp("animation"), nativeScrolling: isNativeScrollingSupported(), winJS: "WinJS" in window, styleProp: styleProp, supportProp: supportProp, hasKo: !!window.ko, hasNg: !window.ko && !!window.angular, inputType: function(type) { if (type === "text") return true; var input = document.createElement("input"); try { input.setAttribute("type", type); input.value = "wrongValue"; return !input.value } catch(e) { return false } } } })(jQuery, DevExpress, this); /*! Module core, file position.js */ (function($, DX, undefined) { var horzRe = /left|right/, vertRe = /top|bottom/, collisionRe = /fit|flip|none/; var normalizeAlign = function(raw) { var result = { h: "center", v: "center" }; var pair = DX.utils.splitPair(raw); if (pair) $.each(pair, function() { var w = String(this).toLowerCase(); if (horzRe.test(w)) result.h = w; else if (vertRe.test(w)) result.v = w }); return result }; var normalizeOffset = function(raw) { var values = DX.utils.stringPairToObject(raw); return { h: values.x, v: values.y } }; var normalizeCollision = function(raw) { var pair = DX.utils.splitPair(raw), h = String(pair && pair[0]).toLowerCase(), v = String(pair && pair[1]).toLowerCase(); if (!collisionRe.test(h)) h = "none"; if (!collisionRe.test(v)) v = h; return { h: h, v: v } }; var getAlignFactor = function(align) { switch (align) { case"center": return 0.5; case"right": case"bottom": return 1; default: return 0 } }; var inverseAlign = function(align) { switch (align) { case"left": return "right"; case"right": return "left"; case"top": return "bottom"; case"bottom": return "top"; default: return align } }; var calculateOversize = function(data, bounds) { var oversize = 0; if (data.myLocation < bounds.min) oversize += bounds.min - data.myLocation; if (data.myLocation > bounds.max) oversize += data.myLocation - bounds.max; return oversize }; var initMyLocation = function(data) { data.myLocation = data.atLocation + getAlignFactor(data.atAlign) * data.atSize - getAlignFactor(data.myAlign) * data.mySize + data.offset }; var decolliders = { fit: function(data, bounds) { var result = false; if (data.myLocation > bounds.max) { data.myLocation = bounds.max; result = true } if (data.myLocation < bounds.min) { data.myLocation = bounds.min; result = true } return result }, flip: function(data, bounds) { if (data.myAlign === "center" && data.atAlign === "center") return false; if (data.myLocation < bounds.min || data.myLocation > bounds.max) { var inverseData = $.extend({}, data, { myAlign: inverseAlign(data.myAlign), atAlign: inverseAlign(data.atAlign), offset: -data.offset }); initMyLocation(inverseData); inverseData.oversize = calculateOversize(inverseData, bounds); if (inverseData.myLocation >= bounds.min && inverseData.myLocation <= bounds.max || inverseData.myLocation > data.myLocation || inverseData.oversize < data.oversize) { data.myLocation = inverseData.myLocation; data.oversize = inverseData.oversize; return true } } return false } }; var scrollbarWidth; var defaultPositionResult = { h: { location: 0, flip: false, fit: false, oversize: 0 }, v: { location: 0, flip: false, fit: false, oversize: 0 } }; var calculatePosition = function(what, options) { var $what = $(what), currentOffset = $what.offset(), result = $.extend(true, {}, defaultPositionResult, { h: {location: currentOffset.left}, v: {location: currentOffset.top} }); if (!options) return result; var my = normalizeAlign(options.my), at = normalizeAlign(options.at), of = options.of || window, offset = normalizeOffset(options.offset), collision = normalizeCollision(options.collision), boundaryOffset = normalizeOffset(options.boundaryOffset); var h = { mySize: $what.outerWidth(), myAlign: my.h, atAlign: at.h, offset: offset.h, collision: collision.h, boundaryOffset: boundaryOffset.h }; var v = { mySize: $what.outerHeight(), myAlign: my.v, atAlign: at.v, offset: offset.v, collision: collision.v, boundaryOffset: boundaryOffset.v }; if (of.preventDefault) { h.atLocation = of.pageX; v.atLocation = of.pageY; h.atSize = 0; v.atSize = 0 } else { of = $(of); if ($.isWindow(of[0])) { h.atLocation = of.scrollLeft(); v.atLocation = of.scrollTop(); h.atSize = of.width(); v.atSize = of.height() } else if (of[0].nodeType === 9) { h.atLocation = 0; v.atLocation = 0; h.atSize = of.width(); v.atSize = of.height() } else { var o = of.offset(); h.atLocation = o.left; v.atLocation = o.top; h.atSize = of.outerWidth(); v.atSize = of.outerHeight() } } initMyLocation(h); initMyLocation(v); var bounds = function() { var win = $(window), windowWidth = win.width(), windowHeight = win.height(), left = win.scrollLeft(), top = win.scrollTop(), hScrollbar = document.width > document.documentElement.clientWidth, vScrollbar = document.height > document.documentElement.clientHeight, hZoomLevel = DX.support.touch ? document.documentElement.clientWidth / (vScrollbar ? windowWidth - scrollbarWidth : windowWidth) : 1, vZoomLevel = DX.support.touch ? document.documentElement.clientHeight / (hScrollbar ? windowHeight - scrollbarWidth : windowHeight) : 1; if (scrollbarWidth === undefined) scrollbarWidth = calculateScrollbarWidth(); return { h: { min: left + h.boundaryOffset, max: left + windowWidth / hZoomLevel - h.mySize - h.boundaryOffset }, v: { min: top + v.boundaryOffset, max: top + windowHeight / vZoomLevel - v.mySize - v.boundaryOffset } } }(); h.oversize = calculateOversize(h, bounds.h); v.oversize = calculateOversize(v, bounds.v); if (decolliders[h.collision]) result.h[h.collision] = decolliders[h.collision](h, bounds.h); if (decolliders[v.collision]) result.v[v.collision] = decolliders[v.collision](v, bounds.v); $.extend(true, result, { h: { location: Math.round(h.myLocation), oversize: Math.round(h.oversize) }, v: { location: Math.round(v.myLocation), oversize: Math.round(v.oversize) } }); return result }; var position = function(what, options) { var $what = $(what); if (!options) return $what.offset(); DX.translator.resetPosition($what); var offset = $what.offset(), targetPosition = options.h && options.v ? options : calculatePosition($what, options); DX.translator.move($what, { left: Math.round(targetPosition.h.location - offset.left), top: Math.round(targetPosition.v.location - offset.top) }); return targetPosition }; $.extend(DX, { calculatePosition: calculatePosition, position: position, inverseAlign: inverseAlign }); var calculateScrollbarWidth = function() { var $scrollDiv = $("