Skip to content

Commit

Permalink
Merge branch 'release/4.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
dawoe committed Jan 22, 2021
2 parents c945dd4 + 2e19f29 commit 050b31e
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 25 deletions.
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
image: Visual Studio 2017

# Version format
version: 4.2.0.{build}
version: 4.3.0.{build}

branches:
only:
Expand Down Expand Up @@ -68,7 +68,7 @@ deploy:
- provider: NuGet
server:
api_key:
secure: nbR13qs8xp+iOGpuDFDsz7AtYFcltXswOXo9N8fhqx+oJoRdkzHk3pjubFbfO6dx
secure: f5ijMJdo8hygOHm+RRD4pCBcRqj6uw4AWqDgG4MvA1x5sgdmcuRxvdtN1Cn2NB6I
artifact: /.*\.nupkg/
on:
branch: master
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,26 @@
top: 0
}

.Dawoe-OEmbedPicker .umb-sortable-thumbnails__actions {
position: absolute;
right: -18px;
top: -12px;
}

.Dawoe-OEmbedPicker .umb-node-preview__action {
background: #fff;
border-radius: 100%;
box-shadow: 0 1px 2px rgba(0,0,0,.25);
color: #d42054;
font-size: 16px;
height: 25px;
line-height: 26px;
position: absolute;
right: -18px;
height: 25px;
line-height: 26px;
text-align: center;
text-decoration: none;
top: -12px;
width: 25px
width: 25px;
}

.Dawoe-OEmbedPicker .umb-node-preview__action.umb-node-preview__action--red {
color: #d42054;
}

/* Overwrite default margin */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@

function openEmbedDialog(embed, onSubmit) {

// Pass in a clone of embed object to embed infinite editor.
// We set both "orignal" and "modify" properties as it changed in Umbraco v8.2
const clone = _.clone(embed);

const embedDialog = {
embed: _.clone(embed),
modify: clone,
original: clone,
submit: function (model) {
onSubmit(model.embed);
editorService.close();
Expand All @@ -22,7 +27,6 @@
};

editorService.embed(embedDialog);

}

function trustHtml(html) {
Expand All @@ -44,6 +48,25 @@
});
}

function editEmbed(index, evt) {
evt.preventDefault();

var embed = vm.items[index];

openEmbedDialog(embed,
(newEmbed) => {

vm.items[index] = {
'url': newEmbed.url,
'width': newEmbed.width,
'height': newEmbed.height,
'preview': newEmbed.preview
};

updateModelValue();
});
}

function removeEmbed(index, evt) {
evt.preventDefault();

Expand Down Expand Up @@ -74,6 +97,7 @@
}

vm.add = addEmbed;
vm.edit = editEmbed;
vm.remove = removeEmbed;
vm.trustHtml = trustHtml;
vm.validateMandatory = validate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,26 @@
<ng-form name="vm.oembedform">
<div ui-sortable="sortableOptions" ng-model="vm.items" class="items-container" ng-hide="!model.value">
<div class="umb-sortable-thumbnails umb-table-row" ng-repeat="embed in vm.items track by $index">
<div class="sort-icon" ng-if="vm.allowMultiple === true && vm.items.length > 1"><i class="icon icon-navigation handle"></i></div>
<div class="sort-icon" ng-if="vm.allowMultiple === true && vm.items.length > 1">
<i class="icon icon-navigation handle" aria-hidden="true"></i>
</div>
<div class="preview-item">
<span ng-bind-html="vm.trustHtml(embed.preview)"></span>
</div>
<a class="umb-node-preview__action umb-node-preview__action--red" ng-click="vm.remove($index, $event)"><i class="icon icon-delete"></i></a>
<div class="umb-sortable-thumbnails__actions">
<button type="button" class="umb-node-preview__action" ng-click="vm.edit($index, $event)">
<i class="icon icon-edit" aria-hidden="true"></i>
</button>
<button type="button" class="umb-node-preview__action umb-node-preview__action--red" ng-click="vm.remove($index, $event)">
<i class="icon icon-delete" aria-hidden="true"></i>
</button>
</div>
</div>
</div>
<div class="picker-btn" ng-hide="vm.allowMultiple === false && vm.items.length == 1">
<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>
<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" aria-hidden="true"></i>
</button>
</div>
<input type="hidden" name="itemCount" ng-model="vm.items.length" val-property-validator="vm.validateMandatory" />
</ng-form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="App_Plugins\Dawoe.OEmbedPickerPropertyEditor\css\editor.styles.css" />
<Content Include="App_Plugins\Dawoe.OEmbedPickerPropertyEditor\scripts\editor.controller.js" />
<Content Include="App_Plugins\Dawoe.OEmbedPickerPropertyEditor\views\editor.html" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.2.0.0")]
[assembly: AssemblyFileVersion("4.2.0.0")]
[assembly: AssemblyVersion("4.3.0.0")]
[assembly: AssemblyFileVersion("4.3.0.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.2.0.0")]
[assembly: AssemblyFileVersion("4.2.0.0")]
[assembly: AssemblyVersion("4.3.0.0")]
[assembly: AssemblyFileVersion("4.3.0.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,16 @@ public override object ConvertIntermediateToObject(
object inter,
bool preview)
{
var allowMultipe = propertyType.DataType.ConfigurationAs<OEmbedPickerConfiguration>().AllowMultiple;
var allowMultiple = propertyType.DataType.ConfigurationAs<OEmbedPickerConfiguration>().AllowMultiple;

if (inter == null)
if (string.IsNullOrWhiteSpace(inter?.ToString()))
{
return allowMultipe ? Enumerable.Empty<OEmbedItem>() : null;
return allowMultiple ? Enumerable.Empty<OEmbedItem>() : null;
}

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

items = JsonConvert.DeserializeObject<List<OEmbedItem>>(inter.ToString());

if (allowMultipe)
if (allowMultiple)
{
return items;
}
Expand Down

0 comments on commit 050b31e

Please sign in to comment.