diff --git a/common.props b/common.props index 6330b8e771..92d87d3d76 100644 --- a/common.props +++ b/common.props @@ -1,7 +1,7 @@ - latest - 2.3.0 + latest + 2.3.0 $(NoWarn);CS1591 https://abp.io/assets/abp_nupkg.png https://abp.io @@ -9,9 +9,7 @@ git https://github.com/abpframework/abp/ - - - + \ No newline at end of file diff --git a/templates/app/angular/package.json b/templates/app/angular/package.json index 64615821ae..faf50f8c72 100644 --- a/templates/app/angular/package.json +++ b/templates/app/angular/package.json @@ -11,11 +11,11 @@ }, "private": true, "dependencies": { - "@abp/ng.account": "~2.1.0", - "@abp/ng.identity": "~2.1.0", - "@abp/ng.setting-management": "~2.1.0", - "@abp/ng.tenant-management": "~2.1.0", - "@abp/ng.theme.basic": "~2.1.0", + "@abp/ng.account": "~2.2.0", + "@abp/ng.identity": "~2.2.0", + "@abp/ng.setting-management": "~2.2.0", + "@abp/ng.tenant-management": "~2.2.0", + "@abp/ng.theme.basic": "~2.2.0", "@angular/animations": "~9.0.2", "@angular/common": "~9.0.2", "@angular/compiler": "~9.0.2", diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/package.json b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/package.json index b620e756f7..6e36dde3bf 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/package.json +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/package.json @@ -3,6 +3,6 @@ "name": "my-app", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.basic": "^2.1.0" + "@abp/aspnetcore.mvc.ui.theme.basic": "^2.2.0" } } \ No newline at end of file diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/wwwroot/libs/abp/core/abp.css b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/wwwroot/libs/abp/core/abp.css index ee3c5080a5..ddf9cae5b2 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/wwwroot/libs/abp/core/abp.css +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/wwwroot/libs/abp/core/abp.css @@ -1,56 +1,56 @@ -@keyframes spin { - 0% { - transform: translateZ(0) rotate(0deg); - } - - 100% { - transform: translateZ(0) rotate(360deg); - } -} - -.abp-block-area { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: 102; - background-color: #fff; - opacity: .8; - transition: opacity .25s; -} - - .abp-block-area.abp-block-area-disappearing { - opacity: 0; - } - - .abp-block-area.abp-block-area-busy:after { - content: attr(data-text); - display: block; - max-width: 125px; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - font-size: 20px; - font-family: sans-serif; - color: #343a40; - text-align: center; - text-transform: uppercase; - } - - .abp-block-area.abp-block-area-busy:before { - content: ""; - display: block; - width: 150px; - height: 150px; - border-radius: 50%; - border-width: 2px; - border-style: solid; - border-color: transparent #228ae6 #228ae6 #228ae6; - position: absolute; - top: calc(50% - 75px); - left: calc(50% - 75px); - will-change: transform; - animation: spin .75s infinite ease-in-out; - } +@keyframes spin { + 0% { + transform: translateZ(0) rotate(0deg); + } + + 100% { + transform: translateZ(0) rotate(360deg); + } +} + +.abp-block-area { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 102; + background-color: #fff; + opacity: .8; + transition: opacity .25s; +} + + .abp-block-area.abp-block-area-disappearing { + opacity: 0; + } + + .abp-block-area.abp-block-area-busy:after { + content: attr(data-text); + display: block; + max-width: 125px; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + font-size: 20px; + font-family: sans-serif; + color: #343a40; + text-align: center; + text-transform: uppercase; + } + + .abp-block-area.abp-block-area-busy:before { + content: ""; + display: block; + width: 150px; + height: 150px; + border-radius: 50%; + border-width: 2px; + border-style: solid; + border-color: transparent #228ae6 #228ae6 #228ae6; + position: absolute; + top: calc(50% - 75px); + left: calc(50% - 75px); + will-change: transform; + animation: spin .75s infinite ease-in-out; + } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/wwwroot/libs/abp/core/abp.js b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/wwwroot/libs/abp/core/abp.js index cef1cf55e1..730db8bc97 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/wwwroot/libs/abp/core/abp.js +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/wwwroot/libs/abp/core/abp.js @@ -1,636 +1,636 @@ -var abp = abp || {}; -(function () { - - /* Application paths *****************************************/ - - //Current application root path (including virtual directory if exists). - abp.appPath = abp.appPath || '/'; - - abp.pageLoadTime = new Date(); - - //Converts given path to absolute path using abp.appPath variable. - abp.toAbsAppPath = function (path) { - if (path.indexOf('/') == 0) { - path = path.substring(1); - } - - return abp.appPath + path; - }; - - /* LOGGING ***************************************************/ - //Implements Logging API that provides secure & controlled usage of console.log - - abp.log = abp.log || {}; - - abp.log.levels = { - DEBUG: 1, - INFO: 2, - WARN: 3, - ERROR: 4, - FATAL: 5 - }; - - abp.log.level = abp.log.levels.DEBUG; - - abp.log.log = function (logObject, logLevel) { - if (!window.console || !window.console.log) { - return; - } - - if (logLevel != undefined && logLevel < abp.log.level) { - return; - } - - console.log(logObject); - }; - - abp.log.debug = function (logObject) { - abp.log.log("DEBUG: ", abp.log.levels.DEBUG); - abp.log.log(logObject, abp.log.levels.DEBUG); - }; - - abp.log.info = function (logObject) { - abp.log.log("INFO: ", abp.log.levels.INFO); - abp.log.log(logObject, abp.log.levels.INFO); - }; - - abp.log.warn = function (logObject) { - abp.log.log("WARN: ", abp.log.levels.WARN); - abp.log.log(logObject, abp.log.levels.WARN); - }; - - abp.log.error = function (logObject) { - abp.log.log("ERROR: ", abp.log.levels.ERROR); - abp.log.log(logObject, abp.log.levels.ERROR); - }; - - abp.log.fatal = function (logObject) { - abp.log.log("FATAL: ", abp.log.levels.FATAL); - abp.log.log(logObject, abp.log.levels.FATAL); - }; - - /* LOCALIZATION ***********************************************/ - - abp.localization = abp.localization || {}; - - abp.localization.values = {}; - - abp.localization.localize = function (key, sourceName) { - sourceName = sourceName || abp.localization.defaultResourceName; - - var source = abp.localization.values[sourceName]; - - if (!source) { - abp.log.warn('Could not find localization source: ' + sourceName); - return key; - } - - var value = source[key]; - if (value == undefined) { - return key; - } - - var copiedArguments = Array.prototype.slice.call(arguments, 0); - copiedArguments.splice(1, 1); - copiedArguments[0] = value; - - return abp.utils.formatString.apply(this, copiedArguments); - }; - - abp.localization.getResource = function (name) { - return function () { - var copiedArguments = Array.prototype.slice.call(arguments, 0); - copiedArguments.splice(1, 0, name); - return abp.localization.localize.apply(this, copiedArguments); - }; - }; - - abp.localization.defaultResourceName = undefined; - - /* AUTHORIZATION **********************************************/ - - abp.auth = abp.auth || {}; - - abp.auth.policies = abp.auth.policies || {}; - - abp.auth.grantedPolicies = abp.auth.grantedPolicies || {}; - - abp.auth.isGranted = function (policyName) { - return abp.auth.policies[policyName] != undefined && abp.auth.grantedPolicies[policyName] != undefined; - }; - - abp.auth.isAnyGranted = function () { - if (!arguments || arguments.length <= 0) { - return true; - } - - for (var i = 0; i < arguments.length; i++) { - if (abp.auth.isGranted(arguments[i])) { - return true; - } - } - - return false; - }; - - abp.auth.areAllGranted = function () { - if (!arguments || arguments.length <= 0) { - return true; - } - - for (var i = 0; i < arguments.length; i++) { - if (!abp.auth.isGranted(arguments[i])) { - return false; - } - } - - return true; - }; - - abp.auth.tokenCookieName = 'Abp.AuthToken'; - - abp.auth.setToken = function (authToken, expireDate) { - abp.utils.setCookieValue(abp.auth.tokenCookieName, authToken, expireDate, abp.appPath, abp.domain); - }; - - abp.auth.getToken = function () { - return abp.utils.getCookieValue(abp.auth.tokenCookieName); - } - - abp.auth.clearToken = function () { - abp.auth.setToken(); - } - - /* SETTINGS *************************************************/ - - abp.setting = abp.setting || {}; - - abp.setting.values = abp.setting.values || {}; - - abp.setting.get = function (name) { - return abp.setting.values[name]; - }; - - abp.setting.getBoolean = function (name) { - var value = abp.setting.get(name); - return value == 'true' || value == 'True'; - }; - - abp.setting.getInt = function (name) { - return parseInt(abp.setting.values[name]); - }; - - /* NOTIFICATION *********************************************/ - //Defines Notification API, not implements it - - abp.notify = abp.notify || {}; - - abp.notify.success = function (message, title, options) { - abp.log.warn('abp.notify.success is not implemented!'); - }; - - abp.notify.info = function (message, title, options) { - abp.log.warn('abp.notify.info is not implemented!'); - }; - - abp.notify.warn = function (message, title, options) { - abp.log.warn('abp.notify.warn is not implemented!'); - }; - - abp.notify.error = function (message, title, options) { - abp.log.warn('abp.notify.error is not implemented!'); - }; - - /* MESSAGE **************************************************/ - //Defines Message API, not implements it - - abp.message = abp.message || {}; - - abp.message._showMessage = function (message, title) { - alert((title || '') + ' ' + message); - }; - - abp.message.info = function (message, title) { - abp.log.warn('abp.message.info is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.success = function (message, title) { - abp.log.warn('abp.message.success is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.warn = function (message, title) { - abp.log.warn('abp.message.warn is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.error = function (message, title) { - abp.log.warn('abp.message.error is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.confirm = function (message, titleOrCallback, callback) { - abp.log.warn('abp.message.confirm is not properly implemented!'); - - if (titleOrCallback && !(typeof titleOrCallback == 'string')) { - callback = titleOrCallback; - } - - var result = confirm(message); - callback && callback(result); - }; - - /* UI *******************************************************/ - - abp.ui = abp.ui || {}; - - /* UI BLOCK */ - //Defines UI Block API and implements basically - - var $abpBlockArea = document.createElement('div'); - $abpBlockArea.classList.add('abp-block-area'); - - /* opts: { //Can be an object with options or a string for query a selector - * elm: a query selector (optional - default: document.body) - * busy: boolean (optional - default: false) - * promise: A promise with always or finally handler (optional - auto unblocks the ui if provided) - * } - */ - abp.ui.block = function (opts) { - if (!opts) { - opts = {}; - } else if (typeof opts == 'string') { - opts = { - elm: opts - }; - } - - var $elm = document.querySelector(opts.elm) || document.body; - - if (opts.busy) { - $abpBlockArea.classList.add('abp-block-area-busy'); - } else { - $abpBlockArea.classList.remove('abp-block-area-busy'); - } - - if (document.querySelector(opts.elm)) { - $abpBlockArea.style.position = 'absolute'; - } else { - $abpBlockArea.style.position = 'fixed'; - } - - $elm.appendChild($abpBlockArea); - - if (opts.promise) { - if (opts.promise.always) { //jQuery.Deferred style - opts.promise.always(function () { - abp.ui.unblock({ - $elm: opts.elm - }); - }); - } else if (opts.promise['finally']) { //Q style - opts.promise['finally'](function () { - abp.ui.unblock({ - $elm: opts.elm - }); - }); - } - } - }; - - /* opts: { - * - * } - */ - abp.ui.unblock = function (opts) { - var element = document.querySelector('.abp-block-area'); - if (element) { - element.classList.add('abp-block-area-disappearing'); - setTimeout(function () { - if (element) { - element.classList.remove('abp-block-area-disappearing'); - element.parentElement.removeChild(element); - } - }, 250); - } - }; - - /* UI BUSY */ - //Defines UI Busy API, not implements it - - abp.ui.setBusy = function (opts) { - if (!opts) { - opts = { - busy: true - }; - } else if (typeof opts == 'string') { - opts = { - elm: opts, - busy: true - }; - } - - abp.ui.block(opts); - }; - - abp.ui.clearBusy = function (opts) { - abp.ui.unblock(opts); - }; - - /* SIMPLE EVENT BUS *****************************************/ - - abp.event = (function () { - - var _callbacks = {}; - - var on = function (eventName, callback) { - if (!_callbacks[eventName]) { - _callbacks[eventName] = []; - } - - _callbacks[eventName].push(callback); - }; - - var off = function (eventName, callback) { - var callbacks = _callbacks[eventName]; - if (!callbacks) { - return; - } - - var index = -1; - for (var i = 0; i < callbacks.length; i++) { - if (callbacks[i] === callback) { - index = i; - break; - } - } - - if (index < 0) { - return; - } - - _callbacks[eventName].splice(index, 1); - }; - - var trigger = function (eventName) { - var callbacks = _callbacks[eventName]; - if (!callbacks || !callbacks.length) { - return; - } - - var args = Array.prototype.slice.call(arguments, 1); - for (var i = 0; i < callbacks.length; i++) { - callbacks[i].apply(this, args); - } - }; - - // Public interface /////////////////////////////////////////////////// - - return { - on: on, - off: off, - trigger: trigger - }; - })(); - - - /* UTILS ***************************************************/ - - abp.utils = abp.utils || {}; - - /* Creates a name namespace. - * Example: - * var taskService = abp.utils.createNamespace(abp, 'services.task'); - * taskService will be equal to abp.services.task - * first argument (root) must be defined first - ************************************************************/ - abp.utils.createNamespace = function (root, ns) { - var parts = ns.split('.'); - for (var i = 0; i < parts.length; i++) { - if (typeof root[parts[i]] == 'undefined') { - root[parts[i]] = {}; - } - - root = root[parts[i]]; - } - - return root; - }; - - /* Find and replaces a string (search) to another string (replacement) in - * given string (str). - * Example: - * abp.utils.replaceAll('This is a test string', 'is', 'X') = 'ThX X a test string' - ************************************************************/ - abp.utils.replaceAll = function (str, search, replacement) { - var fix = search.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); - return str.replace(new RegExp(fix, 'g'), replacement); - }; - - /* Formats a string just like string.format in C#. - * Example: - * abp.utils.formatString('Hello {0}','Tuana') = 'Hello Tuana' - ************************************************************/ - abp.utils.formatString = function () { - if (arguments.length < 1) { - return null; - } - - var str = arguments[0]; - - for (var i = 1; i < arguments.length; i++) { - var placeHolder = '{' + (i - 1) + '}'; - str = abp.utils.replaceAll(str, placeHolder, arguments[i]); - } - - return str; - }; - - abp.utils.toPascalCase = function (str) { - if (!str || !str.length) { - return str; - } - - if (str.length === 1) { - return str.charAt(0).toUpperCase(); - } - - return str.charAt(0).toUpperCase() + str.substr(1); - } - - abp.utils.toCamelCase = function (str) { - if (!str || !str.length) { - return str; - } - - if (str.length === 1) { - return str.charAt(0).toLowerCase(); - } - - return str.charAt(0).toLowerCase() + str.substr(1); - } - - abp.utils.truncateString = function (str, maxLength) { - if (!str || !str.length || str.length <= maxLength) { - return str; - } - - return str.substr(0, maxLength); - }; - - abp.utils.truncateStringWithPostfix = function (str, maxLength, postfix) { - postfix = postfix || '...'; - - if (!str || !str.length || str.length <= maxLength) { - return str; - } - - if (maxLength <= postfix.length) { - return postfix.substr(0, maxLength); - } - - return str.substr(0, maxLength - postfix.length) + postfix; - }; - - abp.utils.isFunction = function (obj) { - return !!(obj && obj.constructor && obj.call && obj.apply); - }; - - /** - * parameterInfos should be an array of { name, value } objects - * where name is query string parameter name and value is it's value. - * includeQuestionMark is true by default. - */ - abp.utils.buildQueryString = function (parameterInfos, includeQuestionMark) { - if (includeQuestionMark === undefined) { - includeQuestionMark = true; - } - - var qs = ''; - - function addSeperator() { - if (!qs.length) { - if (includeQuestionMark) { - qs = qs + '?'; - } - } else { - qs = qs + '&'; - } - } - - for (var i = 0; i < parameterInfos.length; ++i) { - var parameterInfo = parameterInfos[i]; - if (parameterInfo.value === undefined) { - continue; - } - - if (parameterInfo.value === null) { - parameterInfo.value = ''; - } - - addSeperator(); - - if (parameterInfo.value.toJSON && typeof parameterInfo.value.toJSON === "function") { - qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value.toJSON()); - } else if (Array.isArray(parameterInfo.value) && parameterInfo.value.length) { - for (var j = 0; j < parameterInfo.value.length; j++) { - if (j > 0) { - addSeperator(); - } - - qs = qs + parameterInfo.name + '[' + j + ']=' + encodeURIComponent(parameterInfo.value[j]); - } - } else { - qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value); - } - } - - return qs; - } - - /** - * Sets a cookie value for given key. - * This is a simple implementation created to be used by ABP. - * Please use a complete cookie library if you need. - * @param {string} key - * @param {string} value - * @param {Date} expireDate (optional). If not specified the cookie will expire at the end of session. - * @param {string} path (optional) - */ - abp.utils.setCookieValue = function (key, value, expireDate, path) { - var cookieValue = encodeURIComponent(key) + '='; - - if (value) { - cookieValue = cookieValue + encodeURIComponent(value); - } - - if (expireDate) { - cookieValue = cookieValue + "; expires=" + expireDate.toUTCString(); - } - - if (path) { - cookieValue = cookieValue + "; path=" + path; - } - - document.cookie = cookieValue; - }; - - /** - * Gets a cookie with given key. - * This is a simple implementation created to be used by ABP. - * Please use a complete cookie library if you need. - * @param {string} key - * @returns {string} Cookie value or null - */ - abp.utils.getCookieValue = function (key) { - var equalities = document.cookie.split('; '); - for (var i = 0; i < equalities.length; i++) { - if (!equalities[i]) { - continue; - } - - var splitted = equalities[i].split('='); - if (splitted.length != 2) { - continue; - } - - if (decodeURIComponent(splitted[0]) === key) { - return decodeURIComponent(splitted[1] || ''); - } - } - - return null; - }; - - /** - * Deletes cookie for given key. - * This is a simple implementation created to be used by ABP. - * Please use a complete cookie library if you need. - * @param {string} key - * @param {string} path (optional) - */ - abp.utils.deleteCookie = function (key, path) { - var cookieValue = encodeURIComponent(key) + '='; - - cookieValue = cookieValue + "; expires=" + (new Date(new Date().getTime() - 86400000)).toUTCString(); - - if (path) { - cookieValue = cookieValue + "; path=" + path; - } - - document.cookie = cookieValue; - } - - /* SECURITY ***************************************/ - abp.security = abp.security || {}; - abp.security.antiForgery = abp.security.antiForgery || {}; - - abp.security.antiForgery.tokenCookieName = 'XSRF-TOKEN'; - abp.security.antiForgery.tokenHeaderName = 'X-XSRF-TOKEN'; - - abp.security.antiForgery.getToken = function () { - return abp.utils.getCookieValue(abp.security.antiForgery.tokenCookieName); - }; - +var abp = abp || {}; +(function () { + + /* Application paths *****************************************/ + + //Current application root path (including virtual directory if exists). + abp.appPath = abp.appPath || '/'; + + abp.pageLoadTime = new Date(); + + //Converts given path to absolute path using abp.appPath variable. + abp.toAbsAppPath = function (path) { + if (path.indexOf('/') == 0) { + path = path.substring(1); + } + + return abp.appPath + path; + }; + + /* LOGGING ***************************************************/ + //Implements Logging API that provides secure & controlled usage of console.log + + abp.log = abp.log || {}; + + abp.log.levels = { + DEBUG: 1, + INFO: 2, + WARN: 3, + ERROR: 4, + FATAL: 5 + }; + + abp.log.level = abp.log.levels.DEBUG; + + abp.log.log = function (logObject, logLevel) { + if (!window.console || !window.console.log) { + return; + } + + if (logLevel != undefined && logLevel < abp.log.level) { + return; + } + + console.log(logObject); + }; + + abp.log.debug = function (logObject) { + abp.log.log("DEBUG: ", abp.log.levels.DEBUG); + abp.log.log(logObject, abp.log.levels.DEBUG); + }; + + abp.log.info = function (logObject) { + abp.log.log("INFO: ", abp.log.levels.INFO); + abp.log.log(logObject, abp.log.levels.INFO); + }; + + abp.log.warn = function (logObject) { + abp.log.log("WARN: ", abp.log.levels.WARN); + abp.log.log(logObject, abp.log.levels.WARN); + }; + + abp.log.error = function (logObject) { + abp.log.log("ERROR: ", abp.log.levels.ERROR); + abp.log.log(logObject, abp.log.levels.ERROR); + }; + + abp.log.fatal = function (logObject) { + abp.log.log("FATAL: ", abp.log.levels.FATAL); + abp.log.log(logObject, abp.log.levels.FATAL); + }; + + /* LOCALIZATION ***********************************************/ + + abp.localization = abp.localization || {}; + + abp.localization.values = {}; + + abp.localization.localize = function (key, sourceName) { + sourceName = sourceName || abp.localization.defaultResourceName; + + var source = abp.localization.values[sourceName]; + + if (!source) { + abp.log.warn('Could not find localization source: ' + sourceName); + return key; + } + + var value = source[key]; + if (value == undefined) { + return key; + } + + var copiedArguments = Array.prototype.slice.call(arguments, 0); + copiedArguments.splice(1, 1); + copiedArguments[0] = value; + + return abp.utils.formatString.apply(this, copiedArguments); + }; + + abp.localization.getResource = function (name) { + return function () { + var copiedArguments = Array.prototype.slice.call(arguments, 0); + copiedArguments.splice(1, 0, name); + return abp.localization.localize.apply(this, copiedArguments); + }; + }; + + abp.localization.defaultResourceName = undefined; + + /* AUTHORIZATION **********************************************/ + + abp.auth = abp.auth || {}; + + abp.auth.policies = abp.auth.policies || {}; + + abp.auth.grantedPolicies = abp.auth.grantedPolicies || {}; + + abp.auth.isGranted = function (policyName) { + return abp.auth.policies[policyName] != undefined && abp.auth.grantedPolicies[policyName] != undefined; + }; + + abp.auth.isAnyGranted = function () { + if (!arguments || arguments.length <= 0) { + return true; + } + + for (var i = 0; i < arguments.length; i++) { + if (abp.auth.isGranted(arguments[i])) { + return true; + } + } + + return false; + }; + + abp.auth.areAllGranted = function () { + if (!arguments || arguments.length <= 0) { + return true; + } + + for (var i = 0; i < arguments.length; i++) { + if (!abp.auth.isGranted(arguments[i])) { + return false; + } + } + + return true; + }; + + abp.auth.tokenCookieName = 'Abp.AuthToken'; + + abp.auth.setToken = function (authToken, expireDate) { + abp.utils.setCookieValue(abp.auth.tokenCookieName, authToken, expireDate, abp.appPath, abp.domain); + }; + + abp.auth.getToken = function () { + return abp.utils.getCookieValue(abp.auth.tokenCookieName); + } + + abp.auth.clearToken = function () { + abp.auth.setToken(); + } + + /* SETTINGS *************************************************/ + + abp.setting = abp.setting || {}; + + abp.setting.values = abp.setting.values || {}; + + abp.setting.get = function (name) { + return abp.setting.values[name]; + }; + + abp.setting.getBoolean = function (name) { + var value = abp.setting.get(name); + return value == 'true' || value == 'True'; + }; + + abp.setting.getInt = function (name) { + return parseInt(abp.setting.values[name]); + }; + + /* NOTIFICATION *********************************************/ + //Defines Notification API, not implements it + + abp.notify = abp.notify || {}; + + abp.notify.success = function (message, title, options) { + abp.log.warn('abp.notify.success is not implemented!'); + }; + + abp.notify.info = function (message, title, options) { + abp.log.warn('abp.notify.info is not implemented!'); + }; + + abp.notify.warn = function (message, title, options) { + abp.log.warn('abp.notify.warn is not implemented!'); + }; + + abp.notify.error = function (message, title, options) { + abp.log.warn('abp.notify.error is not implemented!'); + }; + + /* MESSAGE **************************************************/ + //Defines Message API, not implements it + + abp.message = abp.message || {}; + + abp.message._showMessage = function (message, title) { + alert((title || '') + ' ' + message); + }; + + abp.message.info = function (message, title) { + abp.log.warn('abp.message.info is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.success = function (message, title) { + abp.log.warn('abp.message.success is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.warn = function (message, title) { + abp.log.warn('abp.message.warn is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.error = function (message, title) { + abp.log.warn('abp.message.error is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.confirm = function (message, titleOrCallback, callback) { + abp.log.warn('abp.message.confirm is not properly implemented!'); + + if (titleOrCallback && !(typeof titleOrCallback == 'string')) { + callback = titleOrCallback; + } + + var result = confirm(message); + callback && callback(result); + }; + + /* UI *******************************************************/ + + abp.ui = abp.ui || {}; + + /* UI BLOCK */ + //Defines UI Block API and implements basically + + var $abpBlockArea = document.createElement('div'); + $abpBlockArea.classList.add('abp-block-area'); + + /* opts: { //Can be an object with options or a string for query a selector + * elm: a query selector (optional - default: document.body) + * busy: boolean (optional - default: false) + * promise: A promise with always or finally handler (optional - auto unblocks the ui if provided) + * } + */ + abp.ui.block = function (opts) { + if (!opts) { + opts = {}; + } else if (typeof opts == 'string') { + opts = { + elm: opts + }; + } + + var $elm = document.querySelector(opts.elm) || document.body; + + if (opts.busy) { + $abpBlockArea.classList.add('abp-block-area-busy'); + } else { + $abpBlockArea.classList.remove('abp-block-area-busy'); + } + + if (document.querySelector(opts.elm)) { + $abpBlockArea.style.position = 'absolute'; + } else { + $abpBlockArea.style.position = 'fixed'; + } + + $elm.appendChild($abpBlockArea); + + if (opts.promise) { + if (opts.promise.always) { //jQuery.Deferred style + opts.promise.always(function () { + abp.ui.unblock({ + $elm: opts.elm + }); + }); + } else if (opts.promise['finally']) { //Q style + opts.promise['finally'](function () { + abp.ui.unblock({ + $elm: opts.elm + }); + }); + } + } + }; + + /* opts: { + * + * } + */ + abp.ui.unblock = function (opts) { + var element = document.querySelector('.abp-block-area'); + if (element) { + element.classList.add('abp-block-area-disappearing'); + setTimeout(function () { + if (element) { + element.classList.remove('abp-block-area-disappearing'); + element.parentElement.removeChild(element); + } + }, 250); + } + }; + + /* UI BUSY */ + //Defines UI Busy API, not implements it + + abp.ui.setBusy = function (opts) { + if (!opts) { + opts = { + busy: true + }; + } else if (typeof opts == 'string') { + opts = { + elm: opts, + busy: true + }; + } + + abp.ui.block(opts); + }; + + abp.ui.clearBusy = function (opts) { + abp.ui.unblock(opts); + }; + + /* SIMPLE EVENT BUS *****************************************/ + + abp.event = (function () { + + var _callbacks = {}; + + var on = function (eventName, callback) { + if (!_callbacks[eventName]) { + _callbacks[eventName] = []; + } + + _callbacks[eventName].push(callback); + }; + + var off = function (eventName, callback) { + var callbacks = _callbacks[eventName]; + if (!callbacks) { + return; + } + + var index = -1; + for (var i = 0; i < callbacks.length; i++) { + if (callbacks[i] === callback) { + index = i; + break; + } + } + + if (index < 0) { + return; + } + + _callbacks[eventName].splice(index, 1); + }; + + var trigger = function (eventName) { + var callbacks = _callbacks[eventName]; + if (!callbacks || !callbacks.length) { + return; + } + + var args = Array.prototype.slice.call(arguments, 1); + for (var i = 0; i < callbacks.length; i++) { + callbacks[i].apply(this, args); + } + }; + + // Public interface /////////////////////////////////////////////////// + + return { + on: on, + off: off, + trigger: trigger + }; + })(); + + + /* UTILS ***************************************************/ + + abp.utils = abp.utils || {}; + + /* Creates a name namespace. + * Example: + * var taskService = abp.utils.createNamespace(abp, 'services.task'); + * taskService will be equal to abp.services.task + * first argument (root) must be defined first + ************************************************************/ + abp.utils.createNamespace = function (root, ns) { + var parts = ns.split('.'); + for (var i = 0; i < parts.length; i++) { + if (typeof root[parts[i]] == 'undefined') { + root[parts[i]] = {}; + } + + root = root[parts[i]]; + } + + return root; + }; + + /* Find and replaces a string (search) to another string (replacement) in + * given string (str). + * Example: + * abp.utils.replaceAll('This is a test string', 'is', 'X') = 'ThX X a test string' + ************************************************************/ + abp.utils.replaceAll = function (str, search, replacement) { + var fix = search.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); + return str.replace(new RegExp(fix, 'g'), replacement); + }; + + /* Formats a string just like string.format in C#. + * Example: + * abp.utils.formatString('Hello {0}','Tuana') = 'Hello Tuana' + ************************************************************/ + abp.utils.formatString = function () { + if (arguments.length < 1) { + return null; + } + + var str = arguments[0]; + + for (var i = 1; i < arguments.length; i++) { + var placeHolder = '{' + (i - 1) + '}'; + str = abp.utils.replaceAll(str, placeHolder, arguments[i]); + } + + return str; + }; + + abp.utils.toPascalCase = function (str) { + if (!str || !str.length) { + return str; + } + + if (str.length === 1) { + return str.charAt(0).toUpperCase(); + } + + return str.charAt(0).toUpperCase() + str.substr(1); + } + + abp.utils.toCamelCase = function (str) { + if (!str || !str.length) { + return str; + } + + if (str.length === 1) { + return str.charAt(0).toLowerCase(); + } + + return str.charAt(0).toLowerCase() + str.substr(1); + } + + abp.utils.truncateString = function (str, maxLength) { + if (!str || !str.length || str.length <= maxLength) { + return str; + } + + return str.substr(0, maxLength); + }; + + abp.utils.truncateStringWithPostfix = function (str, maxLength, postfix) { + postfix = postfix || '...'; + + if (!str || !str.length || str.length <= maxLength) { + return str; + } + + if (maxLength <= postfix.length) { + return postfix.substr(0, maxLength); + } + + return str.substr(0, maxLength - postfix.length) + postfix; + }; + + abp.utils.isFunction = function (obj) { + return !!(obj && obj.constructor && obj.call && obj.apply); + }; + + /** + * parameterInfos should be an array of { name, value } objects + * where name is query string parameter name and value is it's value. + * includeQuestionMark is true by default. + */ + abp.utils.buildQueryString = function (parameterInfos, includeQuestionMark) { + if (includeQuestionMark === undefined) { + includeQuestionMark = true; + } + + var qs = ''; + + function addSeperator() { + if (!qs.length) { + if (includeQuestionMark) { + qs = qs + '?'; + } + } else { + qs = qs + '&'; + } + } + + for (var i = 0; i < parameterInfos.length; ++i) { + var parameterInfo = parameterInfos[i]; + if (parameterInfo.value === undefined) { + continue; + } + + if (parameterInfo.value === null) { + parameterInfo.value = ''; + } + + addSeperator(); + + if (parameterInfo.value.toJSON && typeof parameterInfo.value.toJSON === "function") { + qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value.toJSON()); + } else if (Array.isArray(parameterInfo.value) && parameterInfo.value.length) { + for (var j = 0; j < parameterInfo.value.length; j++) { + if (j > 0) { + addSeperator(); + } + + qs = qs + parameterInfo.name + '[' + j + ']=' + encodeURIComponent(parameterInfo.value[j]); + } + } else { + qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value); + } + } + + return qs; + } + + /** + * Sets a cookie value for given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @param {string} value + * @param {Date} expireDate (optional). If not specified the cookie will expire at the end of session. + * @param {string} path (optional) + */ + abp.utils.setCookieValue = function (key, value, expireDate, path) { + var cookieValue = encodeURIComponent(key) + '='; + + if (value) { + cookieValue = cookieValue + encodeURIComponent(value); + } + + if (expireDate) { + cookieValue = cookieValue + "; expires=" + expireDate.toUTCString(); + } + + if (path) { + cookieValue = cookieValue + "; path=" + path; + } + + document.cookie = cookieValue; + }; + + /** + * Gets a cookie with given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @returns {string} Cookie value or null + */ + abp.utils.getCookieValue = function (key) { + var equalities = document.cookie.split('; '); + for (var i = 0; i < equalities.length; i++) { + if (!equalities[i]) { + continue; + } + + var splitted = equalities[i].split('='); + if (splitted.length != 2) { + continue; + } + + if (decodeURIComponent(splitted[0]) === key) { + return decodeURIComponent(splitted[1] || ''); + } + } + + return null; + }; + + /** + * Deletes cookie for given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @param {string} path (optional) + */ + abp.utils.deleteCookie = function (key, path) { + var cookieValue = encodeURIComponent(key) + '='; + + cookieValue = cookieValue + "; expires=" + (new Date(new Date().getTime() - 86400000)).toUTCString(); + + if (path) { + cookieValue = cookieValue + "; path=" + path; + } + + document.cookie = cookieValue; + } + + /* SECURITY ***************************************/ + abp.security = abp.security || {}; + abp.security.antiForgery = abp.security.antiForgery || {}; + + abp.security.antiForgery.tokenCookieName = 'XSRF-TOKEN'; + abp.security.antiForgery.tokenHeaderName = 'X-XSRF-TOKEN'; + + abp.security.antiForgery.getToken = function () { + return abp.utils.getCookieValue(abp.security.antiForgery.tokenCookieName); + }; + })(); \ No newline at end of file diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/wwwroot/libs/abp/jquery/abp.jquery.js b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/wwwroot/libs/abp/jquery/abp.jquery.js index 6e2ee001b8..e6aff047f7 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/wwwroot/libs/abp/jquery/abp.jquery.js +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/wwwroot/libs/abp/jquery/abp.jquery.js @@ -1,393 +1,393 @@ -var abp = abp || {}; -(function($) { - - if (!$) { - throw "abp/jquery library requires the jquery library included to the page!"; - } - - // ABP CORE OVERRIDES ///////////////////////////////////////////////////// - - abp.message._showMessage = function (message, title) { - alert((title || '') + ' ' + message); - - return $.Deferred(function ($dfd) { - $dfd.resolve(); - }); - }; - - abp.message.confirm = function (message, titleOrCallback, callback) { - if (titleOrCallback && !(typeof titleOrCallback == 'string')) { - callback = titleOrCallback; - } - - var result = confirm(message); - callback && callback(result); - - return $.Deferred(function ($dfd) { - $dfd.resolve(result); - }); - }; - - abp.utils.isFunction = function (obj) { - return $.isFunction(obj); - }; - - // JQUERY EXTENSIONS ////////////////////////////////////////////////////// - - $.fn.findWithSelf = function (selector) { - return this.filter(selector).add(this.find(selector)); - }; - - // DOM //////////////////////////////////////////////////////////////////// - - abp.dom = abp.dom || {}; - - abp.dom.onNodeAdded = function (callback) { - abp.event.on('abp.dom.nodeAdded', callback); - }; - - abp.dom.onNodeRemoved = function (callback) { - abp.event.on('abp.dom.nodeRemoved', callback); - }; - - var mutationObserverCallback = function (mutationsList) { - for (var i = 0; i < mutationsList.length; i++) { - var mutation = mutationsList[i]; - if (mutation.type === 'childList') { - if (mutation.addedNodes && mutation.removedNodes.length) { - for (var k = 0; k < mutation.removedNodes.length; k++) { - abp.event.trigger( - 'abp.dom.nodeRemoved', - { - $el: $(mutation.removedNodes[k]) - } - ); - } - } - - if (mutation.addedNodes && mutation.addedNodes.length) { - for (var j = 0; j < mutation.addedNodes.length; j++) { - abp.event.trigger( - 'abp.dom.nodeAdded', - { - $el: $(mutation.addedNodes[j]) - } - ); - } - } - } - } - }; - - new MutationObserver(mutationObserverCallback).observe( - $('body')[0], - { - subtree: true, - childList: true - } - ); - - // AJAX /////////////////////////////////////////////////////////////////// - - abp.ajax = function (userOptions) { - userOptions = userOptions || {}; - - var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); - - options.success = undefined; - options.error = undefined; - - return $.Deferred(function ($dfd) { - $.ajax(options) - .done(function (data, textStatus, jqXHR) { - $dfd.resolve(data); - userOptions.success && userOptions.success(data); - }).fail(function (jqXHR) { - if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { - abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); - } else { - abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); - } - }); - }); - }; - - $.extend(abp.ajax, { - defaultOpts: { - dataType: 'json', - type: 'POST', - contentType: 'application/json', - headers: { - 'X-Requested-With': 'XMLHttpRequest' - } - }, - - defaultError: { - message: 'An error has occurred!', - details: 'Error detail not sent by server.' - }, - - defaultError401: { - message: 'You are not authenticated!', - details: 'You should be authenticated (sign in) in order to perform this operation.' - }, - - defaultError403: { - message: 'You are not authorized!', - details: 'You are not allowed to perform this operation.' - }, - - defaultError404: { - message: 'Resource not found!', - details: 'The resource requested could not found on the server.' - }, - - logError: function (error) { - abp.log.error(error); - }, - - showError: function (error) { - if (error.details) { - return abp.message.error(error.details, error.message); - } else { - return abp.message.error(error.message || abp.ajax.defaultError.message); - } - }, - - handleTargetUrl: function (targetUrl) { - if (!targetUrl) { - location.href = abp.appPath; - } else { - location.href = targetUrl; - } - }, - - handleErrorStatusCode: function (status) { - switch (status) { - case 401: - abp.ajax.handleUnAuthorizedRequest( - abp.ajax.showError(abp.ajax.defaultError401), - abp.appPath - ); - break; - case 403: - abp.ajax.showError(abp.ajax.defaultError403); - break; - case 404: - abp.ajax.showError(abp.ajax.defaultError404); - break; - default: - abp.ajax.showError(abp.ajax.defaultError); - break; - } - }, - - handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { - if (userOptions.abpHandleError !== false) { - abp.ajax.handleErrorStatusCode(jqXHR.status); - } - - $dfd.reject.apply(this, arguments); - userOptions.error && userOptions.error.apply(this, arguments); - }, - - handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { - var messagePromise = null; - - if (userOptions.abpHandleError !== false) { - messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); - } - - abp.ajax.logError(jqXHR.responseJSON.error); - - $dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); - userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); - - if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { - abp.ajax.handleUnAuthorizedRequest(messagePromise); - } - }, - - handleUnAuthorizedRequest: function (messagePromise, targetUrl) { - if (messagePromise) { - messagePromise.done(function () { - abp.ajax.handleTargetUrl(targetUrl); - }); - } else { - abp.ajax.handleTargetUrl(targetUrl); - } - }, - - blockUI: function (options) { - if (options.blockUI) { - if (options.blockUI === true) { //block whole page - abp.ui.setBusy(); - } else { //block an element - abp.ui.setBusy(options.blockUI); - } - } - }, - - unblockUI: function (options) { - if (options.blockUI) { - if (options.blockUI === true) { //unblock whole page - abp.ui.clearBusy(); - } else { //unblock an element - abp.ui.clearBusy(options.blockUI); - } - } - }, - - ajaxSendHandler: function (event, request, settings) { - var token = abp.security.antiForgery.getToken(); - if (!token) { - return; - } - - if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { - request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); - } - } - }); - - $(document).ajaxSend(function (event, request, settings) { - return abp.ajax.ajaxSendHandler(event, request, settings); - }); - - abp.event.on('abp.configurationInitialized', function () { - var l = abp.localization.getResource('AbpUi'); - - abp.ajax.defaultError.message = l('DefaultErrorMessage'); - abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); - abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); - abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); - abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); - abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); - abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); - abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); - }); - - // RESOURCE LOADER //////////////////////////////////////////////////////// - - /* UrlStates enum */ - var UrlStates = { - LOADING: 'LOADING', - LOADED: 'LOADED', - FAILED: 'FAILED' - }; - - /* UrlInfo class */ - function UrlInfo(url) { - this.url = url; - this.state = UrlStates.LOADING; - this.loadCallbacks = []; - this.failCallbacks = []; - } - - UrlInfo.prototype.succeed = function () { - this.state = UrlStates.LOADED; - for (var i = 0; i < this.loadCallbacks.length; i++) { - this.loadCallbacks[i](); - } - }; - - UrlInfo.prototype.failed = function () { - this.state = UrlStates.FAILED; - for (var i = 0; i < this.failCallbacks.length; i++) { - this.failCallbacks[i](); - } - }; - - UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { - switch (this.state) { - case UrlStates.LOADED: - loadCallback && loadCallback(); - break; - case UrlStates.FAILED: - failCallback && failCallback(); - break; - case UrlStates.LOADING: - this.addCallbacks(loadCallback, failCallback); - break; - } - }; - - UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { - loadCallback && this.loadCallbacks.push(loadCallback); - failCallback && this.failCallbacks.push(failCallback); - }; - - /* ResourceLoader API */ - - abp.ResourceLoader = (function () { - - var _urlInfos = {}; - - function getCacheKey(url) { - return url; - } - - function appendTimeToUrl(url) { - - if (url.indexOf('?') < 0) { - url += '?'; - } else { - url += '&'; - } - - url += '_=' + new Date().getTime(); - - return url; - } - - var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { - - var cacheKey = getCacheKey(url); - - var urlInfo = _urlInfos[cacheKey]; - - if (urlInfo) { - urlInfo.handleCallbacks(loadCallback, failCallback); - return; - } - - _urlInfos[cacheKey] = urlInfo = new UrlInfo(url); - urlInfo.addCallbacks(loadCallback, failCallback); - - serverLoader(urlInfo); - }; - - var _loadScript = function (url, loadCallback, failCallback) { - _loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { - $.get({ - url: url, - dataType: 'text' - }) - .done(function (script) { - $.globalEval(script); - urlInfo.succeed(); - }) - .fail(function () { - urlInfo.failed(); - }); - }); - }; - - var _loadStyle = function (url) { - _loadFromUrl(url, undefined, undefined, function (urlInfo) { - - $('', { - rel: 'stylesheet', - type: 'text/css', - href: appendTimeToUrl(url) - }).appendTo('head'); - }); - }; - - return { - loadScript: _loadScript, - loadStyle: _loadStyle - } - })(); - +var abp = abp || {}; +(function($) { + + if (!$) { + throw "abp/jquery library requires the jquery library included to the page!"; + } + + // ABP CORE OVERRIDES ///////////////////////////////////////////////////// + + abp.message._showMessage = function (message, title) { + alert((title || '') + ' ' + message); + + return $.Deferred(function ($dfd) { + $dfd.resolve(); + }); + }; + + abp.message.confirm = function (message, titleOrCallback, callback) { + if (titleOrCallback && !(typeof titleOrCallback == 'string')) { + callback = titleOrCallback; + } + + var result = confirm(message); + callback && callback(result); + + return $.Deferred(function ($dfd) { + $dfd.resolve(result); + }); + }; + + abp.utils.isFunction = function (obj) { + return $.isFunction(obj); + }; + + // JQUERY EXTENSIONS ////////////////////////////////////////////////////// + + $.fn.findWithSelf = function (selector) { + return this.filter(selector).add(this.find(selector)); + }; + + // DOM //////////////////////////////////////////////////////////////////// + + abp.dom = abp.dom || {}; + + abp.dom.onNodeAdded = function (callback) { + abp.event.on('abp.dom.nodeAdded', callback); + }; + + abp.dom.onNodeRemoved = function (callback) { + abp.event.on('abp.dom.nodeRemoved', callback); + }; + + var mutationObserverCallback = function (mutationsList) { + for (var i = 0; i < mutationsList.length; i++) { + var mutation = mutationsList[i]; + if (mutation.type === 'childList') { + if (mutation.addedNodes && mutation.removedNodes.length) { + for (var k = 0; k < mutation.removedNodes.length; k++) { + abp.event.trigger( + 'abp.dom.nodeRemoved', + { + $el: $(mutation.removedNodes[k]) + } + ); + } + } + + if (mutation.addedNodes && mutation.addedNodes.length) { + for (var j = 0; j < mutation.addedNodes.length; j++) { + abp.event.trigger( + 'abp.dom.nodeAdded', + { + $el: $(mutation.addedNodes[j]) + } + ); + } + } + } + } + }; + + new MutationObserver(mutationObserverCallback).observe( + $('body')[0], + { + subtree: true, + childList: true + } + ); + + // AJAX /////////////////////////////////////////////////////////////////// + + abp.ajax = function (userOptions) { + userOptions = userOptions || {}; + + var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); + + options.success = undefined; + options.error = undefined; + + return $.Deferred(function ($dfd) { + $.ajax(options) + .done(function (data, textStatus, jqXHR) { + $dfd.resolve(data); + userOptions.success && userOptions.success(data); + }).fail(function (jqXHR) { + if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { + abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); + } else { + abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); + } + }); + }); + }; + + $.extend(abp.ajax, { + defaultOpts: { + dataType: 'json', + type: 'POST', + contentType: 'application/json', + headers: { + 'X-Requested-With': 'XMLHttpRequest' + } + }, + + defaultError: { + message: 'An error has occurred!', + details: 'Error detail not sent by server.' + }, + + defaultError401: { + message: 'You are not authenticated!', + details: 'You should be authenticated (sign in) in order to perform this operation.' + }, + + defaultError403: { + message: 'You are not authorized!', + details: 'You are not allowed to perform this operation.' + }, + + defaultError404: { + message: 'Resource not found!', + details: 'The resource requested could not found on the server.' + }, + + logError: function (error) { + abp.log.error(error); + }, + + showError: function (error) { + if (error.details) { + return abp.message.error(error.details, error.message); + } else { + return abp.message.error(error.message || abp.ajax.defaultError.message); + } + }, + + handleTargetUrl: function (targetUrl) { + if (!targetUrl) { + location.href = abp.appPath; + } else { + location.href = targetUrl; + } + }, + + handleErrorStatusCode: function (status) { + switch (status) { + case 401: + abp.ajax.handleUnAuthorizedRequest( + abp.ajax.showError(abp.ajax.defaultError401), + abp.appPath + ); + break; + case 403: + abp.ajax.showError(abp.ajax.defaultError403); + break; + case 404: + abp.ajax.showError(abp.ajax.defaultError404); + break; + default: + abp.ajax.showError(abp.ajax.defaultError); + break; + } + }, + + handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { + if (userOptions.abpHandleError !== false) { + abp.ajax.handleErrorStatusCode(jqXHR.status); + } + + $dfd.reject.apply(this, arguments); + userOptions.error && userOptions.error.apply(this, arguments); + }, + + handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { + var messagePromise = null; + + if (userOptions.abpHandleError !== false) { + messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); + } + + abp.ajax.logError(jqXHR.responseJSON.error); + + $dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); + userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); + + if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { + abp.ajax.handleUnAuthorizedRequest(messagePromise); + } + }, + + handleUnAuthorizedRequest: function (messagePromise, targetUrl) { + if (messagePromise) { + messagePromise.done(function () { + abp.ajax.handleTargetUrl(targetUrl); + }); + } else { + abp.ajax.handleTargetUrl(targetUrl); + } + }, + + blockUI: function (options) { + if (options.blockUI) { + if (options.blockUI === true) { //block whole page + abp.ui.setBusy(); + } else { //block an element + abp.ui.setBusy(options.blockUI); + } + } + }, + + unblockUI: function (options) { + if (options.blockUI) { + if (options.blockUI === true) { //unblock whole page + abp.ui.clearBusy(); + } else { //unblock an element + abp.ui.clearBusy(options.blockUI); + } + } + }, + + ajaxSendHandler: function (event, request, settings) { + var token = abp.security.antiForgery.getToken(); + if (!token) { + return; + } + + if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { + request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); + } + } + }); + + $(document).ajaxSend(function (event, request, settings) { + return abp.ajax.ajaxSendHandler(event, request, settings); + }); + + abp.event.on('abp.configurationInitialized', function () { + var l = abp.localization.getResource('AbpUi'); + + abp.ajax.defaultError.message = l('DefaultErrorMessage'); + abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); + abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); + abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); + abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); + abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); + abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); + abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); + }); + + // RESOURCE LOADER //////////////////////////////////////////////////////// + + /* UrlStates enum */ + var UrlStates = { + LOADING: 'LOADING', + LOADED: 'LOADED', + FAILED: 'FAILED' + }; + + /* UrlInfo class */ + function UrlInfo(url) { + this.url = url; + this.state = UrlStates.LOADING; + this.loadCallbacks = []; + this.failCallbacks = []; + } + + UrlInfo.prototype.succeed = function () { + this.state = UrlStates.LOADED; + for (var i = 0; i < this.loadCallbacks.length; i++) { + this.loadCallbacks[i](); + } + }; + + UrlInfo.prototype.failed = function () { + this.state = UrlStates.FAILED; + for (var i = 0; i < this.failCallbacks.length; i++) { + this.failCallbacks[i](); + } + }; + + UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { + switch (this.state) { + case UrlStates.LOADED: + loadCallback && loadCallback(); + break; + case UrlStates.FAILED: + failCallback && failCallback(); + break; + case UrlStates.LOADING: + this.addCallbacks(loadCallback, failCallback); + break; + } + }; + + UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { + loadCallback && this.loadCallbacks.push(loadCallback); + failCallback && this.failCallbacks.push(failCallback); + }; + + /* ResourceLoader API */ + + abp.ResourceLoader = (function () { + + var _urlInfos = {}; + + function getCacheKey(url) { + return url; + } + + function appendTimeToUrl(url) { + + if (url.indexOf('?') < 0) { + url += '?'; + } else { + url += '&'; + } + + url += '_=' + new Date().getTime(); + + return url; + } + + var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { + + var cacheKey = getCacheKey(url); + + var urlInfo = _urlInfos[cacheKey]; + + if (urlInfo) { + urlInfo.handleCallbacks(loadCallback, failCallback); + return; + } + + _urlInfos[cacheKey] = urlInfo = new UrlInfo(url); + urlInfo.addCallbacks(loadCallback, failCallback); + + serverLoader(urlInfo); + }; + + var _loadScript = function (url, loadCallback, failCallback) { + _loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { + $.get({ + url: url, + dataType: 'text' + }) + .done(function (script) { + $.globalEval(script); + urlInfo.succeed(); + }) + .fail(function () { + urlInfo.failed(); + }); + }); + }; + + var _loadStyle = function (url) { + _loadFromUrl(url, undefined, undefined, function (urlInfo) { + + $('', { + rel: 'stylesheet', + type: 'text/css', + href: appendTimeToUrl(url) + }).appendTo('head'); + }); + }; + + return { + loadScript: _loadScript, + loadStyle: _loadStyle + } + })(); + })(jQuery); \ No newline at end of file diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/yarn.lock b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/yarn.lock index d125f98cc5..157d0f2e34 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/yarn.lock +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/yarn.lock @@ -2,37 +2,37 @@ # yarn lockfile v1 -"@abp/aspnetcore.mvc.ui.theme.basic@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-2.1.0.tgz#f815001bd856fb5cbdd0b736181f2401a1a7ec62" - integrity sha512-ej6dhUo3H9w6bpBTpMhk3M6zbC3fVAVMm5yLSYlYJ0sQxjb9PqC02OgiJme0mkxCUMwPuHVSQLrMQbioXdZu3A== +"@abp/aspnetcore.mvc.ui.theme.basic@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-2.2.0.tgz#e7f4e57d2b17cc76388e9c56bc34d50c9658873b" + integrity sha512-S9GQ9YVg4DWrgjujwiXBER6KqdqW5nZ1Bmt+YEePn5gEoPvoVrh6ojthpHYRjBJtGFqBSzRAQ9eVZLebT22Ozg== dependencies: - "@abp/aspnetcore.mvc.ui.theme.shared" "^2.1.0" + "@abp/aspnetcore.mvc.ui.theme.shared" "^2.2.0" -"@abp/aspnetcore.mvc.ui.theme.shared@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-2.1.0.tgz#c2790241b5a44b9d6e4f65911a1b9d9e9104ed82" - integrity sha512-dxC0P/b1T+QJmRrB8HoLM7/GkWblz/X5lLqgn583W7/OTYhvxIxszuRDy/XIEuS+fP6a9rcGvGu5jcKJEqe/xA== - dependencies: - "@abp/aspnetcore.mvc.ui" "^2.1.0" - "@abp/bootstrap" "^2.1.0" - "@abp/bootstrap-datepicker" "^2.1.0" - "@abp/datatables.net-bs4" "^2.1.0" - "@abp/font-awesome" "^2.1.0" - "@abp/jquery-form" "^2.1.0" - "@abp/jquery-validation-unobtrusive" "^2.1.0" - "@abp/lodash" "^2.1.0" - "@abp/luxon" "^2.1.0" - "@abp/malihu-custom-scrollbar-plugin" "^2.1.0" - "@abp/select2" "^2.1.0" - "@abp/sweetalert" "^2.1.0" - "@abp/timeago" "^2.1.0" - "@abp/toastr" "^2.1.0" - -"@abp/aspnetcore.mvc.ui@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-2.1.0.tgz#3c86f42e52af3151d2aee0ffdd1281014ea61054" - integrity sha512-pKiKMBOPuLm7p44DW8DdbsVn5PY3NqGYkz6gf75uzxyWiVYyl2CM/bvX9w4Ie7Q969owENMLrBREN6ezWZ5ynA== +"@abp/aspnetcore.mvc.ui.theme.shared@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-2.2.0.tgz#e0df953853be2a184d323931573f9f98aebbaa62" + integrity sha512-urxziaCdvfEqN5cjiiM5f5dx2Yr+AoGqCJVCo0Okjl2dosdaj5DH4SBzMvKAaLXzo3Ep1h4b3Wvws4BThL/6rA== + dependencies: + "@abp/aspnetcore.mvc.ui" "^2.2.0" + "@abp/bootstrap" "^2.2.0" + "@abp/bootstrap-datepicker" "^2.2.0" + "@abp/datatables.net-bs4" "^2.2.0" + "@abp/font-awesome" "^2.2.0" + "@abp/jquery-form" "^2.2.0" + "@abp/jquery-validation-unobtrusive" "^2.2.0" + "@abp/lodash" "^2.2.0" + "@abp/luxon" "^2.2.0" + "@abp/malihu-custom-scrollbar-plugin" "^2.2.0" + "@abp/select2" "^2.2.0" + "@abp/sweetalert" "^2.2.0" + "@abp/timeago" "^2.2.0" + "@abp/toastr" "^2.2.0" + +"@abp/aspnetcore.mvc.ui@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-2.2.0.tgz#b2cdd421eed09ec1d30ae85e14434b7efc094ade" + integrity sha512-IO/AjhJu+LUa9zOaT8JlEnV+Pcp9oQ3q9kTq8kmMakC35vTIyvBpB3nnykXIOytZSyjsBgFYB/uMxPgBOjWagg== dependencies: ansi-colors "^4.1.1" extend-object "^1.0.0" @@ -41,135 +41,135 @@ path "^0.12.7" rimraf "^3.0.0" -"@abp/bootstrap-datepicker@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-2.1.0.tgz#a0d71da15cb3d3cc02f9a390437a44db5e9f9ea1" - integrity sha512-lkNI0iyefiXS2O5x9Ae9eJQLPXSQlOWDX7QhKnBHLR9JxjJEnhBUIIOylMltAIqtVDtjk2ikDyd3BAiyBdtB/w== +"@abp/bootstrap-datepicker@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-2.2.0.tgz#a2f50b422824f18ed4b7e80be6852e2979119f8e" + integrity sha512-X9jT5mU42QFfVhOZdun7aEJUf3bMko6NsG3NFQVjqTqKH+iYGKfHPFpXD0gP/6Nb4KgZUdId8hSyQTZyOK2JEA== dependencies: bootstrap-datepicker "^1.9.0" -"@abp/bootstrap@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-2.1.0.tgz#7ce15d4effac0e0991a3520c4666c6cb17a3fef2" - integrity sha512-1xQjqu6shCgzd1FI94y5AIXGIhBlZEoRrOhaT84j/2KzYiDvhP+LAqQjMgqlQmBLs6vMckpxtf5thxKTMXvtOw== +"@abp/bootstrap@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-2.2.0.tgz#16e41d3432117bbcd9012c6f735c49c543255879" + integrity sha512-aRmluu6SkIl+JgCzSSJZrDPkYr6WWaQdY0iJAOz6NHtffa7Aumh1IUOrLVKL0T1pQn6QKs0Z7JDGyYMdh1HPkQ== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" bootstrap "^4.3.1" -"@abp/core@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/core/-/core-2.1.0.tgz#0cd2850f029df1d18517b8e74c70341972c37ed7" - integrity sha512-1wnRo00hWncZWSakaEXm388XhhbKXDVkWDIdaT3kyQpvp3kX1lFx7I5iiZiwIeULwZRF9mi6HV6iHEze58x0kQ== +"@abp/core@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/core/-/core-2.2.0.tgz#4eea0a06458c90acb8566a11eb841fe65d15d256" + integrity sha512-tBGHa5CUr0ewT31g689RAfQ6Su2p4uyn2PzmrW/8lahBrvqkoCb41fkCDLQJkTY5rKPrEKZd/s9OoyOnS20DLg== -"@abp/datatables.net-bs4@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-2.1.0.tgz#a0f36cf4e3ef96ae03aa4b9956fcb8b971c854cb" - integrity sha512-93qc2rrGs+JKRPM/7UCasa5VmfswgYU8cv3Ybg5OKoaASODYUn06GChRFnd/mvqcDxw4+8gaqpC3U2ETZZI4pA== +"@abp/datatables.net-bs4@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-2.2.0.tgz#c7cc49e889b295ae10fb24ed62b154ef79ffc85a" + integrity sha512-zjJRPqOCWPfkHt1QztfFHKrsTE9o6Je2EpfA7hRMej2FlGbsMWUxOqx/btK1vjD6YIU8DtVDpIdj1WvPOITQ4Q== dependencies: - "@abp/datatables.net" "^2.1.0" + "@abp/datatables.net" "^2.2.0" datatables.net-bs4 "^1.10.20" -"@abp/datatables.net@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-2.1.0.tgz#674eaaa5b0948d7ee85b6605bfbad1a70f839aa7" - integrity sha512-3ZM2p+JpHumxbIKlDP/LKLsfceMdttdTOL0ckIZCmAAgoIeKmAtuMoKcHTr8lj5mjgv4arBGvG9WVCemep2PEw== +"@abp/datatables.net@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-2.2.0.tgz#22f9c7ca90c2d4af264483b4f8286b0feb7c3d52" + integrity sha512-L4MnpdloSWr/px3mvV75sxsxL68MyALB2LKdzCFMQWILCZVkxMmQb9LARINYIrn461Wrc+zbYWNEBD0MAq7flg== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" datatables.net "^1.10.20" -"@abp/font-awesome@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-2.1.0.tgz#c2e628a1b9d0525e7d6950bf007feebcd1c490c8" - integrity sha512-vlm1IQuQVfuCI2O1vphDd11zUEJ4/4PU0/0XI1YCpilse8fBg080CM3+G0kw6Erm/riznqhOJwBcfT+K+zqk8A== +"@abp/font-awesome@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-2.2.0.tgz#2de39e3c6c3e8c30394d82861761a66c5b4032f0" + integrity sha512-RT06MYUGgaWBEpW5c7wUcfMXgxcOHWdX/C01LDO/j6iVoKBuBHOkkvcUoTWII068ECrLYOkj+RyT59dCKm8FFw== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" "@fortawesome/fontawesome-free" "^5.11.2" -"@abp/jquery-form@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-2.1.0.tgz#285dbfdcf722cb0249f149e728cef7f788410c0c" - integrity sha512-A17rjHTiBJBKYgrtDX5wIqnI89wNmo3bdK9NagL1wMFj4GvDyOZoRIDLqkopYQsc8zuPjqw4+1aa2TPiA+jtKg== +"@abp/jquery-form@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-2.2.0.tgz#951653fac4013a7bbec065b5101b86d575e0eca7" + integrity sha512-ji44E3Ud0S3LNXn1WJ/Aw44qAIG7EITEW1KOe46oz+/awPpbiiA4dDDNleTvO2jI2/s8mNyR0bNanP6BUsc7tw== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" jquery-form "^4.2.2" -"@abp/jquery-validation-unobtrusive@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-2.1.0.tgz#fc938775ced2efc686e7dd092d6ceff1ea947f36" - integrity sha512-a8iBIj6amJ9rQNV+wxQUuEVh93M/c32kJcrwSEPWQcOoTj5gf0j8eKK9YvZaGokpylraz9mdGOwYQQuNj1sxEw== +"@abp/jquery-validation-unobtrusive@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-2.2.0.tgz#6d39ba9f7bf026d1380796bf5dff76c8d16b42ce" + integrity sha512-SuS/dRRVz7ZR4HK/h9x0jRRVLPqXN0CPRGPdJZ1LJraXVEJ9/eDEGf1rMlHmEGt1FXXFTD01/zjisbweDE786w== dependencies: - "@abp/jquery-validation" "^2.1.0" + "@abp/jquery-validation" "^2.2.0" jquery-validation-unobtrusive "^3.2.11" -"@abp/jquery-validation@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-2.1.0.tgz#2bf1a31321cce3b2abe6d56c6112c52a8ecb28b6" - integrity sha512-kU6/E+Xc3wHAUs+sGMAL8uozkXv65HnpksTwV4/+RK+D6iFU2EyNgCEFu7QGSwYZsV1/7YsCe2GD4ucBXIknbA== +"@abp/jquery-validation@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-2.2.0.tgz#02bb8ba883e72c1204867ee4d1c1094bd91c4c4c" + integrity sha512-ypITQloO4iEDgqlA6qb3taj+7HMX0Cf/ACA2OvtrvOgJejx6J4wfrPjwuFZu1WWJ0xtc9yTdbovdcSVcQbIGaA== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" jquery-validation "^1.19.1" -"@abp/jquery@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-2.1.0.tgz#fb5b4c9e8622cf46fee92f9f731d007d5fb200bb" - integrity sha512-ZpfzRut5G611bBmuDdiT6BD0M7Rl1P6r8uNxUjdmFXYwFd8wD02ZhIcsX7qFHFkYERuXfcLrZh4rpw9G1DVCJg== +"@abp/jquery@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-2.2.0.tgz#0e641b1109e78eff4c34331ca2b123b67cc30cbe" + integrity sha512-vEfRoFEAmDmRgSq98Y9EZExfQFSWtmjaHrodUu+MadTcRlnn+wHq8wwkKKxpj/eYtNc8aFORpyHMMH7uliAKxg== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" jquery "^3.4.1" -"@abp/lodash@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-2.1.0.tgz#9fc9e6521e6284d607cedbff1a458fa324137c5c" - integrity sha512-s1gTHhpbmEDDCsZeXb9MpClkDS4wH5R2IWPRZUlSPxo3gF0pvkx5ubdhYUEUgqy5QqWxE/+zUAjDc4x+cEriFQ== +"@abp/lodash@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-2.2.0.tgz#af0a2ebcb28fd0a8c02da5026479d9370ed19719" + integrity sha512-wOMLqIpuq4a7ww7pB138G6YxBiTGBgxNW/IWGUiWbfgrr88cGPKIYYv/8O8mvr8PLNGjizNynuwQRj522yA3Dw== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" lodash "^4.17.15" -"@abp/luxon@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-2.1.0.tgz#624796722119f075119006b436054aecbb38f15f" - integrity sha512-2b0sRo6rdYT1wDu9nSXm/9o8rhQ9ED7FxrDMYabYuOQz48esgn4fBUNcPqpxwejpFmlhZY6CONvkddNtaMeVHw== +"@abp/luxon@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-2.2.0.tgz#0d0e78edc249853fa31eceecc00df2846a879aa9" + integrity sha512-WbOW0PcMks+WXRPWt/+H4pOa5waM331WkY0F+EJx8fpxemNGQNUEXLkuMXzN3MrN6LrplM9AZ9i+NRA9PWHbNw== dependencies: luxon "^1.21.3" -"@abp/malihu-custom-scrollbar-plugin@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-2.1.0.tgz#f4dc1a32cefc3de8af08cb6d585ec5f7636a0c5e" - integrity sha512-WcxzCZ5YOMxGxZerEh966cVrFSCw1UTDqwU2rxA/LsHEbPKd69AY+SHvUiacNxPXs1ZCF6FFJ29C5dWicEIRaQ== +"@abp/malihu-custom-scrollbar-plugin@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-2.2.0.tgz#e11fd46dccbb28d44fb199e880b91d27c94f1919" + integrity sha512-YDu/NLpIzMA96NDHxd27/+liTm3sow9M+oWH29+9JW8o/AEpXUH3T3AmoXXcTgsBlzLaewgHEFM8yxsAAFoj8Q== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" malihu-custom-scrollbar-plugin "^3.1.5" -"@abp/select2@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-2.1.0.tgz#79e50d2c25e74a5f96520e8aa1433d79aea674d1" - integrity sha512-ut/3c+lFdoepuDH36M7thWagmAmTFrChcPnhYjTx4MmIf31WW1BwqOSx3I2g8M+NEEx+V2jTNuBpTq7PONgSJg== +"@abp/select2@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-2.2.0.tgz#4639d4e5b72b1736fa4476bd9b6a78e036400421" + integrity sha512-tc87JyM0kvVF388kyGUjDby49Zrrb089jVRRipoIaxXeu4M1YxEFSKBEcUK1MohZWjVtWrNs8MoxPlfukaMpyw== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" select2 "^4.0.12" -"@abp/sweetalert@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-2.1.0.tgz#88f405c4ba9f9ed2fd54b945ed6bc48d5ae2fa23" - integrity sha512-EWvReqxZ1DrNH9XD+cf/yGVj+8IPTpuoPuWKDryN4fF7TCMJA+KrXp5lFxpjfkKTtNzLeFGsJqDFWaUifxtqTA== +"@abp/sweetalert@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-2.2.0.tgz#dfc60ba085522d8390e41b90bf5a3d474f4ae624" + integrity sha512-HS6TKOwP91UjzjZHaheurZ1AYUSMkQyCSmoX6g5LAK4eH8IIgpojVSp1AFCSPATrFsFWY/dzkDGcfu90FWsVBg== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" sweetalert "^2.1.2" -"@abp/timeago@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-2.1.0.tgz#28c0aef88aff8b54d1dfb42a664d05097e7fda35" - integrity sha512-NklUYcWeji7po+Y6Oi7b7IkYmjd5YRu123bm3MqjQ71AzuOCTFbvPMHzYOjrUTkzr6gW3IJ24LQ4YmpshPy4ZQ== +"@abp/timeago@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-2.2.0.tgz#9a8297f36a46cdc4cc62f44d0fdc91b70def389c" + integrity sha512-8qjmKscsTvPznHKWEsddYxdSBiU+l+OgLG6vzMcSWqngYbDQGXqNA93BwJI2qiwd+FkNcfGgYg7CN7bcwzmaiw== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" timeago "^1.6.7" -"@abp/toastr@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-2.1.0.tgz#22a53a2b1f354770fdc7b37f06bec10eefccfe7a" - integrity sha512-hD3hTDx+CixTVTx73rnZDiiFkfSxpZox8RLm+CiFA62ORdO8Ryij8TOXXkJd84b2tJfkAkYehohVXKwHlHU7Zg== +"@abp/toastr@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-2.2.0.tgz#1cad83a89da244685b3c82adff64260b7ccf4742" + integrity sha512-HHfSaw4M/9zS+KgzxGvbHYiQ5qcJgpf21cRZEo16aUwnTeKr4SRaewAWryNn4dKcIO2YNrhzDLH+OYbEaJJlDQ== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" toastr "^2.1.4" "@fortawesome/fontawesome-free@^5.11.2": diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/package.json b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/package.json index bd35b85b18..5d035c76c9 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/package.json +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/package.json @@ -3,6 +3,6 @@ "name": "my-app-identityserver", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.basic": "^2.1.0" + "@abp/aspnetcore.mvc.ui.theme.basic": "^2.2.0" } } \ No newline at end of file diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/wwwroot/libs/abp/core/abp.css b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/wwwroot/libs/abp/core/abp.css index ee3c5080a5..ddf9cae5b2 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/wwwroot/libs/abp/core/abp.css +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/wwwroot/libs/abp/core/abp.css @@ -1,56 +1,56 @@ -@keyframes spin { - 0% { - transform: translateZ(0) rotate(0deg); - } - - 100% { - transform: translateZ(0) rotate(360deg); - } -} - -.abp-block-area { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: 102; - background-color: #fff; - opacity: .8; - transition: opacity .25s; -} - - .abp-block-area.abp-block-area-disappearing { - opacity: 0; - } - - .abp-block-area.abp-block-area-busy:after { - content: attr(data-text); - display: block; - max-width: 125px; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - font-size: 20px; - font-family: sans-serif; - color: #343a40; - text-align: center; - text-transform: uppercase; - } - - .abp-block-area.abp-block-area-busy:before { - content: ""; - display: block; - width: 150px; - height: 150px; - border-radius: 50%; - border-width: 2px; - border-style: solid; - border-color: transparent #228ae6 #228ae6 #228ae6; - position: absolute; - top: calc(50% - 75px); - left: calc(50% - 75px); - will-change: transform; - animation: spin .75s infinite ease-in-out; - } +@keyframes spin { + 0% { + transform: translateZ(0) rotate(0deg); + } + + 100% { + transform: translateZ(0) rotate(360deg); + } +} + +.abp-block-area { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 102; + background-color: #fff; + opacity: .8; + transition: opacity .25s; +} + + .abp-block-area.abp-block-area-disappearing { + opacity: 0; + } + + .abp-block-area.abp-block-area-busy:after { + content: attr(data-text); + display: block; + max-width: 125px; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + font-size: 20px; + font-family: sans-serif; + color: #343a40; + text-align: center; + text-transform: uppercase; + } + + .abp-block-area.abp-block-area-busy:before { + content: ""; + display: block; + width: 150px; + height: 150px; + border-radius: 50%; + border-width: 2px; + border-style: solid; + border-color: transparent #228ae6 #228ae6 #228ae6; + position: absolute; + top: calc(50% - 75px); + left: calc(50% - 75px); + will-change: transform; + animation: spin .75s infinite ease-in-out; + } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/wwwroot/libs/abp/core/abp.js b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/wwwroot/libs/abp/core/abp.js index cef1cf55e1..730db8bc97 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/wwwroot/libs/abp/core/abp.js +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/wwwroot/libs/abp/core/abp.js @@ -1,636 +1,636 @@ -var abp = abp || {}; -(function () { - - /* Application paths *****************************************/ - - //Current application root path (including virtual directory if exists). - abp.appPath = abp.appPath || '/'; - - abp.pageLoadTime = new Date(); - - //Converts given path to absolute path using abp.appPath variable. - abp.toAbsAppPath = function (path) { - if (path.indexOf('/') == 0) { - path = path.substring(1); - } - - return abp.appPath + path; - }; - - /* LOGGING ***************************************************/ - //Implements Logging API that provides secure & controlled usage of console.log - - abp.log = abp.log || {}; - - abp.log.levels = { - DEBUG: 1, - INFO: 2, - WARN: 3, - ERROR: 4, - FATAL: 5 - }; - - abp.log.level = abp.log.levels.DEBUG; - - abp.log.log = function (logObject, logLevel) { - if (!window.console || !window.console.log) { - return; - } - - if (logLevel != undefined && logLevel < abp.log.level) { - return; - } - - console.log(logObject); - }; - - abp.log.debug = function (logObject) { - abp.log.log("DEBUG: ", abp.log.levels.DEBUG); - abp.log.log(logObject, abp.log.levels.DEBUG); - }; - - abp.log.info = function (logObject) { - abp.log.log("INFO: ", abp.log.levels.INFO); - abp.log.log(logObject, abp.log.levels.INFO); - }; - - abp.log.warn = function (logObject) { - abp.log.log("WARN: ", abp.log.levels.WARN); - abp.log.log(logObject, abp.log.levels.WARN); - }; - - abp.log.error = function (logObject) { - abp.log.log("ERROR: ", abp.log.levels.ERROR); - abp.log.log(logObject, abp.log.levels.ERROR); - }; - - abp.log.fatal = function (logObject) { - abp.log.log("FATAL: ", abp.log.levels.FATAL); - abp.log.log(logObject, abp.log.levels.FATAL); - }; - - /* LOCALIZATION ***********************************************/ - - abp.localization = abp.localization || {}; - - abp.localization.values = {}; - - abp.localization.localize = function (key, sourceName) { - sourceName = sourceName || abp.localization.defaultResourceName; - - var source = abp.localization.values[sourceName]; - - if (!source) { - abp.log.warn('Could not find localization source: ' + sourceName); - return key; - } - - var value = source[key]; - if (value == undefined) { - return key; - } - - var copiedArguments = Array.prototype.slice.call(arguments, 0); - copiedArguments.splice(1, 1); - copiedArguments[0] = value; - - return abp.utils.formatString.apply(this, copiedArguments); - }; - - abp.localization.getResource = function (name) { - return function () { - var copiedArguments = Array.prototype.slice.call(arguments, 0); - copiedArguments.splice(1, 0, name); - return abp.localization.localize.apply(this, copiedArguments); - }; - }; - - abp.localization.defaultResourceName = undefined; - - /* AUTHORIZATION **********************************************/ - - abp.auth = abp.auth || {}; - - abp.auth.policies = abp.auth.policies || {}; - - abp.auth.grantedPolicies = abp.auth.grantedPolicies || {}; - - abp.auth.isGranted = function (policyName) { - return abp.auth.policies[policyName] != undefined && abp.auth.grantedPolicies[policyName] != undefined; - }; - - abp.auth.isAnyGranted = function () { - if (!arguments || arguments.length <= 0) { - return true; - } - - for (var i = 0; i < arguments.length; i++) { - if (abp.auth.isGranted(arguments[i])) { - return true; - } - } - - return false; - }; - - abp.auth.areAllGranted = function () { - if (!arguments || arguments.length <= 0) { - return true; - } - - for (var i = 0; i < arguments.length; i++) { - if (!abp.auth.isGranted(arguments[i])) { - return false; - } - } - - return true; - }; - - abp.auth.tokenCookieName = 'Abp.AuthToken'; - - abp.auth.setToken = function (authToken, expireDate) { - abp.utils.setCookieValue(abp.auth.tokenCookieName, authToken, expireDate, abp.appPath, abp.domain); - }; - - abp.auth.getToken = function () { - return abp.utils.getCookieValue(abp.auth.tokenCookieName); - } - - abp.auth.clearToken = function () { - abp.auth.setToken(); - } - - /* SETTINGS *************************************************/ - - abp.setting = abp.setting || {}; - - abp.setting.values = abp.setting.values || {}; - - abp.setting.get = function (name) { - return abp.setting.values[name]; - }; - - abp.setting.getBoolean = function (name) { - var value = abp.setting.get(name); - return value == 'true' || value == 'True'; - }; - - abp.setting.getInt = function (name) { - return parseInt(abp.setting.values[name]); - }; - - /* NOTIFICATION *********************************************/ - //Defines Notification API, not implements it - - abp.notify = abp.notify || {}; - - abp.notify.success = function (message, title, options) { - abp.log.warn('abp.notify.success is not implemented!'); - }; - - abp.notify.info = function (message, title, options) { - abp.log.warn('abp.notify.info is not implemented!'); - }; - - abp.notify.warn = function (message, title, options) { - abp.log.warn('abp.notify.warn is not implemented!'); - }; - - abp.notify.error = function (message, title, options) { - abp.log.warn('abp.notify.error is not implemented!'); - }; - - /* MESSAGE **************************************************/ - //Defines Message API, not implements it - - abp.message = abp.message || {}; - - abp.message._showMessage = function (message, title) { - alert((title || '') + ' ' + message); - }; - - abp.message.info = function (message, title) { - abp.log.warn('abp.message.info is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.success = function (message, title) { - abp.log.warn('abp.message.success is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.warn = function (message, title) { - abp.log.warn('abp.message.warn is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.error = function (message, title) { - abp.log.warn('abp.message.error is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.confirm = function (message, titleOrCallback, callback) { - abp.log.warn('abp.message.confirm is not properly implemented!'); - - if (titleOrCallback && !(typeof titleOrCallback == 'string')) { - callback = titleOrCallback; - } - - var result = confirm(message); - callback && callback(result); - }; - - /* UI *******************************************************/ - - abp.ui = abp.ui || {}; - - /* UI BLOCK */ - //Defines UI Block API and implements basically - - var $abpBlockArea = document.createElement('div'); - $abpBlockArea.classList.add('abp-block-area'); - - /* opts: { //Can be an object with options or a string for query a selector - * elm: a query selector (optional - default: document.body) - * busy: boolean (optional - default: false) - * promise: A promise with always or finally handler (optional - auto unblocks the ui if provided) - * } - */ - abp.ui.block = function (opts) { - if (!opts) { - opts = {}; - } else if (typeof opts == 'string') { - opts = { - elm: opts - }; - } - - var $elm = document.querySelector(opts.elm) || document.body; - - if (opts.busy) { - $abpBlockArea.classList.add('abp-block-area-busy'); - } else { - $abpBlockArea.classList.remove('abp-block-area-busy'); - } - - if (document.querySelector(opts.elm)) { - $abpBlockArea.style.position = 'absolute'; - } else { - $abpBlockArea.style.position = 'fixed'; - } - - $elm.appendChild($abpBlockArea); - - if (opts.promise) { - if (opts.promise.always) { //jQuery.Deferred style - opts.promise.always(function () { - abp.ui.unblock({ - $elm: opts.elm - }); - }); - } else if (opts.promise['finally']) { //Q style - opts.promise['finally'](function () { - abp.ui.unblock({ - $elm: opts.elm - }); - }); - } - } - }; - - /* opts: { - * - * } - */ - abp.ui.unblock = function (opts) { - var element = document.querySelector('.abp-block-area'); - if (element) { - element.classList.add('abp-block-area-disappearing'); - setTimeout(function () { - if (element) { - element.classList.remove('abp-block-area-disappearing'); - element.parentElement.removeChild(element); - } - }, 250); - } - }; - - /* UI BUSY */ - //Defines UI Busy API, not implements it - - abp.ui.setBusy = function (opts) { - if (!opts) { - opts = { - busy: true - }; - } else if (typeof opts == 'string') { - opts = { - elm: opts, - busy: true - }; - } - - abp.ui.block(opts); - }; - - abp.ui.clearBusy = function (opts) { - abp.ui.unblock(opts); - }; - - /* SIMPLE EVENT BUS *****************************************/ - - abp.event = (function () { - - var _callbacks = {}; - - var on = function (eventName, callback) { - if (!_callbacks[eventName]) { - _callbacks[eventName] = []; - } - - _callbacks[eventName].push(callback); - }; - - var off = function (eventName, callback) { - var callbacks = _callbacks[eventName]; - if (!callbacks) { - return; - } - - var index = -1; - for (var i = 0; i < callbacks.length; i++) { - if (callbacks[i] === callback) { - index = i; - break; - } - } - - if (index < 0) { - return; - } - - _callbacks[eventName].splice(index, 1); - }; - - var trigger = function (eventName) { - var callbacks = _callbacks[eventName]; - if (!callbacks || !callbacks.length) { - return; - } - - var args = Array.prototype.slice.call(arguments, 1); - for (var i = 0; i < callbacks.length; i++) { - callbacks[i].apply(this, args); - } - }; - - // Public interface /////////////////////////////////////////////////// - - return { - on: on, - off: off, - trigger: trigger - }; - })(); - - - /* UTILS ***************************************************/ - - abp.utils = abp.utils || {}; - - /* Creates a name namespace. - * Example: - * var taskService = abp.utils.createNamespace(abp, 'services.task'); - * taskService will be equal to abp.services.task - * first argument (root) must be defined first - ************************************************************/ - abp.utils.createNamespace = function (root, ns) { - var parts = ns.split('.'); - for (var i = 0; i < parts.length; i++) { - if (typeof root[parts[i]] == 'undefined') { - root[parts[i]] = {}; - } - - root = root[parts[i]]; - } - - return root; - }; - - /* Find and replaces a string (search) to another string (replacement) in - * given string (str). - * Example: - * abp.utils.replaceAll('This is a test string', 'is', 'X') = 'ThX X a test string' - ************************************************************/ - abp.utils.replaceAll = function (str, search, replacement) { - var fix = search.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); - return str.replace(new RegExp(fix, 'g'), replacement); - }; - - /* Formats a string just like string.format in C#. - * Example: - * abp.utils.formatString('Hello {0}','Tuana') = 'Hello Tuana' - ************************************************************/ - abp.utils.formatString = function () { - if (arguments.length < 1) { - return null; - } - - var str = arguments[0]; - - for (var i = 1; i < arguments.length; i++) { - var placeHolder = '{' + (i - 1) + '}'; - str = abp.utils.replaceAll(str, placeHolder, arguments[i]); - } - - return str; - }; - - abp.utils.toPascalCase = function (str) { - if (!str || !str.length) { - return str; - } - - if (str.length === 1) { - return str.charAt(0).toUpperCase(); - } - - return str.charAt(0).toUpperCase() + str.substr(1); - } - - abp.utils.toCamelCase = function (str) { - if (!str || !str.length) { - return str; - } - - if (str.length === 1) { - return str.charAt(0).toLowerCase(); - } - - return str.charAt(0).toLowerCase() + str.substr(1); - } - - abp.utils.truncateString = function (str, maxLength) { - if (!str || !str.length || str.length <= maxLength) { - return str; - } - - return str.substr(0, maxLength); - }; - - abp.utils.truncateStringWithPostfix = function (str, maxLength, postfix) { - postfix = postfix || '...'; - - if (!str || !str.length || str.length <= maxLength) { - return str; - } - - if (maxLength <= postfix.length) { - return postfix.substr(0, maxLength); - } - - return str.substr(0, maxLength - postfix.length) + postfix; - }; - - abp.utils.isFunction = function (obj) { - return !!(obj && obj.constructor && obj.call && obj.apply); - }; - - /** - * parameterInfos should be an array of { name, value } objects - * where name is query string parameter name and value is it's value. - * includeQuestionMark is true by default. - */ - abp.utils.buildQueryString = function (parameterInfos, includeQuestionMark) { - if (includeQuestionMark === undefined) { - includeQuestionMark = true; - } - - var qs = ''; - - function addSeperator() { - if (!qs.length) { - if (includeQuestionMark) { - qs = qs + '?'; - } - } else { - qs = qs + '&'; - } - } - - for (var i = 0; i < parameterInfos.length; ++i) { - var parameterInfo = parameterInfos[i]; - if (parameterInfo.value === undefined) { - continue; - } - - if (parameterInfo.value === null) { - parameterInfo.value = ''; - } - - addSeperator(); - - if (parameterInfo.value.toJSON && typeof parameterInfo.value.toJSON === "function") { - qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value.toJSON()); - } else if (Array.isArray(parameterInfo.value) && parameterInfo.value.length) { - for (var j = 0; j < parameterInfo.value.length; j++) { - if (j > 0) { - addSeperator(); - } - - qs = qs + parameterInfo.name + '[' + j + ']=' + encodeURIComponent(parameterInfo.value[j]); - } - } else { - qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value); - } - } - - return qs; - } - - /** - * Sets a cookie value for given key. - * This is a simple implementation created to be used by ABP. - * Please use a complete cookie library if you need. - * @param {string} key - * @param {string} value - * @param {Date} expireDate (optional). If not specified the cookie will expire at the end of session. - * @param {string} path (optional) - */ - abp.utils.setCookieValue = function (key, value, expireDate, path) { - var cookieValue = encodeURIComponent(key) + '='; - - if (value) { - cookieValue = cookieValue + encodeURIComponent(value); - } - - if (expireDate) { - cookieValue = cookieValue + "; expires=" + expireDate.toUTCString(); - } - - if (path) { - cookieValue = cookieValue + "; path=" + path; - } - - document.cookie = cookieValue; - }; - - /** - * Gets a cookie with given key. - * This is a simple implementation created to be used by ABP. - * Please use a complete cookie library if you need. - * @param {string} key - * @returns {string} Cookie value or null - */ - abp.utils.getCookieValue = function (key) { - var equalities = document.cookie.split('; '); - for (var i = 0; i < equalities.length; i++) { - if (!equalities[i]) { - continue; - } - - var splitted = equalities[i].split('='); - if (splitted.length != 2) { - continue; - } - - if (decodeURIComponent(splitted[0]) === key) { - return decodeURIComponent(splitted[1] || ''); - } - } - - return null; - }; - - /** - * Deletes cookie for given key. - * This is a simple implementation created to be used by ABP. - * Please use a complete cookie library if you need. - * @param {string} key - * @param {string} path (optional) - */ - abp.utils.deleteCookie = function (key, path) { - var cookieValue = encodeURIComponent(key) + '='; - - cookieValue = cookieValue + "; expires=" + (new Date(new Date().getTime() - 86400000)).toUTCString(); - - if (path) { - cookieValue = cookieValue + "; path=" + path; - } - - document.cookie = cookieValue; - } - - /* SECURITY ***************************************/ - abp.security = abp.security || {}; - abp.security.antiForgery = abp.security.antiForgery || {}; - - abp.security.antiForgery.tokenCookieName = 'XSRF-TOKEN'; - abp.security.antiForgery.tokenHeaderName = 'X-XSRF-TOKEN'; - - abp.security.antiForgery.getToken = function () { - return abp.utils.getCookieValue(abp.security.antiForgery.tokenCookieName); - }; - +var abp = abp || {}; +(function () { + + /* Application paths *****************************************/ + + //Current application root path (including virtual directory if exists). + abp.appPath = abp.appPath || '/'; + + abp.pageLoadTime = new Date(); + + //Converts given path to absolute path using abp.appPath variable. + abp.toAbsAppPath = function (path) { + if (path.indexOf('/') == 0) { + path = path.substring(1); + } + + return abp.appPath + path; + }; + + /* LOGGING ***************************************************/ + //Implements Logging API that provides secure & controlled usage of console.log + + abp.log = abp.log || {}; + + abp.log.levels = { + DEBUG: 1, + INFO: 2, + WARN: 3, + ERROR: 4, + FATAL: 5 + }; + + abp.log.level = abp.log.levels.DEBUG; + + abp.log.log = function (logObject, logLevel) { + if (!window.console || !window.console.log) { + return; + } + + if (logLevel != undefined && logLevel < abp.log.level) { + return; + } + + console.log(logObject); + }; + + abp.log.debug = function (logObject) { + abp.log.log("DEBUG: ", abp.log.levels.DEBUG); + abp.log.log(logObject, abp.log.levels.DEBUG); + }; + + abp.log.info = function (logObject) { + abp.log.log("INFO: ", abp.log.levels.INFO); + abp.log.log(logObject, abp.log.levels.INFO); + }; + + abp.log.warn = function (logObject) { + abp.log.log("WARN: ", abp.log.levels.WARN); + abp.log.log(logObject, abp.log.levels.WARN); + }; + + abp.log.error = function (logObject) { + abp.log.log("ERROR: ", abp.log.levels.ERROR); + abp.log.log(logObject, abp.log.levels.ERROR); + }; + + abp.log.fatal = function (logObject) { + abp.log.log("FATAL: ", abp.log.levels.FATAL); + abp.log.log(logObject, abp.log.levels.FATAL); + }; + + /* LOCALIZATION ***********************************************/ + + abp.localization = abp.localization || {}; + + abp.localization.values = {}; + + abp.localization.localize = function (key, sourceName) { + sourceName = sourceName || abp.localization.defaultResourceName; + + var source = abp.localization.values[sourceName]; + + if (!source) { + abp.log.warn('Could not find localization source: ' + sourceName); + return key; + } + + var value = source[key]; + if (value == undefined) { + return key; + } + + var copiedArguments = Array.prototype.slice.call(arguments, 0); + copiedArguments.splice(1, 1); + copiedArguments[0] = value; + + return abp.utils.formatString.apply(this, copiedArguments); + }; + + abp.localization.getResource = function (name) { + return function () { + var copiedArguments = Array.prototype.slice.call(arguments, 0); + copiedArguments.splice(1, 0, name); + return abp.localization.localize.apply(this, copiedArguments); + }; + }; + + abp.localization.defaultResourceName = undefined; + + /* AUTHORIZATION **********************************************/ + + abp.auth = abp.auth || {}; + + abp.auth.policies = abp.auth.policies || {}; + + abp.auth.grantedPolicies = abp.auth.grantedPolicies || {}; + + abp.auth.isGranted = function (policyName) { + return abp.auth.policies[policyName] != undefined && abp.auth.grantedPolicies[policyName] != undefined; + }; + + abp.auth.isAnyGranted = function () { + if (!arguments || arguments.length <= 0) { + return true; + } + + for (var i = 0; i < arguments.length; i++) { + if (abp.auth.isGranted(arguments[i])) { + return true; + } + } + + return false; + }; + + abp.auth.areAllGranted = function () { + if (!arguments || arguments.length <= 0) { + return true; + } + + for (var i = 0; i < arguments.length; i++) { + if (!abp.auth.isGranted(arguments[i])) { + return false; + } + } + + return true; + }; + + abp.auth.tokenCookieName = 'Abp.AuthToken'; + + abp.auth.setToken = function (authToken, expireDate) { + abp.utils.setCookieValue(abp.auth.tokenCookieName, authToken, expireDate, abp.appPath, abp.domain); + }; + + abp.auth.getToken = function () { + return abp.utils.getCookieValue(abp.auth.tokenCookieName); + } + + abp.auth.clearToken = function () { + abp.auth.setToken(); + } + + /* SETTINGS *************************************************/ + + abp.setting = abp.setting || {}; + + abp.setting.values = abp.setting.values || {}; + + abp.setting.get = function (name) { + return abp.setting.values[name]; + }; + + abp.setting.getBoolean = function (name) { + var value = abp.setting.get(name); + return value == 'true' || value == 'True'; + }; + + abp.setting.getInt = function (name) { + return parseInt(abp.setting.values[name]); + }; + + /* NOTIFICATION *********************************************/ + //Defines Notification API, not implements it + + abp.notify = abp.notify || {}; + + abp.notify.success = function (message, title, options) { + abp.log.warn('abp.notify.success is not implemented!'); + }; + + abp.notify.info = function (message, title, options) { + abp.log.warn('abp.notify.info is not implemented!'); + }; + + abp.notify.warn = function (message, title, options) { + abp.log.warn('abp.notify.warn is not implemented!'); + }; + + abp.notify.error = function (message, title, options) { + abp.log.warn('abp.notify.error is not implemented!'); + }; + + /* MESSAGE **************************************************/ + //Defines Message API, not implements it + + abp.message = abp.message || {}; + + abp.message._showMessage = function (message, title) { + alert((title || '') + ' ' + message); + }; + + abp.message.info = function (message, title) { + abp.log.warn('abp.message.info is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.success = function (message, title) { + abp.log.warn('abp.message.success is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.warn = function (message, title) { + abp.log.warn('abp.message.warn is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.error = function (message, title) { + abp.log.warn('abp.message.error is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.confirm = function (message, titleOrCallback, callback) { + abp.log.warn('abp.message.confirm is not properly implemented!'); + + if (titleOrCallback && !(typeof titleOrCallback == 'string')) { + callback = titleOrCallback; + } + + var result = confirm(message); + callback && callback(result); + }; + + /* UI *******************************************************/ + + abp.ui = abp.ui || {}; + + /* UI BLOCK */ + //Defines UI Block API and implements basically + + var $abpBlockArea = document.createElement('div'); + $abpBlockArea.classList.add('abp-block-area'); + + /* opts: { //Can be an object with options or a string for query a selector + * elm: a query selector (optional - default: document.body) + * busy: boolean (optional - default: false) + * promise: A promise with always or finally handler (optional - auto unblocks the ui if provided) + * } + */ + abp.ui.block = function (opts) { + if (!opts) { + opts = {}; + } else if (typeof opts == 'string') { + opts = { + elm: opts + }; + } + + var $elm = document.querySelector(opts.elm) || document.body; + + if (opts.busy) { + $abpBlockArea.classList.add('abp-block-area-busy'); + } else { + $abpBlockArea.classList.remove('abp-block-area-busy'); + } + + if (document.querySelector(opts.elm)) { + $abpBlockArea.style.position = 'absolute'; + } else { + $abpBlockArea.style.position = 'fixed'; + } + + $elm.appendChild($abpBlockArea); + + if (opts.promise) { + if (opts.promise.always) { //jQuery.Deferred style + opts.promise.always(function () { + abp.ui.unblock({ + $elm: opts.elm + }); + }); + } else if (opts.promise['finally']) { //Q style + opts.promise['finally'](function () { + abp.ui.unblock({ + $elm: opts.elm + }); + }); + } + } + }; + + /* opts: { + * + * } + */ + abp.ui.unblock = function (opts) { + var element = document.querySelector('.abp-block-area'); + if (element) { + element.classList.add('abp-block-area-disappearing'); + setTimeout(function () { + if (element) { + element.classList.remove('abp-block-area-disappearing'); + element.parentElement.removeChild(element); + } + }, 250); + } + }; + + /* UI BUSY */ + //Defines UI Busy API, not implements it + + abp.ui.setBusy = function (opts) { + if (!opts) { + opts = { + busy: true + }; + } else if (typeof opts == 'string') { + opts = { + elm: opts, + busy: true + }; + } + + abp.ui.block(opts); + }; + + abp.ui.clearBusy = function (opts) { + abp.ui.unblock(opts); + }; + + /* SIMPLE EVENT BUS *****************************************/ + + abp.event = (function () { + + var _callbacks = {}; + + var on = function (eventName, callback) { + if (!_callbacks[eventName]) { + _callbacks[eventName] = []; + } + + _callbacks[eventName].push(callback); + }; + + var off = function (eventName, callback) { + var callbacks = _callbacks[eventName]; + if (!callbacks) { + return; + } + + var index = -1; + for (var i = 0; i < callbacks.length; i++) { + if (callbacks[i] === callback) { + index = i; + break; + } + } + + if (index < 0) { + return; + } + + _callbacks[eventName].splice(index, 1); + }; + + var trigger = function (eventName) { + var callbacks = _callbacks[eventName]; + if (!callbacks || !callbacks.length) { + return; + } + + var args = Array.prototype.slice.call(arguments, 1); + for (var i = 0; i < callbacks.length; i++) { + callbacks[i].apply(this, args); + } + }; + + // Public interface /////////////////////////////////////////////////// + + return { + on: on, + off: off, + trigger: trigger + }; + })(); + + + /* UTILS ***************************************************/ + + abp.utils = abp.utils || {}; + + /* Creates a name namespace. + * Example: + * var taskService = abp.utils.createNamespace(abp, 'services.task'); + * taskService will be equal to abp.services.task + * first argument (root) must be defined first + ************************************************************/ + abp.utils.createNamespace = function (root, ns) { + var parts = ns.split('.'); + for (var i = 0; i < parts.length; i++) { + if (typeof root[parts[i]] == 'undefined') { + root[parts[i]] = {}; + } + + root = root[parts[i]]; + } + + return root; + }; + + /* Find and replaces a string (search) to another string (replacement) in + * given string (str). + * Example: + * abp.utils.replaceAll('This is a test string', 'is', 'X') = 'ThX X a test string' + ************************************************************/ + abp.utils.replaceAll = function (str, search, replacement) { + var fix = search.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); + return str.replace(new RegExp(fix, 'g'), replacement); + }; + + /* Formats a string just like string.format in C#. + * Example: + * abp.utils.formatString('Hello {0}','Tuana') = 'Hello Tuana' + ************************************************************/ + abp.utils.formatString = function () { + if (arguments.length < 1) { + return null; + } + + var str = arguments[0]; + + for (var i = 1; i < arguments.length; i++) { + var placeHolder = '{' + (i - 1) + '}'; + str = abp.utils.replaceAll(str, placeHolder, arguments[i]); + } + + return str; + }; + + abp.utils.toPascalCase = function (str) { + if (!str || !str.length) { + return str; + } + + if (str.length === 1) { + return str.charAt(0).toUpperCase(); + } + + return str.charAt(0).toUpperCase() + str.substr(1); + } + + abp.utils.toCamelCase = function (str) { + if (!str || !str.length) { + return str; + } + + if (str.length === 1) { + return str.charAt(0).toLowerCase(); + } + + return str.charAt(0).toLowerCase() + str.substr(1); + } + + abp.utils.truncateString = function (str, maxLength) { + if (!str || !str.length || str.length <= maxLength) { + return str; + } + + return str.substr(0, maxLength); + }; + + abp.utils.truncateStringWithPostfix = function (str, maxLength, postfix) { + postfix = postfix || '...'; + + if (!str || !str.length || str.length <= maxLength) { + return str; + } + + if (maxLength <= postfix.length) { + return postfix.substr(0, maxLength); + } + + return str.substr(0, maxLength - postfix.length) + postfix; + }; + + abp.utils.isFunction = function (obj) { + return !!(obj && obj.constructor && obj.call && obj.apply); + }; + + /** + * parameterInfos should be an array of { name, value } objects + * where name is query string parameter name and value is it's value. + * includeQuestionMark is true by default. + */ + abp.utils.buildQueryString = function (parameterInfos, includeQuestionMark) { + if (includeQuestionMark === undefined) { + includeQuestionMark = true; + } + + var qs = ''; + + function addSeperator() { + if (!qs.length) { + if (includeQuestionMark) { + qs = qs + '?'; + } + } else { + qs = qs + '&'; + } + } + + for (var i = 0; i < parameterInfos.length; ++i) { + var parameterInfo = parameterInfos[i]; + if (parameterInfo.value === undefined) { + continue; + } + + if (parameterInfo.value === null) { + parameterInfo.value = ''; + } + + addSeperator(); + + if (parameterInfo.value.toJSON && typeof parameterInfo.value.toJSON === "function") { + qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value.toJSON()); + } else if (Array.isArray(parameterInfo.value) && parameterInfo.value.length) { + for (var j = 0; j < parameterInfo.value.length; j++) { + if (j > 0) { + addSeperator(); + } + + qs = qs + parameterInfo.name + '[' + j + ']=' + encodeURIComponent(parameterInfo.value[j]); + } + } else { + qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value); + } + } + + return qs; + } + + /** + * Sets a cookie value for given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @param {string} value + * @param {Date} expireDate (optional). If not specified the cookie will expire at the end of session. + * @param {string} path (optional) + */ + abp.utils.setCookieValue = function (key, value, expireDate, path) { + var cookieValue = encodeURIComponent(key) + '='; + + if (value) { + cookieValue = cookieValue + encodeURIComponent(value); + } + + if (expireDate) { + cookieValue = cookieValue + "; expires=" + expireDate.toUTCString(); + } + + if (path) { + cookieValue = cookieValue + "; path=" + path; + } + + document.cookie = cookieValue; + }; + + /** + * Gets a cookie with given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @returns {string} Cookie value or null + */ + abp.utils.getCookieValue = function (key) { + var equalities = document.cookie.split('; '); + for (var i = 0; i < equalities.length; i++) { + if (!equalities[i]) { + continue; + } + + var splitted = equalities[i].split('='); + if (splitted.length != 2) { + continue; + } + + if (decodeURIComponent(splitted[0]) === key) { + return decodeURIComponent(splitted[1] || ''); + } + } + + return null; + }; + + /** + * Deletes cookie for given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @param {string} path (optional) + */ + abp.utils.deleteCookie = function (key, path) { + var cookieValue = encodeURIComponent(key) + '='; + + cookieValue = cookieValue + "; expires=" + (new Date(new Date().getTime() - 86400000)).toUTCString(); + + if (path) { + cookieValue = cookieValue + "; path=" + path; + } + + document.cookie = cookieValue; + } + + /* SECURITY ***************************************/ + abp.security = abp.security || {}; + abp.security.antiForgery = abp.security.antiForgery || {}; + + abp.security.antiForgery.tokenCookieName = 'XSRF-TOKEN'; + abp.security.antiForgery.tokenHeaderName = 'X-XSRF-TOKEN'; + + abp.security.antiForgery.getToken = function () { + return abp.utils.getCookieValue(abp.security.antiForgery.tokenCookieName); + }; + })(); \ No newline at end of file diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/wwwroot/libs/abp/jquery/abp.jquery.js b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/wwwroot/libs/abp/jquery/abp.jquery.js index 6e2ee001b8..e6aff047f7 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/wwwroot/libs/abp/jquery/abp.jquery.js +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/wwwroot/libs/abp/jquery/abp.jquery.js @@ -1,393 +1,393 @@ -var abp = abp || {}; -(function($) { - - if (!$) { - throw "abp/jquery library requires the jquery library included to the page!"; - } - - // ABP CORE OVERRIDES ///////////////////////////////////////////////////// - - abp.message._showMessage = function (message, title) { - alert((title || '') + ' ' + message); - - return $.Deferred(function ($dfd) { - $dfd.resolve(); - }); - }; - - abp.message.confirm = function (message, titleOrCallback, callback) { - if (titleOrCallback && !(typeof titleOrCallback == 'string')) { - callback = titleOrCallback; - } - - var result = confirm(message); - callback && callback(result); - - return $.Deferred(function ($dfd) { - $dfd.resolve(result); - }); - }; - - abp.utils.isFunction = function (obj) { - return $.isFunction(obj); - }; - - // JQUERY EXTENSIONS ////////////////////////////////////////////////////// - - $.fn.findWithSelf = function (selector) { - return this.filter(selector).add(this.find(selector)); - }; - - // DOM //////////////////////////////////////////////////////////////////// - - abp.dom = abp.dom || {}; - - abp.dom.onNodeAdded = function (callback) { - abp.event.on('abp.dom.nodeAdded', callback); - }; - - abp.dom.onNodeRemoved = function (callback) { - abp.event.on('abp.dom.nodeRemoved', callback); - }; - - var mutationObserverCallback = function (mutationsList) { - for (var i = 0; i < mutationsList.length; i++) { - var mutation = mutationsList[i]; - if (mutation.type === 'childList') { - if (mutation.addedNodes && mutation.removedNodes.length) { - for (var k = 0; k < mutation.removedNodes.length; k++) { - abp.event.trigger( - 'abp.dom.nodeRemoved', - { - $el: $(mutation.removedNodes[k]) - } - ); - } - } - - if (mutation.addedNodes && mutation.addedNodes.length) { - for (var j = 0; j < mutation.addedNodes.length; j++) { - abp.event.trigger( - 'abp.dom.nodeAdded', - { - $el: $(mutation.addedNodes[j]) - } - ); - } - } - } - } - }; - - new MutationObserver(mutationObserverCallback).observe( - $('body')[0], - { - subtree: true, - childList: true - } - ); - - // AJAX /////////////////////////////////////////////////////////////////// - - abp.ajax = function (userOptions) { - userOptions = userOptions || {}; - - var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); - - options.success = undefined; - options.error = undefined; - - return $.Deferred(function ($dfd) { - $.ajax(options) - .done(function (data, textStatus, jqXHR) { - $dfd.resolve(data); - userOptions.success && userOptions.success(data); - }).fail(function (jqXHR) { - if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { - abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); - } else { - abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); - } - }); - }); - }; - - $.extend(abp.ajax, { - defaultOpts: { - dataType: 'json', - type: 'POST', - contentType: 'application/json', - headers: { - 'X-Requested-With': 'XMLHttpRequest' - } - }, - - defaultError: { - message: 'An error has occurred!', - details: 'Error detail not sent by server.' - }, - - defaultError401: { - message: 'You are not authenticated!', - details: 'You should be authenticated (sign in) in order to perform this operation.' - }, - - defaultError403: { - message: 'You are not authorized!', - details: 'You are not allowed to perform this operation.' - }, - - defaultError404: { - message: 'Resource not found!', - details: 'The resource requested could not found on the server.' - }, - - logError: function (error) { - abp.log.error(error); - }, - - showError: function (error) { - if (error.details) { - return abp.message.error(error.details, error.message); - } else { - return abp.message.error(error.message || abp.ajax.defaultError.message); - } - }, - - handleTargetUrl: function (targetUrl) { - if (!targetUrl) { - location.href = abp.appPath; - } else { - location.href = targetUrl; - } - }, - - handleErrorStatusCode: function (status) { - switch (status) { - case 401: - abp.ajax.handleUnAuthorizedRequest( - abp.ajax.showError(abp.ajax.defaultError401), - abp.appPath - ); - break; - case 403: - abp.ajax.showError(abp.ajax.defaultError403); - break; - case 404: - abp.ajax.showError(abp.ajax.defaultError404); - break; - default: - abp.ajax.showError(abp.ajax.defaultError); - break; - } - }, - - handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { - if (userOptions.abpHandleError !== false) { - abp.ajax.handleErrorStatusCode(jqXHR.status); - } - - $dfd.reject.apply(this, arguments); - userOptions.error && userOptions.error.apply(this, arguments); - }, - - handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { - var messagePromise = null; - - if (userOptions.abpHandleError !== false) { - messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); - } - - abp.ajax.logError(jqXHR.responseJSON.error); - - $dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); - userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); - - if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { - abp.ajax.handleUnAuthorizedRequest(messagePromise); - } - }, - - handleUnAuthorizedRequest: function (messagePromise, targetUrl) { - if (messagePromise) { - messagePromise.done(function () { - abp.ajax.handleTargetUrl(targetUrl); - }); - } else { - abp.ajax.handleTargetUrl(targetUrl); - } - }, - - blockUI: function (options) { - if (options.blockUI) { - if (options.blockUI === true) { //block whole page - abp.ui.setBusy(); - } else { //block an element - abp.ui.setBusy(options.blockUI); - } - } - }, - - unblockUI: function (options) { - if (options.blockUI) { - if (options.blockUI === true) { //unblock whole page - abp.ui.clearBusy(); - } else { //unblock an element - abp.ui.clearBusy(options.blockUI); - } - } - }, - - ajaxSendHandler: function (event, request, settings) { - var token = abp.security.antiForgery.getToken(); - if (!token) { - return; - } - - if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { - request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); - } - } - }); - - $(document).ajaxSend(function (event, request, settings) { - return abp.ajax.ajaxSendHandler(event, request, settings); - }); - - abp.event.on('abp.configurationInitialized', function () { - var l = abp.localization.getResource('AbpUi'); - - abp.ajax.defaultError.message = l('DefaultErrorMessage'); - abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); - abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); - abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); - abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); - abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); - abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); - abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); - }); - - // RESOURCE LOADER //////////////////////////////////////////////////////// - - /* UrlStates enum */ - var UrlStates = { - LOADING: 'LOADING', - LOADED: 'LOADED', - FAILED: 'FAILED' - }; - - /* UrlInfo class */ - function UrlInfo(url) { - this.url = url; - this.state = UrlStates.LOADING; - this.loadCallbacks = []; - this.failCallbacks = []; - } - - UrlInfo.prototype.succeed = function () { - this.state = UrlStates.LOADED; - for (var i = 0; i < this.loadCallbacks.length; i++) { - this.loadCallbacks[i](); - } - }; - - UrlInfo.prototype.failed = function () { - this.state = UrlStates.FAILED; - for (var i = 0; i < this.failCallbacks.length; i++) { - this.failCallbacks[i](); - } - }; - - UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { - switch (this.state) { - case UrlStates.LOADED: - loadCallback && loadCallback(); - break; - case UrlStates.FAILED: - failCallback && failCallback(); - break; - case UrlStates.LOADING: - this.addCallbacks(loadCallback, failCallback); - break; - } - }; - - UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { - loadCallback && this.loadCallbacks.push(loadCallback); - failCallback && this.failCallbacks.push(failCallback); - }; - - /* ResourceLoader API */ - - abp.ResourceLoader = (function () { - - var _urlInfos = {}; - - function getCacheKey(url) { - return url; - } - - function appendTimeToUrl(url) { - - if (url.indexOf('?') < 0) { - url += '?'; - } else { - url += '&'; - } - - url += '_=' + new Date().getTime(); - - return url; - } - - var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { - - var cacheKey = getCacheKey(url); - - var urlInfo = _urlInfos[cacheKey]; - - if (urlInfo) { - urlInfo.handleCallbacks(loadCallback, failCallback); - return; - } - - _urlInfos[cacheKey] = urlInfo = new UrlInfo(url); - urlInfo.addCallbacks(loadCallback, failCallback); - - serverLoader(urlInfo); - }; - - var _loadScript = function (url, loadCallback, failCallback) { - _loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { - $.get({ - url: url, - dataType: 'text' - }) - .done(function (script) { - $.globalEval(script); - urlInfo.succeed(); - }) - .fail(function () { - urlInfo.failed(); - }); - }); - }; - - var _loadStyle = function (url) { - _loadFromUrl(url, undefined, undefined, function (urlInfo) { - - $('', { - rel: 'stylesheet', - type: 'text/css', - href: appendTimeToUrl(url) - }).appendTo('head'); - }); - }; - - return { - loadScript: _loadScript, - loadStyle: _loadStyle - } - })(); - +var abp = abp || {}; +(function($) { + + if (!$) { + throw "abp/jquery library requires the jquery library included to the page!"; + } + + // ABP CORE OVERRIDES ///////////////////////////////////////////////////// + + abp.message._showMessage = function (message, title) { + alert((title || '') + ' ' + message); + + return $.Deferred(function ($dfd) { + $dfd.resolve(); + }); + }; + + abp.message.confirm = function (message, titleOrCallback, callback) { + if (titleOrCallback && !(typeof titleOrCallback == 'string')) { + callback = titleOrCallback; + } + + var result = confirm(message); + callback && callback(result); + + return $.Deferred(function ($dfd) { + $dfd.resolve(result); + }); + }; + + abp.utils.isFunction = function (obj) { + return $.isFunction(obj); + }; + + // JQUERY EXTENSIONS ////////////////////////////////////////////////////// + + $.fn.findWithSelf = function (selector) { + return this.filter(selector).add(this.find(selector)); + }; + + // DOM //////////////////////////////////////////////////////////////////// + + abp.dom = abp.dom || {}; + + abp.dom.onNodeAdded = function (callback) { + abp.event.on('abp.dom.nodeAdded', callback); + }; + + abp.dom.onNodeRemoved = function (callback) { + abp.event.on('abp.dom.nodeRemoved', callback); + }; + + var mutationObserverCallback = function (mutationsList) { + for (var i = 0; i < mutationsList.length; i++) { + var mutation = mutationsList[i]; + if (mutation.type === 'childList') { + if (mutation.addedNodes && mutation.removedNodes.length) { + for (var k = 0; k < mutation.removedNodes.length; k++) { + abp.event.trigger( + 'abp.dom.nodeRemoved', + { + $el: $(mutation.removedNodes[k]) + } + ); + } + } + + if (mutation.addedNodes && mutation.addedNodes.length) { + for (var j = 0; j < mutation.addedNodes.length; j++) { + abp.event.trigger( + 'abp.dom.nodeAdded', + { + $el: $(mutation.addedNodes[j]) + } + ); + } + } + } + } + }; + + new MutationObserver(mutationObserverCallback).observe( + $('body')[0], + { + subtree: true, + childList: true + } + ); + + // AJAX /////////////////////////////////////////////////////////////////// + + abp.ajax = function (userOptions) { + userOptions = userOptions || {}; + + var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); + + options.success = undefined; + options.error = undefined; + + return $.Deferred(function ($dfd) { + $.ajax(options) + .done(function (data, textStatus, jqXHR) { + $dfd.resolve(data); + userOptions.success && userOptions.success(data); + }).fail(function (jqXHR) { + if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { + abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); + } else { + abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); + } + }); + }); + }; + + $.extend(abp.ajax, { + defaultOpts: { + dataType: 'json', + type: 'POST', + contentType: 'application/json', + headers: { + 'X-Requested-With': 'XMLHttpRequest' + } + }, + + defaultError: { + message: 'An error has occurred!', + details: 'Error detail not sent by server.' + }, + + defaultError401: { + message: 'You are not authenticated!', + details: 'You should be authenticated (sign in) in order to perform this operation.' + }, + + defaultError403: { + message: 'You are not authorized!', + details: 'You are not allowed to perform this operation.' + }, + + defaultError404: { + message: 'Resource not found!', + details: 'The resource requested could not found on the server.' + }, + + logError: function (error) { + abp.log.error(error); + }, + + showError: function (error) { + if (error.details) { + return abp.message.error(error.details, error.message); + } else { + return abp.message.error(error.message || abp.ajax.defaultError.message); + } + }, + + handleTargetUrl: function (targetUrl) { + if (!targetUrl) { + location.href = abp.appPath; + } else { + location.href = targetUrl; + } + }, + + handleErrorStatusCode: function (status) { + switch (status) { + case 401: + abp.ajax.handleUnAuthorizedRequest( + abp.ajax.showError(abp.ajax.defaultError401), + abp.appPath + ); + break; + case 403: + abp.ajax.showError(abp.ajax.defaultError403); + break; + case 404: + abp.ajax.showError(abp.ajax.defaultError404); + break; + default: + abp.ajax.showError(abp.ajax.defaultError); + break; + } + }, + + handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { + if (userOptions.abpHandleError !== false) { + abp.ajax.handleErrorStatusCode(jqXHR.status); + } + + $dfd.reject.apply(this, arguments); + userOptions.error && userOptions.error.apply(this, arguments); + }, + + handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { + var messagePromise = null; + + if (userOptions.abpHandleError !== false) { + messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); + } + + abp.ajax.logError(jqXHR.responseJSON.error); + + $dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); + userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); + + if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { + abp.ajax.handleUnAuthorizedRequest(messagePromise); + } + }, + + handleUnAuthorizedRequest: function (messagePromise, targetUrl) { + if (messagePromise) { + messagePromise.done(function () { + abp.ajax.handleTargetUrl(targetUrl); + }); + } else { + abp.ajax.handleTargetUrl(targetUrl); + } + }, + + blockUI: function (options) { + if (options.blockUI) { + if (options.blockUI === true) { //block whole page + abp.ui.setBusy(); + } else { //block an element + abp.ui.setBusy(options.blockUI); + } + } + }, + + unblockUI: function (options) { + if (options.blockUI) { + if (options.blockUI === true) { //unblock whole page + abp.ui.clearBusy(); + } else { //unblock an element + abp.ui.clearBusy(options.blockUI); + } + } + }, + + ajaxSendHandler: function (event, request, settings) { + var token = abp.security.antiForgery.getToken(); + if (!token) { + return; + } + + if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { + request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); + } + } + }); + + $(document).ajaxSend(function (event, request, settings) { + return abp.ajax.ajaxSendHandler(event, request, settings); + }); + + abp.event.on('abp.configurationInitialized', function () { + var l = abp.localization.getResource('AbpUi'); + + abp.ajax.defaultError.message = l('DefaultErrorMessage'); + abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); + abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); + abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); + abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); + abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); + abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); + abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); + }); + + // RESOURCE LOADER //////////////////////////////////////////////////////// + + /* UrlStates enum */ + var UrlStates = { + LOADING: 'LOADING', + LOADED: 'LOADED', + FAILED: 'FAILED' + }; + + /* UrlInfo class */ + function UrlInfo(url) { + this.url = url; + this.state = UrlStates.LOADING; + this.loadCallbacks = []; + this.failCallbacks = []; + } + + UrlInfo.prototype.succeed = function () { + this.state = UrlStates.LOADED; + for (var i = 0; i < this.loadCallbacks.length; i++) { + this.loadCallbacks[i](); + } + }; + + UrlInfo.prototype.failed = function () { + this.state = UrlStates.FAILED; + for (var i = 0; i < this.failCallbacks.length; i++) { + this.failCallbacks[i](); + } + }; + + UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { + switch (this.state) { + case UrlStates.LOADED: + loadCallback && loadCallback(); + break; + case UrlStates.FAILED: + failCallback && failCallback(); + break; + case UrlStates.LOADING: + this.addCallbacks(loadCallback, failCallback); + break; + } + }; + + UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { + loadCallback && this.loadCallbacks.push(loadCallback); + failCallback && this.failCallbacks.push(failCallback); + }; + + /* ResourceLoader API */ + + abp.ResourceLoader = (function () { + + var _urlInfos = {}; + + function getCacheKey(url) { + return url; + } + + function appendTimeToUrl(url) { + + if (url.indexOf('?') < 0) { + url += '?'; + } else { + url += '&'; + } + + url += '_=' + new Date().getTime(); + + return url; + } + + var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { + + var cacheKey = getCacheKey(url); + + var urlInfo = _urlInfos[cacheKey]; + + if (urlInfo) { + urlInfo.handleCallbacks(loadCallback, failCallback); + return; + } + + _urlInfos[cacheKey] = urlInfo = new UrlInfo(url); + urlInfo.addCallbacks(loadCallback, failCallback); + + serverLoader(urlInfo); + }; + + var _loadScript = function (url, loadCallback, failCallback) { + _loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { + $.get({ + url: url, + dataType: 'text' + }) + .done(function (script) { + $.globalEval(script); + urlInfo.succeed(); + }) + .fail(function () { + urlInfo.failed(); + }); + }); + }; + + var _loadStyle = function (url) { + _loadFromUrl(url, undefined, undefined, function (urlInfo) { + + $('', { + rel: 'stylesheet', + type: 'text/css', + href: appendTimeToUrl(url) + }).appendTo('head'); + }); + }; + + return { + loadScript: _loadScript, + loadStyle: _loadStyle + } + })(); + })(jQuery); \ No newline at end of file diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/yarn.lock b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/yarn.lock index 7230736133..b3b0eb268b 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/yarn.lock +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/yarn.lock @@ -2,37 +2,37 @@ # yarn lockfile v1 -"@abp/aspnetcore.mvc.ui.theme.basic@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-2.1.0.tgz#f815001bd856fb5cbdd0b736181f2401a1a7ec62" - integrity sha512-ej6dhUo3H9w6bpBTpMhk3M6zbC3fVAVMm5yLSYlYJ0sQxjb9PqC02OgiJme0mkxCUMwPuHVSQLrMQbioXdZu3A== +"@abp/aspnetcore.mvc.ui.theme.basic@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-2.2.0.tgz#e7f4e57d2b17cc76388e9c56bc34d50c9658873b" + integrity sha512-S9GQ9YVg4DWrgjujwiXBER6KqdqW5nZ1Bmt+YEePn5gEoPvoVrh6ojthpHYRjBJtGFqBSzRAQ9eVZLebT22Ozg== dependencies: - "@abp/aspnetcore.mvc.ui.theme.shared" "^2.1.0" + "@abp/aspnetcore.mvc.ui.theme.shared" "^2.2.0" -"@abp/aspnetcore.mvc.ui.theme.shared@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-2.1.0.tgz#c2790241b5a44b9d6e4f65911a1b9d9e9104ed82" - integrity sha512-dxC0P/b1T+QJmRrB8HoLM7/GkWblz/X5lLqgn583W7/OTYhvxIxszuRDy/XIEuS+fP6a9rcGvGu5jcKJEqe/xA== - dependencies: - "@abp/aspnetcore.mvc.ui" "^2.1.0" - "@abp/bootstrap" "^2.1.0" - "@abp/bootstrap-datepicker" "^2.1.0" - "@abp/datatables.net-bs4" "^2.1.0" - "@abp/font-awesome" "^2.1.0" - "@abp/jquery-form" "^2.1.0" - "@abp/jquery-validation-unobtrusive" "^2.1.0" - "@abp/lodash" "^2.1.0" - "@abp/luxon" "^2.1.0" - "@abp/malihu-custom-scrollbar-plugin" "^2.1.0" - "@abp/select2" "^2.1.0" - "@abp/sweetalert" "^2.1.0" - "@abp/timeago" "^2.1.0" - "@abp/toastr" "^2.1.0" - -"@abp/aspnetcore.mvc.ui@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-2.1.0.tgz#3c86f42e52af3151d2aee0ffdd1281014ea61054" - integrity sha512-pKiKMBOPuLm7p44DW8DdbsVn5PY3NqGYkz6gf75uzxyWiVYyl2CM/bvX9w4Ie7Q969owENMLrBREN6ezWZ5ynA== +"@abp/aspnetcore.mvc.ui.theme.shared@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-2.2.0.tgz#e0df953853be2a184d323931573f9f98aebbaa62" + integrity sha512-urxziaCdvfEqN5cjiiM5f5dx2Yr+AoGqCJVCo0Okjl2dosdaj5DH4SBzMvKAaLXzo3Ep1h4b3Wvws4BThL/6rA== + dependencies: + "@abp/aspnetcore.mvc.ui" "^2.2.0" + "@abp/bootstrap" "^2.2.0" + "@abp/bootstrap-datepicker" "^2.2.0" + "@abp/datatables.net-bs4" "^2.2.0" + "@abp/font-awesome" "^2.2.0" + "@abp/jquery-form" "^2.2.0" + "@abp/jquery-validation-unobtrusive" "^2.2.0" + "@abp/lodash" "^2.2.0" + "@abp/luxon" "^2.2.0" + "@abp/malihu-custom-scrollbar-plugin" "^2.2.0" + "@abp/select2" "^2.2.0" + "@abp/sweetalert" "^2.2.0" + "@abp/timeago" "^2.2.0" + "@abp/toastr" "^2.2.0" + +"@abp/aspnetcore.mvc.ui@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-2.2.0.tgz#b2cdd421eed09ec1d30ae85e14434b7efc094ade" + integrity sha512-IO/AjhJu+LUa9zOaT8JlEnV+Pcp9oQ3q9kTq8kmMakC35vTIyvBpB3nnykXIOytZSyjsBgFYB/uMxPgBOjWagg== dependencies: ansi-colors "^4.1.1" extend-object "^1.0.0" @@ -41,135 +41,135 @@ path "^0.12.7" rimraf "^3.0.0" -"@abp/bootstrap-datepicker@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-2.1.0.tgz#a0d71da15cb3d3cc02f9a390437a44db5e9f9ea1" - integrity sha512-lkNI0iyefiXS2O5x9Ae9eJQLPXSQlOWDX7QhKnBHLR9JxjJEnhBUIIOylMltAIqtVDtjk2ikDyd3BAiyBdtB/w== +"@abp/bootstrap-datepicker@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-2.2.0.tgz#a2f50b422824f18ed4b7e80be6852e2979119f8e" + integrity sha512-X9jT5mU42QFfVhOZdun7aEJUf3bMko6NsG3NFQVjqTqKH+iYGKfHPFpXD0gP/6Nb4KgZUdId8hSyQTZyOK2JEA== dependencies: bootstrap-datepicker "^1.9.0" -"@abp/bootstrap@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-2.1.0.tgz#7ce15d4effac0e0991a3520c4666c6cb17a3fef2" - integrity sha512-1xQjqu6shCgzd1FI94y5AIXGIhBlZEoRrOhaT84j/2KzYiDvhP+LAqQjMgqlQmBLs6vMckpxtf5thxKTMXvtOw== +"@abp/bootstrap@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-2.2.0.tgz#16e41d3432117bbcd9012c6f735c49c543255879" + integrity sha512-aRmluu6SkIl+JgCzSSJZrDPkYr6WWaQdY0iJAOz6NHtffa7Aumh1IUOrLVKL0T1pQn6QKs0Z7JDGyYMdh1HPkQ== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" bootstrap "^4.3.1" -"@abp/core@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/core/-/core-2.1.0.tgz#0cd2850f029df1d18517b8e74c70341972c37ed7" - integrity sha512-1wnRo00hWncZWSakaEXm388XhhbKXDVkWDIdaT3kyQpvp3kX1lFx7I5iiZiwIeULwZRF9mi6HV6iHEze58x0kQ== +"@abp/core@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/core/-/core-2.2.0.tgz#4eea0a06458c90acb8566a11eb841fe65d15d256" + integrity sha512-tBGHa5CUr0ewT31g689RAfQ6Su2p4uyn2PzmrW/8lahBrvqkoCb41fkCDLQJkTY5rKPrEKZd/s9OoyOnS20DLg== -"@abp/datatables.net-bs4@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-2.1.0.tgz#a0f36cf4e3ef96ae03aa4b9956fcb8b971c854cb" - integrity sha512-93qc2rrGs+JKRPM/7UCasa5VmfswgYU8cv3Ybg5OKoaASODYUn06GChRFnd/mvqcDxw4+8gaqpC3U2ETZZI4pA== +"@abp/datatables.net-bs4@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-2.2.0.tgz#c7cc49e889b295ae10fb24ed62b154ef79ffc85a" + integrity sha512-zjJRPqOCWPfkHt1QztfFHKrsTE9o6Je2EpfA7hRMej2FlGbsMWUxOqx/btK1vjD6YIU8DtVDpIdj1WvPOITQ4Q== dependencies: - "@abp/datatables.net" "^2.1.0" + "@abp/datatables.net" "^2.2.0" datatables.net-bs4 "^1.10.20" -"@abp/datatables.net@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-2.1.0.tgz#674eaaa5b0948d7ee85b6605bfbad1a70f839aa7" - integrity sha512-3ZM2p+JpHumxbIKlDP/LKLsfceMdttdTOL0ckIZCmAAgoIeKmAtuMoKcHTr8lj5mjgv4arBGvG9WVCemep2PEw== +"@abp/datatables.net@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-2.2.0.tgz#22f9c7ca90c2d4af264483b4f8286b0feb7c3d52" + integrity sha512-L4MnpdloSWr/px3mvV75sxsxL68MyALB2LKdzCFMQWILCZVkxMmQb9LARINYIrn461Wrc+zbYWNEBD0MAq7flg== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" datatables.net "^1.10.20" -"@abp/font-awesome@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-2.1.0.tgz#c2e628a1b9d0525e7d6950bf007feebcd1c490c8" - integrity sha512-vlm1IQuQVfuCI2O1vphDd11zUEJ4/4PU0/0XI1YCpilse8fBg080CM3+G0kw6Erm/riznqhOJwBcfT+K+zqk8A== +"@abp/font-awesome@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-2.2.0.tgz#2de39e3c6c3e8c30394d82861761a66c5b4032f0" + integrity sha512-RT06MYUGgaWBEpW5c7wUcfMXgxcOHWdX/C01LDO/j6iVoKBuBHOkkvcUoTWII068ECrLYOkj+RyT59dCKm8FFw== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" "@fortawesome/fontawesome-free" "^5.11.2" -"@abp/jquery-form@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-2.1.0.tgz#285dbfdcf722cb0249f149e728cef7f788410c0c" - integrity sha512-A17rjHTiBJBKYgrtDX5wIqnI89wNmo3bdK9NagL1wMFj4GvDyOZoRIDLqkopYQsc8zuPjqw4+1aa2TPiA+jtKg== +"@abp/jquery-form@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-2.2.0.tgz#951653fac4013a7bbec065b5101b86d575e0eca7" + integrity sha512-ji44E3Ud0S3LNXn1WJ/Aw44qAIG7EITEW1KOe46oz+/awPpbiiA4dDDNleTvO2jI2/s8mNyR0bNanP6BUsc7tw== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" jquery-form "^4.2.2" -"@abp/jquery-validation-unobtrusive@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-2.1.0.tgz#fc938775ced2efc686e7dd092d6ceff1ea947f36" - integrity sha512-a8iBIj6amJ9rQNV+wxQUuEVh93M/c32kJcrwSEPWQcOoTj5gf0j8eKK9YvZaGokpylraz9mdGOwYQQuNj1sxEw== +"@abp/jquery-validation-unobtrusive@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-2.2.0.tgz#6d39ba9f7bf026d1380796bf5dff76c8d16b42ce" + integrity sha512-SuS/dRRVz7ZR4HK/h9x0jRRVLPqXN0CPRGPdJZ1LJraXVEJ9/eDEGf1rMlHmEGt1FXXFTD01/zjisbweDE786w== dependencies: - "@abp/jquery-validation" "^2.1.0" + "@abp/jquery-validation" "^2.2.0" jquery-validation-unobtrusive "^3.2.11" -"@abp/jquery-validation@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-2.1.0.tgz#2bf1a31321cce3b2abe6d56c6112c52a8ecb28b6" - integrity sha512-kU6/E+Xc3wHAUs+sGMAL8uozkXv65HnpksTwV4/+RK+D6iFU2EyNgCEFu7QGSwYZsV1/7YsCe2GD4ucBXIknbA== +"@abp/jquery-validation@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-2.2.0.tgz#02bb8ba883e72c1204867ee4d1c1094bd91c4c4c" + integrity sha512-ypITQloO4iEDgqlA6qb3taj+7HMX0Cf/ACA2OvtrvOgJejx6J4wfrPjwuFZu1WWJ0xtc9yTdbovdcSVcQbIGaA== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" jquery-validation "^1.19.1" -"@abp/jquery@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-2.1.0.tgz#fb5b4c9e8622cf46fee92f9f731d007d5fb200bb" - integrity sha512-ZpfzRut5G611bBmuDdiT6BD0M7Rl1P6r8uNxUjdmFXYwFd8wD02ZhIcsX7qFHFkYERuXfcLrZh4rpw9G1DVCJg== +"@abp/jquery@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-2.2.0.tgz#0e641b1109e78eff4c34331ca2b123b67cc30cbe" + integrity sha512-vEfRoFEAmDmRgSq98Y9EZExfQFSWtmjaHrodUu+MadTcRlnn+wHq8wwkKKxpj/eYtNc8aFORpyHMMH7uliAKxg== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" jquery "^3.4.1" -"@abp/lodash@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-2.1.0.tgz#9fc9e6521e6284d607cedbff1a458fa324137c5c" - integrity sha512-s1gTHhpbmEDDCsZeXb9MpClkDS4wH5R2IWPRZUlSPxo3gF0pvkx5ubdhYUEUgqy5QqWxE/+zUAjDc4x+cEriFQ== +"@abp/lodash@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-2.2.0.tgz#af0a2ebcb28fd0a8c02da5026479d9370ed19719" + integrity sha512-wOMLqIpuq4a7ww7pB138G6YxBiTGBgxNW/IWGUiWbfgrr88cGPKIYYv/8O8mvr8PLNGjizNynuwQRj522yA3Dw== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" lodash "^4.17.15" -"@abp/luxon@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-2.1.0.tgz#624796722119f075119006b436054aecbb38f15f" - integrity sha512-2b0sRo6rdYT1wDu9nSXm/9o8rhQ9ED7FxrDMYabYuOQz48esgn4fBUNcPqpxwejpFmlhZY6CONvkddNtaMeVHw== +"@abp/luxon@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-2.2.0.tgz#0d0e78edc249853fa31eceecc00df2846a879aa9" + integrity sha512-WbOW0PcMks+WXRPWt/+H4pOa5waM331WkY0F+EJx8fpxemNGQNUEXLkuMXzN3MrN6LrplM9AZ9i+NRA9PWHbNw== dependencies: luxon "^1.21.3" -"@abp/malihu-custom-scrollbar-plugin@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-2.1.0.tgz#f4dc1a32cefc3de8af08cb6d585ec5f7636a0c5e" - integrity sha512-WcxzCZ5YOMxGxZerEh966cVrFSCw1UTDqwU2rxA/LsHEbPKd69AY+SHvUiacNxPXs1ZCF6FFJ29C5dWicEIRaQ== +"@abp/malihu-custom-scrollbar-plugin@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-2.2.0.tgz#e11fd46dccbb28d44fb199e880b91d27c94f1919" + integrity sha512-YDu/NLpIzMA96NDHxd27/+liTm3sow9M+oWH29+9JW8o/AEpXUH3T3AmoXXcTgsBlzLaewgHEFM8yxsAAFoj8Q== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" malihu-custom-scrollbar-plugin "^3.1.5" -"@abp/select2@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-2.1.0.tgz#79e50d2c25e74a5f96520e8aa1433d79aea674d1" - integrity sha512-ut/3c+lFdoepuDH36M7thWagmAmTFrChcPnhYjTx4MmIf31WW1BwqOSx3I2g8M+NEEx+V2jTNuBpTq7PONgSJg== +"@abp/select2@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-2.2.0.tgz#4639d4e5b72b1736fa4476bd9b6a78e036400421" + integrity sha512-tc87JyM0kvVF388kyGUjDby49Zrrb089jVRRipoIaxXeu4M1YxEFSKBEcUK1MohZWjVtWrNs8MoxPlfukaMpyw== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" select2 "^4.0.12" -"@abp/sweetalert@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-2.1.0.tgz#88f405c4ba9f9ed2fd54b945ed6bc48d5ae2fa23" - integrity sha512-EWvReqxZ1DrNH9XD+cf/yGVj+8IPTpuoPuWKDryN4fF7TCMJA+KrXp5lFxpjfkKTtNzLeFGsJqDFWaUifxtqTA== +"@abp/sweetalert@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-2.2.0.tgz#dfc60ba085522d8390e41b90bf5a3d474f4ae624" + integrity sha512-HS6TKOwP91UjzjZHaheurZ1AYUSMkQyCSmoX6g5LAK4eH8IIgpojVSp1AFCSPATrFsFWY/dzkDGcfu90FWsVBg== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" sweetalert "^2.1.2" -"@abp/timeago@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-2.1.0.tgz#28c0aef88aff8b54d1dfb42a664d05097e7fda35" - integrity sha512-NklUYcWeji7po+Y6Oi7b7IkYmjd5YRu123bm3MqjQ71AzuOCTFbvPMHzYOjrUTkzr6gW3IJ24LQ4YmpshPy4ZQ== +"@abp/timeago@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-2.2.0.tgz#9a8297f36a46cdc4cc62f44d0fdc91b70def389c" + integrity sha512-8qjmKscsTvPznHKWEsddYxdSBiU+l+OgLG6vzMcSWqngYbDQGXqNA93BwJI2qiwd+FkNcfGgYg7CN7bcwzmaiw== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" timeago "^1.6.7" -"@abp/toastr@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-2.1.0.tgz#22a53a2b1f354770fdc7b37f06bec10eefccfe7a" - integrity sha512-hD3hTDx+CixTVTx73rnZDiiFkfSxpZox8RLm+CiFA62ORdO8Ryij8TOXXkJd84b2tJfkAkYehohVXKwHlHU7Zg== +"@abp/toastr@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-2.2.0.tgz#1cad83a89da244685b3c82adff64260b7ccf4742" + integrity sha512-HHfSaw4M/9zS+KgzxGvbHYiQ5qcJgpf21cRZEo16aUwnTeKr4SRaewAWryNn4dKcIO2YNrhzDLH+OYbEaJJlDQ== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" toastr "^2.1.4" "@fortawesome/fontawesome-free@^5.11.2": diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/package.json b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/package.json index b620e756f7..6e36dde3bf 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/package.json +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/package.json @@ -3,6 +3,6 @@ "name": "my-app", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.basic": "^2.1.0" + "@abp/aspnetcore.mvc.ui.theme.basic": "^2.2.0" } } \ No newline at end of file diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/wwwroot/libs/abp/core/abp.css b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/wwwroot/libs/abp/core/abp.css index ee3c5080a5..ddf9cae5b2 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/wwwroot/libs/abp/core/abp.css +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/wwwroot/libs/abp/core/abp.css @@ -1,56 +1,56 @@ -@keyframes spin { - 0% { - transform: translateZ(0) rotate(0deg); - } - - 100% { - transform: translateZ(0) rotate(360deg); - } -} - -.abp-block-area { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: 102; - background-color: #fff; - opacity: .8; - transition: opacity .25s; -} - - .abp-block-area.abp-block-area-disappearing { - opacity: 0; - } - - .abp-block-area.abp-block-area-busy:after { - content: attr(data-text); - display: block; - max-width: 125px; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - font-size: 20px; - font-family: sans-serif; - color: #343a40; - text-align: center; - text-transform: uppercase; - } - - .abp-block-area.abp-block-area-busy:before { - content: ""; - display: block; - width: 150px; - height: 150px; - border-radius: 50%; - border-width: 2px; - border-style: solid; - border-color: transparent #228ae6 #228ae6 #228ae6; - position: absolute; - top: calc(50% - 75px); - left: calc(50% - 75px); - will-change: transform; - animation: spin .75s infinite ease-in-out; - } +@keyframes spin { + 0% { + transform: translateZ(0) rotate(0deg); + } + + 100% { + transform: translateZ(0) rotate(360deg); + } +} + +.abp-block-area { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 102; + background-color: #fff; + opacity: .8; + transition: opacity .25s; +} + + .abp-block-area.abp-block-area-disappearing { + opacity: 0; + } + + .abp-block-area.abp-block-area-busy:after { + content: attr(data-text); + display: block; + max-width: 125px; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + font-size: 20px; + font-family: sans-serif; + color: #343a40; + text-align: center; + text-transform: uppercase; + } + + .abp-block-area.abp-block-area-busy:before { + content: ""; + display: block; + width: 150px; + height: 150px; + border-radius: 50%; + border-width: 2px; + border-style: solid; + border-color: transparent #228ae6 #228ae6 #228ae6; + position: absolute; + top: calc(50% - 75px); + left: calc(50% - 75px); + will-change: transform; + animation: spin .75s infinite ease-in-out; + } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/wwwroot/libs/abp/core/abp.js b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/wwwroot/libs/abp/core/abp.js index cef1cf55e1..730db8bc97 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/wwwroot/libs/abp/core/abp.js +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/wwwroot/libs/abp/core/abp.js @@ -1,636 +1,636 @@ -var abp = abp || {}; -(function () { - - /* Application paths *****************************************/ - - //Current application root path (including virtual directory if exists). - abp.appPath = abp.appPath || '/'; - - abp.pageLoadTime = new Date(); - - //Converts given path to absolute path using abp.appPath variable. - abp.toAbsAppPath = function (path) { - if (path.indexOf('/') == 0) { - path = path.substring(1); - } - - return abp.appPath + path; - }; - - /* LOGGING ***************************************************/ - //Implements Logging API that provides secure & controlled usage of console.log - - abp.log = abp.log || {}; - - abp.log.levels = { - DEBUG: 1, - INFO: 2, - WARN: 3, - ERROR: 4, - FATAL: 5 - }; - - abp.log.level = abp.log.levels.DEBUG; - - abp.log.log = function (logObject, logLevel) { - if (!window.console || !window.console.log) { - return; - } - - if (logLevel != undefined && logLevel < abp.log.level) { - return; - } - - console.log(logObject); - }; - - abp.log.debug = function (logObject) { - abp.log.log("DEBUG: ", abp.log.levels.DEBUG); - abp.log.log(logObject, abp.log.levels.DEBUG); - }; - - abp.log.info = function (logObject) { - abp.log.log("INFO: ", abp.log.levels.INFO); - abp.log.log(logObject, abp.log.levels.INFO); - }; - - abp.log.warn = function (logObject) { - abp.log.log("WARN: ", abp.log.levels.WARN); - abp.log.log(logObject, abp.log.levels.WARN); - }; - - abp.log.error = function (logObject) { - abp.log.log("ERROR: ", abp.log.levels.ERROR); - abp.log.log(logObject, abp.log.levels.ERROR); - }; - - abp.log.fatal = function (logObject) { - abp.log.log("FATAL: ", abp.log.levels.FATAL); - abp.log.log(logObject, abp.log.levels.FATAL); - }; - - /* LOCALIZATION ***********************************************/ - - abp.localization = abp.localization || {}; - - abp.localization.values = {}; - - abp.localization.localize = function (key, sourceName) { - sourceName = sourceName || abp.localization.defaultResourceName; - - var source = abp.localization.values[sourceName]; - - if (!source) { - abp.log.warn('Could not find localization source: ' + sourceName); - return key; - } - - var value = source[key]; - if (value == undefined) { - return key; - } - - var copiedArguments = Array.prototype.slice.call(arguments, 0); - copiedArguments.splice(1, 1); - copiedArguments[0] = value; - - return abp.utils.formatString.apply(this, copiedArguments); - }; - - abp.localization.getResource = function (name) { - return function () { - var copiedArguments = Array.prototype.slice.call(arguments, 0); - copiedArguments.splice(1, 0, name); - return abp.localization.localize.apply(this, copiedArguments); - }; - }; - - abp.localization.defaultResourceName = undefined; - - /* AUTHORIZATION **********************************************/ - - abp.auth = abp.auth || {}; - - abp.auth.policies = abp.auth.policies || {}; - - abp.auth.grantedPolicies = abp.auth.grantedPolicies || {}; - - abp.auth.isGranted = function (policyName) { - return abp.auth.policies[policyName] != undefined && abp.auth.grantedPolicies[policyName] != undefined; - }; - - abp.auth.isAnyGranted = function () { - if (!arguments || arguments.length <= 0) { - return true; - } - - for (var i = 0; i < arguments.length; i++) { - if (abp.auth.isGranted(arguments[i])) { - return true; - } - } - - return false; - }; - - abp.auth.areAllGranted = function () { - if (!arguments || arguments.length <= 0) { - return true; - } - - for (var i = 0; i < arguments.length; i++) { - if (!abp.auth.isGranted(arguments[i])) { - return false; - } - } - - return true; - }; - - abp.auth.tokenCookieName = 'Abp.AuthToken'; - - abp.auth.setToken = function (authToken, expireDate) { - abp.utils.setCookieValue(abp.auth.tokenCookieName, authToken, expireDate, abp.appPath, abp.domain); - }; - - abp.auth.getToken = function () { - return abp.utils.getCookieValue(abp.auth.tokenCookieName); - } - - abp.auth.clearToken = function () { - abp.auth.setToken(); - } - - /* SETTINGS *************************************************/ - - abp.setting = abp.setting || {}; - - abp.setting.values = abp.setting.values || {}; - - abp.setting.get = function (name) { - return abp.setting.values[name]; - }; - - abp.setting.getBoolean = function (name) { - var value = abp.setting.get(name); - return value == 'true' || value == 'True'; - }; - - abp.setting.getInt = function (name) { - return parseInt(abp.setting.values[name]); - }; - - /* NOTIFICATION *********************************************/ - //Defines Notification API, not implements it - - abp.notify = abp.notify || {}; - - abp.notify.success = function (message, title, options) { - abp.log.warn('abp.notify.success is not implemented!'); - }; - - abp.notify.info = function (message, title, options) { - abp.log.warn('abp.notify.info is not implemented!'); - }; - - abp.notify.warn = function (message, title, options) { - abp.log.warn('abp.notify.warn is not implemented!'); - }; - - abp.notify.error = function (message, title, options) { - abp.log.warn('abp.notify.error is not implemented!'); - }; - - /* MESSAGE **************************************************/ - //Defines Message API, not implements it - - abp.message = abp.message || {}; - - abp.message._showMessage = function (message, title) { - alert((title || '') + ' ' + message); - }; - - abp.message.info = function (message, title) { - abp.log.warn('abp.message.info is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.success = function (message, title) { - abp.log.warn('abp.message.success is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.warn = function (message, title) { - abp.log.warn('abp.message.warn is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.error = function (message, title) { - abp.log.warn('abp.message.error is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.confirm = function (message, titleOrCallback, callback) { - abp.log.warn('abp.message.confirm is not properly implemented!'); - - if (titleOrCallback && !(typeof titleOrCallback == 'string')) { - callback = titleOrCallback; - } - - var result = confirm(message); - callback && callback(result); - }; - - /* UI *******************************************************/ - - abp.ui = abp.ui || {}; - - /* UI BLOCK */ - //Defines UI Block API and implements basically - - var $abpBlockArea = document.createElement('div'); - $abpBlockArea.classList.add('abp-block-area'); - - /* opts: { //Can be an object with options or a string for query a selector - * elm: a query selector (optional - default: document.body) - * busy: boolean (optional - default: false) - * promise: A promise with always or finally handler (optional - auto unblocks the ui if provided) - * } - */ - abp.ui.block = function (opts) { - if (!opts) { - opts = {}; - } else if (typeof opts == 'string') { - opts = { - elm: opts - }; - } - - var $elm = document.querySelector(opts.elm) || document.body; - - if (opts.busy) { - $abpBlockArea.classList.add('abp-block-area-busy'); - } else { - $abpBlockArea.classList.remove('abp-block-area-busy'); - } - - if (document.querySelector(opts.elm)) { - $abpBlockArea.style.position = 'absolute'; - } else { - $abpBlockArea.style.position = 'fixed'; - } - - $elm.appendChild($abpBlockArea); - - if (opts.promise) { - if (opts.promise.always) { //jQuery.Deferred style - opts.promise.always(function () { - abp.ui.unblock({ - $elm: opts.elm - }); - }); - } else if (opts.promise['finally']) { //Q style - opts.promise['finally'](function () { - abp.ui.unblock({ - $elm: opts.elm - }); - }); - } - } - }; - - /* opts: { - * - * } - */ - abp.ui.unblock = function (opts) { - var element = document.querySelector('.abp-block-area'); - if (element) { - element.classList.add('abp-block-area-disappearing'); - setTimeout(function () { - if (element) { - element.classList.remove('abp-block-area-disappearing'); - element.parentElement.removeChild(element); - } - }, 250); - } - }; - - /* UI BUSY */ - //Defines UI Busy API, not implements it - - abp.ui.setBusy = function (opts) { - if (!opts) { - opts = { - busy: true - }; - } else if (typeof opts == 'string') { - opts = { - elm: opts, - busy: true - }; - } - - abp.ui.block(opts); - }; - - abp.ui.clearBusy = function (opts) { - abp.ui.unblock(opts); - }; - - /* SIMPLE EVENT BUS *****************************************/ - - abp.event = (function () { - - var _callbacks = {}; - - var on = function (eventName, callback) { - if (!_callbacks[eventName]) { - _callbacks[eventName] = []; - } - - _callbacks[eventName].push(callback); - }; - - var off = function (eventName, callback) { - var callbacks = _callbacks[eventName]; - if (!callbacks) { - return; - } - - var index = -1; - for (var i = 0; i < callbacks.length; i++) { - if (callbacks[i] === callback) { - index = i; - break; - } - } - - if (index < 0) { - return; - } - - _callbacks[eventName].splice(index, 1); - }; - - var trigger = function (eventName) { - var callbacks = _callbacks[eventName]; - if (!callbacks || !callbacks.length) { - return; - } - - var args = Array.prototype.slice.call(arguments, 1); - for (var i = 0; i < callbacks.length; i++) { - callbacks[i].apply(this, args); - } - }; - - // Public interface /////////////////////////////////////////////////// - - return { - on: on, - off: off, - trigger: trigger - }; - })(); - - - /* UTILS ***************************************************/ - - abp.utils = abp.utils || {}; - - /* Creates a name namespace. - * Example: - * var taskService = abp.utils.createNamespace(abp, 'services.task'); - * taskService will be equal to abp.services.task - * first argument (root) must be defined first - ************************************************************/ - abp.utils.createNamespace = function (root, ns) { - var parts = ns.split('.'); - for (var i = 0; i < parts.length; i++) { - if (typeof root[parts[i]] == 'undefined') { - root[parts[i]] = {}; - } - - root = root[parts[i]]; - } - - return root; - }; - - /* Find and replaces a string (search) to another string (replacement) in - * given string (str). - * Example: - * abp.utils.replaceAll('This is a test string', 'is', 'X') = 'ThX X a test string' - ************************************************************/ - abp.utils.replaceAll = function (str, search, replacement) { - var fix = search.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); - return str.replace(new RegExp(fix, 'g'), replacement); - }; - - /* Formats a string just like string.format in C#. - * Example: - * abp.utils.formatString('Hello {0}','Tuana') = 'Hello Tuana' - ************************************************************/ - abp.utils.formatString = function () { - if (arguments.length < 1) { - return null; - } - - var str = arguments[0]; - - for (var i = 1; i < arguments.length; i++) { - var placeHolder = '{' + (i - 1) + '}'; - str = abp.utils.replaceAll(str, placeHolder, arguments[i]); - } - - return str; - }; - - abp.utils.toPascalCase = function (str) { - if (!str || !str.length) { - return str; - } - - if (str.length === 1) { - return str.charAt(0).toUpperCase(); - } - - return str.charAt(0).toUpperCase() + str.substr(1); - } - - abp.utils.toCamelCase = function (str) { - if (!str || !str.length) { - return str; - } - - if (str.length === 1) { - return str.charAt(0).toLowerCase(); - } - - return str.charAt(0).toLowerCase() + str.substr(1); - } - - abp.utils.truncateString = function (str, maxLength) { - if (!str || !str.length || str.length <= maxLength) { - return str; - } - - return str.substr(0, maxLength); - }; - - abp.utils.truncateStringWithPostfix = function (str, maxLength, postfix) { - postfix = postfix || '...'; - - if (!str || !str.length || str.length <= maxLength) { - return str; - } - - if (maxLength <= postfix.length) { - return postfix.substr(0, maxLength); - } - - return str.substr(0, maxLength - postfix.length) + postfix; - }; - - abp.utils.isFunction = function (obj) { - return !!(obj && obj.constructor && obj.call && obj.apply); - }; - - /** - * parameterInfos should be an array of { name, value } objects - * where name is query string parameter name and value is it's value. - * includeQuestionMark is true by default. - */ - abp.utils.buildQueryString = function (parameterInfos, includeQuestionMark) { - if (includeQuestionMark === undefined) { - includeQuestionMark = true; - } - - var qs = ''; - - function addSeperator() { - if (!qs.length) { - if (includeQuestionMark) { - qs = qs + '?'; - } - } else { - qs = qs + '&'; - } - } - - for (var i = 0; i < parameterInfos.length; ++i) { - var parameterInfo = parameterInfos[i]; - if (parameterInfo.value === undefined) { - continue; - } - - if (parameterInfo.value === null) { - parameterInfo.value = ''; - } - - addSeperator(); - - if (parameterInfo.value.toJSON && typeof parameterInfo.value.toJSON === "function") { - qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value.toJSON()); - } else if (Array.isArray(parameterInfo.value) && parameterInfo.value.length) { - for (var j = 0; j < parameterInfo.value.length; j++) { - if (j > 0) { - addSeperator(); - } - - qs = qs + parameterInfo.name + '[' + j + ']=' + encodeURIComponent(parameterInfo.value[j]); - } - } else { - qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value); - } - } - - return qs; - } - - /** - * Sets a cookie value for given key. - * This is a simple implementation created to be used by ABP. - * Please use a complete cookie library if you need. - * @param {string} key - * @param {string} value - * @param {Date} expireDate (optional). If not specified the cookie will expire at the end of session. - * @param {string} path (optional) - */ - abp.utils.setCookieValue = function (key, value, expireDate, path) { - var cookieValue = encodeURIComponent(key) + '='; - - if (value) { - cookieValue = cookieValue + encodeURIComponent(value); - } - - if (expireDate) { - cookieValue = cookieValue + "; expires=" + expireDate.toUTCString(); - } - - if (path) { - cookieValue = cookieValue + "; path=" + path; - } - - document.cookie = cookieValue; - }; - - /** - * Gets a cookie with given key. - * This is a simple implementation created to be used by ABP. - * Please use a complete cookie library if you need. - * @param {string} key - * @returns {string} Cookie value or null - */ - abp.utils.getCookieValue = function (key) { - var equalities = document.cookie.split('; '); - for (var i = 0; i < equalities.length; i++) { - if (!equalities[i]) { - continue; - } - - var splitted = equalities[i].split('='); - if (splitted.length != 2) { - continue; - } - - if (decodeURIComponent(splitted[0]) === key) { - return decodeURIComponent(splitted[1] || ''); - } - } - - return null; - }; - - /** - * Deletes cookie for given key. - * This is a simple implementation created to be used by ABP. - * Please use a complete cookie library if you need. - * @param {string} key - * @param {string} path (optional) - */ - abp.utils.deleteCookie = function (key, path) { - var cookieValue = encodeURIComponent(key) + '='; - - cookieValue = cookieValue + "; expires=" + (new Date(new Date().getTime() - 86400000)).toUTCString(); - - if (path) { - cookieValue = cookieValue + "; path=" + path; - } - - document.cookie = cookieValue; - } - - /* SECURITY ***************************************/ - abp.security = abp.security || {}; - abp.security.antiForgery = abp.security.antiForgery || {}; - - abp.security.antiForgery.tokenCookieName = 'XSRF-TOKEN'; - abp.security.antiForgery.tokenHeaderName = 'X-XSRF-TOKEN'; - - abp.security.antiForgery.getToken = function () { - return abp.utils.getCookieValue(abp.security.antiForgery.tokenCookieName); - }; - +var abp = abp || {}; +(function () { + + /* Application paths *****************************************/ + + //Current application root path (including virtual directory if exists). + abp.appPath = abp.appPath || '/'; + + abp.pageLoadTime = new Date(); + + //Converts given path to absolute path using abp.appPath variable. + abp.toAbsAppPath = function (path) { + if (path.indexOf('/') == 0) { + path = path.substring(1); + } + + return abp.appPath + path; + }; + + /* LOGGING ***************************************************/ + //Implements Logging API that provides secure & controlled usage of console.log + + abp.log = abp.log || {}; + + abp.log.levels = { + DEBUG: 1, + INFO: 2, + WARN: 3, + ERROR: 4, + FATAL: 5 + }; + + abp.log.level = abp.log.levels.DEBUG; + + abp.log.log = function (logObject, logLevel) { + if (!window.console || !window.console.log) { + return; + } + + if (logLevel != undefined && logLevel < abp.log.level) { + return; + } + + console.log(logObject); + }; + + abp.log.debug = function (logObject) { + abp.log.log("DEBUG: ", abp.log.levels.DEBUG); + abp.log.log(logObject, abp.log.levels.DEBUG); + }; + + abp.log.info = function (logObject) { + abp.log.log("INFO: ", abp.log.levels.INFO); + abp.log.log(logObject, abp.log.levels.INFO); + }; + + abp.log.warn = function (logObject) { + abp.log.log("WARN: ", abp.log.levels.WARN); + abp.log.log(logObject, abp.log.levels.WARN); + }; + + abp.log.error = function (logObject) { + abp.log.log("ERROR: ", abp.log.levels.ERROR); + abp.log.log(logObject, abp.log.levels.ERROR); + }; + + abp.log.fatal = function (logObject) { + abp.log.log("FATAL: ", abp.log.levels.FATAL); + abp.log.log(logObject, abp.log.levels.FATAL); + }; + + /* LOCALIZATION ***********************************************/ + + abp.localization = abp.localization || {}; + + abp.localization.values = {}; + + abp.localization.localize = function (key, sourceName) { + sourceName = sourceName || abp.localization.defaultResourceName; + + var source = abp.localization.values[sourceName]; + + if (!source) { + abp.log.warn('Could not find localization source: ' + sourceName); + return key; + } + + var value = source[key]; + if (value == undefined) { + return key; + } + + var copiedArguments = Array.prototype.slice.call(arguments, 0); + copiedArguments.splice(1, 1); + copiedArguments[0] = value; + + return abp.utils.formatString.apply(this, copiedArguments); + }; + + abp.localization.getResource = function (name) { + return function () { + var copiedArguments = Array.prototype.slice.call(arguments, 0); + copiedArguments.splice(1, 0, name); + return abp.localization.localize.apply(this, copiedArguments); + }; + }; + + abp.localization.defaultResourceName = undefined; + + /* AUTHORIZATION **********************************************/ + + abp.auth = abp.auth || {}; + + abp.auth.policies = abp.auth.policies || {}; + + abp.auth.grantedPolicies = abp.auth.grantedPolicies || {}; + + abp.auth.isGranted = function (policyName) { + return abp.auth.policies[policyName] != undefined && abp.auth.grantedPolicies[policyName] != undefined; + }; + + abp.auth.isAnyGranted = function () { + if (!arguments || arguments.length <= 0) { + return true; + } + + for (var i = 0; i < arguments.length; i++) { + if (abp.auth.isGranted(arguments[i])) { + return true; + } + } + + return false; + }; + + abp.auth.areAllGranted = function () { + if (!arguments || arguments.length <= 0) { + return true; + } + + for (var i = 0; i < arguments.length; i++) { + if (!abp.auth.isGranted(arguments[i])) { + return false; + } + } + + return true; + }; + + abp.auth.tokenCookieName = 'Abp.AuthToken'; + + abp.auth.setToken = function (authToken, expireDate) { + abp.utils.setCookieValue(abp.auth.tokenCookieName, authToken, expireDate, abp.appPath, abp.domain); + }; + + abp.auth.getToken = function () { + return abp.utils.getCookieValue(abp.auth.tokenCookieName); + } + + abp.auth.clearToken = function () { + abp.auth.setToken(); + } + + /* SETTINGS *************************************************/ + + abp.setting = abp.setting || {}; + + abp.setting.values = abp.setting.values || {}; + + abp.setting.get = function (name) { + return abp.setting.values[name]; + }; + + abp.setting.getBoolean = function (name) { + var value = abp.setting.get(name); + return value == 'true' || value == 'True'; + }; + + abp.setting.getInt = function (name) { + return parseInt(abp.setting.values[name]); + }; + + /* NOTIFICATION *********************************************/ + //Defines Notification API, not implements it + + abp.notify = abp.notify || {}; + + abp.notify.success = function (message, title, options) { + abp.log.warn('abp.notify.success is not implemented!'); + }; + + abp.notify.info = function (message, title, options) { + abp.log.warn('abp.notify.info is not implemented!'); + }; + + abp.notify.warn = function (message, title, options) { + abp.log.warn('abp.notify.warn is not implemented!'); + }; + + abp.notify.error = function (message, title, options) { + abp.log.warn('abp.notify.error is not implemented!'); + }; + + /* MESSAGE **************************************************/ + //Defines Message API, not implements it + + abp.message = abp.message || {}; + + abp.message._showMessage = function (message, title) { + alert((title || '') + ' ' + message); + }; + + abp.message.info = function (message, title) { + abp.log.warn('abp.message.info is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.success = function (message, title) { + abp.log.warn('abp.message.success is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.warn = function (message, title) { + abp.log.warn('abp.message.warn is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.error = function (message, title) { + abp.log.warn('abp.message.error is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.confirm = function (message, titleOrCallback, callback) { + abp.log.warn('abp.message.confirm is not properly implemented!'); + + if (titleOrCallback && !(typeof titleOrCallback == 'string')) { + callback = titleOrCallback; + } + + var result = confirm(message); + callback && callback(result); + }; + + /* UI *******************************************************/ + + abp.ui = abp.ui || {}; + + /* UI BLOCK */ + //Defines UI Block API and implements basically + + var $abpBlockArea = document.createElement('div'); + $abpBlockArea.classList.add('abp-block-area'); + + /* opts: { //Can be an object with options or a string for query a selector + * elm: a query selector (optional - default: document.body) + * busy: boolean (optional - default: false) + * promise: A promise with always or finally handler (optional - auto unblocks the ui if provided) + * } + */ + abp.ui.block = function (opts) { + if (!opts) { + opts = {}; + } else if (typeof opts == 'string') { + opts = { + elm: opts + }; + } + + var $elm = document.querySelector(opts.elm) || document.body; + + if (opts.busy) { + $abpBlockArea.classList.add('abp-block-area-busy'); + } else { + $abpBlockArea.classList.remove('abp-block-area-busy'); + } + + if (document.querySelector(opts.elm)) { + $abpBlockArea.style.position = 'absolute'; + } else { + $abpBlockArea.style.position = 'fixed'; + } + + $elm.appendChild($abpBlockArea); + + if (opts.promise) { + if (opts.promise.always) { //jQuery.Deferred style + opts.promise.always(function () { + abp.ui.unblock({ + $elm: opts.elm + }); + }); + } else if (opts.promise['finally']) { //Q style + opts.promise['finally'](function () { + abp.ui.unblock({ + $elm: opts.elm + }); + }); + } + } + }; + + /* opts: { + * + * } + */ + abp.ui.unblock = function (opts) { + var element = document.querySelector('.abp-block-area'); + if (element) { + element.classList.add('abp-block-area-disappearing'); + setTimeout(function () { + if (element) { + element.classList.remove('abp-block-area-disappearing'); + element.parentElement.removeChild(element); + } + }, 250); + } + }; + + /* UI BUSY */ + //Defines UI Busy API, not implements it + + abp.ui.setBusy = function (opts) { + if (!opts) { + opts = { + busy: true + }; + } else if (typeof opts == 'string') { + opts = { + elm: opts, + busy: true + }; + } + + abp.ui.block(opts); + }; + + abp.ui.clearBusy = function (opts) { + abp.ui.unblock(opts); + }; + + /* SIMPLE EVENT BUS *****************************************/ + + abp.event = (function () { + + var _callbacks = {}; + + var on = function (eventName, callback) { + if (!_callbacks[eventName]) { + _callbacks[eventName] = []; + } + + _callbacks[eventName].push(callback); + }; + + var off = function (eventName, callback) { + var callbacks = _callbacks[eventName]; + if (!callbacks) { + return; + } + + var index = -1; + for (var i = 0; i < callbacks.length; i++) { + if (callbacks[i] === callback) { + index = i; + break; + } + } + + if (index < 0) { + return; + } + + _callbacks[eventName].splice(index, 1); + }; + + var trigger = function (eventName) { + var callbacks = _callbacks[eventName]; + if (!callbacks || !callbacks.length) { + return; + } + + var args = Array.prototype.slice.call(arguments, 1); + for (var i = 0; i < callbacks.length; i++) { + callbacks[i].apply(this, args); + } + }; + + // Public interface /////////////////////////////////////////////////// + + return { + on: on, + off: off, + trigger: trigger + }; + })(); + + + /* UTILS ***************************************************/ + + abp.utils = abp.utils || {}; + + /* Creates a name namespace. + * Example: + * var taskService = abp.utils.createNamespace(abp, 'services.task'); + * taskService will be equal to abp.services.task + * first argument (root) must be defined first + ************************************************************/ + abp.utils.createNamespace = function (root, ns) { + var parts = ns.split('.'); + for (var i = 0; i < parts.length; i++) { + if (typeof root[parts[i]] == 'undefined') { + root[parts[i]] = {}; + } + + root = root[parts[i]]; + } + + return root; + }; + + /* Find and replaces a string (search) to another string (replacement) in + * given string (str). + * Example: + * abp.utils.replaceAll('This is a test string', 'is', 'X') = 'ThX X a test string' + ************************************************************/ + abp.utils.replaceAll = function (str, search, replacement) { + var fix = search.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); + return str.replace(new RegExp(fix, 'g'), replacement); + }; + + /* Formats a string just like string.format in C#. + * Example: + * abp.utils.formatString('Hello {0}','Tuana') = 'Hello Tuana' + ************************************************************/ + abp.utils.formatString = function () { + if (arguments.length < 1) { + return null; + } + + var str = arguments[0]; + + for (var i = 1; i < arguments.length; i++) { + var placeHolder = '{' + (i - 1) + '}'; + str = abp.utils.replaceAll(str, placeHolder, arguments[i]); + } + + return str; + }; + + abp.utils.toPascalCase = function (str) { + if (!str || !str.length) { + return str; + } + + if (str.length === 1) { + return str.charAt(0).toUpperCase(); + } + + return str.charAt(0).toUpperCase() + str.substr(1); + } + + abp.utils.toCamelCase = function (str) { + if (!str || !str.length) { + return str; + } + + if (str.length === 1) { + return str.charAt(0).toLowerCase(); + } + + return str.charAt(0).toLowerCase() + str.substr(1); + } + + abp.utils.truncateString = function (str, maxLength) { + if (!str || !str.length || str.length <= maxLength) { + return str; + } + + return str.substr(0, maxLength); + }; + + abp.utils.truncateStringWithPostfix = function (str, maxLength, postfix) { + postfix = postfix || '...'; + + if (!str || !str.length || str.length <= maxLength) { + return str; + } + + if (maxLength <= postfix.length) { + return postfix.substr(0, maxLength); + } + + return str.substr(0, maxLength - postfix.length) + postfix; + }; + + abp.utils.isFunction = function (obj) { + return !!(obj && obj.constructor && obj.call && obj.apply); + }; + + /** + * parameterInfos should be an array of { name, value } objects + * where name is query string parameter name and value is it's value. + * includeQuestionMark is true by default. + */ + abp.utils.buildQueryString = function (parameterInfos, includeQuestionMark) { + if (includeQuestionMark === undefined) { + includeQuestionMark = true; + } + + var qs = ''; + + function addSeperator() { + if (!qs.length) { + if (includeQuestionMark) { + qs = qs + '?'; + } + } else { + qs = qs + '&'; + } + } + + for (var i = 0; i < parameterInfos.length; ++i) { + var parameterInfo = parameterInfos[i]; + if (parameterInfo.value === undefined) { + continue; + } + + if (parameterInfo.value === null) { + parameterInfo.value = ''; + } + + addSeperator(); + + if (parameterInfo.value.toJSON && typeof parameterInfo.value.toJSON === "function") { + qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value.toJSON()); + } else if (Array.isArray(parameterInfo.value) && parameterInfo.value.length) { + for (var j = 0; j < parameterInfo.value.length; j++) { + if (j > 0) { + addSeperator(); + } + + qs = qs + parameterInfo.name + '[' + j + ']=' + encodeURIComponent(parameterInfo.value[j]); + } + } else { + qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value); + } + } + + return qs; + } + + /** + * Sets a cookie value for given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @param {string} value + * @param {Date} expireDate (optional). If not specified the cookie will expire at the end of session. + * @param {string} path (optional) + */ + abp.utils.setCookieValue = function (key, value, expireDate, path) { + var cookieValue = encodeURIComponent(key) + '='; + + if (value) { + cookieValue = cookieValue + encodeURIComponent(value); + } + + if (expireDate) { + cookieValue = cookieValue + "; expires=" + expireDate.toUTCString(); + } + + if (path) { + cookieValue = cookieValue + "; path=" + path; + } + + document.cookie = cookieValue; + }; + + /** + * Gets a cookie with given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @returns {string} Cookie value or null + */ + abp.utils.getCookieValue = function (key) { + var equalities = document.cookie.split('; '); + for (var i = 0; i < equalities.length; i++) { + if (!equalities[i]) { + continue; + } + + var splitted = equalities[i].split('='); + if (splitted.length != 2) { + continue; + } + + if (decodeURIComponent(splitted[0]) === key) { + return decodeURIComponent(splitted[1] || ''); + } + } + + return null; + }; + + /** + * Deletes cookie for given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @param {string} path (optional) + */ + abp.utils.deleteCookie = function (key, path) { + var cookieValue = encodeURIComponent(key) + '='; + + cookieValue = cookieValue + "; expires=" + (new Date(new Date().getTime() - 86400000)).toUTCString(); + + if (path) { + cookieValue = cookieValue + "; path=" + path; + } + + document.cookie = cookieValue; + } + + /* SECURITY ***************************************/ + abp.security = abp.security || {}; + abp.security.antiForgery = abp.security.antiForgery || {}; + + abp.security.antiForgery.tokenCookieName = 'XSRF-TOKEN'; + abp.security.antiForgery.tokenHeaderName = 'X-XSRF-TOKEN'; + + abp.security.antiForgery.getToken = function () { + return abp.utils.getCookieValue(abp.security.antiForgery.tokenCookieName); + }; + })(); \ No newline at end of file diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/wwwroot/libs/abp/jquery/abp.jquery.js b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/wwwroot/libs/abp/jquery/abp.jquery.js index 6e2ee001b8..e6aff047f7 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/wwwroot/libs/abp/jquery/abp.jquery.js +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/wwwroot/libs/abp/jquery/abp.jquery.js @@ -1,393 +1,393 @@ -var abp = abp || {}; -(function($) { - - if (!$) { - throw "abp/jquery library requires the jquery library included to the page!"; - } - - // ABP CORE OVERRIDES ///////////////////////////////////////////////////// - - abp.message._showMessage = function (message, title) { - alert((title || '') + ' ' + message); - - return $.Deferred(function ($dfd) { - $dfd.resolve(); - }); - }; - - abp.message.confirm = function (message, titleOrCallback, callback) { - if (titleOrCallback && !(typeof titleOrCallback == 'string')) { - callback = titleOrCallback; - } - - var result = confirm(message); - callback && callback(result); - - return $.Deferred(function ($dfd) { - $dfd.resolve(result); - }); - }; - - abp.utils.isFunction = function (obj) { - return $.isFunction(obj); - }; - - // JQUERY EXTENSIONS ////////////////////////////////////////////////////// - - $.fn.findWithSelf = function (selector) { - return this.filter(selector).add(this.find(selector)); - }; - - // DOM //////////////////////////////////////////////////////////////////// - - abp.dom = abp.dom || {}; - - abp.dom.onNodeAdded = function (callback) { - abp.event.on('abp.dom.nodeAdded', callback); - }; - - abp.dom.onNodeRemoved = function (callback) { - abp.event.on('abp.dom.nodeRemoved', callback); - }; - - var mutationObserverCallback = function (mutationsList) { - for (var i = 0; i < mutationsList.length; i++) { - var mutation = mutationsList[i]; - if (mutation.type === 'childList') { - if (mutation.addedNodes && mutation.removedNodes.length) { - for (var k = 0; k < mutation.removedNodes.length; k++) { - abp.event.trigger( - 'abp.dom.nodeRemoved', - { - $el: $(mutation.removedNodes[k]) - } - ); - } - } - - if (mutation.addedNodes && mutation.addedNodes.length) { - for (var j = 0; j < mutation.addedNodes.length; j++) { - abp.event.trigger( - 'abp.dom.nodeAdded', - { - $el: $(mutation.addedNodes[j]) - } - ); - } - } - } - } - }; - - new MutationObserver(mutationObserverCallback).observe( - $('body')[0], - { - subtree: true, - childList: true - } - ); - - // AJAX /////////////////////////////////////////////////////////////////// - - abp.ajax = function (userOptions) { - userOptions = userOptions || {}; - - var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); - - options.success = undefined; - options.error = undefined; - - return $.Deferred(function ($dfd) { - $.ajax(options) - .done(function (data, textStatus, jqXHR) { - $dfd.resolve(data); - userOptions.success && userOptions.success(data); - }).fail(function (jqXHR) { - if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { - abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); - } else { - abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); - } - }); - }); - }; - - $.extend(abp.ajax, { - defaultOpts: { - dataType: 'json', - type: 'POST', - contentType: 'application/json', - headers: { - 'X-Requested-With': 'XMLHttpRequest' - } - }, - - defaultError: { - message: 'An error has occurred!', - details: 'Error detail not sent by server.' - }, - - defaultError401: { - message: 'You are not authenticated!', - details: 'You should be authenticated (sign in) in order to perform this operation.' - }, - - defaultError403: { - message: 'You are not authorized!', - details: 'You are not allowed to perform this operation.' - }, - - defaultError404: { - message: 'Resource not found!', - details: 'The resource requested could not found on the server.' - }, - - logError: function (error) { - abp.log.error(error); - }, - - showError: function (error) { - if (error.details) { - return abp.message.error(error.details, error.message); - } else { - return abp.message.error(error.message || abp.ajax.defaultError.message); - } - }, - - handleTargetUrl: function (targetUrl) { - if (!targetUrl) { - location.href = abp.appPath; - } else { - location.href = targetUrl; - } - }, - - handleErrorStatusCode: function (status) { - switch (status) { - case 401: - abp.ajax.handleUnAuthorizedRequest( - abp.ajax.showError(abp.ajax.defaultError401), - abp.appPath - ); - break; - case 403: - abp.ajax.showError(abp.ajax.defaultError403); - break; - case 404: - abp.ajax.showError(abp.ajax.defaultError404); - break; - default: - abp.ajax.showError(abp.ajax.defaultError); - break; - } - }, - - handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { - if (userOptions.abpHandleError !== false) { - abp.ajax.handleErrorStatusCode(jqXHR.status); - } - - $dfd.reject.apply(this, arguments); - userOptions.error && userOptions.error.apply(this, arguments); - }, - - handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { - var messagePromise = null; - - if (userOptions.abpHandleError !== false) { - messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); - } - - abp.ajax.logError(jqXHR.responseJSON.error); - - $dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); - userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); - - if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { - abp.ajax.handleUnAuthorizedRequest(messagePromise); - } - }, - - handleUnAuthorizedRequest: function (messagePromise, targetUrl) { - if (messagePromise) { - messagePromise.done(function () { - abp.ajax.handleTargetUrl(targetUrl); - }); - } else { - abp.ajax.handleTargetUrl(targetUrl); - } - }, - - blockUI: function (options) { - if (options.blockUI) { - if (options.blockUI === true) { //block whole page - abp.ui.setBusy(); - } else { //block an element - abp.ui.setBusy(options.blockUI); - } - } - }, - - unblockUI: function (options) { - if (options.blockUI) { - if (options.blockUI === true) { //unblock whole page - abp.ui.clearBusy(); - } else { //unblock an element - abp.ui.clearBusy(options.blockUI); - } - } - }, - - ajaxSendHandler: function (event, request, settings) { - var token = abp.security.antiForgery.getToken(); - if (!token) { - return; - } - - if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { - request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); - } - } - }); - - $(document).ajaxSend(function (event, request, settings) { - return abp.ajax.ajaxSendHandler(event, request, settings); - }); - - abp.event.on('abp.configurationInitialized', function () { - var l = abp.localization.getResource('AbpUi'); - - abp.ajax.defaultError.message = l('DefaultErrorMessage'); - abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); - abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); - abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); - abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); - abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); - abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); - abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); - }); - - // RESOURCE LOADER //////////////////////////////////////////////////////// - - /* UrlStates enum */ - var UrlStates = { - LOADING: 'LOADING', - LOADED: 'LOADED', - FAILED: 'FAILED' - }; - - /* UrlInfo class */ - function UrlInfo(url) { - this.url = url; - this.state = UrlStates.LOADING; - this.loadCallbacks = []; - this.failCallbacks = []; - } - - UrlInfo.prototype.succeed = function () { - this.state = UrlStates.LOADED; - for (var i = 0; i < this.loadCallbacks.length; i++) { - this.loadCallbacks[i](); - } - }; - - UrlInfo.prototype.failed = function () { - this.state = UrlStates.FAILED; - for (var i = 0; i < this.failCallbacks.length; i++) { - this.failCallbacks[i](); - } - }; - - UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { - switch (this.state) { - case UrlStates.LOADED: - loadCallback && loadCallback(); - break; - case UrlStates.FAILED: - failCallback && failCallback(); - break; - case UrlStates.LOADING: - this.addCallbacks(loadCallback, failCallback); - break; - } - }; - - UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { - loadCallback && this.loadCallbacks.push(loadCallback); - failCallback && this.failCallbacks.push(failCallback); - }; - - /* ResourceLoader API */ - - abp.ResourceLoader = (function () { - - var _urlInfos = {}; - - function getCacheKey(url) { - return url; - } - - function appendTimeToUrl(url) { - - if (url.indexOf('?') < 0) { - url += '?'; - } else { - url += '&'; - } - - url += '_=' + new Date().getTime(); - - return url; - } - - var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { - - var cacheKey = getCacheKey(url); - - var urlInfo = _urlInfos[cacheKey]; - - if (urlInfo) { - urlInfo.handleCallbacks(loadCallback, failCallback); - return; - } - - _urlInfos[cacheKey] = urlInfo = new UrlInfo(url); - urlInfo.addCallbacks(loadCallback, failCallback); - - serverLoader(urlInfo); - }; - - var _loadScript = function (url, loadCallback, failCallback) { - _loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { - $.get({ - url: url, - dataType: 'text' - }) - .done(function (script) { - $.globalEval(script); - urlInfo.succeed(); - }) - .fail(function () { - urlInfo.failed(); - }); - }); - }; - - var _loadStyle = function (url) { - _loadFromUrl(url, undefined, undefined, function (urlInfo) { - - $('', { - rel: 'stylesheet', - type: 'text/css', - href: appendTimeToUrl(url) - }).appendTo('head'); - }); - }; - - return { - loadScript: _loadScript, - loadStyle: _loadStyle - } - })(); - +var abp = abp || {}; +(function($) { + + if (!$) { + throw "abp/jquery library requires the jquery library included to the page!"; + } + + // ABP CORE OVERRIDES ///////////////////////////////////////////////////// + + abp.message._showMessage = function (message, title) { + alert((title || '') + ' ' + message); + + return $.Deferred(function ($dfd) { + $dfd.resolve(); + }); + }; + + abp.message.confirm = function (message, titleOrCallback, callback) { + if (titleOrCallback && !(typeof titleOrCallback == 'string')) { + callback = titleOrCallback; + } + + var result = confirm(message); + callback && callback(result); + + return $.Deferred(function ($dfd) { + $dfd.resolve(result); + }); + }; + + abp.utils.isFunction = function (obj) { + return $.isFunction(obj); + }; + + // JQUERY EXTENSIONS ////////////////////////////////////////////////////// + + $.fn.findWithSelf = function (selector) { + return this.filter(selector).add(this.find(selector)); + }; + + // DOM //////////////////////////////////////////////////////////////////// + + abp.dom = abp.dom || {}; + + abp.dom.onNodeAdded = function (callback) { + abp.event.on('abp.dom.nodeAdded', callback); + }; + + abp.dom.onNodeRemoved = function (callback) { + abp.event.on('abp.dom.nodeRemoved', callback); + }; + + var mutationObserverCallback = function (mutationsList) { + for (var i = 0; i < mutationsList.length; i++) { + var mutation = mutationsList[i]; + if (mutation.type === 'childList') { + if (mutation.addedNodes && mutation.removedNodes.length) { + for (var k = 0; k < mutation.removedNodes.length; k++) { + abp.event.trigger( + 'abp.dom.nodeRemoved', + { + $el: $(mutation.removedNodes[k]) + } + ); + } + } + + if (mutation.addedNodes && mutation.addedNodes.length) { + for (var j = 0; j < mutation.addedNodes.length; j++) { + abp.event.trigger( + 'abp.dom.nodeAdded', + { + $el: $(mutation.addedNodes[j]) + } + ); + } + } + } + } + }; + + new MutationObserver(mutationObserverCallback).observe( + $('body')[0], + { + subtree: true, + childList: true + } + ); + + // AJAX /////////////////////////////////////////////////////////////////// + + abp.ajax = function (userOptions) { + userOptions = userOptions || {}; + + var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); + + options.success = undefined; + options.error = undefined; + + return $.Deferred(function ($dfd) { + $.ajax(options) + .done(function (data, textStatus, jqXHR) { + $dfd.resolve(data); + userOptions.success && userOptions.success(data); + }).fail(function (jqXHR) { + if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { + abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); + } else { + abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); + } + }); + }); + }; + + $.extend(abp.ajax, { + defaultOpts: { + dataType: 'json', + type: 'POST', + contentType: 'application/json', + headers: { + 'X-Requested-With': 'XMLHttpRequest' + } + }, + + defaultError: { + message: 'An error has occurred!', + details: 'Error detail not sent by server.' + }, + + defaultError401: { + message: 'You are not authenticated!', + details: 'You should be authenticated (sign in) in order to perform this operation.' + }, + + defaultError403: { + message: 'You are not authorized!', + details: 'You are not allowed to perform this operation.' + }, + + defaultError404: { + message: 'Resource not found!', + details: 'The resource requested could not found on the server.' + }, + + logError: function (error) { + abp.log.error(error); + }, + + showError: function (error) { + if (error.details) { + return abp.message.error(error.details, error.message); + } else { + return abp.message.error(error.message || abp.ajax.defaultError.message); + } + }, + + handleTargetUrl: function (targetUrl) { + if (!targetUrl) { + location.href = abp.appPath; + } else { + location.href = targetUrl; + } + }, + + handleErrorStatusCode: function (status) { + switch (status) { + case 401: + abp.ajax.handleUnAuthorizedRequest( + abp.ajax.showError(abp.ajax.defaultError401), + abp.appPath + ); + break; + case 403: + abp.ajax.showError(abp.ajax.defaultError403); + break; + case 404: + abp.ajax.showError(abp.ajax.defaultError404); + break; + default: + abp.ajax.showError(abp.ajax.defaultError); + break; + } + }, + + handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { + if (userOptions.abpHandleError !== false) { + abp.ajax.handleErrorStatusCode(jqXHR.status); + } + + $dfd.reject.apply(this, arguments); + userOptions.error && userOptions.error.apply(this, arguments); + }, + + handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { + var messagePromise = null; + + if (userOptions.abpHandleError !== false) { + messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); + } + + abp.ajax.logError(jqXHR.responseJSON.error); + + $dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); + userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); + + if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { + abp.ajax.handleUnAuthorizedRequest(messagePromise); + } + }, + + handleUnAuthorizedRequest: function (messagePromise, targetUrl) { + if (messagePromise) { + messagePromise.done(function () { + abp.ajax.handleTargetUrl(targetUrl); + }); + } else { + abp.ajax.handleTargetUrl(targetUrl); + } + }, + + blockUI: function (options) { + if (options.blockUI) { + if (options.blockUI === true) { //block whole page + abp.ui.setBusy(); + } else { //block an element + abp.ui.setBusy(options.blockUI); + } + } + }, + + unblockUI: function (options) { + if (options.blockUI) { + if (options.blockUI === true) { //unblock whole page + abp.ui.clearBusy(); + } else { //unblock an element + abp.ui.clearBusy(options.blockUI); + } + } + }, + + ajaxSendHandler: function (event, request, settings) { + var token = abp.security.antiForgery.getToken(); + if (!token) { + return; + } + + if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { + request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); + } + } + }); + + $(document).ajaxSend(function (event, request, settings) { + return abp.ajax.ajaxSendHandler(event, request, settings); + }); + + abp.event.on('abp.configurationInitialized', function () { + var l = abp.localization.getResource('AbpUi'); + + abp.ajax.defaultError.message = l('DefaultErrorMessage'); + abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); + abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); + abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); + abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); + abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); + abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); + abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); + }); + + // RESOURCE LOADER //////////////////////////////////////////////////////// + + /* UrlStates enum */ + var UrlStates = { + LOADING: 'LOADING', + LOADED: 'LOADED', + FAILED: 'FAILED' + }; + + /* UrlInfo class */ + function UrlInfo(url) { + this.url = url; + this.state = UrlStates.LOADING; + this.loadCallbacks = []; + this.failCallbacks = []; + } + + UrlInfo.prototype.succeed = function () { + this.state = UrlStates.LOADED; + for (var i = 0; i < this.loadCallbacks.length; i++) { + this.loadCallbacks[i](); + } + }; + + UrlInfo.prototype.failed = function () { + this.state = UrlStates.FAILED; + for (var i = 0; i < this.failCallbacks.length; i++) { + this.failCallbacks[i](); + } + }; + + UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { + switch (this.state) { + case UrlStates.LOADED: + loadCallback && loadCallback(); + break; + case UrlStates.FAILED: + failCallback && failCallback(); + break; + case UrlStates.LOADING: + this.addCallbacks(loadCallback, failCallback); + break; + } + }; + + UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { + loadCallback && this.loadCallbacks.push(loadCallback); + failCallback && this.failCallbacks.push(failCallback); + }; + + /* ResourceLoader API */ + + abp.ResourceLoader = (function () { + + var _urlInfos = {}; + + function getCacheKey(url) { + return url; + } + + function appendTimeToUrl(url) { + + if (url.indexOf('?') < 0) { + url += '?'; + } else { + url += '&'; + } + + url += '_=' + new Date().getTime(); + + return url; + } + + var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { + + var cacheKey = getCacheKey(url); + + var urlInfo = _urlInfos[cacheKey]; + + if (urlInfo) { + urlInfo.handleCallbacks(loadCallback, failCallback); + return; + } + + _urlInfos[cacheKey] = urlInfo = new UrlInfo(url); + urlInfo.addCallbacks(loadCallback, failCallback); + + serverLoader(urlInfo); + }; + + var _loadScript = function (url, loadCallback, failCallback) { + _loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { + $.get({ + url: url, + dataType: 'text' + }) + .done(function (script) { + $.globalEval(script); + urlInfo.succeed(); + }) + .fail(function () { + urlInfo.failed(); + }); + }); + }; + + var _loadStyle = function (url) { + _loadFromUrl(url, undefined, undefined, function (urlInfo) { + + $('', { + rel: 'stylesheet', + type: 'text/css', + href: appendTimeToUrl(url) + }).appendTo('head'); + }); + }; + + return { + loadScript: _loadScript, + loadStyle: _loadStyle + } + })(); + })(jQuery); \ No newline at end of file diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/yarn.lock b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/yarn.lock index 7230736133..b3b0eb268b 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/yarn.lock +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/yarn.lock @@ -2,37 +2,37 @@ # yarn lockfile v1 -"@abp/aspnetcore.mvc.ui.theme.basic@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-2.1.0.tgz#f815001bd856fb5cbdd0b736181f2401a1a7ec62" - integrity sha512-ej6dhUo3H9w6bpBTpMhk3M6zbC3fVAVMm5yLSYlYJ0sQxjb9PqC02OgiJme0mkxCUMwPuHVSQLrMQbioXdZu3A== +"@abp/aspnetcore.mvc.ui.theme.basic@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-2.2.0.tgz#e7f4e57d2b17cc76388e9c56bc34d50c9658873b" + integrity sha512-S9GQ9YVg4DWrgjujwiXBER6KqdqW5nZ1Bmt+YEePn5gEoPvoVrh6ojthpHYRjBJtGFqBSzRAQ9eVZLebT22Ozg== dependencies: - "@abp/aspnetcore.mvc.ui.theme.shared" "^2.1.0" + "@abp/aspnetcore.mvc.ui.theme.shared" "^2.2.0" -"@abp/aspnetcore.mvc.ui.theme.shared@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-2.1.0.tgz#c2790241b5a44b9d6e4f65911a1b9d9e9104ed82" - integrity sha512-dxC0P/b1T+QJmRrB8HoLM7/GkWblz/X5lLqgn583W7/OTYhvxIxszuRDy/XIEuS+fP6a9rcGvGu5jcKJEqe/xA== - dependencies: - "@abp/aspnetcore.mvc.ui" "^2.1.0" - "@abp/bootstrap" "^2.1.0" - "@abp/bootstrap-datepicker" "^2.1.0" - "@abp/datatables.net-bs4" "^2.1.0" - "@abp/font-awesome" "^2.1.0" - "@abp/jquery-form" "^2.1.0" - "@abp/jquery-validation-unobtrusive" "^2.1.0" - "@abp/lodash" "^2.1.0" - "@abp/luxon" "^2.1.0" - "@abp/malihu-custom-scrollbar-plugin" "^2.1.0" - "@abp/select2" "^2.1.0" - "@abp/sweetalert" "^2.1.0" - "@abp/timeago" "^2.1.0" - "@abp/toastr" "^2.1.0" - -"@abp/aspnetcore.mvc.ui@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-2.1.0.tgz#3c86f42e52af3151d2aee0ffdd1281014ea61054" - integrity sha512-pKiKMBOPuLm7p44DW8DdbsVn5PY3NqGYkz6gf75uzxyWiVYyl2CM/bvX9w4Ie7Q969owENMLrBREN6ezWZ5ynA== +"@abp/aspnetcore.mvc.ui.theme.shared@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-2.2.0.tgz#e0df953853be2a184d323931573f9f98aebbaa62" + integrity sha512-urxziaCdvfEqN5cjiiM5f5dx2Yr+AoGqCJVCo0Okjl2dosdaj5DH4SBzMvKAaLXzo3Ep1h4b3Wvws4BThL/6rA== + dependencies: + "@abp/aspnetcore.mvc.ui" "^2.2.0" + "@abp/bootstrap" "^2.2.0" + "@abp/bootstrap-datepicker" "^2.2.0" + "@abp/datatables.net-bs4" "^2.2.0" + "@abp/font-awesome" "^2.2.0" + "@abp/jquery-form" "^2.2.0" + "@abp/jquery-validation-unobtrusive" "^2.2.0" + "@abp/lodash" "^2.2.0" + "@abp/luxon" "^2.2.0" + "@abp/malihu-custom-scrollbar-plugin" "^2.2.0" + "@abp/select2" "^2.2.0" + "@abp/sweetalert" "^2.2.0" + "@abp/timeago" "^2.2.0" + "@abp/toastr" "^2.2.0" + +"@abp/aspnetcore.mvc.ui@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-2.2.0.tgz#b2cdd421eed09ec1d30ae85e14434b7efc094ade" + integrity sha512-IO/AjhJu+LUa9zOaT8JlEnV+Pcp9oQ3q9kTq8kmMakC35vTIyvBpB3nnykXIOytZSyjsBgFYB/uMxPgBOjWagg== dependencies: ansi-colors "^4.1.1" extend-object "^1.0.0" @@ -41,135 +41,135 @@ path "^0.12.7" rimraf "^3.0.0" -"@abp/bootstrap-datepicker@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-2.1.0.tgz#a0d71da15cb3d3cc02f9a390437a44db5e9f9ea1" - integrity sha512-lkNI0iyefiXS2O5x9Ae9eJQLPXSQlOWDX7QhKnBHLR9JxjJEnhBUIIOylMltAIqtVDtjk2ikDyd3BAiyBdtB/w== +"@abp/bootstrap-datepicker@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-2.2.0.tgz#a2f50b422824f18ed4b7e80be6852e2979119f8e" + integrity sha512-X9jT5mU42QFfVhOZdun7aEJUf3bMko6NsG3NFQVjqTqKH+iYGKfHPFpXD0gP/6Nb4KgZUdId8hSyQTZyOK2JEA== dependencies: bootstrap-datepicker "^1.9.0" -"@abp/bootstrap@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-2.1.0.tgz#7ce15d4effac0e0991a3520c4666c6cb17a3fef2" - integrity sha512-1xQjqu6shCgzd1FI94y5AIXGIhBlZEoRrOhaT84j/2KzYiDvhP+LAqQjMgqlQmBLs6vMckpxtf5thxKTMXvtOw== +"@abp/bootstrap@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-2.2.0.tgz#16e41d3432117bbcd9012c6f735c49c543255879" + integrity sha512-aRmluu6SkIl+JgCzSSJZrDPkYr6WWaQdY0iJAOz6NHtffa7Aumh1IUOrLVKL0T1pQn6QKs0Z7JDGyYMdh1HPkQ== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" bootstrap "^4.3.1" -"@abp/core@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/core/-/core-2.1.0.tgz#0cd2850f029df1d18517b8e74c70341972c37ed7" - integrity sha512-1wnRo00hWncZWSakaEXm388XhhbKXDVkWDIdaT3kyQpvp3kX1lFx7I5iiZiwIeULwZRF9mi6HV6iHEze58x0kQ== +"@abp/core@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/core/-/core-2.2.0.tgz#4eea0a06458c90acb8566a11eb841fe65d15d256" + integrity sha512-tBGHa5CUr0ewT31g689RAfQ6Su2p4uyn2PzmrW/8lahBrvqkoCb41fkCDLQJkTY5rKPrEKZd/s9OoyOnS20DLg== -"@abp/datatables.net-bs4@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-2.1.0.tgz#a0f36cf4e3ef96ae03aa4b9956fcb8b971c854cb" - integrity sha512-93qc2rrGs+JKRPM/7UCasa5VmfswgYU8cv3Ybg5OKoaASODYUn06GChRFnd/mvqcDxw4+8gaqpC3U2ETZZI4pA== +"@abp/datatables.net-bs4@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-2.2.0.tgz#c7cc49e889b295ae10fb24ed62b154ef79ffc85a" + integrity sha512-zjJRPqOCWPfkHt1QztfFHKrsTE9o6Je2EpfA7hRMej2FlGbsMWUxOqx/btK1vjD6YIU8DtVDpIdj1WvPOITQ4Q== dependencies: - "@abp/datatables.net" "^2.1.0" + "@abp/datatables.net" "^2.2.0" datatables.net-bs4 "^1.10.20" -"@abp/datatables.net@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-2.1.0.tgz#674eaaa5b0948d7ee85b6605bfbad1a70f839aa7" - integrity sha512-3ZM2p+JpHumxbIKlDP/LKLsfceMdttdTOL0ckIZCmAAgoIeKmAtuMoKcHTr8lj5mjgv4arBGvG9WVCemep2PEw== +"@abp/datatables.net@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-2.2.0.tgz#22f9c7ca90c2d4af264483b4f8286b0feb7c3d52" + integrity sha512-L4MnpdloSWr/px3mvV75sxsxL68MyALB2LKdzCFMQWILCZVkxMmQb9LARINYIrn461Wrc+zbYWNEBD0MAq7flg== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" datatables.net "^1.10.20" -"@abp/font-awesome@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-2.1.0.tgz#c2e628a1b9d0525e7d6950bf007feebcd1c490c8" - integrity sha512-vlm1IQuQVfuCI2O1vphDd11zUEJ4/4PU0/0XI1YCpilse8fBg080CM3+G0kw6Erm/riznqhOJwBcfT+K+zqk8A== +"@abp/font-awesome@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-2.2.0.tgz#2de39e3c6c3e8c30394d82861761a66c5b4032f0" + integrity sha512-RT06MYUGgaWBEpW5c7wUcfMXgxcOHWdX/C01LDO/j6iVoKBuBHOkkvcUoTWII068ECrLYOkj+RyT59dCKm8FFw== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" "@fortawesome/fontawesome-free" "^5.11.2" -"@abp/jquery-form@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-2.1.0.tgz#285dbfdcf722cb0249f149e728cef7f788410c0c" - integrity sha512-A17rjHTiBJBKYgrtDX5wIqnI89wNmo3bdK9NagL1wMFj4GvDyOZoRIDLqkopYQsc8zuPjqw4+1aa2TPiA+jtKg== +"@abp/jquery-form@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-2.2.0.tgz#951653fac4013a7bbec065b5101b86d575e0eca7" + integrity sha512-ji44E3Ud0S3LNXn1WJ/Aw44qAIG7EITEW1KOe46oz+/awPpbiiA4dDDNleTvO2jI2/s8mNyR0bNanP6BUsc7tw== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" jquery-form "^4.2.2" -"@abp/jquery-validation-unobtrusive@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-2.1.0.tgz#fc938775ced2efc686e7dd092d6ceff1ea947f36" - integrity sha512-a8iBIj6amJ9rQNV+wxQUuEVh93M/c32kJcrwSEPWQcOoTj5gf0j8eKK9YvZaGokpylraz9mdGOwYQQuNj1sxEw== +"@abp/jquery-validation-unobtrusive@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-2.2.0.tgz#6d39ba9f7bf026d1380796bf5dff76c8d16b42ce" + integrity sha512-SuS/dRRVz7ZR4HK/h9x0jRRVLPqXN0CPRGPdJZ1LJraXVEJ9/eDEGf1rMlHmEGt1FXXFTD01/zjisbweDE786w== dependencies: - "@abp/jquery-validation" "^2.1.0" + "@abp/jquery-validation" "^2.2.0" jquery-validation-unobtrusive "^3.2.11" -"@abp/jquery-validation@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-2.1.0.tgz#2bf1a31321cce3b2abe6d56c6112c52a8ecb28b6" - integrity sha512-kU6/E+Xc3wHAUs+sGMAL8uozkXv65HnpksTwV4/+RK+D6iFU2EyNgCEFu7QGSwYZsV1/7YsCe2GD4ucBXIknbA== +"@abp/jquery-validation@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-2.2.0.tgz#02bb8ba883e72c1204867ee4d1c1094bd91c4c4c" + integrity sha512-ypITQloO4iEDgqlA6qb3taj+7HMX0Cf/ACA2OvtrvOgJejx6J4wfrPjwuFZu1WWJ0xtc9yTdbovdcSVcQbIGaA== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" jquery-validation "^1.19.1" -"@abp/jquery@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-2.1.0.tgz#fb5b4c9e8622cf46fee92f9f731d007d5fb200bb" - integrity sha512-ZpfzRut5G611bBmuDdiT6BD0M7Rl1P6r8uNxUjdmFXYwFd8wD02ZhIcsX7qFHFkYERuXfcLrZh4rpw9G1DVCJg== +"@abp/jquery@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-2.2.0.tgz#0e641b1109e78eff4c34331ca2b123b67cc30cbe" + integrity sha512-vEfRoFEAmDmRgSq98Y9EZExfQFSWtmjaHrodUu+MadTcRlnn+wHq8wwkKKxpj/eYtNc8aFORpyHMMH7uliAKxg== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" jquery "^3.4.1" -"@abp/lodash@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-2.1.0.tgz#9fc9e6521e6284d607cedbff1a458fa324137c5c" - integrity sha512-s1gTHhpbmEDDCsZeXb9MpClkDS4wH5R2IWPRZUlSPxo3gF0pvkx5ubdhYUEUgqy5QqWxE/+zUAjDc4x+cEriFQ== +"@abp/lodash@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-2.2.0.tgz#af0a2ebcb28fd0a8c02da5026479d9370ed19719" + integrity sha512-wOMLqIpuq4a7ww7pB138G6YxBiTGBgxNW/IWGUiWbfgrr88cGPKIYYv/8O8mvr8PLNGjizNynuwQRj522yA3Dw== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" lodash "^4.17.15" -"@abp/luxon@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-2.1.0.tgz#624796722119f075119006b436054aecbb38f15f" - integrity sha512-2b0sRo6rdYT1wDu9nSXm/9o8rhQ9ED7FxrDMYabYuOQz48esgn4fBUNcPqpxwejpFmlhZY6CONvkddNtaMeVHw== +"@abp/luxon@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-2.2.0.tgz#0d0e78edc249853fa31eceecc00df2846a879aa9" + integrity sha512-WbOW0PcMks+WXRPWt/+H4pOa5waM331WkY0F+EJx8fpxemNGQNUEXLkuMXzN3MrN6LrplM9AZ9i+NRA9PWHbNw== dependencies: luxon "^1.21.3" -"@abp/malihu-custom-scrollbar-plugin@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-2.1.0.tgz#f4dc1a32cefc3de8af08cb6d585ec5f7636a0c5e" - integrity sha512-WcxzCZ5YOMxGxZerEh966cVrFSCw1UTDqwU2rxA/LsHEbPKd69AY+SHvUiacNxPXs1ZCF6FFJ29C5dWicEIRaQ== +"@abp/malihu-custom-scrollbar-plugin@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-2.2.0.tgz#e11fd46dccbb28d44fb199e880b91d27c94f1919" + integrity sha512-YDu/NLpIzMA96NDHxd27/+liTm3sow9M+oWH29+9JW8o/AEpXUH3T3AmoXXcTgsBlzLaewgHEFM8yxsAAFoj8Q== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" malihu-custom-scrollbar-plugin "^3.1.5" -"@abp/select2@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-2.1.0.tgz#79e50d2c25e74a5f96520e8aa1433d79aea674d1" - integrity sha512-ut/3c+lFdoepuDH36M7thWagmAmTFrChcPnhYjTx4MmIf31WW1BwqOSx3I2g8M+NEEx+V2jTNuBpTq7PONgSJg== +"@abp/select2@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-2.2.0.tgz#4639d4e5b72b1736fa4476bd9b6a78e036400421" + integrity sha512-tc87JyM0kvVF388kyGUjDby49Zrrb089jVRRipoIaxXeu4M1YxEFSKBEcUK1MohZWjVtWrNs8MoxPlfukaMpyw== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" select2 "^4.0.12" -"@abp/sweetalert@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-2.1.0.tgz#88f405c4ba9f9ed2fd54b945ed6bc48d5ae2fa23" - integrity sha512-EWvReqxZ1DrNH9XD+cf/yGVj+8IPTpuoPuWKDryN4fF7TCMJA+KrXp5lFxpjfkKTtNzLeFGsJqDFWaUifxtqTA== +"@abp/sweetalert@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-2.2.0.tgz#dfc60ba085522d8390e41b90bf5a3d474f4ae624" + integrity sha512-HS6TKOwP91UjzjZHaheurZ1AYUSMkQyCSmoX6g5LAK4eH8IIgpojVSp1AFCSPATrFsFWY/dzkDGcfu90FWsVBg== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" sweetalert "^2.1.2" -"@abp/timeago@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-2.1.0.tgz#28c0aef88aff8b54d1dfb42a664d05097e7fda35" - integrity sha512-NklUYcWeji7po+Y6Oi7b7IkYmjd5YRu123bm3MqjQ71AzuOCTFbvPMHzYOjrUTkzr6gW3IJ24LQ4YmpshPy4ZQ== +"@abp/timeago@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-2.2.0.tgz#9a8297f36a46cdc4cc62f44d0fdc91b70def389c" + integrity sha512-8qjmKscsTvPznHKWEsddYxdSBiU+l+OgLG6vzMcSWqngYbDQGXqNA93BwJI2qiwd+FkNcfGgYg7CN7bcwzmaiw== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" timeago "^1.6.7" -"@abp/toastr@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-2.1.0.tgz#22a53a2b1f354770fdc7b37f06bec10eefccfe7a" - integrity sha512-hD3hTDx+CixTVTx73rnZDiiFkfSxpZox8RLm+CiFA62ORdO8Ryij8TOXXkJd84b2tJfkAkYehohVXKwHlHU7Zg== +"@abp/toastr@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-2.2.0.tgz#1cad83a89da244685b3c82adff64260b7ccf4742" + integrity sha512-HHfSaw4M/9zS+KgzxGvbHYiQ5qcJgpf21cRZEo16aUwnTeKr4SRaewAWryNn4dKcIO2YNrhzDLH+OYbEaJJlDQ== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" toastr "^2.1.4" "@fortawesome/fontawesome-free@^5.11.2": diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/package.json b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/package.json index b620e756f7..6e36dde3bf 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/package.json +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/package.json @@ -3,6 +3,6 @@ "name": "my-app", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.basic": "^2.1.0" + "@abp/aspnetcore.mvc.ui.theme.basic": "^2.2.0" } } \ No newline at end of file diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/wwwroot/libs/abp/core/abp.css b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/wwwroot/libs/abp/core/abp.css index ee3c5080a5..ddf9cae5b2 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/wwwroot/libs/abp/core/abp.css +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/wwwroot/libs/abp/core/abp.css @@ -1,56 +1,56 @@ -@keyframes spin { - 0% { - transform: translateZ(0) rotate(0deg); - } - - 100% { - transform: translateZ(0) rotate(360deg); - } -} - -.abp-block-area { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: 102; - background-color: #fff; - opacity: .8; - transition: opacity .25s; -} - - .abp-block-area.abp-block-area-disappearing { - opacity: 0; - } - - .abp-block-area.abp-block-area-busy:after { - content: attr(data-text); - display: block; - max-width: 125px; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - font-size: 20px; - font-family: sans-serif; - color: #343a40; - text-align: center; - text-transform: uppercase; - } - - .abp-block-area.abp-block-area-busy:before { - content: ""; - display: block; - width: 150px; - height: 150px; - border-radius: 50%; - border-width: 2px; - border-style: solid; - border-color: transparent #228ae6 #228ae6 #228ae6; - position: absolute; - top: calc(50% - 75px); - left: calc(50% - 75px); - will-change: transform; - animation: spin .75s infinite ease-in-out; - } +@keyframes spin { + 0% { + transform: translateZ(0) rotate(0deg); + } + + 100% { + transform: translateZ(0) rotate(360deg); + } +} + +.abp-block-area { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 102; + background-color: #fff; + opacity: .8; + transition: opacity .25s; +} + + .abp-block-area.abp-block-area-disappearing { + opacity: 0; + } + + .abp-block-area.abp-block-area-busy:after { + content: attr(data-text); + display: block; + max-width: 125px; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + font-size: 20px; + font-family: sans-serif; + color: #343a40; + text-align: center; + text-transform: uppercase; + } + + .abp-block-area.abp-block-area-busy:before { + content: ""; + display: block; + width: 150px; + height: 150px; + border-radius: 50%; + border-width: 2px; + border-style: solid; + border-color: transparent #228ae6 #228ae6 #228ae6; + position: absolute; + top: calc(50% - 75px); + left: calc(50% - 75px); + will-change: transform; + animation: spin .75s infinite ease-in-out; + } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/wwwroot/libs/abp/core/abp.js b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/wwwroot/libs/abp/core/abp.js index cef1cf55e1..730db8bc97 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/wwwroot/libs/abp/core/abp.js +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/wwwroot/libs/abp/core/abp.js @@ -1,636 +1,636 @@ -var abp = abp || {}; -(function () { - - /* Application paths *****************************************/ - - //Current application root path (including virtual directory if exists). - abp.appPath = abp.appPath || '/'; - - abp.pageLoadTime = new Date(); - - //Converts given path to absolute path using abp.appPath variable. - abp.toAbsAppPath = function (path) { - if (path.indexOf('/') == 0) { - path = path.substring(1); - } - - return abp.appPath + path; - }; - - /* LOGGING ***************************************************/ - //Implements Logging API that provides secure & controlled usage of console.log - - abp.log = abp.log || {}; - - abp.log.levels = { - DEBUG: 1, - INFO: 2, - WARN: 3, - ERROR: 4, - FATAL: 5 - }; - - abp.log.level = abp.log.levels.DEBUG; - - abp.log.log = function (logObject, logLevel) { - if (!window.console || !window.console.log) { - return; - } - - if (logLevel != undefined && logLevel < abp.log.level) { - return; - } - - console.log(logObject); - }; - - abp.log.debug = function (logObject) { - abp.log.log("DEBUG: ", abp.log.levels.DEBUG); - abp.log.log(logObject, abp.log.levels.DEBUG); - }; - - abp.log.info = function (logObject) { - abp.log.log("INFO: ", abp.log.levels.INFO); - abp.log.log(logObject, abp.log.levels.INFO); - }; - - abp.log.warn = function (logObject) { - abp.log.log("WARN: ", abp.log.levels.WARN); - abp.log.log(logObject, abp.log.levels.WARN); - }; - - abp.log.error = function (logObject) { - abp.log.log("ERROR: ", abp.log.levels.ERROR); - abp.log.log(logObject, abp.log.levels.ERROR); - }; - - abp.log.fatal = function (logObject) { - abp.log.log("FATAL: ", abp.log.levels.FATAL); - abp.log.log(logObject, abp.log.levels.FATAL); - }; - - /* LOCALIZATION ***********************************************/ - - abp.localization = abp.localization || {}; - - abp.localization.values = {}; - - abp.localization.localize = function (key, sourceName) { - sourceName = sourceName || abp.localization.defaultResourceName; - - var source = abp.localization.values[sourceName]; - - if (!source) { - abp.log.warn('Could not find localization source: ' + sourceName); - return key; - } - - var value = source[key]; - if (value == undefined) { - return key; - } - - var copiedArguments = Array.prototype.slice.call(arguments, 0); - copiedArguments.splice(1, 1); - copiedArguments[0] = value; - - return abp.utils.formatString.apply(this, copiedArguments); - }; - - abp.localization.getResource = function (name) { - return function () { - var copiedArguments = Array.prototype.slice.call(arguments, 0); - copiedArguments.splice(1, 0, name); - return abp.localization.localize.apply(this, copiedArguments); - }; - }; - - abp.localization.defaultResourceName = undefined; - - /* AUTHORIZATION **********************************************/ - - abp.auth = abp.auth || {}; - - abp.auth.policies = abp.auth.policies || {}; - - abp.auth.grantedPolicies = abp.auth.grantedPolicies || {}; - - abp.auth.isGranted = function (policyName) { - return abp.auth.policies[policyName] != undefined && abp.auth.grantedPolicies[policyName] != undefined; - }; - - abp.auth.isAnyGranted = function () { - if (!arguments || arguments.length <= 0) { - return true; - } - - for (var i = 0; i < arguments.length; i++) { - if (abp.auth.isGranted(arguments[i])) { - return true; - } - } - - return false; - }; - - abp.auth.areAllGranted = function () { - if (!arguments || arguments.length <= 0) { - return true; - } - - for (var i = 0; i < arguments.length; i++) { - if (!abp.auth.isGranted(arguments[i])) { - return false; - } - } - - return true; - }; - - abp.auth.tokenCookieName = 'Abp.AuthToken'; - - abp.auth.setToken = function (authToken, expireDate) { - abp.utils.setCookieValue(abp.auth.tokenCookieName, authToken, expireDate, abp.appPath, abp.domain); - }; - - abp.auth.getToken = function () { - return abp.utils.getCookieValue(abp.auth.tokenCookieName); - } - - abp.auth.clearToken = function () { - abp.auth.setToken(); - } - - /* SETTINGS *************************************************/ - - abp.setting = abp.setting || {}; - - abp.setting.values = abp.setting.values || {}; - - abp.setting.get = function (name) { - return abp.setting.values[name]; - }; - - abp.setting.getBoolean = function (name) { - var value = abp.setting.get(name); - return value == 'true' || value == 'True'; - }; - - abp.setting.getInt = function (name) { - return parseInt(abp.setting.values[name]); - }; - - /* NOTIFICATION *********************************************/ - //Defines Notification API, not implements it - - abp.notify = abp.notify || {}; - - abp.notify.success = function (message, title, options) { - abp.log.warn('abp.notify.success is not implemented!'); - }; - - abp.notify.info = function (message, title, options) { - abp.log.warn('abp.notify.info is not implemented!'); - }; - - abp.notify.warn = function (message, title, options) { - abp.log.warn('abp.notify.warn is not implemented!'); - }; - - abp.notify.error = function (message, title, options) { - abp.log.warn('abp.notify.error is not implemented!'); - }; - - /* MESSAGE **************************************************/ - //Defines Message API, not implements it - - abp.message = abp.message || {}; - - abp.message._showMessage = function (message, title) { - alert((title || '') + ' ' + message); - }; - - abp.message.info = function (message, title) { - abp.log.warn('abp.message.info is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.success = function (message, title) { - abp.log.warn('abp.message.success is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.warn = function (message, title) { - abp.log.warn('abp.message.warn is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.error = function (message, title) { - abp.log.warn('abp.message.error is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.confirm = function (message, titleOrCallback, callback) { - abp.log.warn('abp.message.confirm is not properly implemented!'); - - if (titleOrCallback && !(typeof titleOrCallback == 'string')) { - callback = titleOrCallback; - } - - var result = confirm(message); - callback && callback(result); - }; - - /* UI *******************************************************/ - - abp.ui = abp.ui || {}; - - /* UI BLOCK */ - //Defines UI Block API and implements basically - - var $abpBlockArea = document.createElement('div'); - $abpBlockArea.classList.add('abp-block-area'); - - /* opts: { //Can be an object with options or a string for query a selector - * elm: a query selector (optional - default: document.body) - * busy: boolean (optional - default: false) - * promise: A promise with always or finally handler (optional - auto unblocks the ui if provided) - * } - */ - abp.ui.block = function (opts) { - if (!opts) { - opts = {}; - } else if (typeof opts == 'string') { - opts = { - elm: opts - }; - } - - var $elm = document.querySelector(opts.elm) || document.body; - - if (opts.busy) { - $abpBlockArea.classList.add('abp-block-area-busy'); - } else { - $abpBlockArea.classList.remove('abp-block-area-busy'); - } - - if (document.querySelector(opts.elm)) { - $abpBlockArea.style.position = 'absolute'; - } else { - $abpBlockArea.style.position = 'fixed'; - } - - $elm.appendChild($abpBlockArea); - - if (opts.promise) { - if (opts.promise.always) { //jQuery.Deferred style - opts.promise.always(function () { - abp.ui.unblock({ - $elm: opts.elm - }); - }); - } else if (opts.promise['finally']) { //Q style - opts.promise['finally'](function () { - abp.ui.unblock({ - $elm: opts.elm - }); - }); - } - } - }; - - /* opts: { - * - * } - */ - abp.ui.unblock = function (opts) { - var element = document.querySelector('.abp-block-area'); - if (element) { - element.classList.add('abp-block-area-disappearing'); - setTimeout(function () { - if (element) { - element.classList.remove('abp-block-area-disappearing'); - element.parentElement.removeChild(element); - } - }, 250); - } - }; - - /* UI BUSY */ - //Defines UI Busy API, not implements it - - abp.ui.setBusy = function (opts) { - if (!opts) { - opts = { - busy: true - }; - } else if (typeof opts == 'string') { - opts = { - elm: opts, - busy: true - }; - } - - abp.ui.block(opts); - }; - - abp.ui.clearBusy = function (opts) { - abp.ui.unblock(opts); - }; - - /* SIMPLE EVENT BUS *****************************************/ - - abp.event = (function () { - - var _callbacks = {}; - - var on = function (eventName, callback) { - if (!_callbacks[eventName]) { - _callbacks[eventName] = []; - } - - _callbacks[eventName].push(callback); - }; - - var off = function (eventName, callback) { - var callbacks = _callbacks[eventName]; - if (!callbacks) { - return; - } - - var index = -1; - for (var i = 0; i < callbacks.length; i++) { - if (callbacks[i] === callback) { - index = i; - break; - } - } - - if (index < 0) { - return; - } - - _callbacks[eventName].splice(index, 1); - }; - - var trigger = function (eventName) { - var callbacks = _callbacks[eventName]; - if (!callbacks || !callbacks.length) { - return; - } - - var args = Array.prototype.slice.call(arguments, 1); - for (var i = 0; i < callbacks.length; i++) { - callbacks[i].apply(this, args); - } - }; - - // Public interface /////////////////////////////////////////////////// - - return { - on: on, - off: off, - trigger: trigger - }; - })(); - - - /* UTILS ***************************************************/ - - abp.utils = abp.utils || {}; - - /* Creates a name namespace. - * Example: - * var taskService = abp.utils.createNamespace(abp, 'services.task'); - * taskService will be equal to abp.services.task - * first argument (root) must be defined first - ************************************************************/ - abp.utils.createNamespace = function (root, ns) { - var parts = ns.split('.'); - for (var i = 0; i < parts.length; i++) { - if (typeof root[parts[i]] == 'undefined') { - root[parts[i]] = {}; - } - - root = root[parts[i]]; - } - - return root; - }; - - /* Find and replaces a string (search) to another string (replacement) in - * given string (str). - * Example: - * abp.utils.replaceAll('This is a test string', 'is', 'X') = 'ThX X a test string' - ************************************************************/ - abp.utils.replaceAll = function (str, search, replacement) { - var fix = search.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); - return str.replace(new RegExp(fix, 'g'), replacement); - }; - - /* Formats a string just like string.format in C#. - * Example: - * abp.utils.formatString('Hello {0}','Tuana') = 'Hello Tuana' - ************************************************************/ - abp.utils.formatString = function () { - if (arguments.length < 1) { - return null; - } - - var str = arguments[0]; - - for (var i = 1; i < arguments.length; i++) { - var placeHolder = '{' + (i - 1) + '}'; - str = abp.utils.replaceAll(str, placeHolder, arguments[i]); - } - - return str; - }; - - abp.utils.toPascalCase = function (str) { - if (!str || !str.length) { - return str; - } - - if (str.length === 1) { - return str.charAt(0).toUpperCase(); - } - - return str.charAt(0).toUpperCase() + str.substr(1); - } - - abp.utils.toCamelCase = function (str) { - if (!str || !str.length) { - return str; - } - - if (str.length === 1) { - return str.charAt(0).toLowerCase(); - } - - return str.charAt(0).toLowerCase() + str.substr(1); - } - - abp.utils.truncateString = function (str, maxLength) { - if (!str || !str.length || str.length <= maxLength) { - return str; - } - - return str.substr(0, maxLength); - }; - - abp.utils.truncateStringWithPostfix = function (str, maxLength, postfix) { - postfix = postfix || '...'; - - if (!str || !str.length || str.length <= maxLength) { - return str; - } - - if (maxLength <= postfix.length) { - return postfix.substr(0, maxLength); - } - - return str.substr(0, maxLength - postfix.length) + postfix; - }; - - abp.utils.isFunction = function (obj) { - return !!(obj && obj.constructor && obj.call && obj.apply); - }; - - /** - * parameterInfos should be an array of { name, value } objects - * where name is query string parameter name and value is it's value. - * includeQuestionMark is true by default. - */ - abp.utils.buildQueryString = function (parameterInfos, includeQuestionMark) { - if (includeQuestionMark === undefined) { - includeQuestionMark = true; - } - - var qs = ''; - - function addSeperator() { - if (!qs.length) { - if (includeQuestionMark) { - qs = qs + '?'; - } - } else { - qs = qs + '&'; - } - } - - for (var i = 0; i < parameterInfos.length; ++i) { - var parameterInfo = parameterInfos[i]; - if (parameterInfo.value === undefined) { - continue; - } - - if (parameterInfo.value === null) { - parameterInfo.value = ''; - } - - addSeperator(); - - if (parameterInfo.value.toJSON && typeof parameterInfo.value.toJSON === "function") { - qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value.toJSON()); - } else if (Array.isArray(parameterInfo.value) && parameterInfo.value.length) { - for (var j = 0; j < parameterInfo.value.length; j++) { - if (j > 0) { - addSeperator(); - } - - qs = qs + parameterInfo.name + '[' + j + ']=' + encodeURIComponent(parameterInfo.value[j]); - } - } else { - qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value); - } - } - - return qs; - } - - /** - * Sets a cookie value for given key. - * This is a simple implementation created to be used by ABP. - * Please use a complete cookie library if you need. - * @param {string} key - * @param {string} value - * @param {Date} expireDate (optional). If not specified the cookie will expire at the end of session. - * @param {string} path (optional) - */ - abp.utils.setCookieValue = function (key, value, expireDate, path) { - var cookieValue = encodeURIComponent(key) + '='; - - if (value) { - cookieValue = cookieValue + encodeURIComponent(value); - } - - if (expireDate) { - cookieValue = cookieValue + "; expires=" + expireDate.toUTCString(); - } - - if (path) { - cookieValue = cookieValue + "; path=" + path; - } - - document.cookie = cookieValue; - }; - - /** - * Gets a cookie with given key. - * This is a simple implementation created to be used by ABP. - * Please use a complete cookie library if you need. - * @param {string} key - * @returns {string} Cookie value or null - */ - abp.utils.getCookieValue = function (key) { - var equalities = document.cookie.split('; '); - for (var i = 0; i < equalities.length; i++) { - if (!equalities[i]) { - continue; - } - - var splitted = equalities[i].split('='); - if (splitted.length != 2) { - continue; - } - - if (decodeURIComponent(splitted[0]) === key) { - return decodeURIComponent(splitted[1] || ''); - } - } - - return null; - }; - - /** - * Deletes cookie for given key. - * This is a simple implementation created to be used by ABP. - * Please use a complete cookie library if you need. - * @param {string} key - * @param {string} path (optional) - */ - abp.utils.deleteCookie = function (key, path) { - var cookieValue = encodeURIComponent(key) + '='; - - cookieValue = cookieValue + "; expires=" + (new Date(new Date().getTime() - 86400000)).toUTCString(); - - if (path) { - cookieValue = cookieValue + "; path=" + path; - } - - document.cookie = cookieValue; - } - - /* SECURITY ***************************************/ - abp.security = abp.security || {}; - abp.security.antiForgery = abp.security.antiForgery || {}; - - abp.security.antiForgery.tokenCookieName = 'XSRF-TOKEN'; - abp.security.antiForgery.tokenHeaderName = 'X-XSRF-TOKEN'; - - abp.security.antiForgery.getToken = function () { - return abp.utils.getCookieValue(abp.security.antiForgery.tokenCookieName); - }; - +var abp = abp || {}; +(function () { + + /* Application paths *****************************************/ + + //Current application root path (including virtual directory if exists). + abp.appPath = abp.appPath || '/'; + + abp.pageLoadTime = new Date(); + + //Converts given path to absolute path using abp.appPath variable. + abp.toAbsAppPath = function (path) { + if (path.indexOf('/') == 0) { + path = path.substring(1); + } + + return abp.appPath + path; + }; + + /* LOGGING ***************************************************/ + //Implements Logging API that provides secure & controlled usage of console.log + + abp.log = abp.log || {}; + + abp.log.levels = { + DEBUG: 1, + INFO: 2, + WARN: 3, + ERROR: 4, + FATAL: 5 + }; + + abp.log.level = abp.log.levels.DEBUG; + + abp.log.log = function (logObject, logLevel) { + if (!window.console || !window.console.log) { + return; + } + + if (logLevel != undefined && logLevel < abp.log.level) { + return; + } + + console.log(logObject); + }; + + abp.log.debug = function (logObject) { + abp.log.log("DEBUG: ", abp.log.levels.DEBUG); + abp.log.log(logObject, abp.log.levels.DEBUG); + }; + + abp.log.info = function (logObject) { + abp.log.log("INFO: ", abp.log.levels.INFO); + abp.log.log(logObject, abp.log.levels.INFO); + }; + + abp.log.warn = function (logObject) { + abp.log.log("WARN: ", abp.log.levels.WARN); + abp.log.log(logObject, abp.log.levels.WARN); + }; + + abp.log.error = function (logObject) { + abp.log.log("ERROR: ", abp.log.levels.ERROR); + abp.log.log(logObject, abp.log.levels.ERROR); + }; + + abp.log.fatal = function (logObject) { + abp.log.log("FATAL: ", abp.log.levels.FATAL); + abp.log.log(logObject, abp.log.levels.FATAL); + }; + + /* LOCALIZATION ***********************************************/ + + abp.localization = abp.localization || {}; + + abp.localization.values = {}; + + abp.localization.localize = function (key, sourceName) { + sourceName = sourceName || abp.localization.defaultResourceName; + + var source = abp.localization.values[sourceName]; + + if (!source) { + abp.log.warn('Could not find localization source: ' + sourceName); + return key; + } + + var value = source[key]; + if (value == undefined) { + return key; + } + + var copiedArguments = Array.prototype.slice.call(arguments, 0); + copiedArguments.splice(1, 1); + copiedArguments[0] = value; + + return abp.utils.formatString.apply(this, copiedArguments); + }; + + abp.localization.getResource = function (name) { + return function () { + var copiedArguments = Array.prototype.slice.call(arguments, 0); + copiedArguments.splice(1, 0, name); + return abp.localization.localize.apply(this, copiedArguments); + }; + }; + + abp.localization.defaultResourceName = undefined; + + /* AUTHORIZATION **********************************************/ + + abp.auth = abp.auth || {}; + + abp.auth.policies = abp.auth.policies || {}; + + abp.auth.grantedPolicies = abp.auth.grantedPolicies || {}; + + abp.auth.isGranted = function (policyName) { + return abp.auth.policies[policyName] != undefined && abp.auth.grantedPolicies[policyName] != undefined; + }; + + abp.auth.isAnyGranted = function () { + if (!arguments || arguments.length <= 0) { + return true; + } + + for (var i = 0; i < arguments.length; i++) { + if (abp.auth.isGranted(arguments[i])) { + return true; + } + } + + return false; + }; + + abp.auth.areAllGranted = function () { + if (!arguments || arguments.length <= 0) { + return true; + } + + for (var i = 0; i < arguments.length; i++) { + if (!abp.auth.isGranted(arguments[i])) { + return false; + } + } + + return true; + }; + + abp.auth.tokenCookieName = 'Abp.AuthToken'; + + abp.auth.setToken = function (authToken, expireDate) { + abp.utils.setCookieValue(abp.auth.tokenCookieName, authToken, expireDate, abp.appPath, abp.domain); + }; + + abp.auth.getToken = function () { + return abp.utils.getCookieValue(abp.auth.tokenCookieName); + } + + abp.auth.clearToken = function () { + abp.auth.setToken(); + } + + /* SETTINGS *************************************************/ + + abp.setting = abp.setting || {}; + + abp.setting.values = abp.setting.values || {}; + + abp.setting.get = function (name) { + return abp.setting.values[name]; + }; + + abp.setting.getBoolean = function (name) { + var value = abp.setting.get(name); + return value == 'true' || value == 'True'; + }; + + abp.setting.getInt = function (name) { + return parseInt(abp.setting.values[name]); + }; + + /* NOTIFICATION *********************************************/ + //Defines Notification API, not implements it + + abp.notify = abp.notify || {}; + + abp.notify.success = function (message, title, options) { + abp.log.warn('abp.notify.success is not implemented!'); + }; + + abp.notify.info = function (message, title, options) { + abp.log.warn('abp.notify.info is not implemented!'); + }; + + abp.notify.warn = function (message, title, options) { + abp.log.warn('abp.notify.warn is not implemented!'); + }; + + abp.notify.error = function (message, title, options) { + abp.log.warn('abp.notify.error is not implemented!'); + }; + + /* MESSAGE **************************************************/ + //Defines Message API, not implements it + + abp.message = abp.message || {}; + + abp.message._showMessage = function (message, title) { + alert((title || '') + ' ' + message); + }; + + abp.message.info = function (message, title) { + abp.log.warn('abp.message.info is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.success = function (message, title) { + abp.log.warn('abp.message.success is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.warn = function (message, title) { + abp.log.warn('abp.message.warn is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.error = function (message, title) { + abp.log.warn('abp.message.error is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.confirm = function (message, titleOrCallback, callback) { + abp.log.warn('abp.message.confirm is not properly implemented!'); + + if (titleOrCallback && !(typeof titleOrCallback == 'string')) { + callback = titleOrCallback; + } + + var result = confirm(message); + callback && callback(result); + }; + + /* UI *******************************************************/ + + abp.ui = abp.ui || {}; + + /* UI BLOCK */ + //Defines UI Block API and implements basically + + var $abpBlockArea = document.createElement('div'); + $abpBlockArea.classList.add('abp-block-area'); + + /* opts: { //Can be an object with options or a string for query a selector + * elm: a query selector (optional - default: document.body) + * busy: boolean (optional - default: false) + * promise: A promise with always or finally handler (optional - auto unblocks the ui if provided) + * } + */ + abp.ui.block = function (opts) { + if (!opts) { + opts = {}; + } else if (typeof opts == 'string') { + opts = { + elm: opts + }; + } + + var $elm = document.querySelector(opts.elm) || document.body; + + if (opts.busy) { + $abpBlockArea.classList.add('abp-block-area-busy'); + } else { + $abpBlockArea.classList.remove('abp-block-area-busy'); + } + + if (document.querySelector(opts.elm)) { + $abpBlockArea.style.position = 'absolute'; + } else { + $abpBlockArea.style.position = 'fixed'; + } + + $elm.appendChild($abpBlockArea); + + if (opts.promise) { + if (opts.promise.always) { //jQuery.Deferred style + opts.promise.always(function () { + abp.ui.unblock({ + $elm: opts.elm + }); + }); + } else if (opts.promise['finally']) { //Q style + opts.promise['finally'](function () { + abp.ui.unblock({ + $elm: opts.elm + }); + }); + } + } + }; + + /* opts: { + * + * } + */ + abp.ui.unblock = function (opts) { + var element = document.querySelector('.abp-block-area'); + if (element) { + element.classList.add('abp-block-area-disappearing'); + setTimeout(function () { + if (element) { + element.classList.remove('abp-block-area-disappearing'); + element.parentElement.removeChild(element); + } + }, 250); + } + }; + + /* UI BUSY */ + //Defines UI Busy API, not implements it + + abp.ui.setBusy = function (opts) { + if (!opts) { + opts = { + busy: true + }; + } else if (typeof opts == 'string') { + opts = { + elm: opts, + busy: true + }; + } + + abp.ui.block(opts); + }; + + abp.ui.clearBusy = function (opts) { + abp.ui.unblock(opts); + }; + + /* SIMPLE EVENT BUS *****************************************/ + + abp.event = (function () { + + var _callbacks = {}; + + var on = function (eventName, callback) { + if (!_callbacks[eventName]) { + _callbacks[eventName] = []; + } + + _callbacks[eventName].push(callback); + }; + + var off = function (eventName, callback) { + var callbacks = _callbacks[eventName]; + if (!callbacks) { + return; + } + + var index = -1; + for (var i = 0; i < callbacks.length; i++) { + if (callbacks[i] === callback) { + index = i; + break; + } + } + + if (index < 0) { + return; + } + + _callbacks[eventName].splice(index, 1); + }; + + var trigger = function (eventName) { + var callbacks = _callbacks[eventName]; + if (!callbacks || !callbacks.length) { + return; + } + + var args = Array.prototype.slice.call(arguments, 1); + for (var i = 0; i < callbacks.length; i++) { + callbacks[i].apply(this, args); + } + }; + + // Public interface /////////////////////////////////////////////////// + + return { + on: on, + off: off, + trigger: trigger + }; + })(); + + + /* UTILS ***************************************************/ + + abp.utils = abp.utils || {}; + + /* Creates a name namespace. + * Example: + * var taskService = abp.utils.createNamespace(abp, 'services.task'); + * taskService will be equal to abp.services.task + * first argument (root) must be defined first + ************************************************************/ + abp.utils.createNamespace = function (root, ns) { + var parts = ns.split('.'); + for (var i = 0; i < parts.length; i++) { + if (typeof root[parts[i]] == 'undefined') { + root[parts[i]] = {}; + } + + root = root[parts[i]]; + } + + return root; + }; + + /* Find and replaces a string (search) to another string (replacement) in + * given string (str). + * Example: + * abp.utils.replaceAll('This is a test string', 'is', 'X') = 'ThX X a test string' + ************************************************************/ + abp.utils.replaceAll = function (str, search, replacement) { + var fix = search.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); + return str.replace(new RegExp(fix, 'g'), replacement); + }; + + /* Formats a string just like string.format in C#. + * Example: + * abp.utils.formatString('Hello {0}','Tuana') = 'Hello Tuana' + ************************************************************/ + abp.utils.formatString = function () { + if (arguments.length < 1) { + return null; + } + + var str = arguments[0]; + + for (var i = 1; i < arguments.length; i++) { + var placeHolder = '{' + (i - 1) + '}'; + str = abp.utils.replaceAll(str, placeHolder, arguments[i]); + } + + return str; + }; + + abp.utils.toPascalCase = function (str) { + if (!str || !str.length) { + return str; + } + + if (str.length === 1) { + return str.charAt(0).toUpperCase(); + } + + return str.charAt(0).toUpperCase() + str.substr(1); + } + + abp.utils.toCamelCase = function (str) { + if (!str || !str.length) { + return str; + } + + if (str.length === 1) { + return str.charAt(0).toLowerCase(); + } + + return str.charAt(0).toLowerCase() + str.substr(1); + } + + abp.utils.truncateString = function (str, maxLength) { + if (!str || !str.length || str.length <= maxLength) { + return str; + } + + return str.substr(0, maxLength); + }; + + abp.utils.truncateStringWithPostfix = function (str, maxLength, postfix) { + postfix = postfix || '...'; + + if (!str || !str.length || str.length <= maxLength) { + return str; + } + + if (maxLength <= postfix.length) { + return postfix.substr(0, maxLength); + } + + return str.substr(0, maxLength - postfix.length) + postfix; + }; + + abp.utils.isFunction = function (obj) { + return !!(obj && obj.constructor && obj.call && obj.apply); + }; + + /** + * parameterInfos should be an array of { name, value } objects + * where name is query string parameter name and value is it's value. + * includeQuestionMark is true by default. + */ + abp.utils.buildQueryString = function (parameterInfos, includeQuestionMark) { + if (includeQuestionMark === undefined) { + includeQuestionMark = true; + } + + var qs = ''; + + function addSeperator() { + if (!qs.length) { + if (includeQuestionMark) { + qs = qs + '?'; + } + } else { + qs = qs + '&'; + } + } + + for (var i = 0; i < parameterInfos.length; ++i) { + var parameterInfo = parameterInfos[i]; + if (parameterInfo.value === undefined) { + continue; + } + + if (parameterInfo.value === null) { + parameterInfo.value = ''; + } + + addSeperator(); + + if (parameterInfo.value.toJSON && typeof parameterInfo.value.toJSON === "function") { + qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value.toJSON()); + } else if (Array.isArray(parameterInfo.value) && parameterInfo.value.length) { + for (var j = 0; j < parameterInfo.value.length; j++) { + if (j > 0) { + addSeperator(); + } + + qs = qs + parameterInfo.name + '[' + j + ']=' + encodeURIComponent(parameterInfo.value[j]); + } + } else { + qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value); + } + } + + return qs; + } + + /** + * Sets a cookie value for given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @param {string} value + * @param {Date} expireDate (optional). If not specified the cookie will expire at the end of session. + * @param {string} path (optional) + */ + abp.utils.setCookieValue = function (key, value, expireDate, path) { + var cookieValue = encodeURIComponent(key) + '='; + + if (value) { + cookieValue = cookieValue + encodeURIComponent(value); + } + + if (expireDate) { + cookieValue = cookieValue + "; expires=" + expireDate.toUTCString(); + } + + if (path) { + cookieValue = cookieValue + "; path=" + path; + } + + document.cookie = cookieValue; + }; + + /** + * Gets a cookie with given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @returns {string} Cookie value or null + */ + abp.utils.getCookieValue = function (key) { + var equalities = document.cookie.split('; '); + for (var i = 0; i < equalities.length; i++) { + if (!equalities[i]) { + continue; + } + + var splitted = equalities[i].split('='); + if (splitted.length != 2) { + continue; + } + + if (decodeURIComponent(splitted[0]) === key) { + return decodeURIComponent(splitted[1] || ''); + } + } + + return null; + }; + + /** + * Deletes cookie for given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @param {string} path (optional) + */ + abp.utils.deleteCookie = function (key, path) { + var cookieValue = encodeURIComponent(key) + '='; + + cookieValue = cookieValue + "; expires=" + (new Date(new Date().getTime() - 86400000)).toUTCString(); + + if (path) { + cookieValue = cookieValue + "; path=" + path; + } + + document.cookie = cookieValue; + } + + /* SECURITY ***************************************/ + abp.security = abp.security || {}; + abp.security.antiForgery = abp.security.antiForgery || {}; + + abp.security.antiForgery.tokenCookieName = 'XSRF-TOKEN'; + abp.security.antiForgery.tokenHeaderName = 'X-XSRF-TOKEN'; + + abp.security.antiForgery.getToken = function () { + return abp.utils.getCookieValue(abp.security.antiForgery.tokenCookieName); + }; + })(); \ No newline at end of file diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/wwwroot/libs/abp/jquery/abp.jquery.js b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/wwwroot/libs/abp/jquery/abp.jquery.js index 6e2ee001b8..e6aff047f7 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/wwwroot/libs/abp/jquery/abp.jquery.js +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/wwwroot/libs/abp/jquery/abp.jquery.js @@ -1,393 +1,393 @@ -var abp = abp || {}; -(function($) { - - if (!$) { - throw "abp/jquery library requires the jquery library included to the page!"; - } - - // ABP CORE OVERRIDES ///////////////////////////////////////////////////// - - abp.message._showMessage = function (message, title) { - alert((title || '') + ' ' + message); - - return $.Deferred(function ($dfd) { - $dfd.resolve(); - }); - }; - - abp.message.confirm = function (message, titleOrCallback, callback) { - if (titleOrCallback && !(typeof titleOrCallback == 'string')) { - callback = titleOrCallback; - } - - var result = confirm(message); - callback && callback(result); - - return $.Deferred(function ($dfd) { - $dfd.resolve(result); - }); - }; - - abp.utils.isFunction = function (obj) { - return $.isFunction(obj); - }; - - // JQUERY EXTENSIONS ////////////////////////////////////////////////////// - - $.fn.findWithSelf = function (selector) { - return this.filter(selector).add(this.find(selector)); - }; - - // DOM //////////////////////////////////////////////////////////////////// - - abp.dom = abp.dom || {}; - - abp.dom.onNodeAdded = function (callback) { - abp.event.on('abp.dom.nodeAdded', callback); - }; - - abp.dom.onNodeRemoved = function (callback) { - abp.event.on('abp.dom.nodeRemoved', callback); - }; - - var mutationObserverCallback = function (mutationsList) { - for (var i = 0; i < mutationsList.length; i++) { - var mutation = mutationsList[i]; - if (mutation.type === 'childList') { - if (mutation.addedNodes && mutation.removedNodes.length) { - for (var k = 0; k < mutation.removedNodes.length; k++) { - abp.event.trigger( - 'abp.dom.nodeRemoved', - { - $el: $(mutation.removedNodes[k]) - } - ); - } - } - - if (mutation.addedNodes && mutation.addedNodes.length) { - for (var j = 0; j < mutation.addedNodes.length; j++) { - abp.event.trigger( - 'abp.dom.nodeAdded', - { - $el: $(mutation.addedNodes[j]) - } - ); - } - } - } - } - }; - - new MutationObserver(mutationObserverCallback).observe( - $('body')[0], - { - subtree: true, - childList: true - } - ); - - // AJAX /////////////////////////////////////////////////////////////////// - - abp.ajax = function (userOptions) { - userOptions = userOptions || {}; - - var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); - - options.success = undefined; - options.error = undefined; - - return $.Deferred(function ($dfd) { - $.ajax(options) - .done(function (data, textStatus, jqXHR) { - $dfd.resolve(data); - userOptions.success && userOptions.success(data); - }).fail(function (jqXHR) { - if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { - abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); - } else { - abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); - } - }); - }); - }; - - $.extend(abp.ajax, { - defaultOpts: { - dataType: 'json', - type: 'POST', - contentType: 'application/json', - headers: { - 'X-Requested-With': 'XMLHttpRequest' - } - }, - - defaultError: { - message: 'An error has occurred!', - details: 'Error detail not sent by server.' - }, - - defaultError401: { - message: 'You are not authenticated!', - details: 'You should be authenticated (sign in) in order to perform this operation.' - }, - - defaultError403: { - message: 'You are not authorized!', - details: 'You are not allowed to perform this operation.' - }, - - defaultError404: { - message: 'Resource not found!', - details: 'The resource requested could not found on the server.' - }, - - logError: function (error) { - abp.log.error(error); - }, - - showError: function (error) { - if (error.details) { - return abp.message.error(error.details, error.message); - } else { - return abp.message.error(error.message || abp.ajax.defaultError.message); - } - }, - - handleTargetUrl: function (targetUrl) { - if (!targetUrl) { - location.href = abp.appPath; - } else { - location.href = targetUrl; - } - }, - - handleErrorStatusCode: function (status) { - switch (status) { - case 401: - abp.ajax.handleUnAuthorizedRequest( - abp.ajax.showError(abp.ajax.defaultError401), - abp.appPath - ); - break; - case 403: - abp.ajax.showError(abp.ajax.defaultError403); - break; - case 404: - abp.ajax.showError(abp.ajax.defaultError404); - break; - default: - abp.ajax.showError(abp.ajax.defaultError); - break; - } - }, - - handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { - if (userOptions.abpHandleError !== false) { - abp.ajax.handleErrorStatusCode(jqXHR.status); - } - - $dfd.reject.apply(this, arguments); - userOptions.error && userOptions.error.apply(this, arguments); - }, - - handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { - var messagePromise = null; - - if (userOptions.abpHandleError !== false) { - messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); - } - - abp.ajax.logError(jqXHR.responseJSON.error); - - $dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); - userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); - - if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { - abp.ajax.handleUnAuthorizedRequest(messagePromise); - } - }, - - handleUnAuthorizedRequest: function (messagePromise, targetUrl) { - if (messagePromise) { - messagePromise.done(function () { - abp.ajax.handleTargetUrl(targetUrl); - }); - } else { - abp.ajax.handleTargetUrl(targetUrl); - } - }, - - blockUI: function (options) { - if (options.blockUI) { - if (options.blockUI === true) { //block whole page - abp.ui.setBusy(); - } else { //block an element - abp.ui.setBusy(options.blockUI); - } - } - }, - - unblockUI: function (options) { - if (options.blockUI) { - if (options.blockUI === true) { //unblock whole page - abp.ui.clearBusy(); - } else { //unblock an element - abp.ui.clearBusy(options.blockUI); - } - } - }, - - ajaxSendHandler: function (event, request, settings) { - var token = abp.security.antiForgery.getToken(); - if (!token) { - return; - } - - if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { - request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); - } - } - }); - - $(document).ajaxSend(function (event, request, settings) { - return abp.ajax.ajaxSendHandler(event, request, settings); - }); - - abp.event.on('abp.configurationInitialized', function () { - var l = abp.localization.getResource('AbpUi'); - - abp.ajax.defaultError.message = l('DefaultErrorMessage'); - abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); - abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); - abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); - abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); - abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); - abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); - abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); - }); - - // RESOURCE LOADER //////////////////////////////////////////////////////// - - /* UrlStates enum */ - var UrlStates = { - LOADING: 'LOADING', - LOADED: 'LOADED', - FAILED: 'FAILED' - }; - - /* UrlInfo class */ - function UrlInfo(url) { - this.url = url; - this.state = UrlStates.LOADING; - this.loadCallbacks = []; - this.failCallbacks = []; - } - - UrlInfo.prototype.succeed = function () { - this.state = UrlStates.LOADED; - for (var i = 0; i < this.loadCallbacks.length; i++) { - this.loadCallbacks[i](); - } - }; - - UrlInfo.prototype.failed = function () { - this.state = UrlStates.FAILED; - for (var i = 0; i < this.failCallbacks.length; i++) { - this.failCallbacks[i](); - } - }; - - UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { - switch (this.state) { - case UrlStates.LOADED: - loadCallback && loadCallback(); - break; - case UrlStates.FAILED: - failCallback && failCallback(); - break; - case UrlStates.LOADING: - this.addCallbacks(loadCallback, failCallback); - break; - } - }; - - UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { - loadCallback && this.loadCallbacks.push(loadCallback); - failCallback && this.failCallbacks.push(failCallback); - }; - - /* ResourceLoader API */ - - abp.ResourceLoader = (function () { - - var _urlInfos = {}; - - function getCacheKey(url) { - return url; - } - - function appendTimeToUrl(url) { - - if (url.indexOf('?') < 0) { - url += '?'; - } else { - url += '&'; - } - - url += '_=' + new Date().getTime(); - - return url; - } - - var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { - - var cacheKey = getCacheKey(url); - - var urlInfo = _urlInfos[cacheKey]; - - if (urlInfo) { - urlInfo.handleCallbacks(loadCallback, failCallback); - return; - } - - _urlInfos[cacheKey] = urlInfo = new UrlInfo(url); - urlInfo.addCallbacks(loadCallback, failCallback); - - serverLoader(urlInfo); - }; - - var _loadScript = function (url, loadCallback, failCallback) { - _loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { - $.get({ - url: url, - dataType: 'text' - }) - .done(function (script) { - $.globalEval(script); - urlInfo.succeed(); - }) - .fail(function () { - urlInfo.failed(); - }); - }); - }; - - var _loadStyle = function (url) { - _loadFromUrl(url, undefined, undefined, function (urlInfo) { - - $('', { - rel: 'stylesheet', - type: 'text/css', - href: appendTimeToUrl(url) - }).appendTo('head'); - }); - }; - - return { - loadScript: _loadScript, - loadStyle: _loadStyle - } - })(); - +var abp = abp || {}; +(function($) { + + if (!$) { + throw "abp/jquery library requires the jquery library included to the page!"; + } + + // ABP CORE OVERRIDES ///////////////////////////////////////////////////// + + abp.message._showMessage = function (message, title) { + alert((title || '') + ' ' + message); + + return $.Deferred(function ($dfd) { + $dfd.resolve(); + }); + }; + + abp.message.confirm = function (message, titleOrCallback, callback) { + if (titleOrCallback && !(typeof titleOrCallback == 'string')) { + callback = titleOrCallback; + } + + var result = confirm(message); + callback && callback(result); + + return $.Deferred(function ($dfd) { + $dfd.resolve(result); + }); + }; + + abp.utils.isFunction = function (obj) { + return $.isFunction(obj); + }; + + // JQUERY EXTENSIONS ////////////////////////////////////////////////////// + + $.fn.findWithSelf = function (selector) { + return this.filter(selector).add(this.find(selector)); + }; + + // DOM //////////////////////////////////////////////////////////////////// + + abp.dom = abp.dom || {}; + + abp.dom.onNodeAdded = function (callback) { + abp.event.on('abp.dom.nodeAdded', callback); + }; + + abp.dom.onNodeRemoved = function (callback) { + abp.event.on('abp.dom.nodeRemoved', callback); + }; + + var mutationObserverCallback = function (mutationsList) { + for (var i = 0; i < mutationsList.length; i++) { + var mutation = mutationsList[i]; + if (mutation.type === 'childList') { + if (mutation.addedNodes && mutation.removedNodes.length) { + for (var k = 0; k < mutation.removedNodes.length; k++) { + abp.event.trigger( + 'abp.dom.nodeRemoved', + { + $el: $(mutation.removedNodes[k]) + } + ); + } + } + + if (mutation.addedNodes && mutation.addedNodes.length) { + for (var j = 0; j < mutation.addedNodes.length; j++) { + abp.event.trigger( + 'abp.dom.nodeAdded', + { + $el: $(mutation.addedNodes[j]) + } + ); + } + } + } + } + }; + + new MutationObserver(mutationObserverCallback).observe( + $('body')[0], + { + subtree: true, + childList: true + } + ); + + // AJAX /////////////////////////////////////////////////////////////////// + + abp.ajax = function (userOptions) { + userOptions = userOptions || {}; + + var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); + + options.success = undefined; + options.error = undefined; + + return $.Deferred(function ($dfd) { + $.ajax(options) + .done(function (data, textStatus, jqXHR) { + $dfd.resolve(data); + userOptions.success && userOptions.success(data); + }).fail(function (jqXHR) { + if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { + abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); + } else { + abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); + } + }); + }); + }; + + $.extend(abp.ajax, { + defaultOpts: { + dataType: 'json', + type: 'POST', + contentType: 'application/json', + headers: { + 'X-Requested-With': 'XMLHttpRequest' + } + }, + + defaultError: { + message: 'An error has occurred!', + details: 'Error detail not sent by server.' + }, + + defaultError401: { + message: 'You are not authenticated!', + details: 'You should be authenticated (sign in) in order to perform this operation.' + }, + + defaultError403: { + message: 'You are not authorized!', + details: 'You are not allowed to perform this operation.' + }, + + defaultError404: { + message: 'Resource not found!', + details: 'The resource requested could not found on the server.' + }, + + logError: function (error) { + abp.log.error(error); + }, + + showError: function (error) { + if (error.details) { + return abp.message.error(error.details, error.message); + } else { + return abp.message.error(error.message || abp.ajax.defaultError.message); + } + }, + + handleTargetUrl: function (targetUrl) { + if (!targetUrl) { + location.href = abp.appPath; + } else { + location.href = targetUrl; + } + }, + + handleErrorStatusCode: function (status) { + switch (status) { + case 401: + abp.ajax.handleUnAuthorizedRequest( + abp.ajax.showError(abp.ajax.defaultError401), + abp.appPath + ); + break; + case 403: + abp.ajax.showError(abp.ajax.defaultError403); + break; + case 404: + abp.ajax.showError(abp.ajax.defaultError404); + break; + default: + abp.ajax.showError(abp.ajax.defaultError); + break; + } + }, + + handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { + if (userOptions.abpHandleError !== false) { + abp.ajax.handleErrorStatusCode(jqXHR.status); + } + + $dfd.reject.apply(this, arguments); + userOptions.error && userOptions.error.apply(this, arguments); + }, + + handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { + var messagePromise = null; + + if (userOptions.abpHandleError !== false) { + messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); + } + + abp.ajax.logError(jqXHR.responseJSON.error); + + $dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); + userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); + + if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { + abp.ajax.handleUnAuthorizedRequest(messagePromise); + } + }, + + handleUnAuthorizedRequest: function (messagePromise, targetUrl) { + if (messagePromise) { + messagePromise.done(function () { + abp.ajax.handleTargetUrl(targetUrl); + }); + } else { + abp.ajax.handleTargetUrl(targetUrl); + } + }, + + blockUI: function (options) { + if (options.blockUI) { + if (options.blockUI === true) { //block whole page + abp.ui.setBusy(); + } else { //block an element + abp.ui.setBusy(options.blockUI); + } + } + }, + + unblockUI: function (options) { + if (options.blockUI) { + if (options.blockUI === true) { //unblock whole page + abp.ui.clearBusy(); + } else { //unblock an element + abp.ui.clearBusy(options.blockUI); + } + } + }, + + ajaxSendHandler: function (event, request, settings) { + var token = abp.security.antiForgery.getToken(); + if (!token) { + return; + } + + if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { + request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); + } + } + }); + + $(document).ajaxSend(function (event, request, settings) { + return abp.ajax.ajaxSendHandler(event, request, settings); + }); + + abp.event.on('abp.configurationInitialized', function () { + var l = abp.localization.getResource('AbpUi'); + + abp.ajax.defaultError.message = l('DefaultErrorMessage'); + abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); + abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); + abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); + abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); + abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); + abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); + abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); + }); + + // RESOURCE LOADER //////////////////////////////////////////////////////// + + /* UrlStates enum */ + var UrlStates = { + LOADING: 'LOADING', + LOADED: 'LOADED', + FAILED: 'FAILED' + }; + + /* UrlInfo class */ + function UrlInfo(url) { + this.url = url; + this.state = UrlStates.LOADING; + this.loadCallbacks = []; + this.failCallbacks = []; + } + + UrlInfo.prototype.succeed = function () { + this.state = UrlStates.LOADED; + for (var i = 0; i < this.loadCallbacks.length; i++) { + this.loadCallbacks[i](); + } + }; + + UrlInfo.prototype.failed = function () { + this.state = UrlStates.FAILED; + for (var i = 0; i < this.failCallbacks.length; i++) { + this.failCallbacks[i](); + } + }; + + UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { + switch (this.state) { + case UrlStates.LOADED: + loadCallback && loadCallback(); + break; + case UrlStates.FAILED: + failCallback && failCallback(); + break; + case UrlStates.LOADING: + this.addCallbacks(loadCallback, failCallback); + break; + } + }; + + UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { + loadCallback && this.loadCallbacks.push(loadCallback); + failCallback && this.failCallbacks.push(failCallback); + }; + + /* ResourceLoader API */ + + abp.ResourceLoader = (function () { + + var _urlInfos = {}; + + function getCacheKey(url) { + return url; + } + + function appendTimeToUrl(url) { + + if (url.indexOf('?') < 0) { + url += '?'; + } else { + url += '&'; + } + + url += '_=' + new Date().getTime(); + + return url; + } + + var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { + + var cacheKey = getCacheKey(url); + + var urlInfo = _urlInfos[cacheKey]; + + if (urlInfo) { + urlInfo.handleCallbacks(loadCallback, failCallback); + return; + } + + _urlInfos[cacheKey] = urlInfo = new UrlInfo(url); + urlInfo.addCallbacks(loadCallback, failCallback); + + serverLoader(urlInfo); + }; + + var _loadScript = function (url, loadCallback, failCallback) { + _loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { + $.get({ + url: url, + dataType: 'text' + }) + .done(function (script) { + $.globalEval(script); + urlInfo.succeed(); + }) + .fail(function () { + urlInfo.failed(); + }); + }); + }; + + var _loadStyle = function (url) { + _loadFromUrl(url, undefined, undefined, function (urlInfo) { + + $('', { + rel: 'stylesheet', + type: 'text/css', + href: appendTimeToUrl(url) + }).appendTo('head'); + }); + }; + + return { + loadScript: _loadScript, + loadStyle: _loadStyle + } + })(); + })(jQuery); \ No newline at end of file diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/yarn.lock b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/yarn.lock index d125f98cc5..157d0f2e34 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/yarn.lock +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/yarn.lock @@ -2,37 +2,37 @@ # yarn lockfile v1 -"@abp/aspnetcore.mvc.ui.theme.basic@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-2.1.0.tgz#f815001bd856fb5cbdd0b736181f2401a1a7ec62" - integrity sha512-ej6dhUo3H9w6bpBTpMhk3M6zbC3fVAVMm5yLSYlYJ0sQxjb9PqC02OgiJme0mkxCUMwPuHVSQLrMQbioXdZu3A== +"@abp/aspnetcore.mvc.ui.theme.basic@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-2.2.0.tgz#e7f4e57d2b17cc76388e9c56bc34d50c9658873b" + integrity sha512-S9GQ9YVg4DWrgjujwiXBER6KqdqW5nZ1Bmt+YEePn5gEoPvoVrh6ojthpHYRjBJtGFqBSzRAQ9eVZLebT22Ozg== dependencies: - "@abp/aspnetcore.mvc.ui.theme.shared" "^2.1.0" + "@abp/aspnetcore.mvc.ui.theme.shared" "^2.2.0" -"@abp/aspnetcore.mvc.ui.theme.shared@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-2.1.0.tgz#c2790241b5a44b9d6e4f65911a1b9d9e9104ed82" - integrity sha512-dxC0P/b1T+QJmRrB8HoLM7/GkWblz/X5lLqgn583W7/OTYhvxIxszuRDy/XIEuS+fP6a9rcGvGu5jcKJEqe/xA== - dependencies: - "@abp/aspnetcore.mvc.ui" "^2.1.0" - "@abp/bootstrap" "^2.1.0" - "@abp/bootstrap-datepicker" "^2.1.0" - "@abp/datatables.net-bs4" "^2.1.0" - "@abp/font-awesome" "^2.1.0" - "@abp/jquery-form" "^2.1.0" - "@abp/jquery-validation-unobtrusive" "^2.1.0" - "@abp/lodash" "^2.1.0" - "@abp/luxon" "^2.1.0" - "@abp/malihu-custom-scrollbar-plugin" "^2.1.0" - "@abp/select2" "^2.1.0" - "@abp/sweetalert" "^2.1.0" - "@abp/timeago" "^2.1.0" - "@abp/toastr" "^2.1.0" - -"@abp/aspnetcore.mvc.ui@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-2.1.0.tgz#3c86f42e52af3151d2aee0ffdd1281014ea61054" - integrity sha512-pKiKMBOPuLm7p44DW8DdbsVn5PY3NqGYkz6gf75uzxyWiVYyl2CM/bvX9w4Ie7Q969owENMLrBREN6ezWZ5ynA== +"@abp/aspnetcore.mvc.ui.theme.shared@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-2.2.0.tgz#e0df953853be2a184d323931573f9f98aebbaa62" + integrity sha512-urxziaCdvfEqN5cjiiM5f5dx2Yr+AoGqCJVCo0Okjl2dosdaj5DH4SBzMvKAaLXzo3Ep1h4b3Wvws4BThL/6rA== + dependencies: + "@abp/aspnetcore.mvc.ui" "^2.2.0" + "@abp/bootstrap" "^2.2.0" + "@abp/bootstrap-datepicker" "^2.2.0" + "@abp/datatables.net-bs4" "^2.2.0" + "@abp/font-awesome" "^2.2.0" + "@abp/jquery-form" "^2.2.0" + "@abp/jquery-validation-unobtrusive" "^2.2.0" + "@abp/lodash" "^2.2.0" + "@abp/luxon" "^2.2.0" + "@abp/malihu-custom-scrollbar-plugin" "^2.2.0" + "@abp/select2" "^2.2.0" + "@abp/sweetalert" "^2.2.0" + "@abp/timeago" "^2.2.0" + "@abp/toastr" "^2.2.0" + +"@abp/aspnetcore.mvc.ui@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-2.2.0.tgz#b2cdd421eed09ec1d30ae85e14434b7efc094ade" + integrity sha512-IO/AjhJu+LUa9zOaT8JlEnV+Pcp9oQ3q9kTq8kmMakC35vTIyvBpB3nnykXIOytZSyjsBgFYB/uMxPgBOjWagg== dependencies: ansi-colors "^4.1.1" extend-object "^1.0.0" @@ -41,135 +41,135 @@ path "^0.12.7" rimraf "^3.0.0" -"@abp/bootstrap-datepicker@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-2.1.0.tgz#a0d71da15cb3d3cc02f9a390437a44db5e9f9ea1" - integrity sha512-lkNI0iyefiXS2O5x9Ae9eJQLPXSQlOWDX7QhKnBHLR9JxjJEnhBUIIOylMltAIqtVDtjk2ikDyd3BAiyBdtB/w== +"@abp/bootstrap-datepicker@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-2.2.0.tgz#a2f50b422824f18ed4b7e80be6852e2979119f8e" + integrity sha512-X9jT5mU42QFfVhOZdun7aEJUf3bMko6NsG3NFQVjqTqKH+iYGKfHPFpXD0gP/6Nb4KgZUdId8hSyQTZyOK2JEA== dependencies: bootstrap-datepicker "^1.9.0" -"@abp/bootstrap@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-2.1.0.tgz#7ce15d4effac0e0991a3520c4666c6cb17a3fef2" - integrity sha512-1xQjqu6shCgzd1FI94y5AIXGIhBlZEoRrOhaT84j/2KzYiDvhP+LAqQjMgqlQmBLs6vMckpxtf5thxKTMXvtOw== +"@abp/bootstrap@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-2.2.0.tgz#16e41d3432117bbcd9012c6f735c49c543255879" + integrity sha512-aRmluu6SkIl+JgCzSSJZrDPkYr6WWaQdY0iJAOz6NHtffa7Aumh1IUOrLVKL0T1pQn6QKs0Z7JDGyYMdh1HPkQ== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" bootstrap "^4.3.1" -"@abp/core@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/core/-/core-2.1.0.tgz#0cd2850f029df1d18517b8e74c70341972c37ed7" - integrity sha512-1wnRo00hWncZWSakaEXm388XhhbKXDVkWDIdaT3kyQpvp3kX1lFx7I5iiZiwIeULwZRF9mi6HV6iHEze58x0kQ== +"@abp/core@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/core/-/core-2.2.0.tgz#4eea0a06458c90acb8566a11eb841fe65d15d256" + integrity sha512-tBGHa5CUr0ewT31g689RAfQ6Su2p4uyn2PzmrW/8lahBrvqkoCb41fkCDLQJkTY5rKPrEKZd/s9OoyOnS20DLg== -"@abp/datatables.net-bs4@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-2.1.0.tgz#a0f36cf4e3ef96ae03aa4b9956fcb8b971c854cb" - integrity sha512-93qc2rrGs+JKRPM/7UCasa5VmfswgYU8cv3Ybg5OKoaASODYUn06GChRFnd/mvqcDxw4+8gaqpC3U2ETZZI4pA== +"@abp/datatables.net-bs4@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-2.2.0.tgz#c7cc49e889b295ae10fb24ed62b154ef79ffc85a" + integrity sha512-zjJRPqOCWPfkHt1QztfFHKrsTE9o6Je2EpfA7hRMej2FlGbsMWUxOqx/btK1vjD6YIU8DtVDpIdj1WvPOITQ4Q== dependencies: - "@abp/datatables.net" "^2.1.0" + "@abp/datatables.net" "^2.2.0" datatables.net-bs4 "^1.10.20" -"@abp/datatables.net@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-2.1.0.tgz#674eaaa5b0948d7ee85b6605bfbad1a70f839aa7" - integrity sha512-3ZM2p+JpHumxbIKlDP/LKLsfceMdttdTOL0ckIZCmAAgoIeKmAtuMoKcHTr8lj5mjgv4arBGvG9WVCemep2PEw== +"@abp/datatables.net@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-2.2.0.tgz#22f9c7ca90c2d4af264483b4f8286b0feb7c3d52" + integrity sha512-L4MnpdloSWr/px3mvV75sxsxL68MyALB2LKdzCFMQWILCZVkxMmQb9LARINYIrn461Wrc+zbYWNEBD0MAq7flg== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" datatables.net "^1.10.20" -"@abp/font-awesome@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-2.1.0.tgz#c2e628a1b9d0525e7d6950bf007feebcd1c490c8" - integrity sha512-vlm1IQuQVfuCI2O1vphDd11zUEJ4/4PU0/0XI1YCpilse8fBg080CM3+G0kw6Erm/riznqhOJwBcfT+K+zqk8A== +"@abp/font-awesome@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-2.2.0.tgz#2de39e3c6c3e8c30394d82861761a66c5b4032f0" + integrity sha512-RT06MYUGgaWBEpW5c7wUcfMXgxcOHWdX/C01LDO/j6iVoKBuBHOkkvcUoTWII068ECrLYOkj+RyT59dCKm8FFw== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" "@fortawesome/fontawesome-free" "^5.11.2" -"@abp/jquery-form@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-2.1.0.tgz#285dbfdcf722cb0249f149e728cef7f788410c0c" - integrity sha512-A17rjHTiBJBKYgrtDX5wIqnI89wNmo3bdK9NagL1wMFj4GvDyOZoRIDLqkopYQsc8zuPjqw4+1aa2TPiA+jtKg== +"@abp/jquery-form@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-2.2.0.tgz#951653fac4013a7bbec065b5101b86d575e0eca7" + integrity sha512-ji44E3Ud0S3LNXn1WJ/Aw44qAIG7EITEW1KOe46oz+/awPpbiiA4dDDNleTvO2jI2/s8mNyR0bNanP6BUsc7tw== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" jquery-form "^4.2.2" -"@abp/jquery-validation-unobtrusive@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-2.1.0.tgz#fc938775ced2efc686e7dd092d6ceff1ea947f36" - integrity sha512-a8iBIj6amJ9rQNV+wxQUuEVh93M/c32kJcrwSEPWQcOoTj5gf0j8eKK9YvZaGokpylraz9mdGOwYQQuNj1sxEw== +"@abp/jquery-validation-unobtrusive@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-2.2.0.tgz#6d39ba9f7bf026d1380796bf5dff76c8d16b42ce" + integrity sha512-SuS/dRRVz7ZR4HK/h9x0jRRVLPqXN0CPRGPdJZ1LJraXVEJ9/eDEGf1rMlHmEGt1FXXFTD01/zjisbweDE786w== dependencies: - "@abp/jquery-validation" "^2.1.0" + "@abp/jquery-validation" "^2.2.0" jquery-validation-unobtrusive "^3.2.11" -"@abp/jquery-validation@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-2.1.0.tgz#2bf1a31321cce3b2abe6d56c6112c52a8ecb28b6" - integrity sha512-kU6/E+Xc3wHAUs+sGMAL8uozkXv65HnpksTwV4/+RK+D6iFU2EyNgCEFu7QGSwYZsV1/7YsCe2GD4ucBXIknbA== +"@abp/jquery-validation@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-2.2.0.tgz#02bb8ba883e72c1204867ee4d1c1094bd91c4c4c" + integrity sha512-ypITQloO4iEDgqlA6qb3taj+7HMX0Cf/ACA2OvtrvOgJejx6J4wfrPjwuFZu1WWJ0xtc9yTdbovdcSVcQbIGaA== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" jquery-validation "^1.19.1" -"@abp/jquery@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-2.1.0.tgz#fb5b4c9e8622cf46fee92f9f731d007d5fb200bb" - integrity sha512-ZpfzRut5G611bBmuDdiT6BD0M7Rl1P6r8uNxUjdmFXYwFd8wD02ZhIcsX7qFHFkYERuXfcLrZh4rpw9G1DVCJg== +"@abp/jquery@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-2.2.0.tgz#0e641b1109e78eff4c34331ca2b123b67cc30cbe" + integrity sha512-vEfRoFEAmDmRgSq98Y9EZExfQFSWtmjaHrodUu+MadTcRlnn+wHq8wwkKKxpj/eYtNc8aFORpyHMMH7uliAKxg== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" jquery "^3.4.1" -"@abp/lodash@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-2.1.0.tgz#9fc9e6521e6284d607cedbff1a458fa324137c5c" - integrity sha512-s1gTHhpbmEDDCsZeXb9MpClkDS4wH5R2IWPRZUlSPxo3gF0pvkx5ubdhYUEUgqy5QqWxE/+zUAjDc4x+cEriFQ== +"@abp/lodash@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-2.2.0.tgz#af0a2ebcb28fd0a8c02da5026479d9370ed19719" + integrity sha512-wOMLqIpuq4a7ww7pB138G6YxBiTGBgxNW/IWGUiWbfgrr88cGPKIYYv/8O8mvr8PLNGjizNynuwQRj522yA3Dw== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" lodash "^4.17.15" -"@abp/luxon@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-2.1.0.tgz#624796722119f075119006b436054aecbb38f15f" - integrity sha512-2b0sRo6rdYT1wDu9nSXm/9o8rhQ9ED7FxrDMYabYuOQz48esgn4fBUNcPqpxwejpFmlhZY6CONvkddNtaMeVHw== +"@abp/luxon@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-2.2.0.tgz#0d0e78edc249853fa31eceecc00df2846a879aa9" + integrity sha512-WbOW0PcMks+WXRPWt/+H4pOa5waM331WkY0F+EJx8fpxemNGQNUEXLkuMXzN3MrN6LrplM9AZ9i+NRA9PWHbNw== dependencies: luxon "^1.21.3" -"@abp/malihu-custom-scrollbar-plugin@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-2.1.0.tgz#f4dc1a32cefc3de8af08cb6d585ec5f7636a0c5e" - integrity sha512-WcxzCZ5YOMxGxZerEh966cVrFSCw1UTDqwU2rxA/LsHEbPKd69AY+SHvUiacNxPXs1ZCF6FFJ29C5dWicEIRaQ== +"@abp/malihu-custom-scrollbar-plugin@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-2.2.0.tgz#e11fd46dccbb28d44fb199e880b91d27c94f1919" + integrity sha512-YDu/NLpIzMA96NDHxd27/+liTm3sow9M+oWH29+9JW8o/AEpXUH3T3AmoXXcTgsBlzLaewgHEFM8yxsAAFoj8Q== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" malihu-custom-scrollbar-plugin "^3.1.5" -"@abp/select2@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-2.1.0.tgz#79e50d2c25e74a5f96520e8aa1433d79aea674d1" - integrity sha512-ut/3c+lFdoepuDH36M7thWagmAmTFrChcPnhYjTx4MmIf31WW1BwqOSx3I2g8M+NEEx+V2jTNuBpTq7PONgSJg== +"@abp/select2@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-2.2.0.tgz#4639d4e5b72b1736fa4476bd9b6a78e036400421" + integrity sha512-tc87JyM0kvVF388kyGUjDby49Zrrb089jVRRipoIaxXeu4M1YxEFSKBEcUK1MohZWjVtWrNs8MoxPlfukaMpyw== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" select2 "^4.0.12" -"@abp/sweetalert@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-2.1.0.tgz#88f405c4ba9f9ed2fd54b945ed6bc48d5ae2fa23" - integrity sha512-EWvReqxZ1DrNH9XD+cf/yGVj+8IPTpuoPuWKDryN4fF7TCMJA+KrXp5lFxpjfkKTtNzLeFGsJqDFWaUifxtqTA== +"@abp/sweetalert@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-2.2.0.tgz#dfc60ba085522d8390e41b90bf5a3d474f4ae624" + integrity sha512-HS6TKOwP91UjzjZHaheurZ1AYUSMkQyCSmoX6g5LAK4eH8IIgpojVSp1AFCSPATrFsFWY/dzkDGcfu90FWsVBg== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" sweetalert "^2.1.2" -"@abp/timeago@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-2.1.0.tgz#28c0aef88aff8b54d1dfb42a664d05097e7fda35" - integrity sha512-NklUYcWeji7po+Y6Oi7b7IkYmjd5YRu123bm3MqjQ71AzuOCTFbvPMHzYOjrUTkzr6gW3IJ24LQ4YmpshPy4ZQ== +"@abp/timeago@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-2.2.0.tgz#9a8297f36a46cdc4cc62f44d0fdc91b70def389c" + integrity sha512-8qjmKscsTvPznHKWEsddYxdSBiU+l+OgLG6vzMcSWqngYbDQGXqNA93BwJI2qiwd+FkNcfGgYg7CN7bcwzmaiw== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" timeago "^1.6.7" -"@abp/toastr@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-2.1.0.tgz#22a53a2b1f354770fdc7b37f06bec10eefccfe7a" - integrity sha512-hD3hTDx+CixTVTx73rnZDiiFkfSxpZox8RLm+CiFA62ORdO8Ryij8TOXXkJd84b2tJfkAkYehohVXKwHlHU7Zg== +"@abp/toastr@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-2.2.0.tgz#1cad83a89da244685b3c82adff64260b7ccf4742" + integrity sha512-HHfSaw4M/9zS+KgzxGvbHYiQ5qcJgpf21cRZEo16aUwnTeKr4SRaewAWryNn4dKcIO2YNrhzDLH+OYbEaJJlDQ== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" toastr "^2.1.4" "@fortawesome/fontawesome-free@^5.11.2": diff --git a/templates/module/angular/package.json b/templates/module/angular/package.json index 25d046c1fa..34ea25858d 100644 --- a/templates/module/angular/package.json +++ b/templates/module/angular/package.json @@ -12,11 +12,11 @@ }, "private": true, "dependencies": { - "@abp/ng.account": "^2.1.0", - "@abp/ng.theme.basic": "^2.1.0", - "@abp/ng.identity": "^2.1.0", - "@abp/ng.tenant-management": "^2.1.0", - "@abp/ng.setting-management": "^2.1.0", + "@abp/ng.account": "^2.2.0", + "@abp/ng.theme.basic": "^2.2.0", + "@abp/ng.identity": "^2.2.0", + "@abp/ng.tenant-management": "^2.2.0", + "@abp/ng.setting-management": "^2.2.0", "@angular/animations": "~8.2.14", "@angular/common": "~8.2.14", "@angular/compiler": "~8.2.14", diff --git a/templates/module/angular/projects/my-project-name-config/package.json b/templates/module/angular/projects/my-project-name-config/package.json index f38bcd8c11..6900d392a2 100644 --- a/templates/module/angular/projects/my-project-name-config/package.json +++ b/templates/module/angular/projects/my-project-name-config/package.json @@ -2,6 +2,6 @@ "name": "my-project-name.config", "version": "0.0.1", "peerDependencies": { - "@abp/ng.core": ">=2.1.0" + "@abp/ng.core": ">=2.2.0" } } diff --git a/templates/module/angular/projects/my-project-name/package.json b/templates/module/angular/projects/my-project-name/package.json index 11317ae64d..d9e41b2608 100644 --- a/templates/module/angular/projects/my-project-name/package.json +++ b/templates/module/angular/projects/my-project-name/package.json @@ -2,7 +2,7 @@ "name": "my-project-name", "version": "0.0.1", "dependencies": { - "@abp/ng.theme.shared": "^2.1.0", + "@abp/ng.theme.shared": "^2.2.0", "my-project-name.config": "^0.0.1" } } diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/package.json b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/package.json index bd35b85b18..5d035c76c9 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/package.json +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/package.json @@ -3,6 +3,6 @@ "name": "my-app-identityserver", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.basic": "^2.1.0" + "@abp/aspnetcore.mvc.ui.theme.basic": "^2.2.0" } } \ No newline at end of file diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/wwwroot/libs/abp/core/abp.css b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/wwwroot/libs/abp/core/abp.css index ee3c5080a5..ddf9cae5b2 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/wwwroot/libs/abp/core/abp.css +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/wwwroot/libs/abp/core/abp.css @@ -1,56 +1,56 @@ -@keyframes spin { - 0% { - transform: translateZ(0) rotate(0deg); - } - - 100% { - transform: translateZ(0) rotate(360deg); - } -} - -.abp-block-area { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: 102; - background-color: #fff; - opacity: .8; - transition: opacity .25s; -} - - .abp-block-area.abp-block-area-disappearing { - opacity: 0; - } - - .abp-block-area.abp-block-area-busy:after { - content: attr(data-text); - display: block; - max-width: 125px; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - font-size: 20px; - font-family: sans-serif; - color: #343a40; - text-align: center; - text-transform: uppercase; - } - - .abp-block-area.abp-block-area-busy:before { - content: ""; - display: block; - width: 150px; - height: 150px; - border-radius: 50%; - border-width: 2px; - border-style: solid; - border-color: transparent #228ae6 #228ae6 #228ae6; - position: absolute; - top: calc(50% - 75px); - left: calc(50% - 75px); - will-change: transform; - animation: spin .75s infinite ease-in-out; - } +@keyframes spin { + 0% { + transform: translateZ(0) rotate(0deg); + } + + 100% { + transform: translateZ(0) rotate(360deg); + } +} + +.abp-block-area { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 102; + background-color: #fff; + opacity: .8; + transition: opacity .25s; +} + + .abp-block-area.abp-block-area-disappearing { + opacity: 0; + } + + .abp-block-area.abp-block-area-busy:after { + content: attr(data-text); + display: block; + max-width: 125px; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + font-size: 20px; + font-family: sans-serif; + color: #343a40; + text-align: center; + text-transform: uppercase; + } + + .abp-block-area.abp-block-area-busy:before { + content: ""; + display: block; + width: 150px; + height: 150px; + border-radius: 50%; + border-width: 2px; + border-style: solid; + border-color: transparent #228ae6 #228ae6 #228ae6; + position: absolute; + top: calc(50% - 75px); + left: calc(50% - 75px); + will-change: transform; + animation: spin .75s infinite ease-in-out; + } diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/wwwroot/libs/abp/core/abp.js b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/wwwroot/libs/abp/core/abp.js index cef1cf55e1..730db8bc97 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/wwwroot/libs/abp/core/abp.js +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/wwwroot/libs/abp/core/abp.js @@ -1,636 +1,636 @@ -var abp = abp || {}; -(function () { - - /* Application paths *****************************************/ - - //Current application root path (including virtual directory if exists). - abp.appPath = abp.appPath || '/'; - - abp.pageLoadTime = new Date(); - - //Converts given path to absolute path using abp.appPath variable. - abp.toAbsAppPath = function (path) { - if (path.indexOf('/') == 0) { - path = path.substring(1); - } - - return abp.appPath + path; - }; - - /* LOGGING ***************************************************/ - //Implements Logging API that provides secure & controlled usage of console.log - - abp.log = abp.log || {}; - - abp.log.levels = { - DEBUG: 1, - INFO: 2, - WARN: 3, - ERROR: 4, - FATAL: 5 - }; - - abp.log.level = abp.log.levels.DEBUG; - - abp.log.log = function (logObject, logLevel) { - if (!window.console || !window.console.log) { - return; - } - - if (logLevel != undefined && logLevel < abp.log.level) { - return; - } - - console.log(logObject); - }; - - abp.log.debug = function (logObject) { - abp.log.log("DEBUG: ", abp.log.levels.DEBUG); - abp.log.log(logObject, abp.log.levels.DEBUG); - }; - - abp.log.info = function (logObject) { - abp.log.log("INFO: ", abp.log.levels.INFO); - abp.log.log(logObject, abp.log.levels.INFO); - }; - - abp.log.warn = function (logObject) { - abp.log.log("WARN: ", abp.log.levels.WARN); - abp.log.log(logObject, abp.log.levels.WARN); - }; - - abp.log.error = function (logObject) { - abp.log.log("ERROR: ", abp.log.levels.ERROR); - abp.log.log(logObject, abp.log.levels.ERROR); - }; - - abp.log.fatal = function (logObject) { - abp.log.log("FATAL: ", abp.log.levels.FATAL); - abp.log.log(logObject, abp.log.levels.FATAL); - }; - - /* LOCALIZATION ***********************************************/ - - abp.localization = abp.localization || {}; - - abp.localization.values = {}; - - abp.localization.localize = function (key, sourceName) { - sourceName = sourceName || abp.localization.defaultResourceName; - - var source = abp.localization.values[sourceName]; - - if (!source) { - abp.log.warn('Could not find localization source: ' + sourceName); - return key; - } - - var value = source[key]; - if (value == undefined) { - return key; - } - - var copiedArguments = Array.prototype.slice.call(arguments, 0); - copiedArguments.splice(1, 1); - copiedArguments[0] = value; - - return abp.utils.formatString.apply(this, copiedArguments); - }; - - abp.localization.getResource = function (name) { - return function () { - var copiedArguments = Array.prototype.slice.call(arguments, 0); - copiedArguments.splice(1, 0, name); - return abp.localization.localize.apply(this, copiedArguments); - }; - }; - - abp.localization.defaultResourceName = undefined; - - /* AUTHORIZATION **********************************************/ - - abp.auth = abp.auth || {}; - - abp.auth.policies = abp.auth.policies || {}; - - abp.auth.grantedPolicies = abp.auth.grantedPolicies || {}; - - abp.auth.isGranted = function (policyName) { - return abp.auth.policies[policyName] != undefined && abp.auth.grantedPolicies[policyName] != undefined; - }; - - abp.auth.isAnyGranted = function () { - if (!arguments || arguments.length <= 0) { - return true; - } - - for (var i = 0; i < arguments.length; i++) { - if (abp.auth.isGranted(arguments[i])) { - return true; - } - } - - return false; - }; - - abp.auth.areAllGranted = function () { - if (!arguments || arguments.length <= 0) { - return true; - } - - for (var i = 0; i < arguments.length; i++) { - if (!abp.auth.isGranted(arguments[i])) { - return false; - } - } - - return true; - }; - - abp.auth.tokenCookieName = 'Abp.AuthToken'; - - abp.auth.setToken = function (authToken, expireDate) { - abp.utils.setCookieValue(abp.auth.tokenCookieName, authToken, expireDate, abp.appPath, abp.domain); - }; - - abp.auth.getToken = function () { - return abp.utils.getCookieValue(abp.auth.tokenCookieName); - } - - abp.auth.clearToken = function () { - abp.auth.setToken(); - } - - /* SETTINGS *************************************************/ - - abp.setting = abp.setting || {}; - - abp.setting.values = abp.setting.values || {}; - - abp.setting.get = function (name) { - return abp.setting.values[name]; - }; - - abp.setting.getBoolean = function (name) { - var value = abp.setting.get(name); - return value == 'true' || value == 'True'; - }; - - abp.setting.getInt = function (name) { - return parseInt(abp.setting.values[name]); - }; - - /* NOTIFICATION *********************************************/ - //Defines Notification API, not implements it - - abp.notify = abp.notify || {}; - - abp.notify.success = function (message, title, options) { - abp.log.warn('abp.notify.success is not implemented!'); - }; - - abp.notify.info = function (message, title, options) { - abp.log.warn('abp.notify.info is not implemented!'); - }; - - abp.notify.warn = function (message, title, options) { - abp.log.warn('abp.notify.warn is not implemented!'); - }; - - abp.notify.error = function (message, title, options) { - abp.log.warn('abp.notify.error is not implemented!'); - }; - - /* MESSAGE **************************************************/ - //Defines Message API, not implements it - - abp.message = abp.message || {}; - - abp.message._showMessage = function (message, title) { - alert((title || '') + ' ' + message); - }; - - abp.message.info = function (message, title) { - abp.log.warn('abp.message.info is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.success = function (message, title) { - abp.log.warn('abp.message.success is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.warn = function (message, title) { - abp.log.warn('abp.message.warn is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.error = function (message, title) { - abp.log.warn('abp.message.error is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.confirm = function (message, titleOrCallback, callback) { - abp.log.warn('abp.message.confirm is not properly implemented!'); - - if (titleOrCallback && !(typeof titleOrCallback == 'string')) { - callback = titleOrCallback; - } - - var result = confirm(message); - callback && callback(result); - }; - - /* UI *******************************************************/ - - abp.ui = abp.ui || {}; - - /* UI BLOCK */ - //Defines UI Block API and implements basically - - var $abpBlockArea = document.createElement('div'); - $abpBlockArea.classList.add('abp-block-area'); - - /* opts: { //Can be an object with options or a string for query a selector - * elm: a query selector (optional - default: document.body) - * busy: boolean (optional - default: false) - * promise: A promise with always or finally handler (optional - auto unblocks the ui if provided) - * } - */ - abp.ui.block = function (opts) { - if (!opts) { - opts = {}; - } else if (typeof opts == 'string') { - opts = { - elm: opts - }; - } - - var $elm = document.querySelector(opts.elm) || document.body; - - if (opts.busy) { - $abpBlockArea.classList.add('abp-block-area-busy'); - } else { - $abpBlockArea.classList.remove('abp-block-area-busy'); - } - - if (document.querySelector(opts.elm)) { - $abpBlockArea.style.position = 'absolute'; - } else { - $abpBlockArea.style.position = 'fixed'; - } - - $elm.appendChild($abpBlockArea); - - if (opts.promise) { - if (opts.promise.always) { //jQuery.Deferred style - opts.promise.always(function () { - abp.ui.unblock({ - $elm: opts.elm - }); - }); - } else if (opts.promise['finally']) { //Q style - opts.promise['finally'](function () { - abp.ui.unblock({ - $elm: opts.elm - }); - }); - } - } - }; - - /* opts: { - * - * } - */ - abp.ui.unblock = function (opts) { - var element = document.querySelector('.abp-block-area'); - if (element) { - element.classList.add('abp-block-area-disappearing'); - setTimeout(function () { - if (element) { - element.classList.remove('abp-block-area-disappearing'); - element.parentElement.removeChild(element); - } - }, 250); - } - }; - - /* UI BUSY */ - //Defines UI Busy API, not implements it - - abp.ui.setBusy = function (opts) { - if (!opts) { - opts = { - busy: true - }; - } else if (typeof opts == 'string') { - opts = { - elm: opts, - busy: true - }; - } - - abp.ui.block(opts); - }; - - abp.ui.clearBusy = function (opts) { - abp.ui.unblock(opts); - }; - - /* SIMPLE EVENT BUS *****************************************/ - - abp.event = (function () { - - var _callbacks = {}; - - var on = function (eventName, callback) { - if (!_callbacks[eventName]) { - _callbacks[eventName] = []; - } - - _callbacks[eventName].push(callback); - }; - - var off = function (eventName, callback) { - var callbacks = _callbacks[eventName]; - if (!callbacks) { - return; - } - - var index = -1; - for (var i = 0; i < callbacks.length; i++) { - if (callbacks[i] === callback) { - index = i; - break; - } - } - - if (index < 0) { - return; - } - - _callbacks[eventName].splice(index, 1); - }; - - var trigger = function (eventName) { - var callbacks = _callbacks[eventName]; - if (!callbacks || !callbacks.length) { - return; - } - - var args = Array.prototype.slice.call(arguments, 1); - for (var i = 0; i < callbacks.length; i++) { - callbacks[i].apply(this, args); - } - }; - - // Public interface /////////////////////////////////////////////////// - - return { - on: on, - off: off, - trigger: trigger - }; - })(); - - - /* UTILS ***************************************************/ - - abp.utils = abp.utils || {}; - - /* Creates a name namespace. - * Example: - * var taskService = abp.utils.createNamespace(abp, 'services.task'); - * taskService will be equal to abp.services.task - * first argument (root) must be defined first - ************************************************************/ - abp.utils.createNamespace = function (root, ns) { - var parts = ns.split('.'); - for (var i = 0; i < parts.length; i++) { - if (typeof root[parts[i]] == 'undefined') { - root[parts[i]] = {}; - } - - root = root[parts[i]]; - } - - return root; - }; - - /* Find and replaces a string (search) to another string (replacement) in - * given string (str). - * Example: - * abp.utils.replaceAll('This is a test string', 'is', 'X') = 'ThX X a test string' - ************************************************************/ - abp.utils.replaceAll = function (str, search, replacement) { - var fix = search.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); - return str.replace(new RegExp(fix, 'g'), replacement); - }; - - /* Formats a string just like string.format in C#. - * Example: - * abp.utils.formatString('Hello {0}','Tuana') = 'Hello Tuana' - ************************************************************/ - abp.utils.formatString = function () { - if (arguments.length < 1) { - return null; - } - - var str = arguments[0]; - - for (var i = 1; i < arguments.length; i++) { - var placeHolder = '{' + (i - 1) + '}'; - str = abp.utils.replaceAll(str, placeHolder, arguments[i]); - } - - return str; - }; - - abp.utils.toPascalCase = function (str) { - if (!str || !str.length) { - return str; - } - - if (str.length === 1) { - return str.charAt(0).toUpperCase(); - } - - return str.charAt(0).toUpperCase() + str.substr(1); - } - - abp.utils.toCamelCase = function (str) { - if (!str || !str.length) { - return str; - } - - if (str.length === 1) { - return str.charAt(0).toLowerCase(); - } - - return str.charAt(0).toLowerCase() + str.substr(1); - } - - abp.utils.truncateString = function (str, maxLength) { - if (!str || !str.length || str.length <= maxLength) { - return str; - } - - return str.substr(0, maxLength); - }; - - abp.utils.truncateStringWithPostfix = function (str, maxLength, postfix) { - postfix = postfix || '...'; - - if (!str || !str.length || str.length <= maxLength) { - return str; - } - - if (maxLength <= postfix.length) { - return postfix.substr(0, maxLength); - } - - return str.substr(0, maxLength - postfix.length) + postfix; - }; - - abp.utils.isFunction = function (obj) { - return !!(obj && obj.constructor && obj.call && obj.apply); - }; - - /** - * parameterInfos should be an array of { name, value } objects - * where name is query string parameter name and value is it's value. - * includeQuestionMark is true by default. - */ - abp.utils.buildQueryString = function (parameterInfos, includeQuestionMark) { - if (includeQuestionMark === undefined) { - includeQuestionMark = true; - } - - var qs = ''; - - function addSeperator() { - if (!qs.length) { - if (includeQuestionMark) { - qs = qs + '?'; - } - } else { - qs = qs + '&'; - } - } - - for (var i = 0; i < parameterInfos.length; ++i) { - var parameterInfo = parameterInfos[i]; - if (parameterInfo.value === undefined) { - continue; - } - - if (parameterInfo.value === null) { - parameterInfo.value = ''; - } - - addSeperator(); - - if (parameterInfo.value.toJSON && typeof parameterInfo.value.toJSON === "function") { - qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value.toJSON()); - } else if (Array.isArray(parameterInfo.value) && parameterInfo.value.length) { - for (var j = 0; j < parameterInfo.value.length; j++) { - if (j > 0) { - addSeperator(); - } - - qs = qs + parameterInfo.name + '[' + j + ']=' + encodeURIComponent(parameterInfo.value[j]); - } - } else { - qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value); - } - } - - return qs; - } - - /** - * Sets a cookie value for given key. - * This is a simple implementation created to be used by ABP. - * Please use a complete cookie library if you need. - * @param {string} key - * @param {string} value - * @param {Date} expireDate (optional). If not specified the cookie will expire at the end of session. - * @param {string} path (optional) - */ - abp.utils.setCookieValue = function (key, value, expireDate, path) { - var cookieValue = encodeURIComponent(key) + '='; - - if (value) { - cookieValue = cookieValue + encodeURIComponent(value); - } - - if (expireDate) { - cookieValue = cookieValue + "; expires=" + expireDate.toUTCString(); - } - - if (path) { - cookieValue = cookieValue + "; path=" + path; - } - - document.cookie = cookieValue; - }; - - /** - * Gets a cookie with given key. - * This is a simple implementation created to be used by ABP. - * Please use a complete cookie library if you need. - * @param {string} key - * @returns {string} Cookie value or null - */ - abp.utils.getCookieValue = function (key) { - var equalities = document.cookie.split('; '); - for (var i = 0; i < equalities.length; i++) { - if (!equalities[i]) { - continue; - } - - var splitted = equalities[i].split('='); - if (splitted.length != 2) { - continue; - } - - if (decodeURIComponent(splitted[0]) === key) { - return decodeURIComponent(splitted[1] || ''); - } - } - - return null; - }; - - /** - * Deletes cookie for given key. - * This is a simple implementation created to be used by ABP. - * Please use a complete cookie library if you need. - * @param {string} key - * @param {string} path (optional) - */ - abp.utils.deleteCookie = function (key, path) { - var cookieValue = encodeURIComponent(key) + '='; - - cookieValue = cookieValue + "; expires=" + (new Date(new Date().getTime() - 86400000)).toUTCString(); - - if (path) { - cookieValue = cookieValue + "; path=" + path; - } - - document.cookie = cookieValue; - } - - /* SECURITY ***************************************/ - abp.security = abp.security || {}; - abp.security.antiForgery = abp.security.antiForgery || {}; - - abp.security.antiForgery.tokenCookieName = 'XSRF-TOKEN'; - abp.security.antiForgery.tokenHeaderName = 'X-XSRF-TOKEN'; - - abp.security.antiForgery.getToken = function () { - return abp.utils.getCookieValue(abp.security.antiForgery.tokenCookieName); - }; - +var abp = abp || {}; +(function () { + + /* Application paths *****************************************/ + + //Current application root path (including virtual directory if exists). + abp.appPath = abp.appPath || '/'; + + abp.pageLoadTime = new Date(); + + //Converts given path to absolute path using abp.appPath variable. + abp.toAbsAppPath = function (path) { + if (path.indexOf('/') == 0) { + path = path.substring(1); + } + + return abp.appPath + path; + }; + + /* LOGGING ***************************************************/ + //Implements Logging API that provides secure & controlled usage of console.log + + abp.log = abp.log || {}; + + abp.log.levels = { + DEBUG: 1, + INFO: 2, + WARN: 3, + ERROR: 4, + FATAL: 5 + }; + + abp.log.level = abp.log.levels.DEBUG; + + abp.log.log = function (logObject, logLevel) { + if (!window.console || !window.console.log) { + return; + } + + if (logLevel != undefined && logLevel < abp.log.level) { + return; + } + + console.log(logObject); + }; + + abp.log.debug = function (logObject) { + abp.log.log("DEBUG: ", abp.log.levels.DEBUG); + abp.log.log(logObject, abp.log.levels.DEBUG); + }; + + abp.log.info = function (logObject) { + abp.log.log("INFO: ", abp.log.levels.INFO); + abp.log.log(logObject, abp.log.levels.INFO); + }; + + abp.log.warn = function (logObject) { + abp.log.log("WARN: ", abp.log.levels.WARN); + abp.log.log(logObject, abp.log.levels.WARN); + }; + + abp.log.error = function (logObject) { + abp.log.log("ERROR: ", abp.log.levels.ERROR); + abp.log.log(logObject, abp.log.levels.ERROR); + }; + + abp.log.fatal = function (logObject) { + abp.log.log("FATAL: ", abp.log.levels.FATAL); + abp.log.log(logObject, abp.log.levels.FATAL); + }; + + /* LOCALIZATION ***********************************************/ + + abp.localization = abp.localization || {}; + + abp.localization.values = {}; + + abp.localization.localize = function (key, sourceName) { + sourceName = sourceName || abp.localization.defaultResourceName; + + var source = abp.localization.values[sourceName]; + + if (!source) { + abp.log.warn('Could not find localization source: ' + sourceName); + return key; + } + + var value = source[key]; + if (value == undefined) { + return key; + } + + var copiedArguments = Array.prototype.slice.call(arguments, 0); + copiedArguments.splice(1, 1); + copiedArguments[0] = value; + + return abp.utils.formatString.apply(this, copiedArguments); + }; + + abp.localization.getResource = function (name) { + return function () { + var copiedArguments = Array.prototype.slice.call(arguments, 0); + copiedArguments.splice(1, 0, name); + return abp.localization.localize.apply(this, copiedArguments); + }; + }; + + abp.localization.defaultResourceName = undefined; + + /* AUTHORIZATION **********************************************/ + + abp.auth = abp.auth || {}; + + abp.auth.policies = abp.auth.policies || {}; + + abp.auth.grantedPolicies = abp.auth.grantedPolicies || {}; + + abp.auth.isGranted = function (policyName) { + return abp.auth.policies[policyName] != undefined && abp.auth.grantedPolicies[policyName] != undefined; + }; + + abp.auth.isAnyGranted = function () { + if (!arguments || arguments.length <= 0) { + return true; + } + + for (var i = 0; i < arguments.length; i++) { + if (abp.auth.isGranted(arguments[i])) { + return true; + } + } + + return false; + }; + + abp.auth.areAllGranted = function () { + if (!arguments || arguments.length <= 0) { + return true; + } + + for (var i = 0; i < arguments.length; i++) { + if (!abp.auth.isGranted(arguments[i])) { + return false; + } + } + + return true; + }; + + abp.auth.tokenCookieName = 'Abp.AuthToken'; + + abp.auth.setToken = function (authToken, expireDate) { + abp.utils.setCookieValue(abp.auth.tokenCookieName, authToken, expireDate, abp.appPath, abp.domain); + }; + + abp.auth.getToken = function () { + return abp.utils.getCookieValue(abp.auth.tokenCookieName); + } + + abp.auth.clearToken = function () { + abp.auth.setToken(); + } + + /* SETTINGS *************************************************/ + + abp.setting = abp.setting || {}; + + abp.setting.values = abp.setting.values || {}; + + abp.setting.get = function (name) { + return abp.setting.values[name]; + }; + + abp.setting.getBoolean = function (name) { + var value = abp.setting.get(name); + return value == 'true' || value == 'True'; + }; + + abp.setting.getInt = function (name) { + return parseInt(abp.setting.values[name]); + }; + + /* NOTIFICATION *********************************************/ + //Defines Notification API, not implements it + + abp.notify = abp.notify || {}; + + abp.notify.success = function (message, title, options) { + abp.log.warn('abp.notify.success is not implemented!'); + }; + + abp.notify.info = function (message, title, options) { + abp.log.warn('abp.notify.info is not implemented!'); + }; + + abp.notify.warn = function (message, title, options) { + abp.log.warn('abp.notify.warn is not implemented!'); + }; + + abp.notify.error = function (message, title, options) { + abp.log.warn('abp.notify.error is not implemented!'); + }; + + /* MESSAGE **************************************************/ + //Defines Message API, not implements it + + abp.message = abp.message || {}; + + abp.message._showMessage = function (message, title) { + alert((title || '') + ' ' + message); + }; + + abp.message.info = function (message, title) { + abp.log.warn('abp.message.info is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.success = function (message, title) { + abp.log.warn('abp.message.success is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.warn = function (message, title) { + abp.log.warn('abp.message.warn is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.error = function (message, title) { + abp.log.warn('abp.message.error is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.confirm = function (message, titleOrCallback, callback) { + abp.log.warn('abp.message.confirm is not properly implemented!'); + + if (titleOrCallback && !(typeof titleOrCallback == 'string')) { + callback = titleOrCallback; + } + + var result = confirm(message); + callback && callback(result); + }; + + /* UI *******************************************************/ + + abp.ui = abp.ui || {}; + + /* UI BLOCK */ + //Defines UI Block API and implements basically + + var $abpBlockArea = document.createElement('div'); + $abpBlockArea.classList.add('abp-block-area'); + + /* opts: { //Can be an object with options or a string for query a selector + * elm: a query selector (optional - default: document.body) + * busy: boolean (optional - default: false) + * promise: A promise with always or finally handler (optional - auto unblocks the ui if provided) + * } + */ + abp.ui.block = function (opts) { + if (!opts) { + opts = {}; + } else if (typeof opts == 'string') { + opts = { + elm: opts + }; + } + + var $elm = document.querySelector(opts.elm) || document.body; + + if (opts.busy) { + $abpBlockArea.classList.add('abp-block-area-busy'); + } else { + $abpBlockArea.classList.remove('abp-block-area-busy'); + } + + if (document.querySelector(opts.elm)) { + $abpBlockArea.style.position = 'absolute'; + } else { + $abpBlockArea.style.position = 'fixed'; + } + + $elm.appendChild($abpBlockArea); + + if (opts.promise) { + if (opts.promise.always) { //jQuery.Deferred style + opts.promise.always(function () { + abp.ui.unblock({ + $elm: opts.elm + }); + }); + } else if (opts.promise['finally']) { //Q style + opts.promise['finally'](function () { + abp.ui.unblock({ + $elm: opts.elm + }); + }); + } + } + }; + + /* opts: { + * + * } + */ + abp.ui.unblock = function (opts) { + var element = document.querySelector('.abp-block-area'); + if (element) { + element.classList.add('abp-block-area-disappearing'); + setTimeout(function () { + if (element) { + element.classList.remove('abp-block-area-disappearing'); + element.parentElement.removeChild(element); + } + }, 250); + } + }; + + /* UI BUSY */ + //Defines UI Busy API, not implements it + + abp.ui.setBusy = function (opts) { + if (!opts) { + opts = { + busy: true + }; + } else if (typeof opts == 'string') { + opts = { + elm: opts, + busy: true + }; + } + + abp.ui.block(opts); + }; + + abp.ui.clearBusy = function (opts) { + abp.ui.unblock(opts); + }; + + /* SIMPLE EVENT BUS *****************************************/ + + abp.event = (function () { + + var _callbacks = {}; + + var on = function (eventName, callback) { + if (!_callbacks[eventName]) { + _callbacks[eventName] = []; + } + + _callbacks[eventName].push(callback); + }; + + var off = function (eventName, callback) { + var callbacks = _callbacks[eventName]; + if (!callbacks) { + return; + } + + var index = -1; + for (var i = 0; i < callbacks.length; i++) { + if (callbacks[i] === callback) { + index = i; + break; + } + } + + if (index < 0) { + return; + } + + _callbacks[eventName].splice(index, 1); + }; + + var trigger = function (eventName) { + var callbacks = _callbacks[eventName]; + if (!callbacks || !callbacks.length) { + return; + } + + var args = Array.prototype.slice.call(arguments, 1); + for (var i = 0; i < callbacks.length; i++) { + callbacks[i].apply(this, args); + } + }; + + // Public interface /////////////////////////////////////////////////// + + return { + on: on, + off: off, + trigger: trigger + }; + })(); + + + /* UTILS ***************************************************/ + + abp.utils = abp.utils || {}; + + /* Creates a name namespace. + * Example: + * var taskService = abp.utils.createNamespace(abp, 'services.task'); + * taskService will be equal to abp.services.task + * first argument (root) must be defined first + ************************************************************/ + abp.utils.createNamespace = function (root, ns) { + var parts = ns.split('.'); + for (var i = 0; i < parts.length; i++) { + if (typeof root[parts[i]] == 'undefined') { + root[parts[i]] = {}; + } + + root = root[parts[i]]; + } + + return root; + }; + + /* Find and replaces a string (search) to another string (replacement) in + * given string (str). + * Example: + * abp.utils.replaceAll('This is a test string', 'is', 'X') = 'ThX X a test string' + ************************************************************/ + abp.utils.replaceAll = function (str, search, replacement) { + var fix = search.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); + return str.replace(new RegExp(fix, 'g'), replacement); + }; + + /* Formats a string just like string.format in C#. + * Example: + * abp.utils.formatString('Hello {0}','Tuana') = 'Hello Tuana' + ************************************************************/ + abp.utils.formatString = function () { + if (arguments.length < 1) { + return null; + } + + var str = arguments[0]; + + for (var i = 1; i < arguments.length; i++) { + var placeHolder = '{' + (i - 1) + '}'; + str = abp.utils.replaceAll(str, placeHolder, arguments[i]); + } + + return str; + }; + + abp.utils.toPascalCase = function (str) { + if (!str || !str.length) { + return str; + } + + if (str.length === 1) { + return str.charAt(0).toUpperCase(); + } + + return str.charAt(0).toUpperCase() + str.substr(1); + } + + abp.utils.toCamelCase = function (str) { + if (!str || !str.length) { + return str; + } + + if (str.length === 1) { + return str.charAt(0).toLowerCase(); + } + + return str.charAt(0).toLowerCase() + str.substr(1); + } + + abp.utils.truncateString = function (str, maxLength) { + if (!str || !str.length || str.length <= maxLength) { + return str; + } + + return str.substr(0, maxLength); + }; + + abp.utils.truncateStringWithPostfix = function (str, maxLength, postfix) { + postfix = postfix || '...'; + + if (!str || !str.length || str.length <= maxLength) { + return str; + } + + if (maxLength <= postfix.length) { + return postfix.substr(0, maxLength); + } + + return str.substr(0, maxLength - postfix.length) + postfix; + }; + + abp.utils.isFunction = function (obj) { + return !!(obj && obj.constructor && obj.call && obj.apply); + }; + + /** + * parameterInfos should be an array of { name, value } objects + * where name is query string parameter name and value is it's value. + * includeQuestionMark is true by default. + */ + abp.utils.buildQueryString = function (parameterInfos, includeQuestionMark) { + if (includeQuestionMark === undefined) { + includeQuestionMark = true; + } + + var qs = ''; + + function addSeperator() { + if (!qs.length) { + if (includeQuestionMark) { + qs = qs + '?'; + } + } else { + qs = qs + '&'; + } + } + + for (var i = 0; i < parameterInfos.length; ++i) { + var parameterInfo = parameterInfos[i]; + if (parameterInfo.value === undefined) { + continue; + } + + if (parameterInfo.value === null) { + parameterInfo.value = ''; + } + + addSeperator(); + + if (parameterInfo.value.toJSON && typeof parameterInfo.value.toJSON === "function") { + qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value.toJSON()); + } else if (Array.isArray(parameterInfo.value) && parameterInfo.value.length) { + for (var j = 0; j < parameterInfo.value.length; j++) { + if (j > 0) { + addSeperator(); + } + + qs = qs + parameterInfo.name + '[' + j + ']=' + encodeURIComponent(parameterInfo.value[j]); + } + } else { + qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value); + } + } + + return qs; + } + + /** + * Sets a cookie value for given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @param {string} value + * @param {Date} expireDate (optional). If not specified the cookie will expire at the end of session. + * @param {string} path (optional) + */ + abp.utils.setCookieValue = function (key, value, expireDate, path) { + var cookieValue = encodeURIComponent(key) + '='; + + if (value) { + cookieValue = cookieValue + encodeURIComponent(value); + } + + if (expireDate) { + cookieValue = cookieValue + "; expires=" + expireDate.toUTCString(); + } + + if (path) { + cookieValue = cookieValue + "; path=" + path; + } + + document.cookie = cookieValue; + }; + + /** + * Gets a cookie with given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @returns {string} Cookie value or null + */ + abp.utils.getCookieValue = function (key) { + var equalities = document.cookie.split('; '); + for (var i = 0; i < equalities.length; i++) { + if (!equalities[i]) { + continue; + } + + var splitted = equalities[i].split('='); + if (splitted.length != 2) { + continue; + } + + if (decodeURIComponent(splitted[0]) === key) { + return decodeURIComponent(splitted[1] || ''); + } + } + + return null; + }; + + /** + * Deletes cookie for given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @param {string} path (optional) + */ + abp.utils.deleteCookie = function (key, path) { + var cookieValue = encodeURIComponent(key) + '='; + + cookieValue = cookieValue + "; expires=" + (new Date(new Date().getTime() - 86400000)).toUTCString(); + + if (path) { + cookieValue = cookieValue + "; path=" + path; + } + + document.cookie = cookieValue; + } + + /* SECURITY ***************************************/ + abp.security = abp.security || {}; + abp.security.antiForgery = abp.security.antiForgery || {}; + + abp.security.antiForgery.tokenCookieName = 'XSRF-TOKEN'; + abp.security.antiForgery.tokenHeaderName = 'X-XSRF-TOKEN'; + + abp.security.antiForgery.getToken = function () { + return abp.utils.getCookieValue(abp.security.antiForgery.tokenCookieName); + }; + })(); \ No newline at end of file diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/wwwroot/libs/abp/jquery/abp.jquery.js b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/wwwroot/libs/abp/jquery/abp.jquery.js index 6e2ee001b8..e6aff047f7 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/wwwroot/libs/abp/jquery/abp.jquery.js +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/wwwroot/libs/abp/jquery/abp.jquery.js @@ -1,393 +1,393 @@ -var abp = abp || {}; -(function($) { - - if (!$) { - throw "abp/jquery library requires the jquery library included to the page!"; - } - - // ABP CORE OVERRIDES ///////////////////////////////////////////////////// - - abp.message._showMessage = function (message, title) { - alert((title || '') + ' ' + message); - - return $.Deferred(function ($dfd) { - $dfd.resolve(); - }); - }; - - abp.message.confirm = function (message, titleOrCallback, callback) { - if (titleOrCallback && !(typeof titleOrCallback == 'string')) { - callback = titleOrCallback; - } - - var result = confirm(message); - callback && callback(result); - - return $.Deferred(function ($dfd) { - $dfd.resolve(result); - }); - }; - - abp.utils.isFunction = function (obj) { - return $.isFunction(obj); - }; - - // JQUERY EXTENSIONS ////////////////////////////////////////////////////// - - $.fn.findWithSelf = function (selector) { - return this.filter(selector).add(this.find(selector)); - }; - - // DOM //////////////////////////////////////////////////////////////////// - - abp.dom = abp.dom || {}; - - abp.dom.onNodeAdded = function (callback) { - abp.event.on('abp.dom.nodeAdded', callback); - }; - - abp.dom.onNodeRemoved = function (callback) { - abp.event.on('abp.dom.nodeRemoved', callback); - }; - - var mutationObserverCallback = function (mutationsList) { - for (var i = 0; i < mutationsList.length; i++) { - var mutation = mutationsList[i]; - if (mutation.type === 'childList') { - if (mutation.addedNodes && mutation.removedNodes.length) { - for (var k = 0; k < mutation.removedNodes.length; k++) { - abp.event.trigger( - 'abp.dom.nodeRemoved', - { - $el: $(mutation.removedNodes[k]) - } - ); - } - } - - if (mutation.addedNodes && mutation.addedNodes.length) { - for (var j = 0; j < mutation.addedNodes.length; j++) { - abp.event.trigger( - 'abp.dom.nodeAdded', - { - $el: $(mutation.addedNodes[j]) - } - ); - } - } - } - } - }; - - new MutationObserver(mutationObserverCallback).observe( - $('body')[0], - { - subtree: true, - childList: true - } - ); - - // AJAX /////////////////////////////////////////////////////////////////// - - abp.ajax = function (userOptions) { - userOptions = userOptions || {}; - - var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); - - options.success = undefined; - options.error = undefined; - - return $.Deferred(function ($dfd) { - $.ajax(options) - .done(function (data, textStatus, jqXHR) { - $dfd.resolve(data); - userOptions.success && userOptions.success(data); - }).fail(function (jqXHR) { - if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { - abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); - } else { - abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); - } - }); - }); - }; - - $.extend(abp.ajax, { - defaultOpts: { - dataType: 'json', - type: 'POST', - contentType: 'application/json', - headers: { - 'X-Requested-With': 'XMLHttpRequest' - } - }, - - defaultError: { - message: 'An error has occurred!', - details: 'Error detail not sent by server.' - }, - - defaultError401: { - message: 'You are not authenticated!', - details: 'You should be authenticated (sign in) in order to perform this operation.' - }, - - defaultError403: { - message: 'You are not authorized!', - details: 'You are not allowed to perform this operation.' - }, - - defaultError404: { - message: 'Resource not found!', - details: 'The resource requested could not found on the server.' - }, - - logError: function (error) { - abp.log.error(error); - }, - - showError: function (error) { - if (error.details) { - return abp.message.error(error.details, error.message); - } else { - return abp.message.error(error.message || abp.ajax.defaultError.message); - } - }, - - handleTargetUrl: function (targetUrl) { - if (!targetUrl) { - location.href = abp.appPath; - } else { - location.href = targetUrl; - } - }, - - handleErrorStatusCode: function (status) { - switch (status) { - case 401: - abp.ajax.handleUnAuthorizedRequest( - abp.ajax.showError(abp.ajax.defaultError401), - abp.appPath - ); - break; - case 403: - abp.ajax.showError(abp.ajax.defaultError403); - break; - case 404: - abp.ajax.showError(abp.ajax.defaultError404); - break; - default: - abp.ajax.showError(abp.ajax.defaultError); - break; - } - }, - - handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { - if (userOptions.abpHandleError !== false) { - abp.ajax.handleErrorStatusCode(jqXHR.status); - } - - $dfd.reject.apply(this, arguments); - userOptions.error && userOptions.error.apply(this, arguments); - }, - - handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { - var messagePromise = null; - - if (userOptions.abpHandleError !== false) { - messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); - } - - abp.ajax.logError(jqXHR.responseJSON.error); - - $dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); - userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); - - if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { - abp.ajax.handleUnAuthorizedRequest(messagePromise); - } - }, - - handleUnAuthorizedRequest: function (messagePromise, targetUrl) { - if (messagePromise) { - messagePromise.done(function () { - abp.ajax.handleTargetUrl(targetUrl); - }); - } else { - abp.ajax.handleTargetUrl(targetUrl); - } - }, - - blockUI: function (options) { - if (options.blockUI) { - if (options.blockUI === true) { //block whole page - abp.ui.setBusy(); - } else { //block an element - abp.ui.setBusy(options.blockUI); - } - } - }, - - unblockUI: function (options) { - if (options.blockUI) { - if (options.blockUI === true) { //unblock whole page - abp.ui.clearBusy(); - } else { //unblock an element - abp.ui.clearBusy(options.blockUI); - } - } - }, - - ajaxSendHandler: function (event, request, settings) { - var token = abp.security.antiForgery.getToken(); - if (!token) { - return; - } - - if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { - request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); - } - } - }); - - $(document).ajaxSend(function (event, request, settings) { - return abp.ajax.ajaxSendHandler(event, request, settings); - }); - - abp.event.on('abp.configurationInitialized', function () { - var l = abp.localization.getResource('AbpUi'); - - abp.ajax.defaultError.message = l('DefaultErrorMessage'); - abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); - abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); - abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); - abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); - abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); - abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); - abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); - }); - - // RESOURCE LOADER //////////////////////////////////////////////////////// - - /* UrlStates enum */ - var UrlStates = { - LOADING: 'LOADING', - LOADED: 'LOADED', - FAILED: 'FAILED' - }; - - /* UrlInfo class */ - function UrlInfo(url) { - this.url = url; - this.state = UrlStates.LOADING; - this.loadCallbacks = []; - this.failCallbacks = []; - } - - UrlInfo.prototype.succeed = function () { - this.state = UrlStates.LOADED; - for (var i = 0; i < this.loadCallbacks.length; i++) { - this.loadCallbacks[i](); - } - }; - - UrlInfo.prototype.failed = function () { - this.state = UrlStates.FAILED; - for (var i = 0; i < this.failCallbacks.length; i++) { - this.failCallbacks[i](); - } - }; - - UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { - switch (this.state) { - case UrlStates.LOADED: - loadCallback && loadCallback(); - break; - case UrlStates.FAILED: - failCallback && failCallback(); - break; - case UrlStates.LOADING: - this.addCallbacks(loadCallback, failCallback); - break; - } - }; - - UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { - loadCallback && this.loadCallbacks.push(loadCallback); - failCallback && this.failCallbacks.push(failCallback); - }; - - /* ResourceLoader API */ - - abp.ResourceLoader = (function () { - - var _urlInfos = {}; - - function getCacheKey(url) { - return url; - } - - function appendTimeToUrl(url) { - - if (url.indexOf('?') < 0) { - url += '?'; - } else { - url += '&'; - } - - url += '_=' + new Date().getTime(); - - return url; - } - - var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { - - var cacheKey = getCacheKey(url); - - var urlInfo = _urlInfos[cacheKey]; - - if (urlInfo) { - urlInfo.handleCallbacks(loadCallback, failCallback); - return; - } - - _urlInfos[cacheKey] = urlInfo = new UrlInfo(url); - urlInfo.addCallbacks(loadCallback, failCallback); - - serverLoader(urlInfo); - }; - - var _loadScript = function (url, loadCallback, failCallback) { - _loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { - $.get({ - url: url, - dataType: 'text' - }) - .done(function (script) { - $.globalEval(script); - urlInfo.succeed(); - }) - .fail(function () { - urlInfo.failed(); - }); - }); - }; - - var _loadStyle = function (url) { - _loadFromUrl(url, undefined, undefined, function (urlInfo) { - - $('', { - rel: 'stylesheet', - type: 'text/css', - href: appendTimeToUrl(url) - }).appendTo('head'); - }); - }; - - return { - loadScript: _loadScript, - loadStyle: _loadStyle - } - })(); - +var abp = abp || {}; +(function($) { + + if (!$) { + throw "abp/jquery library requires the jquery library included to the page!"; + } + + // ABP CORE OVERRIDES ///////////////////////////////////////////////////// + + abp.message._showMessage = function (message, title) { + alert((title || '') + ' ' + message); + + return $.Deferred(function ($dfd) { + $dfd.resolve(); + }); + }; + + abp.message.confirm = function (message, titleOrCallback, callback) { + if (titleOrCallback && !(typeof titleOrCallback == 'string')) { + callback = titleOrCallback; + } + + var result = confirm(message); + callback && callback(result); + + return $.Deferred(function ($dfd) { + $dfd.resolve(result); + }); + }; + + abp.utils.isFunction = function (obj) { + return $.isFunction(obj); + }; + + // JQUERY EXTENSIONS ////////////////////////////////////////////////////// + + $.fn.findWithSelf = function (selector) { + return this.filter(selector).add(this.find(selector)); + }; + + // DOM //////////////////////////////////////////////////////////////////// + + abp.dom = abp.dom || {}; + + abp.dom.onNodeAdded = function (callback) { + abp.event.on('abp.dom.nodeAdded', callback); + }; + + abp.dom.onNodeRemoved = function (callback) { + abp.event.on('abp.dom.nodeRemoved', callback); + }; + + var mutationObserverCallback = function (mutationsList) { + for (var i = 0; i < mutationsList.length; i++) { + var mutation = mutationsList[i]; + if (mutation.type === 'childList') { + if (mutation.addedNodes && mutation.removedNodes.length) { + for (var k = 0; k < mutation.removedNodes.length; k++) { + abp.event.trigger( + 'abp.dom.nodeRemoved', + { + $el: $(mutation.removedNodes[k]) + } + ); + } + } + + if (mutation.addedNodes && mutation.addedNodes.length) { + for (var j = 0; j < mutation.addedNodes.length; j++) { + abp.event.trigger( + 'abp.dom.nodeAdded', + { + $el: $(mutation.addedNodes[j]) + } + ); + } + } + } + } + }; + + new MutationObserver(mutationObserverCallback).observe( + $('body')[0], + { + subtree: true, + childList: true + } + ); + + // AJAX /////////////////////////////////////////////////////////////////// + + abp.ajax = function (userOptions) { + userOptions = userOptions || {}; + + var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); + + options.success = undefined; + options.error = undefined; + + return $.Deferred(function ($dfd) { + $.ajax(options) + .done(function (data, textStatus, jqXHR) { + $dfd.resolve(data); + userOptions.success && userOptions.success(data); + }).fail(function (jqXHR) { + if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { + abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); + } else { + abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); + } + }); + }); + }; + + $.extend(abp.ajax, { + defaultOpts: { + dataType: 'json', + type: 'POST', + contentType: 'application/json', + headers: { + 'X-Requested-With': 'XMLHttpRequest' + } + }, + + defaultError: { + message: 'An error has occurred!', + details: 'Error detail not sent by server.' + }, + + defaultError401: { + message: 'You are not authenticated!', + details: 'You should be authenticated (sign in) in order to perform this operation.' + }, + + defaultError403: { + message: 'You are not authorized!', + details: 'You are not allowed to perform this operation.' + }, + + defaultError404: { + message: 'Resource not found!', + details: 'The resource requested could not found on the server.' + }, + + logError: function (error) { + abp.log.error(error); + }, + + showError: function (error) { + if (error.details) { + return abp.message.error(error.details, error.message); + } else { + return abp.message.error(error.message || abp.ajax.defaultError.message); + } + }, + + handleTargetUrl: function (targetUrl) { + if (!targetUrl) { + location.href = abp.appPath; + } else { + location.href = targetUrl; + } + }, + + handleErrorStatusCode: function (status) { + switch (status) { + case 401: + abp.ajax.handleUnAuthorizedRequest( + abp.ajax.showError(abp.ajax.defaultError401), + abp.appPath + ); + break; + case 403: + abp.ajax.showError(abp.ajax.defaultError403); + break; + case 404: + abp.ajax.showError(abp.ajax.defaultError404); + break; + default: + abp.ajax.showError(abp.ajax.defaultError); + break; + } + }, + + handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { + if (userOptions.abpHandleError !== false) { + abp.ajax.handleErrorStatusCode(jqXHR.status); + } + + $dfd.reject.apply(this, arguments); + userOptions.error && userOptions.error.apply(this, arguments); + }, + + handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { + var messagePromise = null; + + if (userOptions.abpHandleError !== false) { + messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); + } + + abp.ajax.logError(jqXHR.responseJSON.error); + + $dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); + userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); + + if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { + abp.ajax.handleUnAuthorizedRequest(messagePromise); + } + }, + + handleUnAuthorizedRequest: function (messagePromise, targetUrl) { + if (messagePromise) { + messagePromise.done(function () { + abp.ajax.handleTargetUrl(targetUrl); + }); + } else { + abp.ajax.handleTargetUrl(targetUrl); + } + }, + + blockUI: function (options) { + if (options.blockUI) { + if (options.blockUI === true) { //block whole page + abp.ui.setBusy(); + } else { //block an element + abp.ui.setBusy(options.blockUI); + } + } + }, + + unblockUI: function (options) { + if (options.blockUI) { + if (options.blockUI === true) { //unblock whole page + abp.ui.clearBusy(); + } else { //unblock an element + abp.ui.clearBusy(options.blockUI); + } + } + }, + + ajaxSendHandler: function (event, request, settings) { + var token = abp.security.antiForgery.getToken(); + if (!token) { + return; + } + + if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { + request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); + } + } + }); + + $(document).ajaxSend(function (event, request, settings) { + return abp.ajax.ajaxSendHandler(event, request, settings); + }); + + abp.event.on('abp.configurationInitialized', function () { + var l = abp.localization.getResource('AbpUi'); + + abp.ajax.defaultError.message = l('DefaultErrorMessage'); + abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); + abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); + abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); + abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); + abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); + abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); + abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); + }); + + // RESOURCE LOADER //////////////////////////////////////////////////////// + + /* UrlStates enum */ + var UrlStates = { + LOADING: 'LOADING', + LOADED: 'LOADED', + FAILED: 'FAILED' + }; + + /* UrlInfo class */ + function UrlInfo(url) { + this.url = url; + this.state = UrlStates.LOADING; + this.loadCallbacks = []; + this.failCallbacks = []; + } + + UrlInfo.prototype.succeed = function () { + this.state = UrlStates.LOADED; + for (var i = 0; i < this.loadCallbacks.length; i++) { + this.loadCallbacks[i](); + } + }; + + UrlInfo.prototype.failed = function () { + this.state = UrlStates.FAILED; + for (var i = 0; i < this.failCallbacks.length; i++) { + this.failCallbacks[i](); + } + }; + + UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { + switch (this.state) { + case UrlStates.LOADED: + loadCallback && loadCallback(); + break; + case UrlStates.FAILED: + failCallback && failCallback(); + break; + case UrlStates.LOADING: + this.addCallbacks(loadCallback, failCallback); + break; + } + }; + + UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { + loadCallback && this.loadCallbacks.push(loadCallback); + failCallback && this.failCallbacks.push(failCallback); + }; + + /* ResourceLoader API */ + + abp.ResourceLoader = (function () { + + var _urlInfos = {}; + + function getCacheKey(url) { + return url; + } + + function appendTimeToUrl(url) { + + if (url.indexOf('?') < 0) { + url += '?'; + } else { + url += '&'; + } + + url += '_=' + new Date().getTime(); + + return url; + } + + var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { + + var cacheKey = getCacheKey(url); + + var urlInfo = _urlInfos[cacheKey]; + + if (urlInfo) { + urlInfo.handleCallbacks(loadCallback, failCallback); + return; + } + + _urlInfos[cacheKey] = urlInfo = new UrlInfo(url); + urlInfo.addCallbacks(loadCallback, failCallback); + + serverLoader(urlInfo); + }; + + var _loadScript = function (url, loadCallback, failCallback) { + _loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { + $.get({ + url: url, + dataType: 'text' + }) + .done(function (script) { + $.globalEval(script); + urlInfo.succeed(); + }) + .fail(function () { + urlInfo.failed(); + }); + }); + }; + + var _loadStyle = function (url) { + _loadFromUrl(url, undefined, undefined, function (urlInfo) { + + $('', { + rel: 'stylesheet', + type: 'text/css', + href: appendTimeToUrl(url) + }).appendTo('head'); + }); + }; + + return { + loadScript: _loadScript, + loadStyle: _loadStyle + } + })(); + })(jQuery); \ No newline at end of file diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/yarn.lock b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/yarn.lock index 7230736133..b3b0eb268b 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/yarn.lock +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/yarn.lock @@ -2,37 +2,37 @@ # yarn lockfile v1 -"@abp/aspnetcore.mvc.ui.theme.basic@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-2.1.0.tgz#f815001bd856fb5cbdd0b736181f2401a1a7ec62" - integrity sha512-ej6dhUo3H9w6bpBTpMhk3M6zbC3fVAVMm5yLSYlYJ0sQxjb9PqC02OgiJme0mkxCUMwPuHVSQLrMQbioXdZu3A== +"@abp/aspnetcore.mvc.ui.theme.basic@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-2.2.0.tgz#e7f4e57d2b17cc76388e9c56bc34d50c9658873b" + integrity sha512-S9GQ9YVg4DWrgjujwiXBER6KqdqW5nZ1Bmt+YEePn5gEoPvoVrh6ojthpHYRjBJtGFqBSzRAQ9eVZLebT22Ozg== dependencies: - "@abp/aspnetcore.mvc.ui.theme.shared" "^2.1.0" + "@abp/aspnetcore.mvc.ui.theme.shared" "^2.2.0" -"@abp/aspnetcore.mvc.ui.theme.shared@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-2.1.0.tgz#c2790241b5a44b9d6e4f65911a1b9d9e9104ed82" - integrity sha512-dxC0P/b1T+QJmRrB8HoLM7/GkWblz/X5lLqgn583W7/OTYhvxIxszuRDy/XIEuS+fP6a9rcGvGu5jcKJEqe/xA== - dependencies: - "@abp/aspnetcore.mvc.ui" "^2.1.0" - "@abp/bootstrap" "^2.1.0" - "@abp/bootstrap-datepicker" "^2.1.0" - "@abp/datatables.net-bs4" "^2.1.0" - "@abp/font-awesome" "^2.1.0" - "@abp/jquery-form" "^2.1.0" - "@abp/jquery-validation-unobtrusive" "^2.1.0" - "@abp/lodash" "^2.1.0" - "@abp/luxon" "^2.1.0" - "@abp/malihu-custom-scrollbar-plugin" "^2.1.0" - "@abp/select2" "^2.1.0" - "@abp/sweetalert" "^2.1.0" - "@abp/timeago" "^2.1.0" - "@abp/toastr" "^2.1.0" - -"@abp/aspnetcore.mvc.ui@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-2.1.0.tgz#3c86f42e52af3151d2aee0ffdd1281014ea61054" - integrity sha512-pKiKMBOPuLm7p44DW8DdbsVn5PY3NqGYkz6gf75uzxyWiVYyl2CM/bvX9w4Ie7Q969owENMLrBREN6ezWZ5ynA== +"@abp/aspnetcore.mvc.ui.theme.shared@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-2.2.0.tgz#e0df953853be2a184d323931573f9f98aebbaa62" + integrity sha512-urxziaCdvfEqN5cjiiM5f5dx2Yr+AoGqCJVCo0Okjl2dosdaj5DH4SBzMvKAaLXzo3Ep1h4b3Wvws4BThL/6rA== + dependencies: + "@abp/aspnetcore.mvc.ui" "^2.2.0" + "@abp/bootstrap" "^2.2.0" + "@abp/bootstrap-datepicker" "^2.2.0" + "@abp/datatables.net-bs4" "^2.2.0" + "@abp/font-awesome" "^2.2.0" + "@abp/jquery-form" "^2.2.0" + "@abp/jquery-validation-unobtrusive" "^2.2.0" + "@abp/lodash" "^2.2.0" + "@abp/luxon" "^2.2.0" + "@abp/malihu-custom-scrollbar-plugin" "^2.2.0" + "@abp/select2" "^2.2.0" + "@abp/sweetalert" "^2.2.0" + "@abp/timeago" "^2.2.0" + "@abp/toastr" "^2.2.0" + +"@abp/aspnetcore.mvc.ui@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-2.2.0.tgz#b2cdd421eed09ec1d30ae85e14434b7efc094ade" + integrity sha512-IO/AjhJu+LUa9zOaT8JlEnV+Pcp9oQ3q9kTq8kmMakC35vTIyvBpB3nnykXIOytZSyjsBgFYB/uMxPgBOjWagg== dependencies: ansi-colors "^4.1.1" extend-object "^1.0.0" @@ -41,135 +41,135 @@ path "^0.12.7" rimraf "^3.0.0" -"@abp/bootstrap-datepicker@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-2.1.0.tgz#a0d71da15cb3d3cc02f9a390437a44db5e9f9ea1" - integrity sha512-lkNI0iyefiXS2O5x9Ae9eJQLPXSQlOWDX7QhKnBHLR9JxjJEnhBUIIOylMltAIqtVDtjk2ikDyd3BAiyBdtB/w== +"@abp/bootstrap-datepicker@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-2.2.0.tgz#a2f50b422824f18ed4b7e80be6852e2979119f8e" + integrity sha512-X9jT5mU42QFfVhOZdun7aEJUf3bMko6NsG3NFQVjqTqKH+iYGKfHPFpXD0gP/6Nb4KgZUdId8hSyQTZyOK2JEA== dependencies: bootstrap-datepicker "^1.9.0" -"@abp/bootstrap@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-2.1.0.tgz#7ce15d4effac0e0991a3520c4666c6cb17a3fef2" - integrity sha512-1xQjqu6shCgzd1FI94y5AIXGIhBlZEoRrOhaT84j/2KzYiDvhP+LAqQjMgqlQmBLs6vMckpxtf5thxKTMXvtOw== +"@abp/bootstrap@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-2.2.0.tgz#16e41d3432117bbcd9012c6f735c49c543255879" + integrity sha512-aRmluu6SkIl+JgCzSSJZrDPkYr6WWaQdY0iJAOz6NHtffa7Aumh1IUOrLVKL0T1pQn6QKs0Z7JDGyYMdh1HPkQ== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" bootstrap "^4.3.1" -"@abp/core@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/core/-/core-2.1.0.tgz#0cd2850f029df1d18517b8e74c70341972c37ed7" - integrity sha512-1wnRo00hWncZWSakaEXm388XhhbKXDVkWDIdaT3kyQpvp3kX1lFx7I5iiZiwIeULwZRF9mi6HV6iHEze58x0kQ== +"@abp/core@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/core/-/core-2.2.0.tgz#4eea0a06458c90acb8566a11eb841fe65d15d256" + integrity sha512-tBGHa5CUr0ewT31g689RAfQ6Su2p4uyn2PzmrW/8lahBrvqkoCb41fkCDLQJkTY5rKPrEKZd/s9OoyOnS20DLg== -"@abp/datatables.net-bs4@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-2.1.0.tgz#a0f36cf4e3ef96ae03aa4b9956fcb8b971c854cb" - integrity sha512-93qc2rrGs+JKRPM/7UCasa5VmfswgYU8cv3Ybg5OKoaASODYUn06GChRFnd/mvqcDxw4+8gaqpC3U2ETZZI4pA== +"@abp/datatables.net-bs4@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-2.2.0.tgz#c7cc49e889b295ae10fb24ed62b154ef79ffc85a" + integrity sha512-zjJRPqOCWPfkHt1QztfFHKrsTE9o6Je2EpfA7hRMej2FlGbsMWUxOqx/btK1vjD6YIU8DtVDpIdj1WvPOITQ4Q== dependencies: - "@abp/datatables.net" "^2.1.0" + "@abp/datatables.net" "^2.2.0" datatables.net-bs4 "^1.10.20" -"@abp/datatables.net@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-2.1.0.tgz#674eaaa5b0948d7ee85b6605bfbad1a70f839aa7" - integrity sha512-3ZM2p+JpHumxbIKlDP/LKLsfceMdttdTOL0ckIZCmAAgoIeKmAtuMoKcHTr8lj5mjgv4arBGvG9WVCemep2PEw== +"@abp/datatables.net@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-2.2.0.tgz#22f9c7ca90c2d4af264483b4f8286b0feb7c3d52" + integrity sha512-L4MnpdloSWr/px3mvV75sxsxL68MyALB2LKdzCFMQWILCZVkxMmQb9LARINYIrn461Wrc+zbYWNEBD0MAq7flg== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" datatables.net "^1.10.20" -"@abp/font-awesome@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-2.1.0.tgz#c2e628a1b9d0525e7d6950bf007feebcd1c490c8" - integrity sha512-vlm1IQuQVfuCI2O1vphDd11zUEJ4/4PU0/0XI1YCpilse8fBg080CM3+G0kw6Erm/riznqhOJwBcfT+K+zqk8A== +"@abp/font-awesome@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-2.2.0.tgz#2de39e3c6c3e8c30394d82861761a66c5b4032f0" + integrity sha512-RT06MYUGgaWBEpW5c7wUcfMXgxcOHWdX/C01LDO/j6iVoKBuBHOkkvcUoTWII068ECrLYOkj+RyT59dCKm8FFw== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" "@fortawesome/fontawesome-free" "^5.11.2" -"@abp/jquery-form@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-2.1.0.tgz#285dbfdcf722cb0249f149e728cef7f788410c0c" - integrity sha512-A17rjHTiBJBKYgrtDX5wIqnI89wNmo3bdK9NagL1wMFj4GvDyOZoRIDLqkopYQsc8zuPjqw4+1aa2TPiA+jtKg== +"@abp/jquery-form@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-2.2.0.tgz#951653fac4013a7bbec065b5101b86d575e0eca7" + integrity sha512-ji44E3Ud0S3LNXn1WJ/Aw44qAIG7EITEW1KOe46oz+/awPpbiiA4dDDNleTvO2jI2/s8mNyR0bNanP6BUsc7tw== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" jquery-form "^4.2.2" -"@abp/jquery-validation-unobtrusive@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-2.1.0.tgz#fc938775ced2efc686e7dd092d6ceff1ea947f36" - integrity sha512-a8iBIj6amJ9rQNV+wxQUuEVh93M/c32kJcrwSEPWQcOoTj5gf0j8eKK9YvZaGokpylraz9mdGOwYQQuNj1sxEw== +"@abp/jquery-validation-unobtrusive@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-2.2.0.tgz#6d39ba9f7bf026d1380796bf5dff76c8d16b42ce" + integrity sha512-SuS/dRRVz7ZR4HK/h9x0jRRVLPqXN0CPRGPdJZ1LJraXVEJ9/eDEGf1rMlHmEGt1FXXFTD01/zjisbweDE786w== dependencies: - "@abp/jquery-validation" "^2.1.0" + "@abp/jquery-validation" "^2.2.0" jquery-validation-unobtrusive "^3.2.11" -"@abp/jquery-validation@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-2.1.0.tgz#2bf1a31321cce3b2abe6d56c6112c52a8ecb28b6" - integrity sha512-kU6/E+Xc3wHAUs+sGMAL8uozkXv65HnpksTwV4/+RK+D6iFU2EyNgCEFu7QGSwYZsV1/7YsCe2GD4ucBXIknbA== +"@abp/jquery-validation@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-2.2.0.tgz#02bb8ba883e72c1204867ee4d1c1094bd91c4c4c" + integrity sha512-ypITQloO4iEDgqlA6qb3taj+7HMX0Cf/ACA2OvtrvOgJejx6J4wfrPjwuFZu1WWJ0xtc9yTdbovdcSVcQbIGaA== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" jquery-validation "^1.19.1" -"@abp/jquery@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-2.1.0.tgz#fb5b4c9e8622cf46fee92f9f731d007d5fb200bb" - integrity sha512-ZpfzRut5G611bBmuDdiT6BD0M7Rl1P6r8uNxUjdmFXYwFd8wD02ZhIcsX7qFHFkYERuXfcLrZh4rpw9G1DVCJg== +"@abp/jquery@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-2.2.0.tgz#0e641b1109e78eff4c34331ca2b123b67cc30cbe" + integrity sha512-vEfRoFEAmDmRgSq98Y9EZExfQFSWtmjaHrodUu+MadTcRlnn+wHq8wwkKKxpj/eYtNc8aFORpyHMMH7uliAKxg== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" jquery "^3.4.1" -"@abp/lodash@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-2.1.0.tgz#9fc9e6521e6284d607cedbff1a458fa324137c5c" - integrity sha512-s1gTHhpbmEDDCsZeXb9MpClkDS4wH5R2IWPRZUlSPxo3gF0pvkx5ubdhYUEUgqy5QqWxE/+zUAjDc4x+cEriFQ== +"@abp/lodash@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-2.2.0.tgz#af0a2ebcb28fd0a8c02da5026479d9370ed19719" + integrity sha512-wOMLqIpuq4a7ww7pB138G6YxBiTGBgxNW/IWGUiWbfgrr88cGPKIYYv/8O8mvr8PLNGjizNynuwQRj522yA3Dw== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" lodash "^4.17.15" -"@abp/luxon@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-2.1.0.tgz#624796722119f075119006b436054aecbb38f15f" - integrity sha512-2b0sRo6rdYT1wDu9nSXm/9o8rhQ9ED7FxrDMYabYuOQz48esgn4fBUNcPqpxwejpFmlhZY6CONvkddNtaMeVHw== +"@abp/luxon@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-2.2.0.tgz#0d0e78edc249853fa31eceecc00df2846a879aa9" + integrity sha512-WbOW0PcMks+WXRPWt/+H4pOa5waM331WkY0F+EJx8fpxemNGQNUEXLkuMXzN3MrN6LrplM9AZ9i+NRA9PWHbNw== dependencies: luxon "^1.21.3" -"@abp/malihu-custom-scrollbar-plugin@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-2.1.0.tgz#f4dc1a32cefc3de8af08cb6d585ec5f7636a0c5e" - integrity sha512-WcxzCZ5YOMxGxZerEh966cVrFSCw1UTDqwU2rxA/LsHEbPKd69AY+SHvUiacNxPXs1ZCF6FFJ29C5dWicEIRaQ== +"@abp/malihu-custom-scrollbar-plugin@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-2.2.0.tgz#e11fd46dccbb28d44fb199e880b91d27c94f1919" + integrity sha512-YDu/NLpIzMA96NDHxd27/+liTm3sow9M+oWH29+9JW8o/AEpXUH3T3AmoXXcTgsBlzLaewgHEFM8yxsAAFoj8Q== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" malihu-custom-scrollbar-plugin "^3.1.5" -"@abp/select2@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-2.1.0.tgz#79e50d2c25e74a5f96520e8aa1433d79aea674d1" - integrity sha512-ut/3c+lFdoepuDH36M7thWagmAmTFrChcPnhYjTx4MmIf31WW1BwqOSx3I2g8M+NEEx+V2jTNuBpTq7PONgSJg== +"@abp/select2@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-2.2.0.tgz#4639d4e5b72b1736fa4476bd9b6a78e036400421" + integrity sha512-tc87JyM0kvVF388kyGUjDby49Zrrb089jVRRipoIaxXeu4M1YxEFSKBEcUK1MohZWjVtWrNs8MoxPlfukaMpyw== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" select2 "^4.0.12" -"@abp/sweetalert@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-2.1.0.tgz#88f405c4ba9f9ed2fd54b945ed6bc48d5ae2fa23" - integrity sha512-EWvReqxZ1DrNH9XD+cf/yGVj+8IPTpuoPuWKDryN4fF7TCMJA+KrXp5lFxpjfkKTtNzLeFGsJqDFWaUifxtqTA== +"@abp/sweetalert@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-2.2.0.tgz#dfc60ba085522d8390e41b90bf5a3d474f4ae624" + integrity sha512-HS6TKOwP91UjzjZHaheurZ1AYUSMkQyCSmoX6g5LAK4eH8IIgpojVSp1AFCSPATrFsFWY/dzkDGcfu90FWsVBg== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" sweetalert "^2.1.2" -"@abp/timeago@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-2.1.0.tgz#28c0aef88aff8b54d1dfb42a664d05097e7fda35" - integrity sha512-NklUYcWeji7po+Y6Oi7b7IkYmjd5YRu123bm3MqjQ71AzuOCTFbvPMHzYOjrUTkzr6gW3IJ24LQ4YmpshPy4ZQ== +"@abp/timeago@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-2.2.0.tgz#9a8297f36a46cdc4cc62f44d0fdc91b70def389c" + integrity sha512-8qjmKscsTvPznHKWEsddYxdSBiU+l+OgLG6vzMcSWqngYbDQGXqNA93BwJI2qiwd+FkNcfGgYg7CN7bcwzmaiw== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" timeago "^1.6.7" -"@abp/toastr@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-2.1.0.tgz#22a53a2b1f354770fdc7b37f06bec10eefccfe7a" - integrity sha512-hD3hTDx+CixTVTx73rnZDiiFkfSxpZox8RLm+CiFA62ORdO8Ryij8TOXXkJd84b2tJfkAkYehohVXKwHlHU7Zg== +"@abp/toastr@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-2.2.0.tgz#1cad83a89da244685b3c82adff64260b7ccf4742" + integrity sha512-HHfSaw4M/9zS+KgzxGvbHYiQ5qcJgpf21cRZEo16aUwnTeKr4SRaewAWryNn4dKcIO2YNrhzDLH+OYbEaJJlDQ== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" toastr "^2.1.4" "@fortawesome/fontawesome-free@^5.11.2": diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/package.json b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/package.json index b620e756f7..6e36dde3bf 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/package.json +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/package.json @@ -3,6 +3,6 @@ "name": "my-app", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.basic": "^2.1.0" + "@abp/aspnetcore.mvc.ui.theme.basic": "^2.2.0" } } \ No newline at end of file diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/wwwroot/libs/abp/core/abp.css b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/wwwroot/libs/abp/core/abp.css index ee3c5080a5..ddf9cae5b2 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/wwwroot/libs/abp/core/abp.css +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/wwwroot/libs/abp/core/abp.css @@ -1,56 +1,56 @@ -@keyframes spin { - 0% { - transform: translateZ(0) rotate(0deg); - } - - 100% { - transform: translateZ(0) rotate(360deg); - } -} - -.abp-block-area { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: 102; - background-color: #fff; - opacity: .8; - transition: opacity .25s; -} - - .abp-block-area.abp-block-area-disappearing { - opacity: 0; - } - - .abp-block-area.abp-block-area-busy:after { - content: attr(data-text); - display: block; - max-width: 125px; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - font-size: 20px; - font-family: sans-serif; - color: #343a40; - text-align: center; - text-transform: uppercase; - } - - .abp-block-area.abp-block-area-busy:before { - content: ""; - display: block; - width: 150px; - height: 150px; - border-radius: 50%; - border-width: 2px; - border-style: solid; - border-color: transparent #228ae6 #228ae6 #228ae6; - position: absolute; - top: calc(50% - 75px); - left: calc(50% - 75px); - will-change: transform; - animation: spin .75s infinite ease-in-out; - } +@keyframes spin { + 0% { + transform: translateZ(0) rotate(0deg); + } + + 100% { + transform: translateZ(0) rotate(360deg); + } +} + +.abp-block-area { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 102; + background-color: #fff; + opacity: .8; + transition: opacity .25s; +} + + .abp-block-area.abp-block-area-disappearing { + opacity: 0; + } + + .abp-block-area.abp-block-area-busy:after { + content: attr(data-text); + display: block; + max-width: 125px; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + font-size: 20px; + font-family: sans-serif; + color: #343a40; + text-align: center; + text-transform: uppercase; + } + + .abp-block-area.abp-block-area-busy:before { + content: ""; + display: block; + width: 150px; + height: 150px; + border-radius: 50%; + border-width: 2px; + border-style: solid; + border-color: transparent #228ae6 #228ae6 #228ae6; + position: absolute; + top: calc(50% - 75px); + left: calc(50% - 75px); + will-change: transform; + animation: spin .75s infinite ease-in-out; + } diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/wwwroot/libs/abp/core/abp.js b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/wwwroot/libs/abp/core/abp.js index cef1cf55e1..730db8bc97 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/wwwroot/libs/abp/core/abp.js +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/wwwroot/libs/abp/core/abp.js @@ -1,636 +1,636 @@ -var abp = abp || {}; -(function () { - - /* Application paths *****************************************/ - - //Current application root path (including virtual directory if exists). - abp.appPath = abp.appPath || '/'; - - abp.pageLoadTime = new Date(); - - //Converts given path to absolute path using abp.appPath variable. - abp.toAbsAppPath = function (path) { - if (path.indexOf('/') == 0) { - path = path.substring(1); - } - - return abp.appPath + path; - }; - - /* LOGGING ***************************************************/ - //Implements Logging API that provides secure & controlled usage of console.log - - abp.log = abp.log || {}; - - abp.log.levels = { - DEBUG: 1, - INFO: 2, - WARN: 3, - ERROR: 4, - FATAL: 5 - }; - - abp.log.level = abp.log.levels.DEBUG; - - abp.log.log = function (logObject, logLevel) { - if (!window.console || !window.console.log) { - return; - } - - if (logLevel != undefined && logLevel < abp.log.level) { - return; - } - - console.log(logObject); - }; - - abp.log.debug = function (logObject) { - abp.log.log("DEBUG: ", abp.log.levels.DEBUG); - abp.log.log(logObject, abp.log.levels.DEBUG); - }; - - abp.log.info = function (logObject) { - abp.log.log("INFO: ", abp.log.levels.INFO); - abp.log.log(logObject, abp.log.levels.INFO); - }; - - abp.log.warn = function (logObject) { - abp.log.log("WARN: ", abp.log.levels.WARN); - abp.log.log(logObject, abp.log.levels.WARN); - }; - - abp.log.error = function (logObject) { - abp.log.log("ERROR: ", abp.log.levels.ERROR); - abp.log.log(logObject, abp.log.levels.ERROR); - }; - - abp.log.fatal = function (logObject) { - abp.log.log("FATAL: ", abp.log.levels.FATAL); - abp.log.log(logObject, abp.log.levels.FATAL); - }; - - /* LOCALIZATION ***********************************************/ - - abp.localization = abp.localization || {}; - - abp.localization.values = {}; - - abp.localization.localize = function (key, sourceName) { - sourceName = sourceName || abp.localization.defaultResourceName; - - var source = abp.localization.values[sourceName]; - - if (!source) { - abp.log.warn('Could not find localization source: ' + sourceName); - return key; - } - - var value = source[key]; - if (value == undefined) { - return key; - } - - var copiedArguments = Array.prototype.slice.call(arguments, 0); - copiedArguments.splice(1, 1); - copiedArguments[0] = value; - - return abp.utils.formatString.apply(this, copiedArguments); - }; - - abp.localization.getResource = function (name) { - return function () { - var copiedArguments = Array.prototype.slice.call(arguments, 0); - copiedArguments.splice(1, 0, name); - return abp.localization.localize.apply(this, copiedArguments); - }; - }; - - abp.localization.defaultResourceName = undefined; - - /* AUTHORIZATION **********************************************/ - - abp.auth = abp.auth || {}; - - abp.auth.policies = abp.auth.policies || {}; - - abp.auth.grantedPolicies = abp.auth.grantedPolicies || {}; - - abp.auth.isGranted = function (policyName) { - return abp.auth.policies[policyName] != undefined && abp.auth.grantedPolicies[policyName] != undefined; - }; - - abp.auth.isAnyGranted = function () { - if (!arguments || arguments.length <= 0) { - return true; - } - - for (var i = 0; i < arguments.length; i++) { - if (abp.auth.isGranted(arguments[i])) { - return true; - } - } - - return false; - }; - - abp.auth.areAllGranted = function () { - if (!arguments || arguments.length <= 0) { - return true; - } - - for (var i = 0; i < arguments.length; i++) { - if (!abp.auth.isGranted(arguments[i])) { - return false; - } - } - - return true; - }; - - abp.auth.tokenCookieName = 'Abp.AuthToken'; - - abp.auth.setToken = function (authToken, expireDate) { - abp.utils.setCookieValue(abp.auth.tokenCookieName, authToken, expireDate, abp.appPath, abp.domain); - }; - - abp.auth.getToken = function () { - return abp.utils.getCookieValue(abp.auth.tokenCookieName); - } - - abp.auth.clearToken = function () { - abp.auth.setToken(); - } - - /* SETTINGS *************************************************/ - - abp.setting = abp.setting || {}; - - abp.setting.values = abp.setting.values || {}; - - abp.setting.get = function (name) { - return abp.setting.values[name]; - }; - - abp.setting.getBoolean = function (name) { - var value = abp.setting.get(name); - return value == 'true' || value == 'True'; - }; - - abp.setting.getInt = function (name) { - return parseInt(abp.setting.values[name]); - }; - - /* NOTIFICATION *********************************************/ - //Defines Notification API, not implements it - - abp.notify = abp.notify || {}; - - abp.notify.success = function (message, title, options) { - abp.log.warn('abp.notify.success is not implemented!'); - }; - - abp.notify.info = function (message, title, options) { - abp.log.warn('abp.notify.info is not implemented!'); - }; - - abp.notify.warn = function (message, title, options) { - abp.log.warn('abp.notify.warn is not implemented!'); - }; - - abp.notify.error = function (message, title, options) { - abp.log.warn('abp.notify.error is not implemented!'); - }; - - /* MESSAGE **************************************************/ - //Defines Message API, not implements it - - abp.message = abp.message || {}; - - abp.message._showMessage = function (message, title) { - alert((title || '') + ' ' + message); - }; - - abp.message.info = function (message, title) { - abp.log.warn('abp.message.info is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.success = function (message, title) { - abp.log.warn('abp.message.success is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.warn = function (message, title) { - abp.log.warn('abp.message.warn is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.error = function (message, title) { - abp.log.warn('abp.message.error is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.confirm = function (message, titleOrCallback, callback) { - abp.log.warn('abp.message.confirm is not properly implemented!'); - - if (titleOrCallback && !(typeof titleOrCallback == 'string')) { - callback = titleOrCallback; - } - - var result = confirm(message); - callback && callback(result); - }; - - /* UI *******************************************************/ - - abp.ui = abp.ui || {}; - - /* UI BLOCK */ - //Defines UI Block API and implements basically - - var $abpBlockArea = document.createElement('div'); - $abpBlockArea.classList.add('abp-block-area'); - - /* opts: { //Can be an object with options or a string for query a selector - * elm: a query selector (optional - default: document.body) - * busy: boolean (optional - default: false) - * promise: A promise with always or finally handler (optional - auto unblocks the ui if provided) - * } - */ - abp.ui.block = function (opts) { - if (!opts) { - opts = {}; - } else if (typeof opts == 'string') { - opts = { - elm: opts - }; - } - - var $elm = document.querySelector(opts.elm) || document.body; - - if (opts.busy) { - $abpBlockArea.classList.add('abp-block-area-busy'); - } else { - $abpBlockArea.classList.remove('abp-block-area-busy'); - } - - if (document.querySelector(opts.elm)) { - $abpBlockArea.style.position = 'absolute'; - } else { - $abpBlockArea.style.position = 'fixed'; - } - - $elm.appendChild($abpBlockArea); - - if (opts.promise) { - if (opts.promise.always) { //jQuery.Deferred style - opts.promise.always(function () { - abp.ui.unblock({ - $elm: opts.elm - }); - }); - } else if (opts.promise['finally']) { //Q style - opts.promise['finally'](function () { - abp.ui.unblock({ - $elm: opts.elm - }); - }); - } - } - }; - - /* opts: { - * - * } - */ - abp.ui.unblock = function (opts) { - var element = document.querySelector('.abp-block-area'); - if (element) { - element.classList.add('abp-block-area-disappearing'); - setTimeout(function () { - if (element) { - element.classList.remove('abp-block-area-disappearing'); - element.parentElement.removeChild(element); - } - }, 250); - } - }; - - /* UI BUSY */ - //Defines UI Busy API, not implements it - - abp.ui.setBusy = function (opts) { - if (!opts) { - opts = { - busy: true - }; - } else if (typeof opts == 'string') { - opts = { - elm: opts, - busy: true - }; - } - - abp.ui.block(opts); - }; - - abp.ui.clearBusy = function (opts) { - abp.ui.unblock(opts); - }; - - /* SIMPLE EVENT BUS *****************************************/ - - abp.event = (function () { - - var _callbacks = {}; - - var on = function (eventName, callback) { - if (!_callbacks[eventName]) { - _callbacks[eventName] = []; - } - - _callbacks[eventName].push(callback); - }; - - var off = function (eventName, callback) { - var callbacks = _callbacks[eventName]; - if (!callbacks) { - return; - } - - var index = -1; - for (var i = 0; i < callbacks.length; i++) { - if (callbacks[i] === callback) { - index = i; - break; - } - } - - if (index < 0) { - return; - } - - _callbacks[eventName].splice(index, 1); - }; - - var trigger = function (eventName) { - var callbacks = _callbacks[eventName]; - if (!callbacks || !callbacks.length) { - return; - } - - var args = Array.prototype.slice.call(arguments, 1); - for (var i = 0; i < callbacks.length; i++) { - callbacks[i].apply(this, args); - } - }; - - // Public interface /////////////////////////////////////////////////// - - return { - on: on, - off: off, - trigger: trigger - }; - })(); - - - /* UTILS ***************************************************/ - - abp.utils = abp.utils || {}; - - /* Creates a name namespace. - * Example: - * var taskService = abp.utils.createNamespace(abp, 'services.task'); - * taskService will be equal to abp.services.task - * first argument (root) must be defined first - ************************************************************/ - abp.utils.createNamespace = function (root, ns) { - var parts = ns.split('.'); - for (var i = 0; i < parts.length; i++) { - if (typeof root[parts[i]] == 'undefined') { - root[parts[i]] = {}; - } - - root = root[parts[i]]; - } - - return root; - }; - - /* Find and replaces a string (search) to another string (replacement) in - * given string (str). - * Example: - * abp.utils.replaceAll('This is a test string', 'is', 'X') = 'ThX X a test string' - ************************************************************/ - abp.utils.replaceAll = function (str, search, replacement) { - var fix = search.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); - return str.replace(new RegExp(fix, 'g'), replacement); - }; - - /* Formats a string just like string.format in C#. - * Example: - * abp.utils.formatString('Hello {0}','Tuana') = 'Hello Tuana' - ************************************************************/ - abp.utils.formatString = function () { - if (arguments.length < 1) { - return null; - } - - var str = arguments[0]; - - for (var i = 1; i < arguments.length; i++) { - var placeHolder = '{' + (i - 1) + '}'; - str = abp.utils.replaceAll(str, placeHolder, arguments[i]); - } - - return str; - }; - - abp.utils.toPascalCase = function (str) { - if (!str || !str.length) { - return str; - } - - if (str.length === 1) { - return str.charAt(0).toUpperCase(); - } - - return str.charAt(0).toUpperCase() + str.substr(1); - } - - abp.utils.toCamelCase = function (str) { - if (!str || !str.length) { - return str; - } - - if (str.length === 1) { - return str.charAt(0).toLowerCase(); - } - - return str.charAt(0).toLowerCase() + str.substr(1); - } - - abp.utils.truncateString = function (str, maxLength) { - if (!str || !str.length || str.length <= maxLength) { - return str; - } - - return str.substr(0, maxLength); - }; - - abp.utils.truncateStringWithPostfix = function (str, maxLength, postfix) { - postfix = postfix || '...'; - - if (!str || !str.length || str.length <= maxLength) { - return str; - } - - if (maxLength <= postfix.length) { - return postfix.substr(0, maxLength); - } - - return str.substr(0, maxLength - postfix.length) + postfix; - }; - - abp.utils.isFunction = function (obj) { - return !!(obj && obj.constructor && obj.call && obj.apply); - }; - - /** - * parameterInfos should be an array of { name, value } objects - * where name is query string parameter name and value is it's value. - * includeQuestionMark is true by default. - */ - abp.utils.buildQueryString = function (parameterInfos, includeQuestionMark) { - if (includeQuestionMark === undefined) { - includeQuestionMark = true; - } - - var qs = ''; - - function addSeperator() { - if (!qs.length) { - if (includeQuestionMark) { - qs = qs + '?'; - } - } else { - qs = qs + '&'; - } - } - - for (var i = 0; i < parameterInfos.length; ++i) { - var parameterInfo = parameterInfos[i]; - if (parameterInfo.value === undefined) { - continue; - } - - if (parameterInfo.value === null) { - parameterInfo.value = ''; - } - - addSeperator(); - - if (parameterInfo.value.toJSON && typeof parameterInfo.value.toJSON === "function") { - qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value.toJSON()); - } else if (Array.isArray(parameterInfo.value) && parameterInfo.value.length) { - for (var j = 0; j < parameterInfo.value.length; j++) { - if (j > 0) { - addSeperator(); - } - - qs = qs + parameterInfo.name + '[' + j + ']=' + encodeURIComponent(parameterInfo.value[j]); - } - } else { - qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value); - } - } - - return qs; - } - - /** - * Sets a cookie value for given key. - * This is a simple implementation created to be used by ABP. - * Please use a complete cookie library if you need. - * @param {string} key - * @param {string} value - * @param {Date} expireDate (optional). If not specified the cookie will expire at the end of session. - * @param {string} path (optional) - */ - abp.utils.setCookieValue = function (key, value, expireDate, path) { - var cookieValue = encodeURIComponent(key) + '='; - - if (value) { - cookieValue = cookieValue + encodeURIComponent(value); - } - - if (expireDate) { - cookieValue = cookieValue + "; expires=" + expireDate.toUTCString(); - } - - if (path) { - cookieValue = cookieValue + "; path=" + path; - } - - document.cookie = cookieValue; - }; - - /** - * Gets a cookie with given key. - * This is a simple implementation created to be used by ABP. - * Please use a complete cookie library if you need. - * @param {string} key - * @returns {string} Cookie value or null - */ - abp.utils.getCookieValue = function (key) { - var equalities = document.cookie.split('; '); - for (var i = 0; i < equalities.length; i++) { - if (!equalities[i]) { - continue; - } - - var splitted = equalities[i].split('='); - if (splitted.length != 2) { - continue; - } - - if (decodeURIComponent(splitted[0]) === key) { - return decodeURIComponent(splitted[1] || ''); - } - } - - return null; - }; - - /** - * Deletes cookie for given key. - * This is a simple implementation created to be used by ABP. - * Please use a complete cookie library if you need. - * @param {string} key - * @param {string} path (optional) - */ - abp.utils.deleteCookie = function (key, path) { - var cookieValue = encodeURIComponent(key) + '='; - - cookieValue = cookieValue + "; expires=" + (new Date(new Date().getTime() - 86400000)).toUTCString(); - - if (path) { - cookieValue = cookieValue + "; path=" + path; - } - - document.cookie = cookieValue; - } - - /* SECURITY ***************************************/ - abp.security = abp.security || {}; - abp.security.antiForgery = abp.security.antiForgery || {}; - - abp.security.antiForgery.tokenCookieName = 'XSRF-TOKEN'; - abp.security.antiForgery.tokenHeaderName = 'X-XSRF-TOKEN'; - - abp.security.antiForgery.getToken = function () { - return abp.utils.getCookieValue(abp.security.antiForgery.tokenCookieName); - }; - +var abp = abp || {}; +(function () { + + /* Application paths *****************************************/ + + //Current application root path (including virtual directory if exists). + abp.appPath = abp.appPath || '/'; + + abp.pageLoadTime = new Date(); + + //Converts given path to absolute path using abp.appPath variable. + abp.toAbsAppPath = function (path) { + if (path.indexOf('/') == 0) { + path = path.substring(1); + } + + return abp.appPath + path; + }; + + /* LOGGING ***************************************************/ + //Implements Logging API that provides secure & controlled usage of console.log + + abp.log = abp.log || {}; + + abp.log.levels = { + DEBUG: 1, + INFO: 2, + WARN: 3, + ERROR: 4, + FATAL: 5 + }; + + abp.log.level = abp.log.levels.DEBUG; + + abp.log.log = function (logObject, logLevel) { + if (!window.console || !window.console.log) { + return; + } + + if (logLevel != undefined && logLevel < abp.log.level) { + return; + } + + console.log(logObject); + }; + + abp.log.debug = function (logObject) { + abp.log.log("DEBUG: ", abp.log.levels.DEBUG); + abp.log.log(logObject, abp.log.levels.DEBUG); + }; + + abp.log.info = function (logObject) { + abp.log.log("INFO: ", abp.log.levels.INFO); + abp.log.log(logObject, abp.log.levels.INFO); + }; + + abp.log.warn = function (logObject) { + abp.log.log("WARN: ", abp.log.levels.WARN); + abp.log.log(logObject, abp.log.levels.WARN); + }; + + abp.log.error = function (logObject) { + abp.log.log("ERROR: ", abp.log.levels.ERROR); + abp.log.log(logObject, abp.log.levels.ERROR); + }; + + abp.log.fatal = function (logObject) { + abp.log.log("FATAL: ", abp.log.levels.FATAL); + abp.log.log(logObject, abp.log.levels.FATAL); + }; + + /* LOCALIZATION ***********************************************/ + + abp.localization = abp.localization || {}; + + abp.localization.values = {}; + + abp.localization.localize = function (key, sourceName) { + sourceName = sourceName || abp.localization.defaultResourceName; + + var source = abp.localization.values[sourceName]; + + if (!source) { + abp.log.warn('Could not find localization source: ' + sourceName); + return key; + } + + var value = source[key]; + if (value == undefined) { + return key; + } + + var copiedArguments = Array.prototype.slice.call(arguments, 0); + copiedArguments.splice(1, 1); + copiedArguments[0] = value; + + return abp.utils.formatString.apply(this, copiedArguments); + }; + + abp.localization.getResource = function (name) { + return function () { + var copiedArguments = Array.prototype.slice.call(arguments, 0); + copiedArguments.splice(1, 0, name); + return abp.localization.localize.apply(this, copiedArguments); + }; + }; + + abp.localization.defaultResourceName = undefined; + + /* AUTHORIZATION **********************************************/ + + abp.auth = abp.auth || {}; + + abp.auth.policies = abp.auth.policies || {}; + + abp.auth.grantedPolicies = abp.auth.grantedPolicies || {}; + + abp.auth.isGranted = function (policyName) { + return abp.auth.policies[policyName] != undefined && abp.auth.grantedPolicies[policyName] != undefined; + }; + + abp.auth.isAnyGranted = function () { + if (!arguments || arguments.length <= 0) { + return true; + } + + for (var i = 0; i < arguments.length; i++) { + if (abp.auth.isGranted(arguments[i])) { + return true; + } + } + + return false; + }; + + abp.auth.areAllGranted = function () { + if (!arguments || arguments.length <= 0) { + return true; + } + + for (var i = 0; i < arguments.length; i++) { + if (!abp.auth.isGranted(arguments[i])) { + return false; + } + } + + return true; + }; + + abp.auth.tokenCookieName = 'Abp.AuthToken'; + + abp.auth.setToken = function (authToken, expireDate) { + abp.utils.setCookieValue(abp.auth.tokenCookieName, authToken, expireDate, abp.appPath, abp.domain); + }; + + abp.auth.getToken = function () { + return abp.utils.getCookieValue(abp.auth.tokenCookieName); + } + + abp.auth.clearToken = function () { + abp.auth.setToken(); + } + + /* SETTINGS *************************************************/ + + abp.setting = abp.setting || {}; + + abp.setting.values = abp.setting.values || {}; + + abp.setting.get = function (name) { + return abp.setting.values[name]; + }; + + abp.setting.getBoolean = function (name) { + var value = abp.setting.get(name); + return value == 'true' || value == 'True'; + }; + + abp.setting.getInt = function (name) { + return parseInt(abp.setting.values[name]); + }; + + /* NOTIFICATION *********************************************/ + //Defines Notification API, not implements it + + abp.notify = abp.notify || {}; + + abp.notify.success = function (message, title, options) { + abp.log.warn('abp.notify.success is not implemented!'); + }; + + abp.notify.info = function (message, title, options) { + abp.log.warn('abp.notify.info is not implemented!'); + }; + + abp.notify.warn = function (message, title, options) { + abp.log.warn('abp.notify.warn is not implemented!'); + }; + + abp.notify.error = function (message, title, options) { + abp.log.warn('abp.notify.error is not implemented!'); + }; + + /* MESSAGE **************************************************/ + //Defines Message API, not implements it + + abp.message = abp.message || {}; + + abp.message._showMessage = function (message, title) { + alert((title || '') + ' ' + message); + }; + + abp.message.info = function (message, title) { + abp.log.warn('abp.message.info is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.success = function (message, title) { + abp.log.warn('abp.message.success is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.warn = function (message, title) { + abp.log.warn('abp.message.warn is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.error = function (message, title) { + abp.log.warn('abp.message.error is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.confirm = function (message, titleOrCallback, callback) { + abp.log.warn('abp.message.confirm is not properly implemented!'); + + if (titleOrCallback && !(typeof titleOrCallback == 'string')) { + callback = titleOrCallback; + } + + var result = confirm(message); + callback && callback(result); + }; + + /* UI *******************************************************/ + + abp.ui = abp.ui || {}; + + /* UI BLOCK */ + //Defines UI Block API and implements basically + + var $abpBlockArea = document.createElement('div'); + $abpBlockArea.classList.add('abp-block-area'); + + /* opts: { //Can be an object with options or a string for query a selector + * elm: a query selector (optional - default: document.body) + * busy: boolean (optional - default: false) + * promise: A promise with always or finally handler (optional - auto unblocks the ui if provided) + * } + */ + abp.ui.block = function (opts) { + if (!opts) { + opts = {}; + } else if (typeof opts == 'string') { + opts = { + elm: opts + }; + } + + var $elm = document.querySelector(opts.elm) || document.body; + + if (opts.busy) { + $abpBlockArea.classList.add('abp-block-area-busy'); + } else { + $abpBlockArea.classList.remove('abp-block-area-busy'); + } + + if (document.querySelector(opts.elm)) { + $abpBlockArea.style.position = 'absolute'; + } else { + $abpBlockArea.style.position = 'fixed'; + } + + $elm.appendChild($abpBlockArea); + + if (opts.promise) { + if (opts.promise.always) { //jQuery.Deferred style + opts.promise.always(function () { + abp.ui.unblock({ + $elm: opts.elm + }); + }); + } else if (opts.promise['finally']) { //Q style + opts.promise['finally'](function () { + abp.ui.unblock({ + $elm: opts.elm + }); + }); + } + } + }; + + /* opts: { + * + * } + */ + abp.ui.unblock = function (opts) { + var element = document.querySelector('.abp-block-area'); + if (element) { + element.classList.add('abp-block-area-disappearing'); + setTimeout(function () { + if (element) { + element.classList.remove('abp-block-area-disappearing'); + element.parentElement.removeChild(element); + } + }, 250); + } + }; + + /* UI BUSY */ + //Defines UI Busy API, not implements it + + abp.ui.setBusy = function (opts) { + if (!opts) { + opts = { + busy: true + }; + } else if (typeof opts == 'string') { + opts = { + elm: opts, + busy: true + }; + } + + abp.ui.block(opts); + }; + + abp.ui.clearBusy = function (opts) { + abp.ui.unblock(opts); + }; + + /* SIMPLE EVENT BUS *****************************************/ + + abp.event = (function () { + + var _callbacks = {}; + + var on = function (eventName, callback) { + if (!_callbacks[eventName]) { + _callbacks[eventName] = []; + } + + _callbacks[eventName].push(callback); + }; + + var off = function (eventName, callback) { + var callbacks = _callbacks[eventName]; + if (!callbacks) { + return; + } + + var index = -1; + for (var i = 0; i < callbacks.length; i++) { + if (callbacks[i] === callback) { + index = i; + break; + } + } + + if (index < 0) { + return; + } + + _callbacks[eventName].splice(index, 1); + }; + + var trigger = function (eventName) { + var callbacks = _callbacks[eventName]; + if (!callbacks || !callbacks.length) { + return; + } + + var args = Array.prototype.slice.call(arguments, 1); + for (var i = 0; i < callbacks.length; i++) { + callbacks[i].apply(this, args); + } + }; + + // Public interface /////////////////////////////////////////////////// + + return { + on: on, + off: off, + trigger: trigger + }; + })(); + + + /* UTILS ***************************************************/ + + abp.utils = abp.utils || {}; + + /* Creates a name namespace. + * Example: + * var taskService = abp.utils.createNamespace(abp, 'services.task'); + * taskService will be equal to abp.services.task + * first argument (root) must be defined first + ************************************************************/ + abp.utils.createNamespace = function (root, ns) { + var parts = ns.split('.'); + for (var i = 0; i < parts.length; i++) { + if (typeof root[parts[i]] == 'undefined') { + root[parts[i]] = {}; + } + + root = root[parts[i]]; + } + + return root; + }; + + /* Find and replaces a string (search) to another string (replacement) in + * given string (str). + * Example: + * abp.utils.replaceAll('This is a test string', 'is', 'X') = 'ThX X a test string' + ************************************************************/ + abp.utils.replaceAll = function (str, search, replacement) { + var fix = search.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); + return str.replace(new RegExp(fix, 'g'), replacement); + }; + + /* Formats a string just like string.format in C#. + * Example: + * abp.utils.formatString('Hello {0}','Tuana') = 'Hello Tuana' + ************************************************************/ + abp.utils.formatString = function () { + if (arguments.length < 1) { + return null; + } + + var str = arguments[0]; + + for (var i = 1; i < arguments.length; i++) { + var placeHolder = '{' + (i - 1) + '}'; + str = abp.utils.replaceAll(str, placeHolder, arguments[i]); + } + + return str; + }; + + abp.utils.toPascalCase = function (str) { + if (!str || !str.length) { + return str; + } + + if (str.length === 1) { + return str.charAt(0).toUpperCase(); + } + + return str.charAt(0).toUpperCase() + str.substr(1); + } + + abp.utils.toCamelCase = function (str) { + if (!str || !str.length) { + return str; + } + + if (str.length === 1) { + return str.charAt(0).toLowerCase(); + } + + return str.charAt(0).toLowerCase() + str.substr(1); + } + + abp.utils.truncateString = function (str, maxLength) { + if (!str || !str.length || str.length <= maxLength) { + return str; + } + + return str.substr(0, maxLength); + }; + + abp.utils.truncateStringWithPostfix = function (str, maxLength, postfix) { + postfix = postfix || '...'; + + if (!str || !str.length || str.length <= maxLength) { + return str; + } + + if (maxLength <= postfix.length) { + return postfix.substr(0, maxLength); + } + + return str.substr(0, maxLength - postfix.length) + postfix; + }; + + abp.utils.isFunction = function (obj) { + return !!(obj && obj.constructor && obj.call && obj.apply); + }; + + /** + * parameterInfos should be an array of { name, value } objects + * where name is query string parameter name and value is it's value. + * includeQuestionMark is true by default. + */ + abp.utils.buildQueryString = function (parameterInfos, includeQuestionMark) { + if (includeQuestionMark === undefined) { + includeQuestionMark = true; + } + + var qs = ''; + + function addSeperator() { + if (!qs.length) { + if (includeQuestionMark) { + qs = qs + '?'; + } + } else { + qs = qs + '&'; + } + } + + for (var i = 0; i < parameterInfos.length; ++i) { + var parameterInfo = parameterInfos[i]; + if (parameterInfo.value === undefined) { + continue; + } + + if (parameterInfo.value === null) { + parameterInfo.value = ''; + } + + addSeperator(); + + if (parameterInfo.value.toJSON && typeof parameterInfo.value.toJSON === "function") { + qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value.toJSON()); + } else if (Array.isArray(parameterInfo.value) && parameterInfo.value.length) { + for (var j = 0; j < parameterInfo.value.length; j++) { + if (j > 0) { + addSeperator(); + } + + qs = qs + parameterInfo.name + '[' + j + ']=' + encodeURIComponent(parameterInfo.value[j]); + } + } else { + qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value); + } + } + + return qs; + } + + /** + * Sets a cookie value for given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @param {string} value + * @param {Date} expireDate (optional). If not specified the cookie will expire at the end of session. + * @param {string} path (optional) + */ + abp.utils.setCookieValue = function (key, value, expireDate, path) { + var cookieValue = encodeURIComponent(key) + '='; + + if (value) { + cookieValue = cookieValue + encodeURIComponent(value); + } + + if (expireDate) { + cookieValue = cookieValue + "; expires=" + expireDate.toUTCString(); + } + + if (path) { + cookieValue = cookieValue + "; path=" + path; + } + + document.cookie = cookieValue; + }; + + /** + * Gets a cookie with given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @returns {string} Cookie value or null + */ + abp.utils.getCookieValue = function (key) { + var equalities = document.cookie.split('; '); + for (var i = 0; i < equalities.length; i++) { + if (!equalities[i]) { + continue; + } + + var splitted = equalities[i].split('='); + if (splitted.length != 2) { + continue; + } + + if (decodeURIComponent(splitted[0]) === key) { + return decodeURIComponent(splitted[1] || ''); + } + } + + return null; + }; + + /** + * Deletes cookie for given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @param {string} path (optional) + */ + abp.utils.deleteCookie = function (key, path) { + var cookieValue = encodeURIComponent(key) + '='; + + cookieValue = cookieValue + "; expires=" + (new Date(new Date().getTime() - 86400000)).toUTCString(); + + if (path) { + cookieValue = cookieValue + "; path=" + path; + } + + document.cookie = cookieValue; + } + + /* SECURITY ***************************************/ + abp.security = abp.security || {}; + abp.security.antiForgery = abp.security.antiForgery || {}; + + abp.security.antiForgery.tokenCookieName = 'XSRF-TOKEN'; + abp.security.antiForgery.tokenHeaderName = 'X-XSRF-TOKEN'; + + abp.security.antiForgery.getToken = function () { + return abp.utils.getCookieValue(abp.security.antiForgery.tokenCookieName); + }; + })(); \ No newline at end of file diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/wwwroot/libs/abp/jquery/abp.jquery.js b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/wwwroot/libs/abp/jquery/abp.jquery.js index 6e2ee001b8..e6aff047f7 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/wwwroot/libs/abp/jquery/abp.jquery.js +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/wwwroot/libs/abp/jquery/abp.jquery.js @@ -1,393 +1,393 @@ -var abp = abp || {}; -(function($) { - - if (!$) { - throw "abp/jquery library requires the jquery library included to the page!"; - } - - // ABP CORE OVERRIDES ///////////////////////////////////////////////////// - - abp.message._showMessage = function (message, title) { - alert((title || '') + ' ' + message); - - return $.Deferred(function ($dfd) { - $dfd.resolve(); - }); - }; - - abp.message.confirm = function (message, titleOrCallback, callback) { - if (titleOrCallback && !(typeof titleOrCallback == 'string')) { - callback = titleOrCallback; - } - - var result = confirm(message); - callback && callback(result); - - return $.Deferred(function ($dfd) { - $dfd.resolve(result); - }); - }; - - abp.utils.isFunction = function (obj) { - return $.isFunction(obj); - }; - - // JQUERY EXTENSIONS ////////////////////////////////////////////////////// - - $.fn.findWithSelf = function (selector) { - return this.filter(selector).add(this.find(selector)); - }; - - // DOM //////////////////////////////////////////////////////////////////// - - abp.dom = abp.dom || {}; - - abp.dom.onNodeAdded = function (callback) { - abp.event.on('abp.dom.nodeAdded', callback); - }; - - abp.dom.onNodeRemoved = function (callback) { - abp.event.on('abp.dom.nodeRemoved', callback); - }; - - var mutationObserverCallback = function (mutationsList) { - for (var i = 0; i < mutationsList.length; i++) { - var mutation = mutationsList[i]; - if (mutation.type === 'childList') { - if (mutation.addedNodes && mutation.removedNodes.length) { - for (var k = 0; k < mutation.removedNodes.length; k++) { - abp.event.trigger( - 'abp.dom.nodeRemoved', - { - $el: $(mutation.removedNodes[k]) - } - ); - } - } - - if (mutation.addedNodes && mutation.addedNodes.length) { - for (var j = 0; j < mutation.addedNodes.length; j++) { - abp.event.trigger( - 'abp.dom.nodeAdded', - { - $el: $(mutation.addedNodes[j]) - } - ); - } - } - } - } - }; - - new MutationObserver(mutationObserverCallback).observe( - $('body')[0], - { - subtree: true, - childList: true - } - ); - - // AJAX /////////////////////////////////////////////////////////////////// - - abp.ajax = function (userOptions) { - userOptions = userOptions || {}; - - var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); - - options.success = undefined; - options.error = undefined; - - return $.Deferred(function ($dfd) { - $.ajax(options) - .done(function (data, textStatus, jqXHR) { - $dfd.resolve(data); - userOptions.success && userOptions.success(data); - }).fail(function (jqXHR) { - if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { - abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); - } else { - abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); - } - }); - }); - }; - - $.extend(abp.ajax, { - defaultOpts: { - dataType: 'json', - type: 'POST', - contentType: 'application/json', - headers: { - 'X-Requested-With': 'XMLHttpRequest' - } - }, - - defaultError: { - message: 'An error has occurred!', - details: 'Error detail not sent by server.' - }, - - defaultError401: { - message: 'You are not authenticated!', - details: 'You should be authenticated (sign in) in order to perform this operation.' - }, - - defaultError403: { - message: 'You are not authorized!', - details: 'You are not allowed to perform this operation.' - }, - - defaultError404: { - message: 'Resource not found!', - details: 'The resource requested could not found on the server.' - }, - - logError: function (error) { - abp.log.error(error); - }, - - showError: function (error) { - if (error.details) { - return abp.message.error(error.details, error.message); - } else { - return abp.message.error(error.message || abp.ajax.defaultError.message); - } - }, - - handleTargetUrl: function (targetUrl) { - if (!targetUrl) { - location.href = abp.appPath; - } else { - location.href = targetUrl; - } - }, - - handleErrorStatusCode: function (status) { - switch (status) { - case 401: - abp.ajax.handleUnAuthorizedRequest( - abp.ajax.showError(abp.ajax.defaultError401), - abp.appPath - ); - break; - case 403: - abp.ajax.showError(abp.ajax.defaultError403); - break; - case 404: - abp.ajax.showError(abp.ajax.defaultError404); - break; - default: - abp.ajax.showError(abp.ajax.defaultError); - break; - } - }, - - handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { - if (userOptions.abpHandleError !== false) { - abp.ajax.handleErrorStatusCode(jqXHR.status); - } - - $dfd.reject.apply(this, arguments); - userOptions.error && userOptions.error.apply(this, arguments); - }, - - handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { - var messagePromise = null; - - if (userOptions.abpHandleError !== false) { - messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); - } - - abp.ajax.logError(jqXHR.responseJSON.error); - - $dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); - userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); - - if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { - abp.ajax.handleUnAuthorizedRequest(messagePromise); - } - }, - - handleUnAuthorizedRequest: function (messagePromise, targetUrl) { - if (messagePromise) { - messagePromise.done(function () { - abp.ajax.handleTargetUrl(targetUrl); - }); - } else { - abp.ajax.handleTargetUrl(targetUrl); - } - }, - - blockUI: function (options) { - if (options.blockUI) { - if (options.blockUI === true) { //block whole page - abp.ui.setBusy(); - } else { //block an element - abp.ui.setBusy(options.blockUI); - } - } - }, - - unblockUI: function (options) { - if (options.blockUI) { - if (options.blockUI === true) { //unblock whole page - abp.ui.clearBusy(); - } else { //unblock an element - abp.ui.clearBusy(options.blockUI); - } - } - }, - - ajaxSendHandler: function (event, request, settings) { - var token = abp.security.antiForgery.getToken(); - if (!token) { - return; - } - - if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { - request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); - } - } - }); - - $(document).ajaxSend(function (event, request, settings) { - return abp.ajax.ajaxSendHandler(event, request, settings); - }); - - abp.event.on('abp.configurationInitialized', function () { - var l = abp.localization.getResource('AbpUi'); - - abp.ajax.defaultError.message = l('DefaultErrorMessage'); - abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); - abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); - abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); - abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); - abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); - abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); - abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); - }); - - // RESOURCE LOADER //////////////////////////////////////////////////////// - - /* UrlStates enum */ - var UrlStates = { - LOADING: 'LOADING', - LOADED: 'LOADED', - FAILED: 'FAILED' - }; - - /* UrlInfo class */ - function UrlInfo(url) { - this.url = url; - this.state = UrlStates.LOADING; - this.loadCallbacks = []; - this.failCallbacks = []; - } - - UrlInfo.prototype.succeed = function () { - this.state = UrlStates.LOADED; - for (var i = 0; i < this.loadCallbacks.length; i++) { - this.loadCallbacks[i](); - } - }; - - UrlInfo.prototype.failed = function () { - this.state = UrlStates.FAILED; - for (var i = 0; i < this.failCallbacks.length; i++) { - this.failCallbacks[i](); - } - }; - - UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { - switch (this.state) { - case UrlStates.LOADED: - loadCallback && loadCallback(); - break; - case UrlStates.FAILED: - failCallback && failCallback(); - break; - case UrlStates.LOADING: - this.addCallbacks(loadCallback, failCallback); - break; - } - }; - - UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { - loadCallback && this.loadCallbacks.push(loadCallback); - failCallback && this.failCallbacks.push(failCallback); - }; - - /* ResourceLoader API */ - - abp.ResourceLoader = (function () { - - var _urlInfos = {}; - - function getCacheKey(url) { - return url; - } - - function appendTimeToUrl(url) { - - if (url.indexOf('?') < 0) { - url += '?'; - } else { - url += '&'; - } - - url += '_=' + new Date().getTime(); - - return url; - } - - var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { - - var cacheKey = getCacheKey(url); - - var urlInfo = _urlInfos[cacheKey]; - - if (urlInfo) { - urlInfo.handleCallbacks(loadCallback, failCallback); - return; - } - - _urlInfos[cacheKey] = urlInfo = new UrlInfo(url); - urlInfo.addCallbacks(loadCallback, failCallback); - - serverLoader(urlInfo); - }; - - var _loadScript = function (url, loadCallback, failCallback) { - _loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { - $.get({ - url: url, - dataType: 'text' - }) - .done(function (script) { - $.globalEval(script); - urlInfo.succeed(); - }) - .fail(function () { - urlInfo.failed(); - }); - }); - }; - - var _loadStyle = function (url) { - _loadFromUrl(url, undefined, undefined, function (urlInfo) { - - $('', { - rel: 'stylesheet', - type: 'text/css', - href: appendTimeToUrl(url) - }).appendTo('head'); - }); - }; - - return { - loadScript: _loadScript, - loadStyle: _loadStyle - } - })(); - +var abp = abp || {}; +(function($) { + + if (!$) { + throw "abp/jquery library requires the jquery library included to the page!"; + } + + // ABP CORE OVERRIDES ///////////////////////////////////////////////////// + + abp.message._showMessage = function (message, title) { + alert((title || '') + ' ' + message); + + return $.Deferred(function ($dfd) { + $dfd.resolve(); + }); + }; + + abp.message.confirm = function (message, titleOrCallback, callback) { + if (titleOrCallback && !(typeof titleOrCallback == 'string')) { + callback = titleOrCallback; + } + + var result = confirm(message); + callback && callback(result); + + return $.Deferred(function ($dfd) { + $dfd.resolve(result); + }); + }; + + abp.utils.isFunction = function (obj) { + return $.isFunction(obj); + }; + + // JQUERY EXTENSIONS ////////////////////////////////////////////////////// + + $.fn.findWithSelf = function (selector) { + return this.filter(selector).add(this.find(selector)); + }; + + // DOM //////////////////////////////////////////////////////////////////// + + abp.dom = abp.dom || {}; + + abp.dom.onNodeAdded = function (callback) { + abp.event.on('abp.dom.nodeAdded', callback); + }; + + abp.dom.onNodeRemoved = function (callback) { + abp.event.on('abp.dom.nodeRemoved', callback); + }; + + var mutationObserverCallback = function (mutationsList) { + for (var i = 0; i < mutationsList.length; i++) { + var mutation = mutationsList[i]; + if (mutation.type === 'childList') { + if (mutation.addedNodes && mutation.removedNodes.length) { + for (var k = 0; k < mutation.removedNodes.length; k++) { + abp.event.trigger( + 'abp.dom.nodeRemoved', + { + $el: $(mutation.removedNodes[k]) + } + ); + } + } + + if (mutation.addedNodes && mutation.addedNodes.length) { + for (var j = 0; j < mutation.addedNodes.length; j++) { + abp.event.trigger( + 'abp.dom.nodeAdded', + { + $el: $(mutation.addedNodes[j]) + } + ); + } + } + } + } + }; + + new MutationObserver(mutationObserverCallback).observe( + $('body')[0], + { + subtree: true, + childList: true + } + ); + + // AJAX /////////////////////////////////////////////////////////////////// + + abp.ajax = function (userOptions) { + userOptions = userOptions || {}; + + var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); + + options.success = undefined; + options.error = undefined; + + return $.Deferred(function ($dfd) { + $.ajax(options) + .done(function (data, textStatus, jqXHR) { + $dfd.resolve(data); + userOptions.success && userOptions.success(data); + }).fail(function (jqXHR) { + if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { + abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); + } else { + abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); + } + }); + }); + }; + + $.extend(abp.ajax, { + defaultOpts: { + dataType: 'json', + type: 'POST', + contentType: 'application/json', + headers: { + 'X-Requested-With': 'XMLHttpRequest' + } + }, + + defaultError: { + message: 'An error has occurred!', + details: 'Error detail not sent by server.' + }, + + defaultError401: { + message: 'You are not authenticated!', + details: 'You should be authenticated (sign in) in order to perform this operation.' + }, + + defaultError403: { + message: 'You are not authorized!', + details: 'You are not allowed to perform this operation.' + }, + + defaultError404: { + message: 'Resource not found!', + details: 'The resource requested could not found on the server.' + }, + + logError: function (error) { + abp.log.error(error); + }, + + showError: function (error) { + if (error.details) { + return abp.message.error(error.details, error.message); + } else { + return abp.message.error(error.message || abp.ajax.defaultError.message); + } + }, + + handleTargetUrl: function (targetUrl) { + if (!targetUrl) { + location.href = abp.appPath; + } else { + location.href = targetUrl; + } + }, + + handleErrorStatusCode: function (status) { + switch (status) { + case 401: + abp.ajax.handleUnAuthorizedRequest( + abp.ajax.showError(abp.ajax.defaultError401), + abp.appPath + ); + break; + case 403: + abp.ajax.showError(abp.ajax.defaultError403); + break; + case 404: + abp.ajax.showError(abp.ajax.defaultError404); + break; + default: + abp.ajax.showError(abp.ajax.defaultError); + break; + } + }, + + handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { + if (userOptions.abpHandleError !== false) { + abp.ajax.handleErrorStatusCode(jqXHR.status); + } + + $dfd.reject.apply(this, arguments); + userOptions.error && userOptions.error.apply(this, arguments); + }, + + handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { + var messagePromise = null; + + if (userOptions.abpHandleError !== false) { + messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); + } + + abp.ajax.logError(jqXHR.responseJSON.error); + + $dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); + userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); + + if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { + abp.ajax.handleUnAuthorizedRequest(messagePromise); + } + }, + + handleUnAuthorizedRequest: function (messagePromise, targetUrl) { + if (messagePromise) { + messagePromise.done(function () { + abp.ajax.handleTargetUrl(targetUrl); + }); + } else { + abp.ajax.handleTargetUrl(targetUrl); + } + }, + + blockUI: function (options) { + if (options.blockUI) { + if (options.blockUI === true) { //block whole page + abp.ui.setBusy(); + } else { //block an element + abp.ui.setBusy(options.blockUI); + } + } + }, + + unblockUI: function (options) { + if (options.blockUI) { + if (options.blockUI === true) { //unblock whole page + abp.ui.clearBusy(); + } else { //unblock an element + abp.ui.clearBusy(options.blockUI); + } + } + }, + + ajaxSendHandler: function (event, request, settings) { + var token = abp.security.antiForgery.getToken(); + if (!token) { + return; + } + + if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { + request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); + } + } + }); + + $(document).ajaxSend(function (event, request, settings) { + return abp.ajax.ajaxSendHandler(event, request, settings); + }); + + abp.event.on('abp.configurationInitialized', function () { + var l = abp.localization.getResource('AbpUi'); + + abp.ajax.defaultError.message = l('DefaultErrorMessage'); + abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); + abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); + abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); + abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); + abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); + abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); + abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); + }); + + // RESOURCE LOADER //////////////////////////////////////////////////////// + + /* UrlStates enum */ + var UrlStates = { + LOADING: 'LOADING', + LOADED: 'LOADED', + FAILED: 'FAILED' + }; + + /* UrlInfo class */ + function UrlInfo(url) { + this.url = url; + this.state = UrlStates.LOADING; + this.loadCallbacks = []; + this.failCallbacks = []; + } + + UrlInfo.prototype.succeed = function () { + this.state = UrlStates.LOADED; + for (var i = 0; i < this.loadCallbacks.length; i++) { + this.loadCallbacks[i](); + } + }; + + UrlInfo.prototype.failed = function () { + this.state = UrlStates.FAILED; + for (var i = 0; i < this.failCallbacks.length; i++) { + this.failCallbacks[i](); + } + }; + + UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { + switch (this.state) { + case UrlStates.LOADED: + loadCallback && loadCallback(); + break; + case UrlStates.FAILED: + failCallback && failCallback(); + break; + case UrlStates.LOADING: + this.addCallbacks(loadCallback, failCallback); + break; + } + }; + + UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { + loadCallback && this.loadCallbacks.push(loadCallback); + failCallback && this.failCallbacks.push(failCallback); + }; + + /* ResourceLoader API */ + + abp.ResourceLoader = (function () { + + var _urlInfos = {}; + + function getCacheKey(url) { + return url; + } + + function appendTimeToUrl(url) { + + if (url.indexOf('?') < 0) { + url += '?'; + } else { + url += '&'; + } + + url += '_=' + new Date().getTime(); + + return url; + } + + var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { + + var cacheKey = getCacheKey(url); + + var urlInfo = _urlInfos[cacheKey]; + + if (urlInfo) { + urlInfo.handleCallbacks(loadCallback, failCallback); + return; + } + + _urlInfos[cacheKey] = urlInfo = new UrlInfo(url); + urlInfo.addCallbacks(loadCallback, failCallback); + + serverLoader(urlInfo); + }; + + var _loadScript = function (url, loadCallback, failCallback) { + _loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { + $.get({ + url: url, + dataType: 'text' + }) + .done(function (script) { + $.globalEval(script); + urlInfo.succeed(); + }) + .fail(function () { + urlInfo.failed(); + }); + }); + }; + + var _loadStyle = function (url) { + _loadFromUrl(url, undefined, undefined, function (urlInfo) { + + $('', { + rel: 'stylesheet', + type: 'text/css', + href: appendTimeToUrl(url) + }).appendTo('head'); + }); + }; + + return { + loadScript: _loadScript, + loadStyle: _loadStyle + } + })(); + })(jQuery); \ No newline at end of file diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/yarn.lock b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/yarn.lock index 7230736133..b3b0eb268b 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/yarn.lock +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/yarn.lock @@ -2,37 +2,37 @@ # yarn lockfile v1 -"@abp/aspnetcore.mvc.ui.theme.basic@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-2.1.0.tgz#f815001bd856fb5cbdd0b736181f2401a1a7ec62" - integrity sha512-ej6dhUo3H9w6bpBTpMhk3M6zbC3fVAVMm5yLSYlYJ0sQxjb9PqC02OgiJme0mkxCUMwPuHVSQLrMQbioXdZu3A== +"@abp/aspnetcore.mvc.ui.theme.basic@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-2.2.0.tgz#e7f4e57d2b17cc76388e9c56bc34d50c9658873b" + integrity sha512-S9GQ9YVg4DWrgjujwiXBER6KqdqW5nZ1Bmt+YEePn5gEoPvoVrh6ojthpHYRjBJtGFqBSzRAQ9eVZLebT22Ozg== dependencies: - "@abp/aspnetcore.mvc.ui.theme.shared" "^2.1.0" + "@abp/aspnetcore.mvc.ui.theme.shared" "^2.2.0" -"@abp/aspnetcore.mvc.ui.theme.shared@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-2.1.0.tgz#c2790241b5a44b9d6e4f65911a1b9d9e9104ed82" - integrity sha512-dxC0P/b1T+QJmRrB8HoLM7/GkWblz/X5lLqgn583W7/OTYhvxIxszuRDy/XIEuS+fP6a9rcGvGu5jcKJEqe/xA== - dependencies: - "@abp/aspnetcore.mvc.ui" "^2.1.0" - "@abp/bootstrap" "^2.1.0" - "@abp/bootstrap-datepicker" "^2.1.0" - "@abp/datatables.net-bs4" "^2.1.0" - "@abp/font-awesome" "^2.1.0" - "@abp/jquery-form" "^2.1.0" - "@abp/jquery-validation-unobtrusive" "^2.1.0" - "@abp/lodash" "^2.1.0" - "@abp/luxon" "^2.1.0" - "@abp/malihu-custom-scrollbar-plugin" "^2.1.0" - "@abp/select2" "^2.1.0" - "@abp/sweetalert" "^2.1.0" - "@abp/timeago" "^2.1.0" - "@abp/toastr" "^2.1.0" - -"@abp/aspnetcore.mvc.ui@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-2.1.0.tgz#3c86f42e52af3151d2aee0ffdd1281014ea61054" - integrity sha512-pKiKMBOPuLm7p44DW8DdbsVn5PY3NqGYkz6gf75uzxyWiVYyl2CM/bvX9w4Ie7Q969owENMLrBREN6ezWZ5ynA== +"@abp/aspnetcore.mvc.ui.theme.shared@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-2.2.0.tgz#e0df953853be2a184d323931573f9f98aebbaa62" + integrity sha512-urxziaCdvfEqN5cjiiM5f5dx2Yr+AoGqCJVCo0Okjl2dosdaj5DH4SBzMvKAaLXzo3Ep1h4b3Wvws4BThL/6rA== + dependencies: + "@abp/aspnetcore.mvc.ui" "^2.2.0" + "@abp/bootstrap" "^2.2.0" + "@abp/bootstrap-datepicker" "^2.2.0" + "@abp/datatables.net-bs4" "^2.2.0" + "@abp/font-awesome" "^2.2.0" + "@abp/jquery-form" "^2.2.0" + "@abp/jquery-validation-unobtrusive" "^2.2.0" + "@abp/lodash" "^2.2.0" + "@abp/luxon" "^2.2.0" + "@abp/malihu-custom-scrollbar-plugin" "^2.2.0" + "@abp/select2" "^2.2.0" + "@abp/sweetalert" "^2.2.0" + "@abp/timeago" "^2.2.0" + "@abp/toastr" "^2.2.0" + +"@abp/aspnetcore.mvc.ui@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-2.2.0.tgz#b2cdd421eed09ec1d30ae85e14434b7efc094ade" + integrity sha512-IO/AjhJu+LUa9zOaT8JlEnV+Pcp9oQ3q9kTq8kmMakC35vTIyvBpB3nnykXIOytZSyjsBgFYB/uMxPgBOjWagg== dependencies: ansi-colors "^4.1.1" extend-object "^1.0.0" @@ -41,135 +41,135 @@ path "^0.12.7" rimraf "^3.0.0" -"@abp/bootstrap-datepicker@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-2.1.0.tgz#a0d71da15cb3d3cc02f9a390437a44db5e9f9ea1" - integrity sha512-lkNI0iyefiXS2O5x9Ae9eJQLPXSQlOWDX7QhKnBHLR9JxjJEnhBUIIOylMltAIqtVDtjk2ikDyd3BAiyBdtB/w== +"@abp/bootstrap-datepicker@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-2.2.0.tgz#a2f50b422824f18ed4b7e80be6852e2979119f8e" + integrity sha512-X9jT5mU42QFfVhOZdun7aEJUf3bMko6NsG3NFQVjqTqKH+iYGKfHPFpXD0gP/6Nb4KgZUdId8hSyQTZyOK2JEA== dependencies: bootstrap-datepicker "^1.9.0" -"@abp/bootstrap@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-2.1.0.tgz#7ce15d4effac0e0991a3520c4666c6cb17a3fef2" - integrity sha512-1xQjqu6shCgzd1FI94y5AIXGIhBlZEoRrOhaT84j/2KzYiDvhP+LAqQjMgqlQmBLs6vMckpxtf5thxKTMXvtOw== +"@abp/bootstrap@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-2.2.0.tgz#16e41d3432117bbcd9012c6f735c49c543255879" + integrity sha512-aRmluu6SkIl+JgCzSSJZrDPkYr6WWaQdY0iJAOz6NHtffa7Aumh1IUOrLVKL0T1pQn6QKs0Z7JDGyYMdh1HPkQ== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" bootstrap "^4.3.1" -"@abp/core@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/core/-/core-2.1.0.tgz#0cd2850f029df1d18517b8e74c70341972c37ed7" - integrity sha512-1wnRo00hWncZWSakaEXm388XhhbKXDVkWDIdaT3kyQpvp3kX1lFx7I5iiZiwIeULwZRF9mi6HV6iHEze58x0kQ== +"@abp/core@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/core/-/core-2.2.0.tgz#4eea0a06458c90acb8566a11eb841fe65d15d256" + integrity sha512-tBGHa5CUr0ewT31g689RAfQ6Su2p4uyn2PzmrW/8lahBrvqkoCb41fkCDLQJkTY5rKPrEKZd/s9OoyOnS20DLg== -"@abp/datatables.net-bs4@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-2.1.0.tgz#a0f36cf4e3ef96ae03aa4b9956fcb8b971c854cb" - integrity sha512-93qc2rrGs+JKRPM/7UCasa5VmfswgYU8cv3Ybg5OKoaASODYUn06GChRFnd/mvqcDxw4+8gaqpC3U2ETZZI4pA== +"@abp/datatables.net-bs4@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-2.2.0.tgz#c7cc49e889b295ae10fb24ed62b154ef79ffc85a" + integrity sha512-zjJRPqOCWPfkHt1QztfFHKrsTE9o6Je2EpfA7hRMej2FlGbsMWUxOqx/btK1vjD6YIU8DtVDpIdj1WvPOITQ4Q== dependencies: - "@abp/datatables.net" "^2.1.0" + "@abp/datatables.net" "^2.2.0" datatables.net-bs4 "^1.10.20" -"@abp/datatables.net@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-2.1.0.tgz#674eaaa5b0948d7ee85b6605bfbad1a70f839aa7" - integrity sha512-3ZM2p+JpHumxbIKlDP/LKLsfceMdttdTOL0ckIZCmAAgoIeKmAtuMoKcHTr8lj5mjgv4arBGvG9WVCemep2PEw== +"@abp/datatables.net@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-2.2.0.tgz#22f9c7ca90c2d4af264483b4f8286b0feb7c3d52" + integrity sha512-L4MnpdloSWr/px3mvV75sxsxL68MyALB2LKdzCFMQWILCZVkxMmQb9LARINYIrn461Wrc+zbYWNEBD0MAq7flg== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" datatables.net "^1.10.20" -"@abp/font-awesome@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-2.1.0.tgz#c2e628a1b9d0525e7d6950bf007feebcd1c490c8" - integrity sha512-vlm1IQuQVfuCI2O1vphDd11zUEJ4/4PU0/0XI1YCpilse8fBg080CM3+G0kw6Erm/riznqhOJwBcfT+K+zqk8A== +"@abp/font-awesome@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-2.2.0.tgz#2de39e3c6c3e8c30394d82861761a66c5b4032f0" + integrity sha512-RT06MYUGgaWBEpW5c7wUcfMXgxcOHWdX/C01LDO/j6iVoKBuBHOkkvcUoTWII068ECrLYOkj+RyT59dCKm8FFw== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" "@fortawesome/fontawesome-free" "^5.11.2" -"@abp/jquery-form@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-2.1.0.tgz#285dbfdcf722cb0249f149e728cef7f788410c0c" - integrity sha512-A17rjHTiBJBKYgrtDX5wIqnI89wNmo3bdK9NagL1wMFj4GvDyOZoRIDLqkopYQsc8zuPjqw4+1aa2TPiA+jtKg== +"@abp/jquery-form@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-2.2.0.tgz#951653fac4013a7bbec065b5101b86d575e0eca7" + integrity sha512-ji44E3Ud0S3LNXn1WJ/Aw44qAIG7EITEW1KOe46oz+/awPpbiiA4dDDNleTvO2jI2/s8mNyR0bNanP6BUsc7tw== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" jquery-form "^4.2.2" -"@abp/jquery-validation-unobtrusive@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-2.1.0.tgz#fc938775ced2efc686e7dd092d6ceff1ea947f36" - integrity sha512-a8iBIj6amJ9rQNV+wxQUuEVh93M/c32kJcrwSEPWQcOoTj5gf0j8eKK9YvZaGokpylraz9mdGOwYQQuNj1sxEw== +"@abp/jquery-validation-unobtrusive@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-2.2.0.tgz#6d39ba9f7bf026d1380796bf5dff76c8d16b42ce" + integrity sha512-SuS/dRRVz7ZR4HK/h9x0jRRVLPqXN0CPRGPdJZ1LJraXVEJ9/eDEGf1rMlHmEGt1FXXFTD01/zjisbweDE786w== dependencies: - "@abp/jquery-validation" "^2.1.0" + "@abp/jquery-validation" "^2.2.0" jquery-validation-unobtrusive "^3.2.11" -"@abp/jquery-validation@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-2.1.0.tgz#2bf1a31321cce3b2abe6d56c6112c52a8ecb28b6" - integrity sha512-kU6/E+Xc3wHAUs+sGMAL8uozkXv65HnpksTwV4/+RK+D6iFU2EyNgCEFu7QGSwYZsV1/7YsCe2GD4ucBXIknbA== +"@abp/jquery-validation@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-2.2.0.tgz#02bb8ba883e72c1204867ee4d1c1094bd91c4c4c" + integrity sha512-ypITQloO4iEDgqlA6qb3taj+7HMX0Cf/ACA2OvtrvOgJejx6J4wfrPjwuFZu1WWJ0xtc9yTdbovdcSVcQbIGaA== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" jquery-validation "^1.19.1" -"@abp/jquery@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-2.1.0.tgz#fb5b4c9e8622cf46fee92f9f731d007d5fb200bb" - integrity sha512-ZpfzRut5G611bBmuDdiT6BD0M7Rl1P6r8uNxUjdmFXYwFd8wD02ZhIcsX7qFHFkYERuXfcLrZh4rpw9G1DVCJg== +"@abp/jquery@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-2.2.0.tgz#0e641b1109e78eff4c34331ca2b123b67cc30cbe" + integrity sha512-vEfRoFEAmDmRgSq98Y9EZExfQFSWtmjaHrodUu+MadTcRlnn+wHq8wwkKKxpj/eYtNc8aFORpyHMMH7uliAKxg== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" jquery "^3.4.1" -"@abp/lodash@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-2.1.0.tgz#9fc9e6521e6284d607cedbff1a458fa324137c5c" - integrity sha512-s1gTHhpbmEDDCsZeXb9MpClkDS4wH5R2IWPRZUlSPxo3gF0pvkx5ubdhYUEUgqy5QqWxE/+zUAjDc4x+cEriFQ== +"@abp/lodash@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-2.2.0.tgz#af0a2ebcb28fd0a8c02da5026479d9370ed19719" + integrity sha512-wOMLqIpuq4a7ww7pB138G6YxBiTGBgxNW/IWGUiWbfgrr88cGPKIYYv/8O8mvr8PLNGjizNynuwQRj522yA3Dw== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" lodash "^4.17.15" -"@abp/luxon@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-2.1.0.tgz#624796722119f075119006b436054aecbb38f15f" - integrity sha512-2b0sRo6rdYT1wDu9nSXm/9o8rhQ9ED7FxrDMYabYuOQz48esgn4fBUNcPqpxwejpFmlhZY6CONvkddNtaMeVHw== +"@abp/luxon@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-2.2.0.tgz#0d0e78edc249853fa31eceecc00df2846a879aa9" + integrity sha512-WbOW0PcMks+WXRPWt/+H4pOa5waM331WkY0F+EJx8fpxemNGQNUEXLkuMXzN3MrN6LrplM9AZ9i+NRA9PWHbNw== dependencies: luxon "^1.21.3" -"@abp/malihu-custom-scrollbar-plugin@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-2.1.0.tgz#f4dc1a32cefc3de8af08cb6d585ec5f7636a0c5e" - integrity sha512-WcxzCZ5YOMxGxZerEh966cVrFSCw1UTDqwU2rxA/LsHEbPKd69AY+SHvUiacNxPXs1ZCF6FFJ29C5dWicEIRaQ== +"@abp/malihu-custom-scrollbar-plugin@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-2.2.0.tgz#e11fd46dccbb28d44fb199e880b91d27c94f1919" + integrity sha512-YDu/NLpIzMA96NDHxd27/+liTm3sow9M+oWH29+9JW8o/AEpXUH3T3AmoXXcTgsBlzLaewgHEFM8yxsAAFoj8Q== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" malihu-custom-scrollbar-plugin "^3.1.5" -"@abp/select2@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-2.1.0.tgz#79e50d2c25e74a5f96520e8aa1433d79aea674d1" - integrity sha512-ut/3c+lFdoepuDH36M7thWagmAmTFrChcPnhYjTx4MmIf31WW1BwqOSx3I2g8M+NEEx+V2jTNuBpTq7PONgSJg== +"@abp/select2@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-2.2.0.tgz#4639d4e5b72b1736fa4476bd9b6a78e036400421" + integrity sha512-tc87JyM0kvVF388kyGUjDby49Zrrb089jVRRipoIaxXeu4M1YxEFSKBEcUK1MohZWjVtWrNs8MoxPlfukaMpyw== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" select2 "^4.0.12" -"@abp/sweetalert@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-2.1.0.tgz#88f405c4ba9f9ed2fd54b945ed6bc48d5ae2fa23" - integrity sha512-EWvReqxZ1DrNH9XD+cf/yGVj+8IPTpuoPuWKDryN4fF7TCMJA+KrXp5lFxpjfkKTtNzLeFGsJqDFWaUifxtqTA== +"@abp/sweetalert@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-2.2.0.tgz#dfc60ba085522d8390e41b90bf5a3d474f4ae624" + integrity sha512-HS6TKOwP91UjzjZHaheurZ1AYUSMkQyCSmoX6g5LAK4eH8IIgpojVSp1AFCSPATrFsFWY/dzkDGcfu90FWsVBg== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" sweetalert "^2.1.2" -"@abp/timeago@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-2.1.0.tgz#28c0aef88aff8b54d1dfb42a664d05097e7fda35" - integrity sha512-NklUYcWeji7po+Y6Oi7b7IkYmjd5YRu123bm3MqjQ71AzuOCTFbvPMHzYOjrUTkzr6gW3IJ24LQ4YmpshPy4ZQ== +"@abp/timeago@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-2.2.0.tgz#9a8297f36a46cdc4cc62f44d0fdc91b70def389c" + integrity sha512-8qjmKscsTvPznHKWEsddYxdSBiU+l+OgLG6vzMcSWqngYbDQGXqNA93BwJI2qiwd+FkNcfGgYg7CN7bcwzmaiw== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" timeago "^1.6.7" -"@abp/toastr@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-2.1.0.tgz#22a53a2b1f354770fdc7b37f06bec10eefccfe7a" - integrity sha512-hD3hTDx+CixTVTx73rnZDiiFkfSxpZox8RLm+CiFA62ORdO8Ryij8TOXXkJd84b2tJfkAkYehohVXKwHlHU7Zg== +"@abp/toastr@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-2.2.0.tgz#1cad83a89da244685b3c82adff64260b7ccf4742" + integrity sha512-HHfSaw4M/9zS+KgzxGvbHYiQ5qcJgpf21cRZEo16aUwnTeKr4SRaewAWryNn4dKcIO2YNrhzDLH+OYbEaJJlDQ== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" toastr "^2.1.4" "@fortawesome/fontawesome-free@^5.11.2": diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/package.json b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/package.json index b620e756f7..6e36dde3bf 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/package.json +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/package.json @@ -3,6 +3,6 @@ "name": "my-app", "private": true, "dependencies": { - "@abp/aspnetcore.mvc.ui.theme.basic": "^2.1.0" + "@abp/aspnetcore.mvc.ui.theme.basic": "^2.2.0" } } \ No newline at end of file diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/wwwroot/libs/abp/core/abp.css b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/wwwroot/libs/abp/core/abp.css index ee3c5080a5..ddf9cae5b2 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/wwwroot/libs/abp/core/abp.css +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/wwwroot/libs/abp/core/abp.css @@ -1,56 +1,56 @@ -@keyframes spin { - 0% { - transform: translateZ(0) rotate(0deg); - } - - 100% { - transform: translateZ(0) rotate(360deg); - } -} - -.abp-block-area { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: 102; - background-color: #fff; - opacity: .8; - transition: opacity .25s; -} - - .abp-block-area.abp-block-area-disappearing { - opacity: 0; - } - - .abp-block-area.abp-block-area-busy:after { - content: attr(data-text); - display: block; - max-width: 125px; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - font-size: 20px; - font-family: sans-serif; - color: #343a40; - text-align: center; - text-transform: uppercase; - } - - .abp-block-area.abp-block-area-busy:before { - content: ""; - display: block; - width: 150px; - height: 150px; - border-radius: 50%; - border-width: 2px; - border-style: solid; - border-color: transparent #228ae6 #228ae6 #228ae6; - position: absolute; - top: calc(50% - 75px); - left: calc(50% - 75px); - will-change: transform; - animation: spin .75s infinite ease-in-out; - } +@keyframes spin { + 0% { + transform: translateZ(0) rotate(0deg); + } + + 100% { + transform: translateZ(0) rotate(360deg); + } +} + +.abp-block-area { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 102; + background-color: #fff; + opacity: .8; + transition: opacity .25s; +} + + .abp-block-area.abp-block-area-disappearing { + opacity: 0; + } + + .abp-block-area.abp-block-area-busy:after { + content: attr(data-text); + display: block; + max-width: 125px; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + font-size: 20px; + font-family: sans-serif; + color: #343a40; + text-align: center; + text-transform: uppercase; + } + + .abp-block-area.abp-block-area-busy:before { + content: ""; + display: block; + width: 150px; + height: 150px; + border-radius: 50%; + border-width: 2px; + border-style: solid; + border-color: transparent #228ae6 #228ae6 #228ae6; + position: absolute; + top: calc(50% - 75px); + left: calc(50% - 75px); + will-change: transform; + animation: spin .75s infinite ease-in-out; + } diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/wwwroot/libs/abp/core/abp.js b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/wwwroot/libs/abp/core/abp.js index cef1cf55e1..730db8bc97 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/wwwroot/libs/abp/core/abp.js +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/wwwroot/libs/abp/core/abp.js @@ -1,636 +1,636 @@ -var abp = abp || {}; -(function () { - - /* Application paths *****************************************/ - - //Current application root path (including virtual directory if exists). - abp.appPath = abp.appPath || '/'; - - abp.pageLoadTime = new Date(); - - //Converts given path to absolute path using abp.appPath variable. - abp.toAbsAppPath = function (path) { - if (path.indexOf('/') == 0) { - path = path.substring(1); - } - - return abp.appPath + path; - }; - - /* LOGGING ***************************************************/ - //Implements Logging API that provides secure & controlled usage of console.log - - abp.log = abp.log || {}; - - abp.log.levels = { - DEBUG: 1, - INFO: 2, - WARN: 3, - ERROR: 4, - FATAL: 5 - }; - - abp.log.level = abp.log.levels.DEBUG; - - abp.log.log = function (logObject, logLevel) { - if (!window.console || !window.console.log) { - return; - } - - if (logLevel != undefined && logLevel < abp.log.level) { - return; - } - - console.log(logObject); - }; - - abp.log.debug = function (logObject) { - abp.log.log("DEBUG: ", abp.log.levels.DEBUG); - abp.log.log(logObject, abp.log.levels.DEBUG); - }; - - abp.log.info = function (logObject) { - abp.log.log("INFO: ", abp.log.levels.INFO); - abp.log.log(logObject, abp.log.levels.INFO); - }; - - abp.log.warn = function (logObject) { - abp.log.log("WARN: ", abp.log.levels.WARN); - abp.log.log(logObject, abp.log.levels.WARN); - }; - - abp.log.error = function (logObject) { - abp.log.log("ERROR: ", abp.log.levels.ERROR); - abp.log.log(logObject, abp.log.levels.ERROR); - }; - - abp.log.fatal = function (logObject) { - abp.log.log("FATAL: ", abp.log.levels.FATAL); - abp.log.log(logObject, abp.log.levels.FATAL); - }; - - /* LOCALIZATION ***********************************************/ - - abp.localization = abp.localization || {}; - - abp.localization.values = {}; - - abp.localization.localize = function (key, sourceName) { - sourceName = sourceName || abp.localization.defaultResourceName; - - var source = abp.localization.values[sourceName]; - - if (!source) { - abp.log.warn('Could not find localization source: ' + sourceName); - return key; - } - - var value = source[key]; - if (value == undefined) { - return key; - } - - var copiedArguments = Array.prototype.slice.call(arguments, 0); - copiedArguments.splice(1, 1); - copiedArguments[0] = value; - - return abp.utils.formatString.apply(this, copiedArguments); - }; - - abp.localization.getResource = function (name) { - return function () { - var copiedArguments = Array.prototype.slice.call(arguments, 0); - copiedArguments.splice(1, 0, name); - return abp.localization.localize.apply(this, copiedArguments); - }; - }; - - abp.localization.defaultResourceName = undefined; - - /* AUTHORIZATION **********************************************/ - - abp.auth = abp.auth || {}; - - abp.auth.policies = abp.auth.policies || {}; - - abp.auth.grantedPolicies = abp.auth.grantedPolicies || {}; - - abp.auth.isGranted = function (policyName) { - return abp.auth.policies[policyName] != undefined && abp.auth.grantedPolicies[policyName] != undefined; - }; - - abp.auth.isAnyGranted = function () { - if (!arguments || arguments.length <= 0) { - return true; - } - - for (var i = 0; i < arguments.length; i++) { - if (abp.auth.isGranted(arguments[i])) { - return true; - } - } - - return false; - }; - - abp.auth.areAllGranted = function () { - if (!arguments || arguments.length <= 0) { - return true; - } - - for (var i = 0; i < arguments.length; i++) { - if (!abp.auth.isGranted(arguments[i])) { - return false; - } - } - - return true; - }; - - abp.auth.tokenCookieName = 'Abp.AuthToken'; - - abp.auth.setToken = function (authToken, expireDate) { - abp.utils.setCookieValue(abp.auth.tokenCookieName, authToken, expireDate, abp.appPath, abp.domain); - }; - - abp.auth.getToken = function () { - return abp.utils.getCookieValue(abp.auth.tokenCookieName); - } - - abp.auth.clearToken = function () { - abp.auth.setToken(); - } - - /* SETTINGS *************************************************/ - - abp.setting = abp.setting || {}; - - abp.setting.values = abp.setting.values || {}; - - abp.setting.get = function (name) { - return abp.setting.values[name]; - }; - - abp.setting.getBoolean = function (name) { - var value = abp.setting.get(name); - return value == 'true' || value == 'True'; - }; - - abp.setting.getInt = function (name) { - return parseInt(abp.setting.values[name]); - }; - - /* NOTIFICATION *********************************************/ - //Defines Notification API, not implements it - - abp.notify = abp.notify || {}; - - abp.notify.success = function (message, title, options) { - abp.log.warn('abp.notify.success is not implemented!'); - }; - - abp.notify.info = function (message, title, options) { - abp.log.warn('abp.notify.info is not implemented!'); - }; - - abp.notify.warn = function (message, title, options) { - abp.log.warn('abp.notify.warn is not implemented!'); - }; - - abp.notify.error = function (message, title, options) { - abp.log.warn('abp.notify.error is not implemented!'); - }; - - /* MESSAGE **************************************************/ - //Defines Message API, not implements it - - abp.message = abp.message || {}; - - abp.message._showMessage = function (message, title) { - alert((title || '') + ' ' + message); - }; - - abp.message.info = function (message, title) { - abp.log.warn('abp.message.info is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.success = function (message, title) { - abp.log.warn('abp.message.success is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.warn = function (message, title) { - abp.log.warn('abp.message.warn is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.error = function (message, title) { - abp.log.warn('abp.message.error is not implemented!'); - return abp.message._showMessage(message, title); - }; - - abp.message.confirm = function (message, titleOrCallback, callback) { - abp.log.warn('abp.message.confirm is not properly implemented!'); - - if (titleOrCallback && !(typeof titleOrCallback == 'string')) { - callback = titleOrCallback; - } - - var result = confirm(message); - callback && callback(result); - }; - - /* UI *******************************************************/ - - abp.ui = abp.ui || {}; - - /* UI BLOCK */ - //Defines UI Block API and implements basically - - var $abpBlockArea = document.createElement('div'); - $abpBlockArea.classList.add('abp-block-area'); - - /* opts: { //Can be an object with options or a string for query a selector - * elm: a query selector (optional - default: document.body) - * busy: boolean (optional - default: false) - * promise: A promise with always or finally handler (optional - auto unblocks the ui if provided) - * } - */ - abp.ui.block = function (opts) { - if (!opts) { - opts = {}; - } else if (typeof opts == 'string') { - opts = { - elm: opts - }; - } - - var $elm = document.querySelector(opts.elm) || document.body; - - if (opts.busy) { - $abpBlockArea.classList.add('abp-block-area-busy'); - } else { - $abpBlockArea.classList.remove('abp-block-area-busy'); - } - - if (document.querySelector(opts.elm)) { - $abpBlockArea.style.position = 'absolute'; - } else { - $abpBlockArea.style.position = 'fixed'; - } - - $elm.appendChild($abpBlockArea); - - if (opts.promise) { - if (opts.promise.always) { //jQuery.Deferred style - opts.promise.always(function () { - abp.ui.unblock({ - $elm: opts.elm - }); - }); - } else if (opts.promise['finally']) { //Q style - opts.promise['finally'](function () { - abp.ui.unblock({ - $elm: opts.elm - }); - }); - } - } - }; - - /* opts: { - * - * } - */ - abp.ui.unblock = function (opts) { - var element = document.querySelector('.abp-block-area'); - if (element) { - element.classList.add('abp-block-area-disappearing'); - setTimeout(function () { - if (element) { - element.classList.remove('abp-block-area-disappearing'); - element.parentElement.removeChild(element); - } - }, 250); - } - }; - - /* UI BUSY */ - //Defines UI Busy API, not implements it - - abp.ui.setBusy = function (opts) { - if (!opts) { - opts = { - busy: true - }; - } else if (typeof opts == 'string') { - opts = { - elm: opts, - busy: true - }; - } - - abp.ui.block(opts); - }; - - abp.ui.clearBusy = function (opts) { - abp.ui.unblock(opts); - }; - - /* SIMPLE EVENT BUS *****************************************/ - - abp.event = (function () { - - var _callbacks = {}; - - var on = function (eventName, callback) { - if (!_callbacks[eventName]) { - _callbacks[eventName] = []; - } - - _callbacks[eventName].push(callback); - }; - - var off = function (eventName, callback) { - var callbacks = _callbacks[eventName]; - if (!callbacks) { - return; - } - - var index = -1; - for (var i = 0; i < callbacks.length; i++) { - if (callbacks[i] === callback) { - index = i; - break; - } - } - - if (index < 0) { - return; - } - - _callbacks[eventName].splice(index, 1); - }; - - var trigger = function (eventName) { - var callbacks = _callbacks[eventName]; - if (!callbacks || !callbacks.length) { - return; - } - - var args = Array.prototype.slice.call(arguments, 1); - for (var i = 0; i < callbacks.length; i++) { - callbacks[i].apply(this, args); - } - }; - - // Public interface /////////////////////////////////////////////////// - - return { - on: on, - off: off, - trigger: trigger - }; - })(); - - - /* UTILS ***************************************************/ - - abp.utils = abp.utils || {}; - - /* Creates a name namespace. - * Example: - * var taskService = abp.utils.createNamespace(abp, 'services.task'); - * taskService will be equal to abp.services.task - * first argument (root) must be defined first - ************************************************************/ - abp.utils.createNamespace = function (root, ns) { - var parts = ns.split('.'); - for (var i = 0; i < parts.length; i++) { - if (typeof root[parts[i]] == 'undefined') { - root[parts[i]] = {}; - } - - root = root[parts[i]]; - } - - return root; - }; - - /* Find and replaces a string (search) to another string (replacement) in - * given string (str). - * Example: - * abp.utils.replaceAll('This is a test string', 'is', 'X') = 'ThX X a test string' - ************************************************************/ - abp.utils.replaceAll = function (str, search, replacement) { - var fix = search.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); - return str.replace(new RegExp(fix, 'g'), replacement); - }; - - /* Formats a string just like string.format in C#. - * Example: - * abp.utils.formatString('Hello {0}','Tuana') = 'Hello Tuana' - ************************************************************/ - abp.utils.formatString = function () { - if (arguments.length < 1) { - return null; - } - - var str = arguments[0]; - - for (var i = 1; i < arguments.length; i++) { - var placeHolder = '{' + (i - 1) + '}'; - str = abp.utils.replaceAll(str, placeHolder, arguments[i]); - } - - return str; - }; - - abp.utils.toPascalCase = function (str) { - if (!str || !str.length) { - return str; - } - - if (str.length === 1) { - return str.charAt(0).toUpperCase(); - } - - return str.charAt(0).toUpperCase() + str.substr(1); - } - - abp.utils.toCamelCase = function (str) { - if (!str || !str.length) { - return str; - } - - if (str.length === 1) { - return str.charAt(0).toLowerCase(); - } - - return str.charAt(0).toLowerCase() + str.substr(1); - } - - abp.utils.truncateString = function (str, maxLength) { - if (!str || !str.length || str.length <= maxLength) { - return str; - } - - return str.substr(0, maxLength); - }; - - abp.utils.truncateStringWithPostfix = function (str, maxLength, postfix) { - postfix = postfix || '...'; - - if (!str || !str.length || str.length <= maxLength) { - return str; - } - - if (maxLength <= postfix.length) { - return postfix.substr(0, maxLength); - } - - return str.substr(0, maxLength - postfix.length) + postfix; - }; - - abp.utils.isFunction = function (obj) { - return !!(obj && obj.constructor && obj.call && obj.apply); - }; - - /** - * parameterInfos should be an array of { name, value } objects - * where name is query string parameter name and value is it's value. - * includeQuestionMark is true by default. - */ - abp.utils.buildQueryString = function (parameterInfos, includeQuestionMark) { - if (includeQuestionMark === undefined) { - includeQuestionMark = true; - } - - var qs = ''; - - function addSeperator() { - if (!qs.length) { - if (includeQuestionMark) { - qs = qs + '?'; - } - } else { - qs = qs + '&'; - } - } - - for (var i = 0; i < parameterInfos.length; ++i) { - var parameterInfo = parameterInfos[i]; - if (parameterInfo.value === undefined) { - continue; - } - - if (parameterInfo.value === null) { - parameterInfo.value = ''; - } - - addSeperator(); - - if (parameterInfo.value.toJSON && typeof parameterInfo.value.toJSON === "function") { - qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value.toJSON()); - } else if (Array.isArray(parameterInfo.value) && parameterInfo.value.length) { - for (var j = 0; j < parameterInfo.value.length; j++) { - if (j > 0) { - addSeperator(); - } - - qs = qs + parameterInfo.name + '[' + j + ']=' + encodeURIComponent(parameterInfo.value[j]); - } - } else { - qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value); - } - } - - return qs; - } - - /** - * Sets a cookie value for given key. - * This is a simple implementation created to be used by ABP. - * Please use a complete cookie library if you need. - * @param {string} key - * @param {string} value - * @param {Date} expireDate (optional). If not specified the cookie will expire at the end of session. - * @param {string} path (optional) - */ - abp.utils.setCookieValue = function (key, value, expireDate, path) { - var cookieValue = encodeURIComponent(key) + '='; - - if (value) { - cookieValue = cookieValue + encodeURIComponent(value); - } - - if (expireDate) { - cookieValue = cookieValue + "; expires=" + expireDate.toUTCString(); - } - - if (path) { - cookieValue = cookieValue + "; path=" + path; - } - - document.cookie = cookieValue; - }; - - /** - * Gets a cookie with given key. - * This is a simple implementation created to be used by ABP. - * Please use a complete cookie library if you need. - * @param {string} key - * @returns {string} Cookie value or null - */ - abp.utils.getCookieValue = function (key) { - var equalities = document.cookie.split('; '); - for (var i = 0; i < equalities.length; i++) { - if (!equalities[i]) { - continue; - } - - var splitted = equalities[i].split('='); - if (splitted.length != 2) { - continue; - } - - if (decodeURIComponent(splitted[0]) === key) { - return decodeURIComponent(splitted[1] || ''); - } - } - - return null; - }; - - /** - * Deletes cookie for given key. - * This is a simple implementation created to be used by ABP. - * Please use a complete cookie library if you need. - * @param {string} key - * @param {string} path (optional) - */ - abp.utils.deleteCookie = function (key, path) { - var cookieValue = encodeURIComponent(key) + '='; - - cookieValue = cookieValue + "; expires=" + (new Date(new Date().getTime() - 86400000)).toUTCString(); - - if (path) { - cookieValue = cookieValue + "; path=" + path; - } - - document.cookie = cookieValue; - } - - /* SECURITY ***************************************/ - abp.security = abp.security || {}; - abp.security.antiForgery = abp.security.antiForgery || {}; - - abp.security.antiForgery.tokenCookieName = 'XSRF-TOKEN'; - abp.security.antiForgery.tokenHeaderName = 'X-XSRF-TOKEN'; - - abp.security.antiForgery.getToken = function () { - return abp.utils.getCookieValue(abp.security.antiForgery.tokenCookieName); - }; - +var abp = abp || {}; +(function () { + + /* Application paths *****************************************/ + + //Current application root path (including virtual directory if exists). + abp.appPath = abp.appPath || '/'; + + abp.pageLoadTime = new Date(); + + //Converts given path to absolute path using abp.appPath variable. + abp.toAbsAppPath = function (path) { + if (path.indexOf('/') == 0) { + path = path.substring(1); + } + + return abp.appPath + path; + }; + + /* LOGGING ***************************************************/ + //Implements Logging API that provides secure & controlled usage of console.log + + abp.log = abp.log || {}; + + abp.log.levels = { + DEBUG: 1, + INFO: 2, + WARN: 3, + ERROR: 4, + FATAL: 5 + }; + + abp.log.level = abp.log.levels.DEBUG; + + abp.log.log = function (logObject, logLevel) { + if (!window.console || !window.console.log) { + return; + } + + if (logLevel != undefined && logLevel < abp.log.level) { + return; + } + + console.log(logObject); + }; + + abp.log.debug = function (logObject) { + abp.log.log("DEBUG: ", abp.log.levels.DEBUG); + abp.log.log(logObject, abp.log.levels.DEBUG); + }; + + abp.log.info = function (logObject) { + abp.log.log("INFO: ", abp.log.levels.INFO); + abp.log.log(logObject, abp.log.levels.INFO); + }; + + abp.log.warn = function (logObject) { + abp.log.log("WARN: ", abp.log.levels.WARN); + abp.log.log(logObject, abp.log.levels.WARN); + }; + + abp.log.error = function (logObject) { + abp.log.log("ERROR: ", abp.log.levels.ERROR); + abp.log.log(logObject, abp.log.levels.ERROR); + }; + + abp.log.fatal = function (logObject) { + abp.log.log("FATAL: ", abp.log.levels.FATAL); + abp.log.log(logObject, abp.log.levels.FATAL); + }; + + /* LOCALIZATION ***********************************************/ + + abp.localization = abp.localization || {}; + + abp.localization.values = {}; + + abp.localization.localize = function (key, sourceName) { + sourceName = sourceName || abp.localization.defaultResourceName; + + var source = abp.localization.values[sourceName]; + + if (!source) { + abp.log.warn('Could not find localization source: ' + sourceName); + return key; + } + + var value = source[key]; + if (value == undefined) { + return key; + } + + var copiedArguments = Array.prototype.slice.call(arguments, 0); + copiedArguments.splice(1, 1); + copiedArguments[0] = value; + + return abp.utils.formatString.apply(this, copiedArguments); + }; + + abp.localization.getResource = function (name) { + return function () { + var copiedArguments = Array.prototype.slice.call(arguments, 0); + copiedArguments.splice(1, 0, name); + return abp.localization.localize.apply(this, copiedArguments); + }; + }; + + abp.localization.defaultResourceName = undefined; + + /* AUTHORIZATION **********************************************/ + + abp.auth = abp.auth || {}; + + abp.auth.policies = abp.auth.policies || {}; + + abp.auth.grantedPolicies = abp.auth.grantedPolicies || {}; + + abp.auth.isGranted = function (policyName) { + return abp.auth.policies[policyName] != undefined && abp.auth.grantedPolicies[policyName] != undefined; + }; + + abp.auth.isAnyGranted = function () { + if (!arguments || arguments.length <= 0) { + return true; + } + + for (var i = 0; i < arguments.length; i++) { + if (abp.auth.isGranted(arguments[i])) { + return true; + } + } + + return false; + }; + + abp.auth.areAllGranted = function () { + if (!arguments || arguments.length <= 0) { + return true; + } + + for (var i = 0; i < arguments.length; i++) { + if (!abp.auth.isGranted(arguments[i])) { + return false; + } + } + + return true; + }; + + abp.auth.tokenCookieName = 'Abp.AuthToken'; + + abp.auth.setToken = function (authToken, expireDate) { + abp.utils.setCookieValue(abp.auth.tokenCookieName, authToken, expireDate, abp.appPath, abp.domain); + }; + + abp.auth.getToken = function () { + return abp.utils.getCookieValue(abp.auth.tokenCookieName); + } + + abp.auth.clearToken = function () { + abp.auth.setToken(); + } + + /* SETTINGS *************************************************/ + + abp.setting = abp.setting || {}; + + abp.setting.values = abp.setting.values || {}; + + abp.setting.get = function (name) { + return abp.setting.values[name]; + }; + + abp.setting.getBoolean = function (name) { + var value = abp.setting.get(name); + return value == 'true' || value == 'True'; + }; + + abp.setting.getInt = function (name) { + return parseInt(abp.setting.values[name]); + }; + + /* NOTIFICATION *********************************************/ + //Defines Notification API, not implements it + + abp.notify = abp.notify || {}; + + abp.notify.success = function (message, title, options) { + abp.log.warn('abp.notify.success is not implemented!'); + }; + + abp.notify.info = function (message, title, options) { + abp.log.warn('abp.notify.info is not implemented!'); + }; + + abp.notify.warn = function (message, title, options) { + abp.log.warn('abp.notify.warn is not implemented!'); + }; + + abp.notify.error = function (message, title, options) { + abp.log.warn('abp.notify.error is not implemented!'); + }; + + /* MESSAGE **************************************************/ + //Defines Message API, not implements it + + abp.message = abp.message || {}; + + abp.message._showMessage = function (message, title) { + alert((title || '') + ' ' + message); + }; + + abp.message.info = function (message, title) { + abp.log.warn('abp.message.info is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.success = function (message, title) { + abp.log.warn('abp.message.success is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.warn = function (message, title) { + abp.log.warn('abp.message.warn is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.error = function (message, title) { + abp.log.warn('abp.message.error is not implemented!'); + return abp.message._showMessage(message, title); + }; + + abp.message.confirm = function (message, titleOrCallback, callback) { + abp.log.warn('abp.message.confirm is not properly implemented!'); + + if (titleOrCallback && !(typeof titleOrCallback == 'string')) { + callback = titleOrCallback; + } + + var result = confirm(message); + callback && callback(result); + }; + + /* UI *******************************************************/ + + abp.ui = abp.ui || {}; + + /* UI BLOCK */ + //Defines UI Block API and implements basically + + var $abpBlockArea = document.createElement('div'); + $abpBlockArea.classList.add('abp-block-area'); + + /* opts: { //Can be an object with options or a string for query a selector + * elm: a query selector (optional - default: document.body) + * busy: boolean (optional - default: false) + * promise: A promise with always or finally handler (optional - auto unblocks the ui if provided) + * } + */ + abp.ui.block = function (opts) { + if (!opts) { + opts = {}; + } else if (typeof opts == 'string') { + opts = { + elm: opts + }; + } + + var $elm = document.querySelector(opts.elm) || document.body; + + if (opts.busy) { + $abpBlockArea.classList.add('abp-block-area-busy'); + } else { + $abpBlockArea.classList.remove('abp-block-area-busy'); + } + + if (document.querySelector(opts.elm)) { + $abpBlockArea.style.position = 'absolute'; + } else { + $abpBlockArea.style.position = 'fixed'; + } + + $elm.appendChild($abpBlockArea); + + if (opts.promise) { + if (opts.promise.always) { //jQuery.Deferred style + opts.promise.always(function () { + abp.ui.unblock({ + $elm: opts.elm + }); + }); + } else if (opts.promise['finally']) { //Q style + opts.promise['finally'](function () { + abp.ui.unblock({ + $elm: opts.elm + }); + }); + } + } + }; + + /* opts: { + * + * } + */ + abp.ui.unblock = function (opts) { + var element = document.querySelector('.abp-block-area'); + if (element) { + element.classList.add('abp-block-area-disappearing'); + setTimeout(function () { + if (element) { + element.classList.remove('abp-block-area-disappearing'); + element.parentElement.removeChild(element); + } + }, 250); + } + }; + + /* UI BUSY */ + //Defines UI Busy API, not implements it + + abp.ui.setBusy = function (opts) { + if (!opts) { + opts = { + busy: true + }; + } else if (typeof opts == 'string') { + opts = { + elm: opts, + busy: true + }; + } + + abp.ui.block(opts); + }; + + abp.ui.clearBusy = function (opts) { + abp.ui.unblock(opts); + }; + + /* SIMPLE EVENT BUS *****************************************/ + + abp.event = (function () { + + var _callbacks = {}; + + var on = function (eventName, callback) { + if (!_callbacks[eventName]) { + _callbacks[eventName] = []; + } + + _callbacks[eventName].push(callback); + }; + + var off = function (eventName, callback) { + var callbacks = _callbacks[eventName]; + if (!callbacks) { + return; + } + + var index = -1; + for (var i = 0; i < callbacks.length; i++) { + if (callbacks[i] === callback) { + index = i; + break; + } + } + + if (index < 0) { + return; + } + + _callbacks[eventName].splice(index, 1); + }; + + var trigger = function (eventName) { + var callbacks = _callbacks[eventName]; + if (!callbacks || !callbacks.length) { + return; + } + + var args = Array.prototype.slice.call(arguments, 1); + for (var i = 0; i < callbacks.length; i++) { + callbacks[i].apply(this, args); + } + }; + + // Public interface /////////////////////////////////////////////////// + + return { + on: on, + off: off, + trigger: trigger + }; + })(); + + + /* UTILS ***************************************************/ + + abp.utils = abp.utils || {}; + + /* Creates a name namespace. + * Example: + * var taskService = abp.utils.createNamespace(abp, 'services.task'); + * taskService will be equal to abp.services.task + * first argument (root) must be defined first + ************************************************************/ + abp.utils.createNamespace = function (root, ns) { + var parts = ns.split('.'); + for (var i = 0; i < parts.length; i++) { + if (typeof root[parts[i]] == 'undefined') { + root[parts[i]] = {}; + } + + root = root[parts[i]]; + } + + return root; + }; + + /* Find and replaces a string (search) to another string (replacement) in + * given string (str). + * Example: + * abp.utils.replaceAll('This is a test string', 'is', 'X') = 'ThX X a test string' + ************************************************************/ + abp.utils.replaceAll = function (str, search, replacement) { + var fix = search.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); + return str.replace(new RegExp(fix, 'g'), replacement); + }; + + /* Formats a string just like string.format in C#. + * Example: + * abp.utils.formatString('Hello {0}','Tuana') = 'Hello Tuana' + ************************************************************/ + abp.utils.formatString = function () { + if (arguments.length < 1) { + return null; + } + + var str = arguments[0]; + + for (var i = 1; i < arguments.length; i++) { + var placeHolder = '{' + (i - 1) + '}'; + str = abp.utils.replaceAll(str, placeHolder, arguments[i]); + } + + return str; + }; + + abp.utils.toPascalCase = function (str) { + if (!str || !str.length) { + return str; + } + + if (str.length === 1) { + return str.charAt(0).toUpperCase(); + } + + return str.charAt(0).toUpperCase() + str.substr(1); + } + + abp.utils.toCamelCase = function (str) { + if (!str || !str.length) { + return str; + } + + if (str.length === 1) { + return str.charAt(0).toLowerCase(); + } + + return str.charAt(0).toLowerCase() + str.substr(1); + } + + abp.utils.truncateString = function (str, maxLength) { + if (!str || !str.length || str.length <= maxLength) { + return str; + } + + return str.substr(0, maxLength); + }; + + abp.utils.truncateStringWithPostfix = function (str, maxLength, postfix) { + postfix = postfix || '...'; + + if (!str || !str.length || str.length <= maxLength) { + return str; + } + + if (maxLength <= postfix.length) { + return postfix.substr(0, maxLength); + } + + return str.substr(0, maxLength - postfix.length) + postfix; + }; + + abp.utils.isFunction = function (obj) { + return !!(obj && obj.constructor && obj.call && obj.apply); + }; + + /** + * parameterInfos should be an array of { name, value } objects + * where name is query string parameter name and value is it's value. + * includeQuestionMark is true by default. + */ + abp.utils.buildQueryString = function (parameterInfos, includeQuestionMark) { + if (includeQuestionMark === undefined) { + includeQuestionMark = true; + } + + var qs = ''; + + function addSeperator() { + if (!qs.length) { + if (includeQuestionMark) { + qs = qs + '?'; + } + } else { + qs = qs + '&'; + } + } + + for (var i = 0; i < parameterInfos.length; ++i) { + var parameterInfo = parameterInfos[i]; + if (parameterInfo.value === undefined) { + continue; + } + + if (parameterInfo.value === null) { + parameterInfo.value = ''; + } + + addSeperator(); + + if (parameterInfo.value.toJSON && typeof parameterInfo.value.toJSON === "function") { + qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value.toJSON()); + } else if (Array.isArray(parameterInfo.value) && parameterInfo.value.length) { + for (var j = 0; j < parameterInfo.value.length; j++) { + if (j > 0) { + addSeperator(); + } + + qs = qs + parameterInfo.name + '[' + j + ']=' + encodeURIComponent(parameterInfo.value[j]); + } + } else { + qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value); + } + } + + return qs; + } + + /** + * Sets a cookie value for given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @param {string} value + * @param {Date} expireDate (optional). If not specified the cookie will expire at the end of session. + * @param {string} path (optional) + */ + abp.utils.setCookieValue = function (key, value, expireDate, path) { + var cookieValue = encodeURIComponent(key) + '='; + + if (value) { + cookieValue = cookieValue + encodeURIComponent(value); + } + + if (expireDate) { + cookieValue = cookieValue + "; expires=" + expireDate.toUTCString(); + } + + if (path) { + cookieValue = cookieValue + "; path=" + path; + } + + document.cookie = cookieValue; + }; + + /** + * Gets a cookie with given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @returns {string} Cookie value or null + */ + abp.utils.getCookieValue = function (key) { + var equalities = document.cookie.split('; '); + for (var i = 0; i < equalities.length; i++) { + if (!equalities[i]) { + continue; + } + + var splitted = equalities[i].split('='); + if (splitted.length != 2) { + continue; + } + + if (decodeURIComponent(splitted[0]) === key) { + return decodeURIComponent(splitted[1] || ''); + } + } + + return null; + }; + + /** + * Deletes cookie for given key. + * This is a simple implementation created to be used by ABP. + * Please use a complete cookie library if you need. + * @param {string} key + * @param {string} path (optional) + */ + abp.utils.deleteCookie = function (key, path) { + var cookieValue = encodeURIComponent(key) + '='; + + cookieValue = cookieValue + "; expires=" + (new Date(new Date().getTime() - 86400000)).toUTCString(); + + if (path) { + cookieValue = cookieValue + "; path=" + path; + } + + document.cookie = cookieValue; + } + + /* SECURITY ***************************************/ + abp.security = abp.security || {}; + abp.security.antiForgery = abp.security.antiForgery || {}; + + abp.security.antiForgery.tokenCookieName = 'XSRF-TOKEN'; + abp.security.antiForgery.tokenHeaderName = 'X-XSRF-TOKEN'; + + abp.security.antiForgery.getToken = function () { + return abp.utils.getCookieValue(abp.security.antiForgery.tokenCookieName); + }; + })(); \ No newline at end of file diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/wwwroot/libs/abp/jquery/abp.jquery.js b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/wwwroot/libs/abp/jquery/abp.jquery.js index 6e2ee001b8..e6aff047f7 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/wwwroot/libs/abp/jquery/abp.jquery.js +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/wwwroot/libs/abp/jquery/abp.jquery.js @@ -1,393 +1,393 @@ -var abp = abp || {}; -(function($) { - - if (!$) { - throw "abp/jquery library requires the jquery library included to the page!"; - } - - // ABP CORE OVERRIDES ///////////////////////////////////////////////////// - - abp.message._showMessage = function (message, title) { - alert((title || '') + ' ' + message); - - return $.Deferred(function ($dfd) { - $dfd.resolve(); - }); - }; - - abp.message.confirm = function (message, titleOrCallback, callback) { - if (titleOrCallback && !(typeof titleOrCallback == 'string')) { - callback = titleOrCallback; - } - - var result = confirm(message); - callback && callback(result); - - return $.Deferred(function ($dfd) { - $dfd.resolve(result); - }); - }; - - abp.utils.isFunction = function (obj) { - return $.isFunction(obj); - }; - - // JQUERY EXTENSIONS ////////////////////////////////////////////////////// - - $.fn.findWithSelf = function (selector) { - return this.filter(selector).add(this.find(selector)); - }; - - // DOM //////////////////////////////////////////////////////////////////// - - abp.dom = abp.dom || {}; - - abp.dom.onNodeAdded = function (callback) { - abp.event.on('abp.dom.nodeAdded', callback); - }; - - abp.dom.onNodeRemoved = function (callback) { - abp.event.on('abp.dom.nodeRemoved', callback); - }; - - var mutationObserverCallback = function (mutationsList) { - for (var i = 0; i < mutationsList.length; i++) { - var mutation = mutationsList[i]; - if (mutation.type === 'childList') { - if (mutation.addedNodes && mutation.removedNodes.length) { - for (var k = 0; k < mutation.removedNodes.length; k++) { - abp.event.trigger( - 'abp.dom.nodeRemoved', - { - $el: $(mutation.removedNodes[k]) - } - ); - } - } - - if (mutation.addedNodes && mutation.addedNodes.length) { - for (var j = 0; j < mutation.addedNodes.length; j++) { - abp.event.trigger( - 'abp.dom.nodeAdded', - { - $el: $(mutation.addedNodes[j]) - } - ); - } - } - } - } - }; - - new MutationObserver(mutationObserverCallback).observe( - $('body')[0], - { - subtree: true, - childList: true - } - ); - - // AJAX /////////////////////////////////////////////////////////////////// - - abp.ajax = function (userOptions) { - userOptions = userOptions || {}; - - var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); - - options.success = undefined; - options.error = undefined; - - return $.Deferred(function ($dfd) { - $.ajax(options) - .done(function (data, textStatus, jqXHR) { - $dfd.resolve(data); - userOptions.success && userOptions.success(data); - }).fail(function (jqXHR) { - if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { - abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); - } else { - abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); - } - }); - }); - }; - - $.extend(abp.ajax, { - defaultOpts: { - dataType: 'json', - type: 'POST', - contentType: 'application/json', - headers: { - 'X-Requested-With': 'XMLHttpRequest' - } - }, - - defaultError: { - message: 'An error has occurred!', - details: 'Error detail not sent by server.' - }, - - defaultError401: { - message: 'You are not authenticated!', - details: 'You should be authenticated (sign in) in order to perform this operation.' - }, - - defaultError403: { - message: 'You are not authorized!', - details: 'You are not allowed to perform this operation.' - }, - - defaultError404: { - message: 'Resource not found!', - details: 'The resource requested could not found on the server.' - }, - - logError: function (error) { - abp.log.error(error); - }, - - showError: function (error) { - if (error.details) { - return abp.message.error(error.details, error.message); - } else { - return abp.message.error(error.message || abp.ajax.defaultError.message); - } - }, - - handleTargetUrl: function (targetUrl) { - if (!targetUrl) { - location.href = abp.appPath; - } else { - location.href = targetUrl; - } - }, - - handleErrorStatusCode: function (status) { - switch (status) { - case 401: - abp.ajax.handleUnAuthorizedRequest( - abp.ajax.showError(abp.ajax.defaultError401), - abp.appPath - ); - break; - case 403: - abp.ajax.showError(abp.ajax.defaultError403); - break; - case 404: - abp.ajax.showError(abp.ajax.defaultError404); - break; - default: - abp.ajax.showError(abp.ajax.defaultError); - break; - } - }, - - handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { - if (userOptions.abpHandleError !== false) { - abp.ajax.handleErrorStatusCode(jqXHR.status); - } - - $dfd.reject.apply(this, arguments); - userOptions.error && userOptions.error.apply(this, arguments); - }, - - handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { - var messagePromise = null; - - if (userOptions.abpHandleError !== false) { - messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); - } - - abp.ajax.logError(jqXHR.responseJSON.error); - - $dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); - userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); - - if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { - abp.ajax.handleUnAuthorizedRequest(messagePromise); - } - }, - - handleUnAuthorizedRequest: function (messagePromise, targetUrl) { - if (messagePromise) { - messagePromise.done(function () { - abp.ajax.handleTargetUrl(targetUrl); - }); - } else { - abp.ajax.handleTargetUrl(targetUrl); - } - }, - - blockUI: function (options) { - if (options.blockUI) { - if (options.blockUI === true) { //block whole page - abp.ui.setBusy(); - } else { //block an element - abp.ui.setBusy(options.blockUI); - } - } - }, - - unblockUI: function (options) { - if (options.blockUI) { - if (options.blockUI === true) { //unblock whole page - abp.ui.clearBusy(); - } else { //unblock an element - abp.ui.clearBusy(options.blockUI); - } - } - }, - - ajaxSendHandler: function (event, request, settings) { - var token = abp.security.antiForgery.getToken(); - if (!token) { - return; - } - - if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { - request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); - } - } - }); - - $(document).ajaxSend(function (event, request, settings) { - return abp.ajax.ajaxSendHandler(event, request, settings); - }); - - abp.event.on('abp.configurationInitialized', function () { - var l = abp.localization.getResource('AbpUi'); - - abp.ajax.defaultError.message = l('DefaultErrorMessage'); - abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); - abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); - abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); - abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); - abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); - abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); - abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); - }); - - // RESOURCE LOADER //////////////////////////////////////////////////////// - - /* UrlStates enum */ - var UrlStates = { - LOADING: 'LOADING', - LOADED: 'LOADED', - FAILED: 'FAILED' - }; - - /* UrlInfo class */ - function UrlInfo(url) { - this.url = url; - this.state = UrlStates.LOADING; - this.loadCallbacks = []; - this.failCallbacks = []; - } - - UrlInfo.prototype.succeed = function () { - this.state = UrlStates.LOADED; - for (var i = 0; i < this.loadCallbacks.length; i++) { - this.loadCallbacks[i](); - } - }; - - UrlInfo.prototype.failed = function () { - this.state = UrlStates.FAILED; - for (var i = 0; i < this.failCallbacks.length; i++) { - this.failCallbacks[i](); - } - }; - - UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { - switch (this.state) { - case UrlStates.LOADED: - loadCallback && loadCallback(); - break; - case UrlStates.FAILED: - failCallback && failCallback(); - break; - case UrlStates.LOADING: - this.addCallbacks(loadCallback, failCallback); - break; - } - }; - - UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { - loadCallback && this.loadCallbacks.push(loadCallback); - failCallback && this.failCallbacks.push(failCallback); - }; - - /* ResourceLoader API */ - - abp.ResourceLoader = (function () { - - var _urlInfos = {}; - - function getCacheKey(url) { - return url; - } - - function appendTimeToUrl(url) { - - if (url.indexOf('?') < 0) { - url += '?'; - } else { - url += '&'; - } - - url += '_=' + new Date().getTime(); - - return url; - } - - var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { - - var cacheKey = getCacheKey(url); - - var urlInfo = _urlInfos[cacheKey]; - - if (urlInfo) { - urlInfo.handleCallbacks(loadCallback, failCallback); - return; - } - - _urlInfos[cacheKey] = urlInfo = new UrlInfo(url); - urlInfo.addCallbacks(loadCallback, failCallback); - - serverLoader(urlInfo); - }; - - var _loadScript = function (url, loadCallback, failCallback) { - _loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { - $.get({ - url: url, - dataType: 'text' - }) - .done(function (script) { - $.globalEval(script); - urlInfo.succeed(); - }) - .fail(function () { - urlInfo.failed(); - }); - }); - }; - - var _loadStyle = function (url) { - _loadFromUrl(url, undefined, undefined, function (urlInfo) { - - $('', { - rel: 'stylesheet', - type: 'text/css', - href: appendTimeToUrl(url) - }).appendTo('head'); - }); - }; - - return { - loadScript: _loadScript, - loadStyle: _loadStyle - } - })(); - +var abp = abp || {}; +(function($) { + + if (!$) { + throw "abp/jquery library requires the jquery library included to the page!"; + } + + // ABP CORE OVERRIDES ///////////////////////////////////////////////////// + + abp.message._showMessage = function (message, title) { + alert((title || '') + ' ' + message); + + return $.Deferred(function ($dfd) { + $dfd.resolve(); + }); + }; + + abp.message.confirm = function (message, titleOrCallback, callback) { + if (titleOrCallback && !(typeof titleOrCallback == 'string')) { + callback = titleOrCallback; + } + + var result = confirm(message); + callback && callback(result); + + return $.Deferred(function ($dfd) { + $dfd.resolve(result); + }); + }; + + abp.utils.isFunction = function (obj) { + return $.isFunction(obj); + }; + + // JQUERY EXTENSIONS ////////////////////////////////////////////////////// + + $.fn.findWithSelf = function (selector) { + return this.filter(selector).add(this.find(selector)); + }; + + // DOM //////////////////////////////////////////////////////////////////// + + abp.dom = abp.dom || {}; + + abp.dom.onNodeAdded = function (callback) { + abp.event.on('abp.dom.nodeAdded', callback); + }; + + abp.dom.onNodeRemoved = function (callback) { + abp.event.on('abp.dom.nodeRemoved', callback); + }; + + var mutationObserverCallback = function (mutationsList) { + for (var i = 0; i < mutationsList.length; i++) { + var mutation = mutationsList[i]; + if (mutation.type === 'childList') { + if (mutation.addedNodes && mutation.removedNodes.length) { + for (var k = 0; k < mutation.removedNodes.length; k++) { + abp.event.trigger( + 'abp.dom.nodeRemoved', + { + $el: $(mutation.removedNodes[k]) + } + ); + } + } + + if (mutation.addedNodes && mutation.addedNodes.length) { + for (var j = 0; j < mutation.addedNodes.length; j++) { + abp.event.trigger( + 'abp.dom.nodeAdded', + { + $el: $(mutation.addedNodes[j]) + } + ); + } + } + } + } + }; + + new MutationObserver(mutationObserverCallback).observe( + $('body')[0], + { + subtree: true, + childList: true + } + ); + + // AJAX /////////////////////////////////////////////////////////////////// + + abp.ajax = function (userOptions) { + userOptions = userOptions || {}; + + var options = $.extend(true, {}, abp.ajax.defaultOpts, userOptions); + + options.success = undefined; + options.error = undefined; + + return $.Deferred(function ($dfd) { + $.ajax(options) + .done(function (data, textStatus, jqXHR) { + $dfd.resolve(data); + userOptions.success && userOptions.success(data); + }).fail(function (jqXHR) { + if (jqXHR.getResponseHeader('_AbpErrorFormat') === 'true') { + abp.ajax.handleAbpErrorResponse(jqXHR, userOptions, $dfd); + } else { + abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd); + } + }); + }); + }; + + $.extend(abp.ajax, { + defaultOpts: { + dataType: 'json', + type: 'POST', + contentType: 'application/json', + headers: { + 'X-Requested-With': 'XMLHttpRequest' + } + }, + + defaultError: { + message: 'An error has occurred!', + details: 'Error detail not sent by server.' + }, + + defaultError401: { + message: 'You are not authenticated!', + details: 'You should be authenticated (sign in) in order to perform this operation.' + }, + + defaultError403: { + message: 'You are not authorized!', + details: 'You are not allowed to perform this operation.' + }, + + defaultError404: { + message: 'Resource not found!', + details: 'The resource requested could not found on the server.' + }, + + logError: function (error) { + abp.log.error(error); + }, + + showError: function (error) { + if (error.details) { + return abp.message.error(error.details, error.message); + } else { + return abp.message.error(error.message || abp.ajax.defaultError.message); + } + }, + + handleTargetUrl: function (targetUrl) { + if (!targetUrl) { + location.href = abp.appPath; + } else { + location.href = targetUrl; + } + }, + + handleErrorStatusCode: function (status) { + switch (status) { + case 401: + abp.ajax.handleUnAuthorizedRequest( + abp.ajax.showError(abp.ajax.defaultError401), + abp.appPath + ); + break; + case 403: + abp.ajax.showError(abp.ajax.defaultError403); + break; + case 404: + abp.ajax.showError(abp.ajax.defaultError404); + break; + default: + abp.ajax.showError(abp.ajax.defaultError); + break; + } + }, + + handleNonAbpErrorResponse: function (jqXHR, userOptions, $dfd) { + if (userOptions.abpHandleError !== false) { + abp.ajax.handleErrorStatusCode(jqXHR.status); + } + + $dfd.reject.apply(this, arguments); + userOptions.error && userOptions.error.apply(this, arguments); + }, + + handleAbpErrorResponse: function (jqXHR, userOptions, $dfd) { + var messagePromise = null; + + if (userOptions.abpHandleError !== false) { + messagePromise = abp.ajax.showError(jqXHR.responseJSON.error); + } + + abp.ajax.logError(jqXHR.responseJSON.error); + + $dfd && $dfd.reject(jqXHR.responseJSON.error, jqXHR); + userOptions.error && userOptions.error(jqXHR.responseJSON.error, jqXHR); + + if (jqXHR.status === 401 && userOptions.abpHandleError !== false) { + abp.ajax.handleUnAuthorizedRequest(messagePromise); + } + }, + + handleUnAuthorizedRequest: function (messagePromise, targetUrl) { + if (messagePromise) { + messagePromise.done(function () { + abp.ajax.handleTargetUrl(targetUrl); + }); + } else { + abp.ajax.handleTargetUrl(targetUrl); + } + }, + + blockUI: function (options) { + if (options.blockUI) { + if (options.blockUI === true) { //block whole page + abp.ui.setBusy(); + } else { //block an element + abp.ui.setBusy(options.blockUI); + } + } + }, + + unblockUI: function (options) { + if (options.blockUI) { + if (options.blockUI === true) { //unblock whole page + abp.ui.clearBusy(); + } else { //unblock an element + abp.ui.clearBusy(options.blockUI); + } + } + }, + + ajaxSendHandler: function (event, request, settings) { + var token = abp.security.antiForgery.getToken(); + if (!token) { + return; + } + + if (!settings.headers || settings.headers[abp.security.antiForgery.tokenHeaderName] === undefined) { + request.setRequestHeader(abp.security.antiForgery.tokenHeaderName, token); + } + } + }); + + $(document).ajaxSend(function (event, request, settings) { + return abp.ajax.ajaxSendHandler(event, request, settings); + }); + + abp.event.on('abp.configurationInitialized', function () { + var l = abp.localization.getResource('AbpUi'); + + abp.ajax.defaultError.message = l('DefaultErrorMessage'); + abp.ajax.defaultError.details = l('DefaultErrorMessageDetail'); + abp.ajax.defaultError401.message = l('DefaultErrorMessage401'); + abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail'); + abp.ajax.defaultError403.message = l('DefaultErrorMessage403'); + abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail'); + abp.ajax.defaultError404.message = l('DefaultErrorMessage404'); + abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail'); + }); + + // RESOURCE LOADER //////////////////////////////////////////////////////// + + /* UrlStates enum */ + var UrlStates = { + LOADING: 'LOADING', + LOADED: 'LOADED', + FAILED: 'FAILED' + }; + + /* UrlInfo class */ + function UrlInfo(url) { + this.url = url; + this.state = UrlStates.LOADING; + this.loadCallbacks = []; + this.failCallbacks = []; + } + + UrlInfo.prototype.succeed = function () { + this.state = UrlStates.LOADED; + for (var i = 0; i < this.loadCallbacks.length; i++) { + this.loadCallbacks[i](); + } + }; + + UrlInfo.prototype.failed = function () { + this.state = UrlStates.FAILED; + for (var i = 0; i < this.failCallbacks.length; i++) { + this.failCallbacks[i](); + } + }; + + UrlInfo.prototype.handleCallbacks = function (loadCallback, failCallback) { + switch (this.state) { + case UrlStates.LOADED: + loadCallback && loadCallback(); + break; + case UrlStates.FAILED: + failCallback && failCallback(); + break; + case UrlStates.LOADING: + this.addCallbacks(loadCallback, failCallback); + break; + } + }; + + UrlInfo.prototype.addCallbacks = function (loadCallback, failCallback) { + loadCallback && this.loadCallbacks.push(loadCallback); + failCallback && this.failCallbacks.push(failCallback); + }; + + /* ResourceLoader API */ + + abp.ResourceLoader = (function () { + + var _urlInfos = {}; + + function getCacheKey(url) { + return url; + } + + function appendTimeToUrl(url) { + + if (url.indexOf('?') < 0) { + url += '?'; + } else { + url += '&'; + } + + url += '_=' + new Date().getTime(); + + return url; + } + + var _loadFromUrl = function (url, loadCallback, failCallback, serverLoader) { + + var cacheKey = getCacheKey(url); + + var urlInfo = _urlInfos[cacheKey]; + + if (urlInfo) { + urlInfo.handleCallbacks(loadCallback, failCallback); + return; + } + + _urlInfos[cacheKey] = urlInfo = new UrlInfo(url); + urlInfo.addCallbacks(loadCallback, failCallback); + + serverLoader(urlInfo); + }; + + var _loadScript = function (url, loadCallback, failCallback) { + _loadFromUrl(url, loadCallback, failCallback, function (urlInfo) { + $.get({ + url: url, + dataType: 'text' + }) + .done(function (script) { + $.globalEval(script); + urlInfo.succeed(); + }) + .fail(function () { + urlInfo.failed(); + }); + }); + }; + + var _loadStyle = function (url) { + _loadFromUrl(url, undefined, undefined, function (urlInfo) { + + $('', { + rel: 'stylesheet', + type: 'text/css', + href: appendTimeToUrl(url) + }).appendTo('head'); + }); + }; + + return { + loadScript: _loadScript, + loadStyle: _loadStyle + } + })(); + })(jQuery); \ No newline at end of file diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/yarn.lock b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/yarn.lock index 8a69d469f0..857eab952e 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/yarn.lock +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/yarn.lock @@ -2,37 +2,37 @@ # yarn lockfile v1 -"@abp/aspnetcore.mvc.ui.theme.basic@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-2.1.0.tgz#f815001bd856fb5cbdd0b736181f2401a1a7ec62" - integrity sha512-ej6dhUo3H9w6bpBTpMhk3M6zbC3fVAVMm5yLSYlYJ0sQxjb9PqC02OgiJme0mkxCUMwPuHVSQLrMQbioXdZu3A== +"@abp/aspnetcore.mvc.ui.theme.basic@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-2.2.0.tgz#e7f4e57d2b17cc76388e9c56bc34d50c9658873b" + integrity sha512-S9GQ9YVg4DWrgjujwiXBER6KqdqW5nZ1Bmt+YEePn5gEoPvoVrh6ojthpHYRjBJtGFqBSzRAQ9eVZLebT22Ozg== dependencies: - "@abp/aspnetcore.mvc.ui.theme.shared" "^2.1.0" + "@abp/aspnetcore.mvc.ui.theme.shared" "^2.2.0" -"@abp/aspnetcore.mvc.ui.theme.shared@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-2.1.0.tgz#c2790241b5a44b9d6e4f65911a1b9d9e9104ed82" - integrity sha512-dxC0P/b1T+QJmRrB8HoLM7/GkWblz/X5lLqgn583W7/OTYhvxIxszuRDy/XIEuS+fP6a9rcGvGu5jcKJEqe/xA== - dependencies: - "@abp/aspnetcore.mvc.ui" "^2.1.0" - "@abp/bootstrap" "^2.1.0" - "@abp/bootstrap-datepicker" "^2.1.0" - "@abp/datatables.net-bs4" "^2.1.0" - "@abp/font-awesome" "^2.1.0" - "@abp/jquery-form" "^2.1.0" - "@abp/jquery-validation-unobtrusive" "^2.1.0" - "@abp/lodash" "^2.1.0" - "@abp/luxon" "^2.1.0" - "@abp/malihu-custom-scrollbar-plugin" "^2.1.0" - "@abp/select2" "^2.1.0" - "@abp/sweetalert" "^2.1.0" - "@abp/timeago" "^2.1.0" - "@abp/toastr" "^2.1.0" - -"@abp/aspnetcore.mvc.ui@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-2.1.0.tgz#3c86f42e52af3151d2aee0ffdd1281014ea61054" - integrity sha512-pKiKMBOPuLm7p44DW8DdbsVn5PY3NqGYkz6gf75uzxyWiVYyl2CM/bvX9w4Ie7Q969owENMLrBREN6ezWZ5ynA== +"@abp/aspnetcore.mvc.ui.theme.shared@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-2.2.0.tgz#e0df953853be2a184d323931573f9f98aebbaa62" + integrity sha512-urxziaCdvfEqN5cjiiM5f5dx2Yr+AoGqCJVCo0Okjl2dosdaj5DH4SBzMvKAaLXzo3Ep1h4b3Wvws4BThL/6rA== + dependencies: + "@abp/aspnetcore.mvc.ui" "^2.2.0" + "@abp/bootstrap" "^2.2.0" + "@abp/bootstrap-datepicker" "^2.2.0" + "@abp/datatables.net-bs4" "^2.2.0" + "@abp/font-awesome" "^2.2.0" + "@abp/jquery-form" "^2.2.0" + "@abp/jquery-validation-unobtrusive" "^2.2.0" + "@abp/lodash" "^2.2.0" + "@abp/luxon" "^2.2.0" + "@abp/malihu-custom-scrollbar-plugin" "^2.2.0" + "@abp/select2" "^2.2.0" + "@abp/sweetalert" "^2.2.0" + "@abp/timeago" "^2.2.0" + "@abp/toastr" "^2.2.0" + +"@abp/aspnetcore.mvc.ui@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-2.2.0.tgz#b2cdd421eed09ec1d30ae85e14434b7efc094ade" + integrity sha512-IO/AjhJu+LUa9zOaT8JlEnV+Pcp9oQ3q9kTq8kmMakC35vTIyvBpB3nnykXIOytZSyjsBgFYB/uMxPgBOjWagg== dependencies: ansi-colors "^4.1.1" extend-object "^1.0.0" @@ -41,135 +41,135 @@ path "^0.12.7" rimraf "^3.0.0" -"@abp/bootstrap-datepicker@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-2.1.0.tgz#a0d71da15cb3d3cc02f9a390437a44db5e9f9ea1" - integrity sha512-lkNI0iyefiXS2O5x9Ae9eJQLPXSQlOWDX7QhKnBHLR9JxjJEnhBUIIOylMltAIqtVDtjk2ikDyd3BAiyBdtB/w== +"@abp/bootstrap-datepicker@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-2.2.0.tgz#a2f50b422824f18ed4b7e80be6852e2979119f8e" + integrity sha512-X9jT5mU42QFfVhOZdun7aEJUf3bMko6NsG3NFQVjqTqKH+iYGKfHPFpXD0gP/6Nb4KgZUdId8hSyQTZyOK2JEA== dependencies: bootstrap-datepicker "^1.9.0" -"@abp/bootstrap@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-2.1.0.tgz#7ce15d4effac0e0991a3520c4666c6cb17a3fef2" - integrity sha512-1xQjqu6shCgzd1FI94y5AIXGIhBlZEoRrOhaT84j/2KzYiDvhP+LAqQjMgqlQmBLs6vMckpxtf5thxKTMXvtOw== +"@abp/bootstrap@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-2.2.0.tgz#16e41d3432117bbcd9012c6f735c49c543255879" + integrity sha512-aRmluu6SkIl+JgCzSSJZrDPkYr6WWaQdY0iJAOz6NHtffa7Aumh1IUOrLVKL0T1pQn6QKs0Z7JDGyYMdh1HPkQ== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" bootstrap "^4.3.1" -"@abp/core@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/core/-/core-2.1.0.tgz#0cd2850f029df1d18517b8e74c70341972c37ed7" - integrity sha512-1wnRo00hWncZWSakaEXm388XhhbKXDVkWDIdaT3kyQpvp3kX1lFx7I5iiZiwIeULwZRF9mi6HV6iHEze58x0kQ== +"@abp/core@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/core/-/core-2.2.0.tgz#4eea0a06458c90acb8566a11eb841fe65d15d256" + integrity sha512-tBGHa5CUr0ewT31g689RAfQ6Su2p4uyn2PzmrW/8lahBrvqkoCb41fkCDLQJkTY5rKPrEKZd/s9OoyOnS20DLg== -"@abp/datatables.net-bs4@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-2.1.0.tgz#a0f36cf4e3ef96ae03aa4b9956fcb8b971c854cb" - integrity sha512-93qc2rrGs+JKRPM/7UCasa5VmfswgYU8cv3Ybg5OKoaASODYUn06GChRFnd/mvqcDxw4+8gaqpC3U2ETZZI4pA== +"@abp/datatables.net-bs4@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs4/-/datatables.net-bs4-2.2.0.tgz#c7cc49e889b295ae10fb24ed62b154ef79ffc85a" + integrity sha512-zjJRPqOCWPfkHt1QztfFHKrsTE9o6Je2EpfA7hRMej2FlGbsMWUxOqx/btK1vjD6YIU8DtVDpIdj1WvPOITQ4Q== dependencies: - "@abp/datatables.net" "^2.1.0" + "@abp/datatables.net" "^2.2.0" datatables.net-bs4 "^1.10.20" -"@abp/datatables.net@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-2.1.0.tgz#674eaaa5b0948d7ee85b6605bfbad1a70f839aa7" - integrity sha512-3ZM2p+JpHumxbIKlDP/LKLsfceMdttdTOL0ckIZCmAAgoIeKmAtuMoKcHTr8lj5mjgv4arBGvG9WVCemep2PEw== +"@abp/datatables.net@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-2.2.0.tgz#22f9c7ca90c2d4af264483b4f8286b0feb7c3d52" + integrity sha512-L4MnpdloSWr/px3mvV75sxsxL68MyALB2LKdzCFMQWILCZVkxMmQb9LARINYIrn461Wrc+zbYWNEBD0MAq7flg== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" datatables.net "^1.10.20" -"@abp/font-awesome@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-2.1.0.tgz#c2e628a1b9d0525e7d6950bf007feebcd1c490c8" - integrity sha512-vlm1IQuQVfuCI2O1vphDd11zUEJ4/4PU0/0XI1YCpilse8fBg080CM3+G0kw6Erm/riznqhOJwBcfT+K+zqk8A== +"@abp/font-awesome@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-2.2.0.tgz#2de39e3c6c3e8c30394d82861761a66c5b4032f0" + integrity sha512-RT06MYUGgaWBEpW5c7wUcfMXgxcOHWdX/C01LDO/j6iVoKBuBHOkkvcUoTWII068ECrLYOkj+RyT59dCKm8FFw== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" "@fortawesome/fontawesome-free" "^5.11.2" -"@abp/jquery-form@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-2.1.0.tgz#285dbfdcf722cb0249f149e728cef7f788410c0c" - integrity sha512-A17rjHTiBJBKYgrtDX5wIqnI89wNmo3bdK9NagL1wMFj4GvDyOZoRIDLqkopYQsc8zuPjqw4+1aa2TPiA+jtKg== +"@abp/jquery-form@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-2.2.0.tgz#951653fac4013a7bbec065b5101b86d575e0eca7" + integrity sha512-ji44E3Ud0S3LNXn1WJ/Aw44qAIG7EITEW1KOe46oz+/awPpbiiA4dDDNleTvO2jI2/s8mNyR0bNanP6BUsc7tw== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" jquery-form "^4.2.2" -"@abp/jquery-validation-unobtrusive@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-2.1.0.tgz#fc938775ced2efc686e7dd092d6ceff1ea947f36" - integrity sha512-a8iBIj6amJ9rQNV+wxQUuEVh93M/c32kJcrwSEPWQcOoTj5gf0j8eKK9YvZaGokpylraz9mdGOwYQQuNj1sxEw== +"@abp/jquery-validation-unobtrusive@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-2.2.0.tgz#6d39ba9f7bf026d1380796bf5dff76c8d16b42ce" + integrity sha512-SuS/dRRVz7ZR4HK/h9x0jRRVLPqXN0CPRGPdJZ1LJraXVEJ9/eDEGf1rMlHmEGt1FXXFTD01/zjisbweDE786w== dependencies: - "@abp/jquery-validation" "^2.1.0" + "@abp/jquery-validation" "^2.2.0" jquery-validation-unobtrusive "^3.2.11" -"@abp/jquery-validation@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-2.1.0.tgz#2bf1a31321cce3b2abe6d56c6112c52a8ecb28b6" - integrity sha512-kU6/E+Xc3wHAUs+sGMAL8uozkXv65HnpksTwV4/+RK+D6iFU2EyNgCEFu7QGSwYZsV1/7YsCe2GD4ucBXIknbA== +"@abp/jquery-validation@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-2.2.0.tgz#02bb8ba883e72c1204867ee4d1c1094bd91c4c4c" + integrity sha512-ypITQloO4iEDgqlA6qb3taj+7HMX0Cf/ACA2OvtrvOgJejx6J4wfrPjwuFZu1WWJ0xtc9yTdbovdcSVcQbIGaA== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" jquery-validation "^1.19.1" -"@abp/jquery@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-2.1.0.tgz#fb5b4c9e8622cf46fee92f9f731d007d5fb200bb" - integrity sha512-ZpfzRut5G611bBmuDdiT6BD0M7Rl1P6r8uNxUjdmFXYwFd8wD02ZhIcsX7qFHFkYERuXfcLrZh4rpw9G1DVCJg== +"@abp/jquery@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-2.2.0.tgz#0e641b1109e78eff4c34331ca2b123b67cc30cbe" + integrity sha512-vEfRoFEAmDmRgSq98Y9EZExfQFSWtmjaHrodUu+MadTcRlnn+wHq8wwkKKxpj/eYtNc8aFORpyHMMH7uliAKxg== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" jquery "^3.4.1" -"@abp/lodash@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-2.1.0.tgz#9fc9e6521e6284d607cedbff1a458fa324137c5c" - integrity sha512-s1gTHhpbmEDDCsZeXb9MpClkDS4wH5R2IWPRZUlSPxo3gF0pvkx5ubdhYUEUgqy5QqWxE/+zUAjDc4x+cEriFQ== +"@abp/lodash@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-2.2.0.tgz#af0a2ebcb28fd0a8c02da5026479d9370ed19719" + integrity sha512-wOMLqIpuq4a7ww7pB138G6YxBiTGBgxNW/IWGUiWbfgrr88cGPKIYYv/8O8mvr8PLNGjizNynuwQRj522yA3Dw== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" lodash "^4.17.15" -"@abp/luxon@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-2.1.0.tgz#624796722119f075119006b436054aecbb38f15f" - integrity sha512-2b0sRo6rdYT1wDu9nSXm/9o8rhQ9ED7FxrDMYabYuOQz48esgn4fBUNcPqpxwejpFmlhZY6CONvkddNtaMeVHw== +"@abp/luxon@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-2.2.0.tgz#0d0e78edc249853fa31eceecc00df2846a879aa9" + integrity sha512-WbOW0PcMks+WXRPWt/+H4pOa5waM331WkY0F+EJx8fpxemNGQNUEXLkuMXzN3MrN6LrplM9AZ9i+NRA9PWHbNw== dependencies: luxon "^1.21.3" -"@abp/malihu-custom-scrollbar-plugin@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-2.1.0.tgz#f4dc1a32cefc3de8af08cb6d585ec5f7636a0c5e" - integrity sha512-WcxzCZ5YOMxGxZerEh966cVrFSCw1UTDqwU2rxA/LsHEbPKd69AY+SHvUiacNxPXs1ZCF6FFJ29C5dWicEIRaQ== +"@abp/malihu-custom-scrollbar-plugin@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-2.2.0.tgz#e11fd46dccbb28d44fb199e880b91d27c94f1919" + integrity sha512-YDu/NLpIzMA96NDHxd27/+liTm3sow9M+oWH29+9JW8o/AEpXUH3T3AmoXXcTgsBlzLaewgHEFM8yxsAAFoj8Q== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" malihu-custom-scrollbar-plugin "^3.1.5" -"@abp/select2@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-2.1.0.tgz#79e50d2c25e74a5f96520e8aa1433d79aea674d1" - integrity sha512-ut/3c+lFdoepuDH36M7thWagmAmTFrChcPnhYjTx4MmIf31WW1BwqOSx3I2g8M+NEEx+V2jTNuBpTq7PONgSJg== +"@abp/select2@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-2.2.0.tgz#4639d4e5b72b1736fa4476bd9b6a78e036400421" + integrity sha512-tc87JyM0kvVF388kyGUjDby49Zrrb089jVRRipoIaxXeu4M1YxEFSKBEcUK1MohZWjVtWrNs8MoxPlfukaMpyw== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" select2 "^4.0.12" -"@abp/sweetalert@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-2.1.0.tgz#88f405c4ba9f9ed2fd54b945ed6bc48d5ae2fa23" - integrity sha512-EWvReqxZ1DrNH9XD+cf/yGVj+8IPTpuoPuWKDryN4fF7TCMJA+KrXp5lFxpjfkKTtNzLeFGsJqDFWaUifxtqTA== +"@abp/sweetalert@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/sweetalert/-/sweetalert-2.2.0.tgz#dfc60ba085522d8390e41b90bf5a3d474f4ae624" + integrity sha512-HS6TKOwP91UjzjZHaheurZ1AYUSMkQyCSmoX6g5LAK4eH8IIgpojVSp1AFCSPATrFsFWY/dzkDGcfu90FWsVBg== dependencies: - "@abp/core" "^2.1.0" + "@abp/core" "^2.2.0" sweetalert "^2.1.2" -"@abp/timeago@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-2.1.0.tgz#28c0aef88aff8b54d1dfb42a664d05097e7fda35" - integrity sha512-NklUYcWeji7po+Y6Oi7b7IkYmjd5YRu123bm3MqjQ71AzuOCTFbvPMHzYOjrUTkzr6gW3IJ24LQ4YmpshPy4ZQ== +"@abp/timeago@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-2.2.0.tgz#9a8297f36a46cdc4cc62f44d0fdc91b70def389c" + integrity sha512-8qjmKscsTvPznHKWEsddYxdSBiU+l+OgLG6vzMcSWqngYbDQGXqNA93BwJI2qiwd+FkNcfGgYg7CN7bcwzmaiw== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" timeago "^1.6.7" -"@abp/toastr@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-2.1.0.tgz#22a53a2b1f354770fdc7b37f06bec10eefccfe7a" - integrity sha512-hD3hTDx+CixTVTx73rnZDiiFkfSxpZox8RLm+CiFA62ORdO8Ryij8TOXXkJd84b2tJfkAkYehohVXKwHlHU7Zg== +"@abp/toastr@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-2.2.0.tgz#1cad83a89da244685b3c82adff64260b7ccf4742" + integrity sha512-HHfSaw4M/9zS+KgzxGvbHYiQ5qcJgpf21cRZEo16aUwnTeKr4SRaewAWryNn4dKcIO2YNrhzDLH+OYbEaJJlDQ== dependencies: - "@abp/jquery" "^2.1.0" + "@abp/jquery" "^2.2.0" toastr "^2.1.4" "@fortawesome/fontawesome-free@^5.11.2": diff --git a/tools/github-changelog-generator/changelog.md b/tools/github-changelog-generator/changelog.md deleted file mode 100644 index e753f610c6..0000000000 Binary files a/tools/github-changelog-generator/changelog.md and /dev/null differ