Skip to content

Commit 16dc374

Browse files
committed
Modified durandal sample for latest ABP system.
1 parent 2626871 commit 16dc374

26 files changed

+888
-182
lines changed

SimpleTaskSystem/SimpleTaskSystem.WebSpaDurandal/App/Common/styles/main.min.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

SimpleTaskSystem/SimpleTaskSystem.WebSpaDurandal/App/Common/styles/main.css renamed to SimpleTaskSystem/SimpleTaskSystem.WebSpaDurandal/App/Main/main.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
body {
1+
body {
22
padding-top: 80px;
33
}
4+
.durandal-animation-container {
5+
position: relative;
6+
}
47
.task-description-active {
58
font-weight: bold;
69
}

SimpleTaskSystem/SimpleTaskSystem.WebSpaDurandal/App/Main/main.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//TODO: Move to framework?
1+
//Shortcuts
22
requirejs.config({
33
paths: {
44
'text': '../../Scripts/text',
@@ -16,15 +16,16 @@ define('knockout', function () { return ko; });
1616

1717
define(['durandal/system', 'durandal/app', 'durandal/viewLocator', 'durandal/viewEngine', 'durandal/activator', 'knockout'],
1818
function (system, app, viewLocator, viewEngine, activator, ko) {
19-
//system.debug(true); //TODO: remove in production code
19+
//system.debug(true); //Enable this line only in debug!
2020

21-
//TODO: Move to framework?
21+
ko.punches.enableAll();
22+
23+
//This is needed to use cshtml files as view
2224
viewEngine.convertViewIdToRequirePath = function (viewId) {
2325
return this.viewPlugin + '!/AbpAppView/Load?viewUrl=/App/Main/' + viewId + '.cshtml';
2426
};
2527

26-
//TODO: Is that good?
27-
//Assume true if not false
28+
//This is needed to return deffered as return values in methods like canActivate.
2829
activator.defaults.interpretResponse = function (value) {
2930
if (system.isObject(value)) {
3031
value = value.can == undefined ? true : value.can;
@@ -42,7 +43,8 @@ define(['durandal/system', 'durandal/app', 'durandal/viewLocator', 'durandal/vie
4243
app.configurePlugins({
4344
router: true,
4445
dialog: true,
45-
widget: true
46+
widget: true,
47+
observable: true
4648
});
4749

4850
app.start().then(function () {

SimpleTaskSystem/SimpleTaskSystem.WebSpaDurandal/App/Common/styles/main.less renamed to SimpleTaskSystem/SimpleTaskSystem.WebSpaDurandal/App/Main/main.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
padding-top: 80px;
33
}
44

5+
.durandal-animation-container {
6+
position: relative;
7+
}
8+
59
.task-description-active {
610
font-weight: bold;
711
}

SimpleTaskSystem/SimpleTaskSystem.WebSpaDurandal/App/Main/main.min.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
@using System.Web.Optimization
2+
@{
3+
Layout = null;
4+
}
5+
<!DOCTYPE html>
6+
<html lang="en">
7+
<head>
8+
<meta charset="utf-8">
9+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
10+
<meta name="viewport" content="width=device-width, initial-scale=1">
11+
<meta name="description" content="">
12+
<meta name="author" content="">
13+
14+
<link rel="shortcut icon" href="~/favicon.ico">
15+
16+
<title>MySpaProject</title>
17+
18+
@Styles.Render("~/Bundles/App/vendor/css")
19+
@Styles.Render("~/Bundles/App/Main/css")
20+
21+
<script type="text/javascript">
22+
//This is used to get the application's root path from javascript. It's useful if you're running application in a virtual directory under IIS.
23+
var abp = abp || {}; abp.appPath = '@ApplicationPath';
24+
</script>
25+
26+
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
27+
<!--[if lt IE 9]>
28+
<script src="@Url.Content("~/Scripts/others/html5shiv.js")"></script>
29+
<script src="@Url.Content("~/Scripts/others/respond.min.js")"></script>
30+
<![endif]-->
31+
32+
@Scripts.Render("~/Bundles/vendor/js/top")
33+
34+
</head>
35+
<body>
36+
<div id="applicationHost"></div>
37+
38+
@Scripts.Render("~/Bundles/vendor/js/bottom")
39+
40+
<!-- Dynamic script for client side localization (It's created on runtime) -->
41+
<script src="~/AbpLocalization/GetScripts" type="text/javascript"></script>
42+
<script src="~/AbpAuthorization/GetScripts" type="text/javascript"></script>
43+
<script src="~/AbpNavigation/GetScripts" type="text/javascript"></script>
44+
45+
<!-- Entrance script of durandal application -->
46+
<script src="~/Scripts/require.js" data-main="/App/Main/main"></script>
47+
</body>
48+
</html>

SimpleTaskSystem/SimpleTaskSystem.WebSpaDurandal/App/Main/styles/main.css

Lines changed: 0 additions & 4 deletions
This file was deleted.

SimpleTaskSystem/SimpleTaskSystem.WebSpaDurandal/App/Main/styles/main.css.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

SimpleTaskSystem/SimpleTaskSystem.WebSpaDurandal/App/Main/styles/main.less

Lines changed: 0 additions & 3 deletions
This file was deleted.

SimpleTaskSystem/SimpleTaskSystem.WebSpaDurandal/App/Main/styles/main.min.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)