Skip to content

Commit 75a076c

Browse files
committed
Update_NPM_Packages
1 parent e9e1c89 commit 75a076c

File tree

618 files changed

+25473
-52595
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

618 files changed

+25473
-52595
lines changed

modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "asp.net",
44
"private": true,
55
"dependencies": {
6-
"@abp/aspnetcore.mvc.ui.theme.shared": "^6.0.1",
6+
"@abp/aspnetcore.mvc.ui.theme.shared": "^7.0.0-rc.1",
77
"highlight.js": "^9.13.1"
88
},
99
"devDependencies": {}

modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/wwwroot/libs/abp/core/abp.js

Lines changed: 63 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -72,59 +72,90 @@ var abp = abp || {};
7272
/* LOCALIZATION ***********************************************/
7373

7474
abp.localization = abp.localization || {};
75-
75+
abp.localization.internal = abp.localization.internal || {};
7676
abp.localization.values = abp.localization.values || {};
77-
78-
abp.localization.localize = function (key, sourceName) {
79-
if (sourceName === '_') { //A convention to suppress the localization
80-
return key;
77+
abp.localization.resources = abp.localization.resources || {};
78+
79+
abp.localization.internal.getResource = function (resourceName) {
80+
var resource = abp.localization.resources[resourceName];
81+
if (resource) {
82+
return resource;
83+
}
84+
85+
var legacySource = abp.localization.values[resourceName];
86+
if (legacySource) {
87+
return {
88+
texts: abp.localization.values[resourceName],
89+
baseResources: []
90+
};
8191
}
82-
83-
sourceName = sourceName || abp.localization.defaultResourceName;
84-
if (!sourceName) {
85-
abp.log.warn('Localization source name is not specified and the defaultResourceName was not defined!');
86-
return key;
92+
93+
abp.log.warn('Could not find localization source: ' + resourceName);
94+
return null;
95+
};
96+
97+
abp.localization.internal.localize = function (key, sourceName) {
98+
var resource = abp.localization.internal.getResource(sourceName);
99+
if (!resource){
100+
return {
101+
value: key,
102+
found: false
103+
};
87104
}
88105

89-
var source = abp.localization.values[sourceName];
90-
if (!source) {
91-
abp.log.warn('Could not find localization source: ' + sourceName);
92-
return key;
93-
}
106+
var value = resource.texts[key];
107+
if (value === undefined) {
108+
for (var i = 0; i < resource.baseResources.length; i++){
109+
var basedArguments = Array.prototype.slice.call(arguments, 0);
110+
basedArguments[1] = resource.baseResources[i];
94111

95-
var value = source[key];
96-
if (value == undefined) {
97-
return key;
112+
var result = abp.localization.internal.localize.apply(this, basedArguments);
113+
if (result.found){
114+
return result;
115+
}
116+
}
117+
118+
return {
119+
value: key,
120+
found: false
121+
};
98122
}
99123

100124
var copiedArguments = Array.prototype.slice.call(arguments, 0);
101125
copiedArguments.splice(1, 1);
102126
copiedArguments[0] = value;
103127

104-
return abp.utils.formatString.apply(this, copiedArguments);
128+
return {
129+
value: abp.utils.formatString.apply(this, copiedArguments),
130+
found: true
131+
};
105132
};
106133

107-
abp.localization.isLocalized = function (key, sourceName) {
134+
abp.localization.localize = function (key, sourceName) {
108135
if (sourceName === '_') { //A convention to suppress the localization
109-
return true;
136+
return key;
110137
}
111138

112139
sourceName = sourceName || abp.localization.defaultResourceName;
113140
if (!sourceName) {
114-
return false;
141+
abp.log.warn('Localization source name is not specified and the defaultResourceName was not defined!');
142+
return key;
115143
}
116144

117-
var source = abp.localization.values[sourceName];
118-
if (!source) {
119-
return false;
145+
return abp.localization.internal.localize.apply(this, arguments).value;
146+
};
147+
148+
abp.localization.isLocalized = function (key, sourceName) {
149+
if (sourceName === '_') { //A convention to suppress the localization
150+
return true;
120151
}
121152

122-
var value = source[key];
123-
if (value === undefined) {
153+
sourceName = sourceName || abp.localization.defaultResourceName;
154+
if (!sourceName) {
124155
return false;
125156
}
126157

127-
return true;
158+
return abp.localization.internal.localize(key, sourceName).found;
128159
};
129160

130161
abp.localization.getResource = function (name) {
@@ -173,12 +204,10 @@ var abp = abp || {};
173204

174205
abp.auth = abp.auth || {};
175206

176-
abp.auth.policies = abp.auth.policies || {};
177-
178207
abp.auth.grantedPolicies = abp.auth.grantedPolicies || {};
179208

180209
abp.auth.isGranted = function (policyName) {
181-
return abp.auth.policies[policyName] != undefined && abp.auth.grantedPolicies[policyName] != undefined;
210+
return abp.auth.grantedPolicies[policyName] != undefined;
182211
};
183212

184213
abp.auth.isAnyGranted = function () {
@@ -687,7 +716,7 @@ var abp = abp || {};
687716
}
688717

689718
/**
690-
* Escape HTML to help prevent XSS attacks.
719+
* Escape HTML to help prevent XSS attacks.
691720
*/
692721
abp.utils.htmlEscape = function (html) {
693722
return typeof html === 'string' ? html.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;') : html;
@@ -759,7 +788,7 @@ var abp = abp || {};
759788
return toUtc(date);
760789
}
761790
};
762-
791+
763792
/* FEATURES *************************************************/
764793

765794
abp.features = abp.features || {};
@@ -774,7 +803,7 @@ var abp = abp || {};
774803
abp.features.get = function (name) {
775804
return abp.features.values[name];
776805
};
777-
806+
778807
/* GLOBAL FEATURES *************************************************/
779808

780809
abp.globalFeatures = abp.globalFeatures || {};

0 commit comments

Comments
 (0)