Skip to content

Commit 56a5a5c

Browse files
committed
add umbraco v9 test site to project.
1 parent d212fd8 commit 56a5a5c

Some content is hidden

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

59 files changed

+2162
-49
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
2+
(function () {
3+
'use strict';
4+
5+
function buttons($scope,
6+
localizationService,
7+
overlayService,
8+
exampleResource) {
9+
10+
var vm = this;
11+
vm.doStuff = doStuff;
12+
vm.linkAway = exampleResource.linkAway;
13+
14+
/// umb-button-group ///
15+
16+
vm.buttonGroup = {
17+
defaultButton: {
18+
labelKey: "buttons_groupedButton_default",
19+
hotKey: "ctrl+d",
20+
hotKeyWhenHidden: true,
21+
buttonStyle: 'success',
22+
handler: function () {
23+
// do magic here
24+
alert("you clicked the default button");
25+
}
26+
},
27+
subButtons: [
28+
{
29+
labelKey: "buttons_groupedButton_subButtonA",
30+
hotKey: "ctrl+a",
31+
hotKeyWhenHidden: true,
32+
handler: function () {
33+
// do magic here
34+
alert("you clicked a sub button A");
35+
}
36+
},
37+
{
38+
labelKey: "buttons_groupedButton_subButtonB",
39+
hotKey: "ctrl+b",
40+
hotKeyWhenHidden: true,
41+
buttonStyle: 'success',
42+
handler: function () {
43+
// do magic here
44+
alert("you clicked a sub button B");
45+
}
46+
}
47+
]
48+
};
49+
50+
///
51+
52+
function doStuff () {
53+
openOverlay();
54+
};
55+
56+
function openOverlay() {
57+
58+
localizationService.localizeMany(["buttonsOverlayTitle", "buttonsOverlayMessage"])
59+
.then(function (values) {
60+
61+
var overlay = {
62+
title: values[0],
63+
content: values[1],
64+
disableBackdropClick: true,
65+
disableEscKey: true,
66+
submit: function () {
67+
overlayService.close();
68+
}
69+
};
70+
71+
overlayService.confirmDelete(overlay);
72+
});
73+
}
74+
};
75+
76+
angular.module('umbraco')
77+
.controller('buttonsSectionController', buttons);
78+
})();
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
<div ng-controller="buttonsSectionController as vm">
2+
<umb-box>
3+
<umb-box-header title-key="buttons_buttonTitle"
4+
description-key="buttons_buttonDescription">
5+
<umb-button action="vm.linkAway('https://our.umbraco.com/apidocs/v8/ui/#/api/umbraco.directives.directive:umbButton');"
6+
label="umb-button"
7+
type="button"
8+
icon="icon-book"
9+
button-style="info">
10+
</umb-button>
11+
</umb-box-header>
12+
13+
<umb-box-content>
14+
<umb-code-snippet language="'html'">&lt;umb-button
15+
action="vm.doStuff()"
16+
label="Hello world"
17+
type="button"
18+
button-style="block | action | primary | info | success | warning | danger | inverse | link"&gt;
19+
&lt;/umb-button&gt;</umb-code-snippet>
20+
<localize key="buttons_buttonNote"></localize>
21+
</umb-box-content>
22+
23+
<umb-box-content>
24+
<umb-button action="vm.doStuff()"
25+
label="block"
26+
type="button"
27+
button-style="block">
28+
</umb-button>
29+
<umb-button action="vm.doStuff()"
30+
label="action"
31+
type="button"
32+
button-style="action">
33+
</umb-button>
34+
<umb-button action="vm.doStuff()"
35+
label="primary"
36+
type="button"
37+
button-style="primary">
38+
</umb-button>
39+
40+
<umb-button action="vm.doStuff()"
41+
label="info"
42+
type="button"
43+
button-style="info">
44+
</umb-button>
45+
46+
<umb-button action="vm.doStuff()"
47+
label="success"
48+
type="button"
49+
button-style="success">
50+
</umb-button>
51+
<umb-button action="vm.doStuff()"
52+
label="warning"
53+
type="button"
54+
button-style="warning">
55+
</umb-button>
56+
57+
<umb-button action="vm.doStuff()"
58+
label="danger"
59+
type="button"
60+
button-style="danger">
61+
</umb-button>
62+
<umb-button action="vm.doStuff()"
63+
label="inverse"
64+
type="button"
65+
button-style="inverse">
66+
</umb-button>
67+
<umb-button action="vm.doStuff()"
68+
label="link"
69+
type="button"
70+
button-style="link">
71+
</umb-button>
72+
73+
</umb-box-content>
74+
</umb-box>
75+
76+
<umb-box>
77+
<umb-box-header title-key="buttons_groupedButtonTitle"
78+
description-key="buttons_groupedButtonDescription">
79+
<umb-button action="vm.linkAway('https://our.umbraco.com/apidocs/v8/ui/#/api/umbraco.directives.directive:umbButtonGroup');"
80+
label="umb-button-group"
81+
type="button"
82+
icon="icon-book"
83+
button-style="info">
84+
</umb-button>
85+
</umb-box-header>
86+
87+
<umb-box-content>
88+
<umb-code-snippet language="'html'">&lt;umb-button-group
89+
button-style="block | action | primary | info | success | warning | danger | inverse | link"
90+
default-button="vm.buttonGroup.defaultButton"
91+
sub-buttons="vm.buttonGroup.subButtons"
92+
direction="up | down">
93+
&lt;/umb-button-group&gt;</umb-code-snippet>
94+
<localize key="buttons_groupedButtonNote"></localize>
95+
</umb-box-content>
96+
97+
<umb-box-content>
98+
99+
<umb-button-group
100+
default-button="vm.buttonGroup.defaultButton"
101+
sub-buttons="vm.buttonGroup.subButtons"
102+
direction="up">
103+
</umb-button-group>
104+
105+
<umb-button-group
106+
button-style="success"
107+
default-button="vm.buttonGroup.defaultButton"
108+
sub-buttons="vm.buttonGroup.subButtons"
109+
direction="up">
110+
</umb-button-group>
111+
112+
<umb-button-group
113+
button-style="danger"
114+
default-button="vm.buttonGroup.defaultButton"
115+
sub-buttons="vm.buttonGroup.subButtons"
116+
direction="up">
117+
</umb-button-group>
118+
119+
</umb-box-content>
120+
</umb-box>
121+
</div>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<language alias="en" intName="English (UK)" localName="English (UK)" lcid="" culture="en-GB">
3+
<area alias="buttons">
4+
<key alias="buttonTitle">umb-button</key>
5+
<key alias="buttonDescription">Render a styled button</key>
6+
<key alias="buttonNote">
7+
<![CDATA[
8+
This is an example of using a button. The type of button depends on the "button-style", you can see the options in the example above and see them rendered down below.
9+
]]>
10+
</key>
11+
<key alias="groupedButtonTitle">umb-grouped-button</key>
12+
<key alias="groupedButtonDescription">Render a grouped button</key>
13+
<key alias="groupedButtonNote">This is an example of a button group, you can see a few examples rendered down below.</key>
14+
<key alias="groupedButton_default">Grouped style 'info'</key>
15+
<key alias="groupedButton_subButtonA">Sub Button A</key>
16+
<key alias="groupedButton_subButtonB">Sub Button B</key>
17+
</area>
18+
</language>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"javascript": [ "~/app_plugins/uiexamples/buttons/buttons.controller.js" ]
3+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
(function () {
2+
'use strict';
3+
4+
5+
function dialogsController($scope, overlayService) {
6+
7+
var vm = this;
8+
9+
vm.openConfirmOverlay = openConfirmOverlay;
10+
vm.openCustomOverlay = openCustomOverlay;
11+
12+
function openConfirmOverlay(content, confirmType) {
13+
14+
var options = {
15+
title: 'Simple',
16+
content: content,
17+
disableBackdropClick: true,
18+
disableEscKey: true,
19+
confirmType: confirmType, // type of confirmation.
20+
submit: function () {
21+
overlayService.close();
22+
}
23+
};
24+
25+
overlayService.confirm(options);
26+
27+
}
28+
29+
function openCustomOverlay() {
30+
31+
32+
var options = {
33+
view: Umbraco.Sys.ServerVariables.umbracoSettings.appPluginsPath + '/uiexamples/dialogs/overlays/customOverlay.html',
34+
title: 'Custom overlay',
35+
description: 'A custom view in an overlay',
36+
disableBackdropClick: true,
37+
disableEscKey: true,
38+
submitButtonLabel: 'Do Things',
39+
closeButtonLable: 'Close',
40+
submit: function (model) {
41+
42+
// multi-step overlay, will still call the submit
43+
// as its the only button,
44+
// but you can use values in the model, to check
45+
// if you are ready to close.
46+
// simple example, we have a process function
47+
// (in the overlay's controller) that does stuff
48+
// and sets complete when done.
49+
50+
// when complete is true, we close the overlay.
51+
// until then we keep calling process.
52+
53+
if (model.complete) {
54+
overlayService.close();
55+
}
56+
else {
57+
model.process();
58+
}
59+
60+
},
61+
close: function () {
62+
overlayService.close();
63+
}
64+
65+
}
66+
67+
overlayService.open(options);
68+
69+
}
70+
71+
72+
}
73+
74+
angular.module('umbraco')
75+
.controller('exampleDialogController', dialogsController);
76+
77+
})();
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<div ng-controller="exampleDialogController as vm">
2+
3+
<umb-box>
4+
<umb-box-header title-key="exdialog_overlayTitle"
5+
description-key="exdialog_overlayDescription">
6+
</umb-box-header>
7+
<umb-box-content>
8+
9+
<localize key="exdialog_overlayConfirmIntro"></localize>
10+
11+
<umb-button action="vm.openConfirmOverlay('Are your really sure?')"
12+
label="Confirm"
13+
type="button"
14+
button-style="action"></umb-button>
15+
16+
<umb-button action="vm.openConfirmOverlay('Are your really sure?', 'remove')"
17+
label="Confirm remove"
18+
type="button"
19+
button-style="success"></umb-button>
20+
21+
<umb-button action="vm.openConfirmOverlay('Are your really sure?', 'delete')"
22+
label="Confirm delete"
23+
type="button"
24+
button-style="danger"></umb-button>
25+
</umb-box-content>
26+
</umb-box>
27+
<umb-box>
28+
29+
<umb-box-header title-key="exdialog_overlayCustom"
30+
description-key="exdialog_overlayCustomDescription">
31+
</umb-box-header>
32+
<umb-box-content>
33+
34+
<localize key="exdialog_overlayCustomIntro"></localize>
35+
36+
<umb-button action="vm.openCustomOverlay()"
37+
label="Custom Overlay"
38+
type="button"
39+
button-style="action"></umb-button>
40+
41+
42+
43+
</umb-box-content>
44+
</umb-box>
45+
46+
47+
</div>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<language alias="en" intName="English (UK)" localName="English (UK)" lcid="" culture="en-GB">
3+
<area alias="exdialog">
4+
<key alias="overlayTitle">Overlay Dialogs</key>
5+
<key alias="overlayDescription">Overlays give you a 'modal' dialog across the whole screen</key>
6+
7+
<key alias="overlayConfirmIntro">
8+
<![CDATA[<p>The overlay service has a confirm option built, in with this you can quickly create a confirm
9+
dialog, to present your users with a simple option.
10+
</p>]]>
11+
</key>
12+
13+
<key alias="overlayCustom">Custom overlay</key>
14+
<key alias="overlayCustomDescription">Custom overlays give you more control</key>
15+
16+
<key alias="overlayCustomIntro">
17+
<![CDATA[<p>For more custom options you need to provide a view and a custom controller to manage what
18+
happens inside the overlay.</p>
19+
<p>With this method you can control the submit and close process so you can (with a little fangling)
20+
have muilt-step processes inside the overlay window.</p>]]>
21+
</key>
22+
</area>
23+
</language>

0 commit comments

Comments
 (0)