Skip to content

Commit 050b31e

Browse files
committed
Merge branch 'release/4.3.0'
2 parents c945dd4 + 2e19f29 commit 050b31e

File tree

8 files changed

+65
-25
lines changed

8 files changed

+65
-25
lines changed

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
image: Visual Studio 2017
22

33
# Version format
4-
version: 4.2.0.{build}
4+
version: 4.3.0.{build}
55

66
branches:
77
only:
@@ -68,7 +68,7 @@ deploy:
6868
- provider: NuGet
6969
server:
7070
api_key:
71-
secure: nbR13qs8xp+iOGpuDFDsz7AtYFcltXswOXo9N8fhqx+oJoRdkzHk3pjubFbfO6dx
71+
secure: f5ijMJdo8hygOHm+RRD4pCBcRqj6uw4AWqDgG4MvA1x5sgdmcuRxvdtN1Cn2NB6I
7272
artifact: /.*\.nupkg/
7373
on:
7474
branch: master

src/Dawoe.OEmbedPickerPropertyEditor.Web/App_Plugins/Dawoe.OEmbedPickerPropertyEditor/css/editor.styles.css

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,26 @@
5050
top: 0
5151
}
5252

53+
.Dawoe-OEmbedPicker .umb-sortable-thumbnails__actions {
54+
position: absolute;
55+
right: -18px;
56+
top: -12px;
57+
}
58+
5359
.Dawoe-OEmbedPicker .umb-node-preview__action {
5460
background: #fff;
5561
border-radius: 100%;
5662
box-shadow: 0 1px 2px rgba(0,0,0,.25);
57-
color: #d42054;
5863
font-size: 16px;
59-
height: 25px;
60-
line-height: 26px;
61-
position: absolute;
62-
right: -18px;
64+
height: 25px;
65+
line-height: 26px;
6366
text-align: center;
6467
text-decoration: none;
65-
top: -12px;
66-
width: 25px
68+
width: 25px;
69+
}
70+
71+
.Dawoe-OEmbedPicker .umb-node-preview__action.umb-node-preview__action--red {
72+
color: #d42054;
6773
}
6874

6975
/* Overwrite default margin */

src/Dawoe.OEmbedPickerPropertyEditor.Web/App_Plugins/Dawoe.OEmbedPickerPropertyEditor/scripts/editor.controller.js

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@
1010

1111
function openEmbedDialog(embed, onSubmit) {
1212

13+
// Pass in a clone of embed object to embed infinite editor.
14+
// We set both "orignal" and "modify" properties as it changed in Umbraco v8.2
15+
const clone = _.clone(embed);
16+
1317
const embedDialog = {
14-
embed: _.clone(embed),
18+
modify: clone,
19+
original: clone,
1520
submit: function (model) {
1621
onSubmit(model.embed);
1722
editorService.close();
@@ -22,7 +27,6 @@
2227
};
2328

2429
editorService.embed(embedDialog);
25-
2630
}
2731

2832
function trustHtml(html) {
@@ -44,6 +48,25 @@
4448
});
4549
}
4650

51+
function editEmbed(index, evt) {
52+
evt.preventDefault();
53+
54+
var embed = vm.items[index];
55+
56+
openEmbedDialog(embed,
57+
(newEmbed) => {
58+
59+
vm.items[index] = {
60+
'url': newEmbed.url,
61+
'width': newEmbed.width,
62+
'height': newEmbed.height,
63+
'preview': newEmbed.preview
64+
};
65+
66+
updateModelValue();
67+
});
68+
}
69+
4770
function removeEmbed(index, evt) {
4871
evt.preventDefault();
4972

@@ -74,6 +97,7 @@
7497
}
7598

7699
vm.add = addEmbed;
100+
vm.edit = editEmbed;
77101
vm.remove = removeEmbed;
78102
vm.trustHtml = trustHtml;
79103
vm.validateMandatory = validate;

src/Dawoe.OEmbedPickerPropertyEditor.Web/App_Plugins/Dawoe.OEmbedPickerPropertyEditor/views/editor.html

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,26 @@
22
<ng-form name="vm.oembedform">
33
<div ui-sortable="sortableOptions" ng-model="vm.items" class="items-container" ng-hide="!model.value">
44
<div class="umb-sortable-thumbnails umb-table-row" ng-repeat="embed in vm.items track by $index">
5-
<div class="sort-icon" ng-if="vm.allowMultiple === true && vm.items.length > 1"><i class="icon icon-navigation handle"></i></div>
5+
<div class="sort-icon" ng-if="vm.allowMultiple === true && vm.items.length > 1">
6+
<i class="icon icon-navigation handle" aria-hidden="true"></i>
7+
</div>
68
<div class="preview-item">
79
<span ng-bind-html="vm.trustHtml(embed.preview)"></span>
810
</div>
9-
<a class="umb-node-preview__action umb-node-preview__action--red" ng-click="vm.remove($index, $event)"><i class="icon icon-delete"></i></a>
11+
<div class="umb-sortable-thumbnails__actions">
12+
<button type="button" class="umb-node-preview__action" ng-click="vm.edit($index, $event)">
13+
<i class="icon icon-edit" aria-hidden="true"></i>
14+
</button>
15+
<button type="button" class="umb-node-preview__action umb-node-preview__action--red" ng-click="vm.remove($index, $event)">
16+
<i class="icon icon-delete" aria-hidden="true"></i>
17+
</button>
18+
</div>
1019
</div>
1120
</div>
1221
<div class="picker-btn" ng-hide="vm.allowMultiple === false && vm.items.length == 1">
13-
<button type="button" class="add-link btn-reset umb-outline umb-outline--surrounding add-link-square" ng-click="vm.add($event)"><i class="icon icon-add large"></i></button>
22+
<button type="button" class="add-link btn-reset umb-outline umb-outline--surrounding add-link-square" ng-click="vm.add($event)">
23+
<i class="icon icon-add large" aria-hidden="true"></i>
24+
</button>
1425
</div>
1526
<input type="hidden" name="itemCount" ng-model="vm.items.length" val-property-validator="vm.validateMandatory" />
1627
</ng-form>

src/Dawoe.OEmbedPickerPropertyEditor.Web/Dawoe.OEmbedPickerPropertyEditor.Web.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@
159159
</ProjectReference>
160160
</ItemGroup>
161161
<ItemGroup>
162+
<Content Include="App_Plugins\Dawoe.OEmbedPickerPropertyEditor\css\editor.styles.css" />
162163
<Content Include="App_Plugins\Dawoe.OEmbedPickerPropertyEditor\scripts\editor.controller.js" />
163164
<Content Include="App_Plugins\Dawoe.OEmbedPickerPropertyEditor\views\editor.html" />
164165
</ItemGroup>

src/Dawoe.OEmbedPickerPropertyEditor.Web/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("4.2.0.0")]
36-
[assembly: AssemblyFileVersion("4.2.0.0")]
35+
[assembly: AssemblyVersion("4.3.0.0")]
36+
[assembly: AssemblyFileVersion("4.3.0.0")]

src/Dawoe.OEmbedPickerPropertyEditor/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("4.2.0.0")]
36-
[assembly: AssemblyFileVersion("4.2.0.0")]
35+
[assembly: AssemblyVersion("4.3.0.0")]
36+
[assembly: AssemblyFileVersion("4.3.0.0")]

src/Dawoe.OEmbedPickerPropertyEditor/ValueConverters/OEmbedPickerValueConverter.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,16 @@ public override object ConvertIntermediateToObject(
4646
object inter,
4747
bool preview)
4848
{
49-
var allowMultipe = propertyType.DataType.ConfigurationAs<OEmbedPickerConfiguration>().AllowMultiple;
49+
var allowMultiple = propertyType.DataType.ConfigurationAs<OEmbedPickerConfiguration>().AllowMultiple;
5050

51-
if (inter == null)
51+
if (string.IsNullOrWhiteSpace(inter?.ToString()))
5252
{
53-
return allowMultipe ? Enumerable.Empty<OEmbedItem>() : null;
53+
return allowMultiple ? Enumerable.Empty<OEmbedItem>() : null;
5454
}
5555

56-
var items = new List<OEmbedItem>();
56+
var items = JsonConvert.DeserializeObject<List<OEmbedItem>>(inter.ToString());
5757

58-
items = JsonConvert.DeserializeObject<List<OEmbedItem>>(inter.ToString());
59-
60-
if (allowMultipe)
58+
if (allowMultiple)
6159
{
6260
return items;
6361
}

0 commit comments

Comments
 (0)