Skip to content

Commit fd88b0d

Browse files
committed
Updated to ABP v0.2.3
1 parent b92b554 commit fd88b0d

File tree

34 files changed

+1335
-498
lines changed

34 files changed

+1335
-498
lines changed

SimpleTaskSystemSPA_Durandal_NHibernate/SimpleTaskSystem.Application/SimpleTaskSystem.Application.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@
3030
<WarningLevel>4</WarningLevel>
3131
</PropertyGroup>
3232
<ItemGroup>
33-
<Reference Include="Abp, Version=0.2.2.1, Culture=neutral, processorArchitecture=MSIL">
33+
<Reference Include="Abp, Version=0.2.3.0, Culture=neutral, processorArchitecture=MSIL">
3434
<SpecificVersion>False</SpecificVersion>
35-
<HintPath>..\packages\Abp.0.2.2.1\lib\net451\Abp.dll</HintPath>
35+
<HintPath>..\packages\Abp.0.2.3.0\lib\net451\Abp.dll</HintPath>
3636
</Reference>
37-
<Reference Include="Abp.Application, Version=0.2.2.1, Culture=neutral, processorArchitecture=MSIL">
37+
<Reference Include="Abp.Application, Version=0.2.3.0, Culture=neutral, processorArchitecture=MSIL">
3838
<SpecificVersion>False</SpecificVersion>
39-
<HintPath>..\packages\Abp.Application.0.2.2.1\lib\net451\Abp.Application.dll</HintPath>
39+
<HintPath>..\packages\Abp.Application.0.2.3.0\lib\net451\Abp.Application.dll</HintPath>
4040
</Reference>
4141
<Reference Include="AutoMapper, Version=3.2.1.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
4242
<SpecificVersion>False</SpecificVersion>

SimpleTaskSystemSPA_Durandal_NHibernate/SimpleTaskSystem.Application/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Abp" version="0.2.2.1" targetFramework="net451" />
4-
<package id="Abp.Application" version="0.2.2.1" targetFramework="net451" />
3+
<package id="Abp" version="0.2.3.0" targetFramework="net451" />
4+
<package id="Abp.Application" version="0.2.3.0" targetFramework="net451" />
55
<package id="AutoMapper" version="3.2.1" targetFramework="net451" />
66
<package id="Castle.Core" version="3.3.0" targetFramework="net451" />
77
<package id="Castle.LoggingFacility" version="3.3.0" targetFramework="net451" />

SimpleTaskSystemSPA_Durandal_NHibernate/SimpleTaskSystem.Core/SimpleTaskSystem.Core.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
<WarningLevel>4</WarningLevel>
3131
</PropertyGroup>
3232
<ItemGroup>
33-
<Reference Include="Abp, Version=0.2.2.1, Culture=neutral, processorArchitecture=MSIL">
33+
<Reference Include="Abp, Version=0.2.3.0, Culture=neutral, processorArchitecture=MSIL">
3434
<SpecificVersion>False</SpecificVersion>
35-
<HintPath>..\packages\Abp.0.2.2.1\lib\net451\Abp.dll</HintPath>
35+
<HintPath>..\packages\Abp.0.2.3.0\lib\net451\Abp.dll</HintPath>
3636
</Reference>
3737
<Reference Include="Castle.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
3838
<SpecificVersion>False</SpecificVersion>

SimpleTaskSystemSPA_Durandal_NHibernate/SimpleTaskSystem.Core/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Abp" version="0.2.2.1" targetFramework="net451" />
3+
<package id="Abp" version="0.2.3.0" targetFramework="net451" />
44
<package id="Castle.Core" version="3.3.0" targetFramework="net451" />
55
<package id="Castle.LoggingFacility" version="3.3.0" targetFramework="net451" />
66
<package id="Castle.Windsor" version="3.3.0" targetFramework="net451" />

SimpleTaskSystemSPA_Durandal_NHibernate/SimpleTaskSystem.Infrastructure.NHibernate/SimpleTaskSystem.Infrastructure.NHibernate.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@
3030
<WarningLevel>4</WarningLevel>
3131
</PropertyGroup>
3232
<ItemGroup>
33-
<Reference Include="Abp, Version=0.2.2.1, Culture=neutral, processorArchitecture=MSIL">
33+
<Reference Include="Abp, Version=0.2.3.0, Culture=neutral, processorArchitecture=MSIL">
3434
<SpecificVersion>False</SpecificVersion>
35-
<HintPath>..\packages\Abp.0.2.2.1\lib\net451\Abp.dll</HintPath>
35+
<HintPath>..\packages\Abp.0.2.3.0\lib\net451\Abp.dll</HintPath>
3636
</Reference>
37-
<Reference Include="Abp.Infrastructure.NHibernate, Version=0.2.2.1, Culture=neutral, processorArchitecture=MSIL">
37+
<Reference Include="Abp.Infrastructure.NHibernate, Version=0.2.3.0, Culture=neutral, processorArchitecture=MSIL">
3838
<SpecificVersion>False</SpecificVersion>
39-
<HintPath>..\packages\Abp.Infrastructure.NHibernate.0.2.2.1\lib\net451\Abp.Infrastructure.NHibernate.dll</HintPath>
39+
<HintPath>..\packages\Abp.Infrastructure.NHibernate.0.2.3.0\lib\net451\Abp.Infrastructure.NHibernate.dll</HintPath>
4040
</Reference>
4141
<Reference Include="Castle.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
4242
<SpecificVersion>False</SpecificVersion>

SimpleTaskSystemSPA_Durandal_NHibernate/SimpleTaskSystem.Infrastructure.NHibernate/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Abp" version="0.2.2.1" targetFramework="net451" />
4-
<package id="Abp.Infrastructure.NHibernate" version="0.2.2.1" targetFramework="net451" />
3+
<package id="Abp" version="0.2.3.0" targetFramework="net451" />
4+
<package id="Abp.Infrastructure.NHibernate" version="0.2.3.0" targetFramework="net451" />
55
<package id="Castle.Core" version="3.3.0" targetFramework="net451" />
66
<package id="Castle.LoggingFacility" version="3.3.0" targetFramework="net451" />
77
<package id="Castle.Windsor" version="3.3.0" targetFramework="net451" />

SimpleTaskSystemSPA_Durandal_NHibernate/SimpleTaskSystem.Web/Abp/Framework/scripts/abp.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,32 @@
11
var abp = abp || {};
22
(function () {
33

4+
/* Application paths *****************************************/
5+
6+
//Current application root path (including virtual directory if exists).
7+
abp.appPath = abp.appPath || '/';
8+
9+
//Converts given path to absolute path using abp.appPath variable.
10+
abp.toAbsAppPath = function (path) {
11+
if (path.indexOf('/') == 0) {
12+
path = path.substring(1);
13+
}
14+
15+
return abp.appPath + path;
16+
};
17+
418
/* LOCALIZATON ***********************************************/
519
//Implements Localization API that simplifies usage of localization scripts generated by Abp.
620

721
abp.localization = abp.localization || {};
822

23+
abp.localization.defaultSourceName = undefined;
24+
925
abp.localization.localize = function (key, sourceName) {
26+
sourceName = sourceName || abp.localization.defaultSourceName;
27+
1028
var source = abp.localization.values[sourceName];
29+
1130
if (source == undefined) {
1231
abp.log.warn('Could not find localization source: ' + sourceName);
1332
return key;

SimpleTaskSystemSPA_Durandal_NHibernate/SimpleTaskSystem.Web/Abp/Framework/scripts/libs/abp.spin.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,16 @@
5555
}
5656
}
5757

58-
if (options.promise) {
59-
options.promise.always(function () {
60-
abp.ui.clearBusy(elm);
61-
});
58+
if (options.promise) { //Supports Q and jQuery.Deferred
59+
if (options.promise.always) {
60+
options.promise.always(function () {
61+
abp.ui.clearBusy(elm);
62+
});
63+
} else if (options.promise.finally) {
64+
options.promise.finally(function () {
65+
abp.ui.clearBusy(elm);
66+
});
67+
}
6268
}
6369
};
6470

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
(function (abp, angular) {
2+
3+
if (!angular) {
4+
return;
5+
}
6+
7+
var abpModule = angular.module('abp', []);
8+
9+
abpModule.config([
10+
'$httpProvider', function ($httpProvider) {
11+
$httpProvider.interceptors.push(function ($q) {
12+
13+
var defaultError = {
14+
message: 'Ajax request is not succeed!',
15+
details: 'Error detail is not sent by server.'
16+
};
17+
18+
return {
19+
20+
'request': function (config) {
21+
if (endsWith(config.url, '.cshtml')) {
22+
config.url = abp.appPath + 'AbpAppView/Load?viewUrl=' + config.url;
23+
}
24+
25+
return config;
26+
},
27+
28+
'response': function (response) {
29+
if (!response.config || !response.config.abp || !response.data) {
30+
return response;
31+
}
32+
33+
var originalData = response.data;
34+
var defer = $q.defer();
35+
36+
if (originalData.success === true) {
37+
response.data = originalData.result;
38+
defer.resolve(response);
39+
} else { //data.success === false
40+
if (originalData.error) {
41+
abp.message.error(originalData.error.message);
42+
} else {
43+
originalData.error = defaultError;
44+
}
45+
46+
abp.log.error(originalData.error.message + ' | ' + originalData.error.details);
47+
48+
response.data = originalData.error;
49+
defer.reject(response);
50+
51+
if (originalData.unAuthorizedRequest && !originalData.targetUrl) {
52+
location.reload();
53+
}
54+
}
55+
56+
if (originalData.targetUrl) {
57+
location.href = originalData.targetUrl;
58+
}
59+
60+
return defer.promise;
61+
}
62+
63+
};
64+
});
65+
}
66+
]);
67+
68+
function endsWith(str, suffix) {
69+
if (suffix.length > str.length) {
70+
return false;
71+
}
72+
73+
return str.indexOf(suffix, str.length - suffix.length) !== -1;
74+
}
75+
76+
})((abp || (abp = {})), (angular || undefined));

SimpleTaskSystemSPA_Durandal_NHibernate/SimpleTaskSystem.Web/Abp/Framework/scripts/libs/requirejs/plugins/service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
define(function () {
22
return {
33
load: function (name, req, onload, config) {
4-
var url = '/api/AbpServiceProxies/Get?name=' + name;
4+
var url = abp.appPath + 'api/AbpServiceProxies/Get?name=' + name;
55
req([url], function (value) {
66
onload(value);
77
});

0 commit comments

Comments
 (0)