1 |
- (function (n) { n(["jquery"], function (n) { return function () { var t = t || {}, i; return t.appPath = t.appPath || "/", t.pageLoadTime = new Date, t.toAbsAppPath = function (n) { return n.indexOf("/") == 0 && (n = n.substring(1)), t.appPath + n }, t.multiTenancy = t.multiTenancy || {}, t.multiTenancy.isEnabled = !1, t.multiTenancy.ignoreFeatureCheckForHostUsers = !1, t.multiTenancy.sides = { TENANT: 1, HOST: 2 }, t.multiTenancy.tenantIdCookieName = "Abp.TenantId", t.multiTenancy.setTenantIdCookie = function (n) { n ? t.utils.setCookieValue(t.multiTenancy.tenantIdCookieName, n.toString(), new Date((new Date).getTime() + 15768e7), t.appPath, t.domain) : t.utils.deleteCookie(t.multiTenancy.tenantIdCookieName, t.appPath) }, t.multiTenancy.getTenantIdCookie = function () { var n = t.utils.getCookieValue(t.multiTenancy.tenantIdCookieName); return n ? parseInt(n) : null }, t.session = t.session || { multiTenancySide: t.multiTenancy.sides.HOST }, t.localization = t.localization || {}, t.localization.languages = [], t.localization.currentLanguage = {}, t.localization.sources = [], t.localization.values = {}, t.localization.localize = function (n, i) { var u, f, r; return (i = i || t.localization.defaultSourceName, u = t.localization.values[i], !u) ? (t.log.warn("Could not find localization source: " + i), n) : (f = u[n], f == undefined) ? n : (r = Array.prototype.slice.call(arguments, 0), r.splice(1, 1), r[0] = f, t.utils.formatString.apply(this, r)) }, t.localization.getSource = function (n) { return function () { var i = Array.prototype.slice.call(arguments, 0); return i.splice(1, 0, n), t.localization.localize.apply(this, i) } }, t.localization.isCurrentCulture = function (n) { return t.localization.currentCulture && t.localization.currentCulture.name && t.localization.currentCulture.name.indexOf(n) == 0 }, t.localization.defaultSourceName = undefined, t.localization.abpWeb = t.localization.getSource("AbpWeb"), t.auth = t.auth || {}, t.auth.allPermissions = t.auth.allPermissions || {}, t.auth.grantedPermissions = t.auth.grantedPermissions || {}, t.auth.hasPermission = function () { return t.auth.isGranted.apply(this, arguments) }, t.auth.hasAnyOfPermissions = function () { return t.auth.isAnyGranted.apply(this, arguments) }, t.auth.hasAllOfPermissions = function () { return t.auth.areAllGranted.apply(this, arguments) }, t.auth.isGranted = function (n) { return t.auth.allPermissions[n] != undefined && t.auth.grantedPermissions[n] != undefined }, t.auth.isAnyGranted = function () { if (!arguments || arguments.length <= 0) return !0; for (var n = 0; n < arguments.length; n++)if (t.auth.isGranted(arguments[n])) return !0; return !1 }, t.auth.areAllGranted = function () { if (!arguments || arguments.length <= 0) return !0; for (var n = 0; n < arguments.length; n++)if (!t.auth.isGranted(arguments[n])) return !1; return !0 }, t.auth.tokenCookieName = "Abp.AuthToken", t.auth.setToken = function (n, i) { t.utils.setCookieValue(t.auth.tokenCookieName, n, i, t.appPath, t.domain) }, t.auth.getToken = function () { return t.utils.getCookieValue(t.auth.tokenCookieName) }, t.auth.clearToken = function () { t.auth.setToken() }, t.features = t.features || {}, t.features.allFeatures = t.features.allFeatures || {}, t.features.get = function (n) { return t.features.allFeatures[n] }, t.features.getValue = function (n) { var i = t.features.get(n); return i == undefined ? undefined : i.value }, t.features.isEnabled = function (n) { var i = t.features.getValue(n); return i == "true" || i == "True" }, t.setting = t.setting || {}, t.setting.values = t.setting.values || {}, t.setting.get = function (n) { return t.setting.values[n] }, t.setting.getBoolean = function (n) { var i = t.setting.get(n); return i == "true" || i == "True" }, t.setting.getInt = function (n) { return parseInt(t.setting.values[n]) }, t.notifications = t.notifications || {}, t.notifications.severity = { INFO: 0, SUCCESS: 1, WARN: 2, ERROR: 3, FATAL: 4 }, t.notifications.userNotificationState = { UNREAD: 0, READ: 1 }, t.notifications.getUserNotificationStateAsString = function (n) { switch (n) { case t.notifications.userNotificationState.READ: return "READ"; case t.notifications.userNotificationState.UNREAD: return "UNREAD"; default: return t.log.warn("Unknown user notification state value: " + n), "?" } }, t.notifications.getUiNotifyFuncBySeverity = function (n) { switch (n) { case t.notifications.severity.SUCCESS: return t.notify.success; case t.notifications.severity.WARN: return t.notify.warn; case t.notifications.severity.ERROR: return t.notify.error; case t.notifications.severity.FATAL: return t.notify.error; case t.notifications.severity.INFO: default: return t.notify.info } }, t.notifications.messageFormatters = {}, t.notifications.messageFormatters["Abp.Notifications.MessageNotificationData"] = function (n) { return n.notification.data.message || n.notification.data.properties.Message }, t.notifications.messageFormatters["Abp.Notifications.LocalizableMessageNotificationData"] = function (i) { var e = i.notification.data.message || i.notification.data.properties.Message, r = t.localization.localize(e.name, e.sourceName), f, u; if (i.notification.data.properties) if (n) n.each(i.notification.data.properties, function (n, t) { r = r.replace("{" + n + "}", t) }); else for (f = Object.keys(i.notification.data.properties), u = 0; u < f.length; u++)r = r.replace("{" + f[u] + "}", i.notification.data.properties[f[u]]); return r }, t.notifications.getFormattedMessageFromUserNotification = function (n) { var i = t.notifications.messageFormatters[n.notification.data.type]; return i ? t.utils.isFunction(i) ? i(n) : (t.log.warn("Message formatter should be a function! It is invalid for data type: " + n.notification.data.type), "?") : (t.log.warn("No message formatter defined for given data type: " + n.notification.data.type), "?") }, t.notifications.showUiNotifyForUserNotification = function (n, i) { var r = t.notifications.getFormattedMessageFromUserNotification(n), u = t.notifications.getUiNotifyFuncBySeverity(n.notification.severity); u(r, undefined, i) }, t.log = t.log || {}, t.log.levels = { DEBUG: 1, INFO: 2, WARN: 3, ERROR: 4, FATAL: 5 }, t.log.level = t.log.levels.DEBUG, t.log.log = function (n, i) { window.console && window.console.log && (i != undefined && i < t.log.level || console.log(n)) }, t.log.debug = function (n) { t.log.log("DEBUG: ", t.log.levels.DEBUG); t.log.log(n, t.log.levels.DEBUG) }, t.log.info = function (n) { t.log.log("INFO: ", t.log.levels.INFO); t.log.log(n, t.log.levels.INFO) }, t.log.warn = function (n) { t.log.log("WARN: ", t.log.levels.WARN); t.log.log(n, t.log.levels.WARN) }, t.log.error = function (n) { t.log.log("ERROR: ", t.log.levels.ERROR); t.log.log(n, t.log.levels.ERROR) }, t.log.fatal = function (n) { t.log.log("FATAL: ", t.log.levels.FATAL); t.log.log(n, t.log.levels.FATAL) }, t.notify = t.notify || {}, t.notify.success = function () { t.log.warn("abp.notify.success is not implemented!") }, t.notify.info = function () { t.log.warn("abp.notify.info is not implemented!") }, t.notify.warn = function () { t.log.warn("abp.notify.warn is not implemented!") }, t.notify.error = function () { t.log.warn("abp.notify.error is not implemented!") }, t.message = t.message || {}, i = function (i, r) { return (alert((r || "") + " " + i), !n) ? (t.log.warn("abp.message can not return promise since jQuery is not defined!"), null) : n.Deferred(function (n) { n.resolve() }) }, t.message.info = function (n, r, u, f) { return t.log.warn("abp.message.info is not implemented!"), i(n, r, u, f) }, t.message.success = function (n, r, u, f) { return t.log.warn("abp.message.success is not implemented!"), i(n, r, u, f) }, t.message.warn = function (n, r, u, f) { return t.log.warn("abp.message.warn is not implemented!"), i(n, r, u, f) }, t.message.error = function (n, r, u, f) { return t.log.warn("abp.message.error is not implemented!"), i(n, r, u, f) }, t.message.confirm = function (i, r, u) { t.log.warn("abp.message.confirm is not implemented!"); !r || typeof r == "string" || (u = r); var f = confirm(i); return (u && u(f), !n) ? (t.log.warn("abp.message can not return promise since jQuery is not defined!"), null) : n.Deferred(function (n) { n.resolve() }) }, t.ui = t.ui || {}, t.ui.block = function () { t.log.warn("abp.ui.block is not implemented!") }, t.ui.unblock = function () { t.log.warn("abp.ui.unblock is not implemented!") }, t.ui.setBusy = function () { t.log.warn("abp.ui.setBusy is not implemented!") }, t.ui.clearBusy = function () { t.log.warn("abp.ui.clearBusy is not implemented!") }, t.event = function () { var n = {}, t = function (t, i) { n[t] || (n[t] = []); n[t].push(i) }, i = function (t, i) { var f = n[t], u, r; if (f) { for (u = -1, r = 0; r < f.length; r++)if (f[r] === i) { u = r; break } u < 0 || n[t].splice(u, 1) } }, r = function (t) { var i = n[t], u, r; if (i && i.length) for (u = Array.prototype.slice.call(arguments, 1), r = 0; r < i.length; r++)i[r].apply(this, u) }; return { on: t, off: i, trigger: r } }(), t.utils = t.utils || {}, t.utils.createNamespace = function (n, t) { for (var r = t.split("."), i = 0; i < r.length; i++)typeof n[r[i]] == "undefined" && (n[r[i]] = {}), n = n[r[i]]; return n }, t.utils.replaceAll = function (n, t, i) { var r = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); return n.replace(new RegExp(r, "g"), i) }, t.utils.formatString = function () { var i, n, r; if (arguments.length < 1) return null; for (i = arguments[0], n = 1; n < arguments.length; n++)r = "{" + (n - 1) + "}", i = t.utils.replaceAll(i, r, arguments[n]); return i }, t.utils.toPascalCase = function (n) { return !n || !n.length ? n : n.length === 1 ? n.charAt(0).toUpperCase() : n.charAt(0).toUpperCase() + n.substr(1) }, t.utils.toCamelCase = function (n) { return !n || !n.length ? n : n.length === 1 ? n.charAt(0).toLowerCase() : n.charAt(0).toLowerCase() + n.substr(1) }, t.utils.truncateString = function (n, t) { return !n || !n.length || n.length <= t ? n : n.substr(0, t) }, t.utils.truncateStringWithPostfix = function (n, t, i) { return (i = i || "...", !n || !n.length || n.length <= t) ? n : t <= i.length ? i.substr(0, t) : n.substr(0, t - i.length) + i }, t.utils.isFunction = function (t) { return n ? n.isFunction(t) : !!(t && t.constructor && t.call && t.apply) }, t.utils.buildQueryString = function (n, t) { function e() { r.length ? r = r + "&" : t && (r = r + "?") } var r, f, i, u; for (t === undefined && (t = !0), r = "", f = 0; f < n.length; ++f)if (i = n[f], i.value !== undefined) if (i.value === null && (i.value = ""), e(), i.value.toJSON && typeof i.value.toJSON == "function") r = r + i.name + "=" + encodeURIComponent(i.value.toJSON()); else if (Array.isArray(i.value) && i.value.length) for (u = 0; u < i.value.length; u++)u > 0 && e(), r = r + i.name + "[" + u + "]=" + encodeURIComponent(i.value[u]); else r = r + i.name + "=" + encodeURIComponent(i.value); return r }, t.utils.setCookieValue = function (n, t, i, r, u) { var f = encodeURIComponent(n) + "="; t && (f = f + encodeURIComponent(t)); i && (f = f + "; expires=" + i.toUTCString()); r && (f = f + "; path=" + r); u && (f = f + "; domain=" + u); document.cookie = f }, t.utils.getCookieValue = function (n) { for (var i, r = document.cookie.split("; "), t = 0; t < r.length; t++)if (r[t] && (i = r[t].split("="), i.length == 2) && decodeURIComponent(i[0]) === n) return decodeURIComponent(i[1] || ""); return null }, t.utils.deleteCookie = function (n, t) { var i = encodeURIComponent(n) + "="; i = i + "; expires=" + new Date((new Date).getTime() - 864e5).toUTCString(); t && (i = i + "; path=" + t); document.cookie = i }, t.utils.getDomain = function (n) { var t = /(https?:){0,1}\/\/((?:[\w\d-]+\.)+[\w\d]{2,})/i.exec(n); return t && t[2] ? t[2] : "" }, t.timing = t.timing || {}, t.timing.utcClockProvider = function () { var n = function (n) { return Date.UTC(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate(), n.getUTCHours(), n.getUTCMinutes(), n.getUTCSeconds(), n.getUTCMilliseconds()) }, t = function () { return n(new Date) }, i = function (t) { return t ? new Date(n(t)) : t }; return { now: t, normalize: i, supportsMultipleTimezone: !0 } }(), t.timing.localClockProvider = function () { var n = function (n) { return new Date(n.getFullYear(), n.getMonth(), n.getDate(), n.getHours(), n.getMinutes(), n.getSeconds(), n.getMilliseconds()) }, t = function () { return n(new Date) }, i = function (t) { return t ? n(t) : t }; return { now: t, normalize: i, supportsMultipleTimezone: !1 } }(), t.timing.unspecifiedClockProvider = function () { var n = function () { return new Date }, t = function (n) { return n }; return { now: n, normalize: t, supportsMultipleTimezone: !1 } }(), t.timing.convertToUserTimezone = function (n) { var i = n.getTime(), r = i + n.getTimezoneOffset() * 6e4, u = parseInt(r) + parseInt(t.timing.timeZoneInfo.windows.currentUtcOffsetInMilliseconds); return new Date(u) }, t.clock = t.clock || {}, t.clock.now = function () { return t.clock.provider ? t.clock.provider.now() : new Date }, t.clock.normalize = function (n) { return t.clock.provider ? t.clock.provider.normalize(n) : n }, t.clock.provider = t.timing.unspecifiedClockProvider, t.security = t.security || {}, t.security.antiForgery = t.security.antiForgery || {}, t.security.antiForgery.tokenCookieName = "XSRF-TOKEN-WePlatform", t.security.antiForgery.tokenHeaderName ="X-XSRF-TOKEN-WePlatform",t.security.antiForgery.getToken=function(){return t.utils.getCookieValue(t.security.antiForgery.tokenCookieName)},t.security.antiForgery.shouldSendToken=function(n){return n.crossDomain===undefined||n.crossDomain===null?t.utils.getDomain(location.href)===t.utils.getDomain(n.url):!n.crossDomain},t}()})})(typeof define=="function"&&define.amd?define:function(n,t){typeof module!="undefined"&&module.exports?module.exports=t(require("jquery")):window.abp=t(window.jQuery)});
|