6 |
10 |
11 | ** control **
12 |
13 |
14 | ...
15 |
16 |
17 | */
18 |
19 | .nuPickers-config div
20 | {
21 | padding-bottom: 20px;
22 | margin-bottom: 15px!important;
23 | border-bottom: 1px solid #f8f8f8;
24 | }
25 |
26 | .nuPickers-config div.disabled
27 | {
28 | background-color: #f8f8f8;
29 | }
30 |
31 | .nuPickers-config div:last-child
32 | {
33 | /*padding-bottom:0;*/
34 | margin-bottom:0;
35 | border-bottom:none;
36 | }
37 |
38 | .nuPickers-config input.wide {
39 | width:95%;
40 | }
--------------------------------------------------------------------------------
/source/nuPickers/Shared/RelationMapping/RelationMappingResource.js:
--------------------------------------------------------------------------------
1 |
2 | angular.module('umbraco.resources')
3 | .factory('nuPickers.Shared.RelationMapping.RelationMappingResource',
4 | ['$http', 'editorState',
5 | function ($http, editorState) {
6 |
7 | return {
8 |
9 | getRelatedIds: function (model) {
10 |
11 | return $http({
12 | method: 'GET',
13 | url: 'backoffice/nuPickers/RelationMappingApi/GetRelatedIds',
14 | params: {
15 | 'contextId': editorState.current.id,
16 | 'propertyAlias' : model.alias,
17 | 'relationTypeAlias': model.config.relationMapping.relationTypeAlias,
18 | 'relationsOnly' : model.config.saveFormat == 'relationsOnly'
19 | }
20 | });
21 |
22 | }
23 |
24 | };
25 | }
26 | ]);
--------------------------------------------------------------------------------
/source/nuPickers/Shared/EnumDataSource/EnumDataSourceConfig.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
22 |
23 |
24 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/source/nuPickers/Shared/ListPicker/ListPickerSelectablePartial.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | -
10 |
11 |
12 |
13 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/source/nuPickers/Shared/PagedListPicker/PagedListPickerEditor.css:
--------------------------------------------------------------------------------
1 |
2 | /* pull styling up from the .selectable ul in to this new wrapper*/
3 | .paged-list-picker .selectable-and-pager {
4 | width:48%;
5 | float: left;
6 | }
7 |
8 | /* reset .selectable to fill wrapper */
9 | .paged-list-picker .selectable {
10 | width:100%;
11 | }
12 |
13 |
14 | .paged-list-picker .paging-buttons {
15 | margin: 20px 0;
16 | text-align: center;
17 | list-style: none;
18 | }
19 |
20 | .paged-list-picker .paging-buttons li {
21 | display: inline;
22 | line-height: 20px;
23 | }
24 |
25 | .paged-list-picker .paging-buttons li a {
26 | display: inline-block;
27 | padding: 0 10px;
28 | background-color: #fff;
29 | border: 1px solid #ddd;
30 | border-radius: 15px;
31 | }
32 |
33 | .paged-list-picker .paging-buttons li a:hover,
34 | .paged-list-picker .paging-buttons li a:focus {
35 | text-decoration:none;
36 | }
37 |
38 | .paged-list-picker .paging-buttons li a:hover,
39 | .paged-list-picker .paging-buttons li.active a {
40 | background-color:#f5f5f5;
41 | }
--------------------------------------------------------------------------------
/source/nuPickers/Shared/TypeaheadListPicker/TypeaheadListPickerConfig.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
21 |
22 |
23 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/source/nuPickers/PropertyEditors/EnumRadioButtonPicker/EnumRadioButtonPickerPreValueEditor.cs:
--------------------------------------------------------------------------------
1 | namespace nuPickers.PropertyEditors.EnumRadioButtonPicker
2 | {
3 | using nuPickers.EmbeddedResource;
4 | using Umbraco.Core.PropertyEditors;
5 |
6 | internal class EnumRadioButtonPickerPreValueEditor : PreValueEditor
7 | {
8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "EnumDataSource/EnumDataSourceConfig.html", HideLabel = true)]
9 | public string DataSource { get; set; }
10 |
11 | [PreValueField("customLabel", "Label Macro", EmbeddedResource.ROOT_URL + "CustomLabel/CustomLabelConfig.html", HideLabel = true)]
12 | public string CustomLabel { get; set; }
13 |
14 | [PreValueField("layoutDirection", "Layout Direction", EmbeddedResource.ROOT_URL + "LayoutDirection/LayoutDirectionConfig.html")]
15 | public string LayoutDirection { get; set; }
16 |
17 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")]
18 | public string SaveFormat { get; set; }
19 | }
20 | }
--------------------------------------------------------------------------------
/source/nuPickers/Shared/PagedListPicker/PagedListPickerEditor.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 uComponents
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/source/nuPickers/EmbeddedResource/EmbeddedResourceController.cs:
--------------------------------------------------------------------------------
1 | namespace nuPickers.EmbeddedResource
2 | {
3 | using System.Web;
4 | using System.Web.Mvc;
5 | using Umbraco.Core;
6 |
7 | ///
8 | /// Handles returning embedded resource files (html, css, js, png)
9 | ///
10 | public class EmbeddedResourceController : Controller
11 | {
12 | public ActionResult GetSharedResource(string folder, string file)
13 | {
14 | string fileName = file.TrimEnd(EmbeddedResource.FILE_EXTENSION);
15 | var resourceStream = EmbeddedResourceHelper.GetResource(EmbeddedResource.RESOURCE_PREFIX + folder + "." + fileName);
16 |
17 | if (resourceStream != null)
18 | {
19 | return new FileStreamResult(resourceStream, GetMimeType(fileName)); ;
20 | }
21 |
22 | return this.HttpNotFound();
23 | }
24 |
25 | private string GetMimeType(string resource)
26 | {
27 | var mimeType = MimeMapping.GetMimeMapping(resource);
28 | return mimeType ?? "text";
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/source/nuPickers/PropertyEditors/EnumLabels/EnumLabelsPreValueEditor.cs:
--------------------------------------------------------------------------------
1 | namespace nuPickers.PropertyEditors.EnumLabels
2 | {
3 | using nuPickers.EmbeddedResource;
4 | using Umbraco.Core.PropertyEditors;
5 |
6 | internal class EnumLabelsPreValueEditor : PreValueEditor
7 | {
8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "EnumDataSource/EnumDataSourceConfig.html", HideLabel = true)]
9 | public string DataSource { get; set; }
10 |
11 | [PreValueField("customLabel", "", EmbeddedResource.ROOT_URL + "CustomLabel/CustomLabelConfig.html", HideLabel = true)]
12 | public string CustomLabel { get; set; }
13 |
14 | ///
15 | /// currently no ui, but forces controller to be loaded
16 | ///
17 | [PreValueField("labels", "", EmbeddedResource.ROOT_URL + "Labels/LabelsConfig.html", HideLabel = true)]
18 | public string Labels { get; set; }
19 |
20 | [PreValueField("layoutDirection", "Layout Direction", EmbeddedResource.ROOT_URL + "LayoutDirection/LayoutDirectionConfig.html")]
21 | public string LayoutDirection { get; set; }
22 | }
23 | }
--------------------------------------------------------------------------------
/source/nuPickers/PropertyEditors/JsonLabels/JsonLabelsPreValueEditor.cs:
--------------------------------------------------------------------------------
1 | namespace nuPickers.PropertyEditors.JsonLabels
2 | {
3 | using nuPickers.EmbeddedResource;
4 | using Umbraco.Core.PropertyEditors;
5 |
6 | internal class JsonLabelsPreValueEditor : PreValueEditor
7 | {
8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "JsonDataSource/JsonDataSourceConfig.html", HideLabel = true)]
9 | public string DataSource { get; set; }
10 |
11 | [PreValueField("customLabel", "", EmbeddedResource.ROOT_URL + "CustomLabel/CustomLabelConfig.html", HideLabel = true)]
12 | public string CustomLabel { get; set; }
13 |
14 | ///
15 | /// currently no ui, but forces controller to be loaded
16 | ///
17 | [PreValueField("labels", "", EmbeddedResource.ROOT_URL + "Labels/LabelsConfig.html", HideLabel = true)]
18 | public string Labels { get; set; }
19 |
20 | [PreValueField("layoutDirection", "Layout Direction", EmbeddedResource.ROOT_URL + "LayoutDirection/LayoutDirectionConfig.html")]
21 | public string LayoutDirection { get; set; }
22 | }
23 | }
--------------------------------------------------------------------------------
/source/nuPickers/PropertyEditors/XmlLabels/XmlLabelsPreValueEditor.cs:
--------------------------------------------------------------------------------
1 | namespace nuPickers.PropertyEditors.XmlLabels
2 | {
3 | using nuPickers.EmbeddedResource;
4 | using Umbraco.Core.PropertyEditors;
5 |
6 | internal class XmlLabelsPreValueEditor : PreValueEditor
7 | {
8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "XmlDataSource/XmlDataSourceConfig.html", HideLabel = true)]
9 | public string DataSource { get; set; }
10 |
11 | [PreValueField("customLabel", "", EmbeddedResource.ROOT_URL + "CustomLabel/CustomLabelConfig.html", HideLabel = true)]
12 | public string CustomLabel { get; set; }
13 |
14 | ///
15 | /// currently no ui, but forces controller to be loaded
16 | ///
17 | [PreValueField("labels", "", EmbeddedResource.ROOT_URL + "Labels/LabelsConfig.html", HideLabel = true)]
18 | public string Labels { get; set; }
19 |
20 | [PreValueField("layoutDirection", "Layout Direction", EmbeddedResource.ROOT_URL + "LayoutDirection/LayoutDirectionConfig.html")]
21 | public string LayoutDirection { get; set; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/source/nuPickers/Shared/SqlDataSource/SqlDataSourceConfig.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
21 |
22 |
23 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/source/nuPickers/PropertyEditors/DotNetLabels/DotNetLabelsPreValueEditor.cs:
--------------------------------------------------------------------------------
1 | namespace nuPickers.PropertyEditors.DotNetLabels
2 | {
3 | using nuPickers.EmbeddedResource;
4 | using Umbraco.Core.PropertyEditors;
5 |
6 | internal class DotNetLabelsPreValueEditor : PreValueEditor
7 | {
8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "DotNetDataSource/DotNetDataSourceConfig.html", HideLabel = true)]
9 | public string DataSource { get; set; }
10 |
11 | [PreValueField("customLabel", "", EmbeddedResource.ROOT_URL + "CustomLabel/CustomLabelConfig.html", HideLabel = true)]
12 | public string CustomLabel { get; set; }
13 |
14 | ///
15 | /// currently no ui, but forces controller to be loaded
16 | ///
17 | [PreValueField("labels", "", EmbeddedResource.ROOT_URL + "Labels/LabelsConfig.html", HideLabel = true)]
18 | public string Labels { get; set; }
19 |
20 | [PreValueField("layoutDirection", "Layout Direction", EmbeddedResource.ROOT_URL + "LayoutDirection/LayoutDirectionConfig.html")]
21 | public string LayoutDirection { get; set; }
22 | }
23 | }
--------------------------------------------------------------------------------
/source/nuPickers/PropertyEditors/LuceneLabels/LuceneLabelsPreValueEditor.cs:
--------------------------------------------------------------------------------
1 | namespace nuPickers.PropertyEditors.LuceneLabels
2 | {
3 | using nuPickers.EmbeddedResource;
4 | using Umbraco.Core.PropertyEditors;
5 |
6 | internal class LuceneLabelsPreValueEditor : PreValueEditor
7 | {
8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "LuceneDataSource/LuceneDataSourceConfig.html", HideLabel = true)]
9 | public string DataSource { get; set; }
10 |
11 | [PreValueField("customLabel", "", EmbeddedResource.ROOT_URL + "CustomLabel/CustomLabelConfig.html", HideLabel = true)]
12 | public string CustomLabel { get; set; }
13 |
14 | ///
15 | /// currently no ui, but forces controller to be loaded
16 | ///
17 | [PreValueField("labels", "", EmbeddedResource.ROOT_URL + "Labels/LabelsConfig.html", HideLabel = true)]
18 | public string Labels { get; set; }
19 |
20 | [PreValueField("layoutDirection", "Layout Direction", EmbeddedResource.ROOT_URL + "LayoutDirection/LayoutDirectionConfig.html")]
21 | public string LayoutDirection { get; set; }
22 | }
23 | }
--------------------------------------------------------------------------------
/source/nuPickers/Shared/DotNetDataSource/IDotNetDataSourcePaged.cs:
--------------------------------------------------------------------------------
1 | namespace nuPickers.Shared.DotNetDataSource
2 | {
3 | ///
4 | /// Implementing this interface will enable a dot-net-data-source to support returning a page sub-set of options
5 | /// ItemsPerPage/Page passed in preference to Skip/Take, as can reliably convert from: ItemsPerPage/Page -> Skip/Take, the same cannot be said for: Skip/Take -> ItemsPerPage/Page
6 | ///
7 | public interface IDotNetDataSourcePaged //: IDotNetDataSourceKeyed
8 | {
9 | ///
10 | /// (set by nuPickers before query)
11 | ///
12 | int ItemsPerPage { set; }
13 |
14 | ///
15 | /// (set by nuPickers before query)
16 | ///
17 | int Page { set; }
18 |
19 | ///
20 | /// The total number of items available, as if skip=0 and take=infinite (read by nuPickers after query)
21 | ///
22 | int Total { get; }
23 |
24 | //IEnumerable
GetEditorDataItems(int currentId, int parentId, int itemsPerPage, int page, out int total);
25 | }
26 | }
--------------------------------------------------------------------------------
/source/nuPickers/Shared/TypeaheadListPicker/TypeaheadListPicker.cs:
--------------------------------------------------------------------------------
1 | namespace nuPickers.Shared.TypeaheadListPicker
2 | {
3 | using System;
4 | using System.Linq;
5 | using System.Text.RegularExpressions;
6 | using nuPickers.Shared.Editor;
7 | using System.Collections.Generic;
8 |
9 | internal class TypeaheadListPicker
10 | {
11 | private string Typeahead { get; set; } // the value supplied by the user - the current typeahead text
12 |
13 | internal TypeaheadListPicker(string typeahead)
14 | {
15 | this.Typeahead = typeahead;
16 | }
17 |
18 | internal IEnumerable ProcessEditorDataItems(IEnumerable editorDataItems)
19 | {
20 | if (this.Typeahead != null)
21 | {
22 | return editorDataItems.Where(x => this.StripHtmlTags(x.Label).IndexOf(this.Typeahead, StringComparison.OrdinalIgnoreCase) >= 0);
23 | }
24 |
25 | return editorDataItems;
26 | }
27 |
28 | private string StripHtmlTags(string html)
29 | {
30 | return Regex.Replace(html, "<.+?>", string.Empty);
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/source/nuPickers/Shared/CheckBoxPicker/CheckBoxPickerEditor.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
12 | ({{getPickedOptions().length}}/{{checkBoxPickerOptions.length}})
13 |
14 |
15 |
16 |
17 |
18 |
31 |
32 |
--------------------------------------------------------------------------------
/source/nuPickers/Shared/EnumDataSource/EnumDataSourceConfigController.js:
--------------------------------------------------------------------------------
1 |
2 | angular
3 | .module("umbraco")
4 | .controller("nuPickers.Shared.EnumDataSource.EnumDataSourceConfigController",
5 | ['$scope', '$http', function ($scope, $http) {
6 |
7 | $scope.model.value = $scope.model.value || new Object();
8 | $scope.model.value.assemblyName = $scope.model.value.assemblyName || 'App_Code';
9 | $scope.model.value.apiController = 'EnumDataSourceApi';
10 |
11 |
12 | $http.get('backoffice/nuPickers/EnumDataSourceApi/GetAssemblyNames').then(function (response) {
13 |
14 | $scope.assemblyNames = response.data;
15 |
16 | $scope.$watch('model.value.assemblyName', function () {
17 |
18 | $scope.enumNames = null;
19 |
20 | $http.get('backoffice/nuPickers/EnumDataSourceApi/GetEnumNames',
21 | { params: { assemblyName: $scope.model.value.assemblyName } })
22 | .then(function (response) {
23 |
24 | $scope.enumNames = response.data;
25 |
26 | });
27 |
28 | });
29 |
30 | });
31 |
32 | }]);
33 |
34 |
--------------------------------------------------------------------------------
/source/nuPickers/PropertyEditors/PickerPropertyEditor.cs:
--------------------------------------------------------------------------------
1 | // left this file here for reference - would be handy if PropertyEditorAsset attributes worked with inheritance, as all pickers share these resources:
2 | namespace nuComponents.DataTypes.PropertyEditors
3 | {
4 | using ClientDependency.Core;
5 | using Umbraco.Core.PropertyEditors;
6 | using Umbraco.Web.PropertyEditors;
7 |
8 | // RESOURCES (all are referenced as EditorResource consumes the others)
9 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.RootUrl + "Editor/EditorResource.js")]
10 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.RootUrl + "DataSource/DataSourceResource.js")]
11 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.RootUrl + "RelationMapping/RelationMappingResource.js")]
12 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.RootUrl + "SaveFormat/SaveFormatResource.js")]
13 |
14 | // CONFIG
15 | [PropertyEditorAsset(ClientDependencyType.Javascript, "App_Plugins/nuComponents/DataTypes/Shared/RelationTypeMapping/RelationMappingConfigController.js")]
16 | public abstract class PickerPropertyEditor : BasePropertyEditor
17 | {
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/source/nuPickers/Shared/DotNetDataSource/IDotNetDataSource.cs:
--------------------------------------------------------------------------------
1 | namespace nuPickers.Shared.DotNetDataSource
2 | {
3 | //using System;
4 | //using nuPickers.Shared.Editor;
5 | using System.Collections.Generic;
6 |
7 | ///
8 | /// All classes that implement this interface can be used as a data-source for a nuPickers property-editor
9 | ///
10 | public interface IDotNetDataSource
11 | {
12 | ///
13 | ///
14 | ///
15 | /// the current content, media, or member id (or the parent if 0)
16 | /// a collection of string key, label pairs
17 | //[Obsolete("BREAKING CHANGE:This method will be obsoleted by the one supplying both current and parent context")]
18 | IEnumerable> GetEditorDataItems(int contextId);
19 |
20 | ///
21 | /// this method will eventually replace the one above
22 | ///
23 | ///
24 | ///
25 | ///
26 | //IEnumerable GetEditorDataItems(int currentId, int parentId);
27 | }
28 | }
--------------------------------------------------------------------------------
/source/nuPickers/Extensions/IPublishedContentExtensions.cs:
--------------------------------------------------------------------------------
1 | namespace nuPickers.Extensions
2 | {
3 | using System.Linq;
4 | using Umbraco.Core.Models;
5 |
6 | public static class IPublishedContentExtensions
7 | {
8 | ///
9 | /// Get a Picker model for the supplied propertyAlias on this
10 | ///
11 | /// The IPublishedContent that this extension method extends
12 | /// The property alias to get the Picker for
13 | /// A or null
14 | public static Picker GetPicker(this IPublishedContent publishedContent, string propertyAlias)
15 | {
16 | var propertyType = publishedContent.ContentType.PropertyTypes.SingleOrDefault(x => x.PropertyTypeAlias == propertyAlias);
17 | if (propertyType != null)
18 | {
19 | if (PickerPropertyValueConverter.IsPicker(propertyType.PropertyEditorAlias))
20 | {
21 | return new Picker(publishedContent.Id, propertyAlias);
22 | }
23 | }
24 |
25 | return null;
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/source/nuPickers/PropertyEditors/EnumCheckBoxPicker/EnumCheckBoxPickerPreValueEditor.cs:
--------------------------------------------------------------------------------
1 | namespace nuPickers.PropertyEditors.EnumCheckBoxPicker
2 | {
3 | using nuPickers.EmbeddedResource;
4 | using Umbraco.Core.PropertyEditors;
5 |
6 | internal class EnumCheckBoxPickerPreValueEditor : PreValueEditor
7 | {
8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "EnumDataSource/EnumDataSourceConfig.html", HideLabel = true)]
9 | public string DataSource { get; set; }
10 |
11 | [PreValueField("customLabel", "", EmbeddedResource.ROOT_URL + "CustomLabel/CustomLabelConfig.html", HideLabel = true)]
12 | public string CustomLabel { get; set; }
13 |
14 | [PreValueField("checkBoxPicker", "", EmbeddedResource.ROOT_URL + "CheckBoxPicker/CheckBoxPickerConfig.html", HideLabel = true)]
15 | public string CheckBoxPicker { get; set; }
16 |
17 | [PreValueField("layoutDirection", "Layout Direction", EmbeddedResource.ROOT_URL + "LayoutDirection/LayoutDirectionConfig.html")]
18 | public string LayoutDirection { get; set; }
19 |
20 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")]
21 | public string SaveFormat { get; set; }
22 | }
23 | }
--------------------------------------------------------------------------------
/source/nuPickers/Shared/EnumDataSource/EnumDataSourceAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace nuPickers.Shared.EnumDataSource
4 | {
5 | ///
6 | /// Attribute that can be applied to enum fields, to configure how the EnumDataSource generates it's data
7 | /// NOTE: this is virtually the same as Shared/Editor/EditorDataItem.cs
8 | ///
9 | public class EnumDataSourceAttribute : Attribute
10 | {
11 | ///
12 | /// Sets the unique identifier (the picker value) - else this defaults to the enum value
13 | ///
14 | public string Key { get; set; }
15 |
16 | ///
17 | /// Sets the visiable label for each item in the picker
18 | ///
19 | public string Label { get; set; }
20 |
21 | ///
22 | /// Gets or sets a value indicating whether this enum field should be enabled
23 | ///
24 | public bool Enabled { get; set; }
25 |
26 | ///
27 | /// Initializes a new instance of the class.
28 | ///
29 | public EnumDataSourceAttribute()
30 | {
31 | this.Enabled = true;
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/source/nuPickers/PropertyEditors/EnumPrefetchListPicker/EnumPrefetchListPickerPreValueEditor.cs:
--------------------------------------------------------------------------------
1 | namespace nuPickers.PropertyEditors.EnumPrefetchListPicker
2 | {
3 | using nuPickers.EmbeddedResource;
4 | using Umbraco.Core.PropertyEditors;
5 |
6 | internal class EnumPrefetchListPickerPreValueEditor : PreValueEditor
7 | {
8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "EnumDataSource/EnumDataSourceConfig.html", HideLabel = true)]
9 | public string DataSource { get; set; }
10 |
11 | [PreValueField("customLabel", "", EmbeddedResource.ROOT_URL + "CustomLabel/CustomLabelConfig.html", HideLabel = true)]
12 | public string CustomLabel { get; set; }
13 |
14 | [PreValueField("prefetchListPicker", "", EmbeddedResource.ROOT_URL + "PrefetchListPicker/PrefetchListPickerConfig.html", HideLabel = true)]
15 | public string PrefetchListPicker { get; set; }
16 |
17 | [PreValueField("listPicker", "", EmbeddedResource.ROOT_URL + "ListPicker/ListPickerConfig.html", HideLabel = true)]
18 | public string ListPicker { get; set; }
19 |
20 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")]
21 | public string SaveFormat { get; set; }
22 | }
23 | }
--------------------------------------------------------------------------------
/source/nuPickers/Shared/RelationMapping/RelationMappingApiController.cs:
--------------------------------------------------------------------------------
1 | namespace nuPickers.Shared.RelationMapping
2 | {
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Web.Http;
6 | using Umbraco.Web.Editors;
7 | using Umbraco.Web.Mvc;
8 |
9 | [PluginController("nuPickers")]
10 | public class RelationMappingApiController : UmbracoAuthorizedJsonController
11 | {
12 | [HttpGet]
13 | public IEnumerable