Merge branch 'v8/contrib' into v8/dev

This commit is contained in:
Sebastiaan Janssen
2022-01-31 14:15:03 +01:00
9 changed files with 102 additions and 53 deletions

View File

@@ -75,7 +75,21 @@
// inheritance is (i.e.infinite editing)
var found = angularHelper.traverseScopeChain($scope, s => s && s.vm && s.vm.constructor.name === "UmbPropertyController");
vm.parentUmbProperty = found ? found.vm : null;
}
if (vm.property.description) {
// split by lines containing only '--'
var descriptionParts = vm.property.description.split(/^--$/gim);
if (descriptionParts.length > 1) {
// if more than one part, we have an extended description,
// combine to one extended description, and remove leading linebreak
vm.property.extendedDescription = descriptionParts.splice(1).join("--").substring(1);
vm.property.extendedDescriptionVisible = false;
// set propertydescription to first part, and remove trailing linebreak
vm.property.description = descriptionParts[0].slice(0, -1);
}
}
}
}

View File

@@ -0,0 +1,20 @@
/**
* @ngdoc filter
* @name umbraco.filters.simpleMarkdown
* @description
* Used when rendering a string as Markdown as HTML (i.e. with ng-bind-html). Allows use of **bold**, *italics*, ![images](url) and [links](url)
**/
angular.module("umbraco.filters").filter('simpleMarkdown', function () {
return function (text) {
if (!text) {
return '';
}
return text
.replace(/\*\*(.*)\*\*/gim, '<b>$1</b>')
.replace(/\*(.*)\*/gim, '<i>$1</i>')
.replace(/!\[(.*?)\]\((.*?)\)/gim, "<img alt='$1' src='$2' />")
.replace(/\[(.*?)\]\((.*?)\)/gim, "<a href='$2' target='_blank' rel='noopener' class='underline'>$1</a>")
.replace(/\n/g, '<br />').trim();
};
});

View File

@@ -30,9 +30,8 @@
for (var p = 0; p < tab.properties.length; p++) {
var prop = tab.properties[p];
if (dataModel[prop.alias]) {
prop.value = dataModel[prop.alias];
}
prop.value = dataModel[prop.alias];
}
}
@@ -53,9 +52,8 @@
for (var p = 0; p < tab.properties.length; p++) {
var prop = tab.properties[p];
if (prop.value) {
dataModel[prop.alias] = prop.value;
}
dataModel[prop.alias] = prop.value;
}
}

View File

@@ -9,44 +9,51 @@
color: @gray-5;
}
.umb-upload-local__dropzone {
position: relative;
width: 500px;
height: 300px;
border: 2px dashed @ui-action-border;
border-radius: 3px;
background: @white;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-bottom: 30px;
transition: 100ms box-shadow ease, 100ms border ease;
.umb-upload-local {
&.drag-over {
border-color: @ui-action-border-hover;
border-style: solid;
box-shadow: 0 3px 8px rgba(0,0,0, .1);
&__dropzone {
position: relative;
width: 500px;
height: 300px;
border: 2px dashed @ui-action-border;
border-radius: 3px;
background: @white;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-bottom: 30px;
transition: 100ms box-shadow ease, 100ms border ease;
&.drag-over {
border-color: @ui-action-border-hover;
border-style: solid;
box-shadow: 0 3px 8px rgba(0,0,0, .1);
transition: 100ms box-shadow ease, 100ms border ease;
}
.umb-icon {
display: block;
color: @ui-action-type;
font-size: 6.75rem;
line-height: 1;
margin: 0 auto;
}
.umb-info-local-item {
margin: 20px;
}
}
.umb-icon {
display: block;
&__select-file {
font-weight: bold;
color: @ui-action-type;
font-size: 6.75rem;
line-height: 1;
margin: 0 auto;
}
}
cursor: pointer;
.umb-upload-local__select-file {
font-weight: bold;
color: @ui-action-type;
cursor: pointer;
&:hover {
text-decoration: underline;
color: @ui-action-type-hover;
&:hover {
text-decoration: underline;
color: @ui-action-type-hover;
}
}
}
@@ -117,7 +124,3 @@
.umb-info-local-item {
margin-bottom: 20px;
}
.umb-upload-local__dropzone .umb-info-local-item {
margin:20px;
}

View File

@@ -237,7 +237,6 @@ umb-property:last-of-type .umb-control-group {
}
.control-description {
max-width:480px;// avoiding description becoming too wide when its placed on top of property.
margin-bottom: 5px;
}
}

View File

@@ -24,7 +24,20 @@
<umb-property-actions ng-if="!vm.showInherit" actions="vm.propertyActions"></umb-property-actions>
<small class="control-description" ng-if="vm.property.description" ng-bind-html="vm.property.description | preserveNewLineInHtml"></small>
<small class="control-description" ng-if="vm.property.description" ng-bind-html="vm.property.description | simpleMarkdown"></small>
<div ng-if="vm.property.extendedDescription">
<div ng-if="vm.property.extendedDescriptionVisible">
<small class="control-description" ng-bind-html="vm.property.extendedDescription | simpleMarkdown"></small>
</div>
<button type="button" class="btn btn-mini btn-link btn-link-reverse p0" ng-click="vm.property.extendedDescriptionVisible = !vm.property.extendedDescriptionVisible">
<localize ng-if="!vm.property.extendedDescriptionVisible" key="general_readMore"></localize>
<localize ng-if="vm.property.extendedDescriptionVisible" key="general_close"></localize>
</button>
</div>
</div>
<div class="controls" ng-transclude>

View File

@@ -92,7 +92,7 @@
function save() {
vm.buttonState = "busy";
var groups = _.map(vm.groups, function (group) { return group.name; });
var groups = _.map(vm.groups, function (group) { return encodeURIComponent(group.name); });
var usernames = _.map(vm.members, function (member) { return member.username; });
contentResource.updatePublicAccess(id, groups, usernames, vm.loginPage.id, vm.errorPage.id).then(
function () {

View File

@@ -19,7 +19,7 @@
serverErrorMessage: null
};
$scope.handleFiles = function (files, event) {
$scope.handleFiles = function (files, event, invalidFiles) {
if (files) {
for (var i = 0; i < files.length; i++) {
upload(files[i]);

View File

@@ -10,14 +10,15 @@
<div ngf-drop
ng-hide="hideDropzone"
ng-model="filesHolder"
ngf-change="handleFiles($files, $event)"
ngf-change="handleFiles($files, $event, $invalidFiles)"
class="umb-upload-local__dropzone"
ngf-drag-over-class="'drag-over'"
ngf-multiple="false"
ngf-allow-dir="false"
ngf-pattern="*.zip"
ngf-max-size="{{ maxFileSize }}"
ng-class="{'is-small': compact!=='false' || (done.length+queue.length) > 0 }">
ngf-max-size="{{maxFileSize}}"
ngf-pattern="'.zip'"
accept=".zip"
ng-class="{ 'is-small': compact !== 'false' || (done.length + queue.length) > 0 }">
<div class="content" draggable="false">
@@ -31,10 +32,11 @@
<div class="umb-upload-local__select-file"
ngf-select
ng-model="filesHolder"
ngf-change="handleFiles($files, $event)"
ngf-change="handleFiles($files, $event, $invalidFiles)"
ngf-multiple="true"
ngf-pattern="*.zip"
ngf-max-size="{{ maxFileSize }}">
ngf-max-size="{{maxFileSize}}"
ngf-pattern="'.zip'"
accept=".zip">
- <localize key="packager_orClickHereToUpload">or click here to choose files</localize>
</div>