This repository has been archived by the owner on Dec 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from umco/develop
Preparing v2.0.0 release
- Loading branch information
Showing
16 changed files
with
269 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<packageSources> | ||
<add key="AppVeyor CI - Inner Content builds" value="https://ci.appveyor.com/nuget/umbraco-inner-content-w59jhwr5br60" /> | ||
<add key="MyGet: Umbraco Community Packages" value="https://www.myget.org/F/umbraco-packages/api/v3/index.json" /> | ||
</packageSources> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
221 changes: 14 additions & 207 deletions
221
src/Our.Umbraco.StackedContent/Our.Umbraco.StackedContent.csproj
Large diffs are not rendered by default.
Oops, something went wrong.
73 changes: 73 additions & 0 deletions
73
src/Our.Umbraco.StackedContent/PropertyEditors/StackedContentPreValueEditor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
using System.Collections.Generic; | ||
using Our.Umbraco.InnerContent.PropertyEditors; | ||
using Umbraco.Core.Models; | ||
using Umbraco.Core.PropertyEditors; | ||
|
||
namespace Our.Umbraco.StackedContent.PropertyEditors | ||
{ | ||
internal class StackedContentPreValueEditor : SimpleInnerContentPreValueEditor | ||
{ | ||
public StackedContentPreValueEditor() | ||
: base() | ||
{ | ||
Fields.AddRange(new[] | ||
{ | ||
new PreValueField | ||
{ | ||
Key = "maxItems", | ||
Name = "Max Items", | ||
View = "number", | ||
Description = "Set the maximum number of items allowed in this stack." | ||
}, | ||
new PreValueField | ||
{ | ||
Key = "singleItemMode", | ||
Name = "Single Item Mode", | ||
View = "boolean", | ||
Description = "Set whether to work in single item mode (only the first defined Content Type will be used)." | ||
}, | ||
new PreValueField | ||
{ | ||
Key = "hideLabel", | ||
Name = "Hide Label", | ||
View = "boolean", | ||
Description = "Set whether to hide the editor label and have the list take up the full width of the editor window." | ||
}, | ||
new PreValueField | ||
{ | ||
Key = "enablePreview", | ||
Name = "Enable Preview", | ||
View = "boolean", | ||
Description = "Select to enable a preview of the items in the stack." | ||
}, | ||
new PreValueField | ||
{ | ||
Key = "enableCopy", | ||
Name = "Enable Copy", | ||
View = "boolean", | ||
Description = "Select to enable copying (and pasting) of items in the stack." | ||
} | ||
}); | ||
} | ||
|
||
public override IDictionary<string, object> ConvertDbToEditor(IDictionary<string, object> defaultPreVals, PreValueCollection persistedPreVals) | ||
{ | ||
// NOTE: For v1.0, we switched around the default option for the preview feature. | ||
// For backwards-compatibility, we check if the legacy "disablePreview" value is available and handle accordingly. | ||
if (persistedPreVals.IsDictionaryBased && persistedPreVals.PreValuesAsDictionary.ContainsKey("disablePreview")) | ||
{ | ||
var enablePreview = persistedPreVals.PreValuesAsDictionary["disablePreview"].Value == "1" ? "0" : "1"; | ||
if (persistedPreVals.PreValuesAsDictionary.ContainsKey("enablePreview")) | ||
{ | ||
persistedPreVals.PreValuesAsDictionary["enablePreview"].Value = enablePreview; | ||
} | ||
else | ||
{ | ||
persistedPreVals.PreValuesAsDictionary.Add("enablePreview", new PreValue(enablePreview)); | ||
} | ||
} | ||
|
||
return base.ConvertDbToEditor(defaultPreVals, persistedPreVals); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.