├── source ├── .nuget │ ├── NuGet.exe │ └── NuGet.Config ├── nuPickers │ ├── Shared │ │ ├── Labels │ │ │ ├── LabelsConfig.html │ │ │ ├── LabelsEditor.html │ │ │ ├── LabelsConfigController.js │ │ │ └── LabelsEditorController.js │ │ ├── HiddenConstant │ │ │ └── HiddenConstantConfig.html │ │ ├── DotNetDataSource │ │ │ ├── DotNetDataSourceProperty.cs │ │ │ ├── IDotNetDataSourceTypeahead.cs │ │ │ ├── IDotNetDataSourceKeyed.cs │ │ │ ├── DotNetDataSourceAttribute.cs │ │ │ ├── IDotNetDataSourcePaged.cs │ │ │ ├── IDotNetDataSource.cs │ │ │ └── DotNetDataSourceConfig.html │ │ ├── CheckBoxPicker │ │ │ ├── CheckBoxPickerEditor.css │ │ │ ├── CheckBoxPickerConfig.html │ │ │ ├── CheckBoxPickerEditor.html │ │ │ └── CheckBoxPickerEditorController.js │ │ ├── LayoutDirection │ │ │ ├── LayoutDirection.css │ │ │ └── LayoutDirectionConfig.html │ │ ├── CustomLabel │ │ │ ├── CustomLabelConfigController.js │ │ │ ├── CustomLabelConfig.html │ │ │ └── CustomLabelApiController.cs │ │ ├── DropDownPicker │ │ │ ├── DropDownPickerEditor.html │ │ │ └── DropDownPickerEditorController.js │ │ ├── Editor │ │ │ └── EditorDataItem.cs │ │ ├── PagedListPicker │ │ │ ├── PagedListPickerConfig.html │ │ │ ├── PagedListPickerEditor.css │ │ │ ├── PagedListPickerEditor.html │ │ │ └── PagedListPickerEditorController.js │ │ ├── TypeaheadListPicker │ │ │ ├── TypeaheadListPickerEditorDirectives.js │ │ │ ├── TypeaheadListPickerConfig.html │ │ │ ├── TypeaheadListPicker.cs │ │ │ ├── TypeaheadListPickerEditor.html │ │ │ └── TypeaheadListPickerEditorController.js │ │ ├── RelationDataSource │ │ │ ├── RelationDataSourceConfigController.js │ │ │ ├── RelationDataSourceConfig.html │ │ │ ├── RelationDataSourceApiController.cs │ │ │ └── RelationDataSource.cs │ │ ├── LuceneDataSource │ │ │ ├── LuceneDataSourceApiController.cs │ │ │ ├── LuceneDataSourceConfigController.js │ │ │ └── LuceneDataSourceConfig.html │ │ ├── SqlDataSource │ │ │ ├── SqlDataSourceConfigController.js │ │ │ ├── SqlDataSourceApiController.cs │ │ │ ├── SqlDataSourceConfig.html │ │ │ └── SqlDataSource.cs │ │ ├── JsonDataSource │ │ │ ├── JsonDataSourceConfigController.js │ │ │ └── JsonDataSourceConfig.html │ │ ├── XmlDataSource │ │ │ └── XmlDataSourceConfigController.js │ │ ├── RadioButtonPicker │ │ │ ├── RadioButtonPickerEditor.html │ │ │ └── RadioButtonPickerEditorController.js │ │ ├── Paging │ │ │ └── PageMarker.cs │ │ ├── SaveFormat │ │ │ ├── SaveFormatConfigController.js │ │ │ ├── SaveFormatConfig.html │ │ │ └── SaveFormatPropertyValueEditor.cs │ │ ├── RelationMapping │ │ │ ├── RelationMappingConfig.html │ │ │ ├── RelationMappingResource.js │ │ │ ├── RelationMappingApiController.cs │ │ │ └── RelationMappingConfigController.js │ │ ├── DataSource │ │ │ ├── DataSourceApiResponse.cs │ │ │ ├── DataSourceResource.js │ │ │ └── IDataSource.cs │ │ ├── PropertyEditor │ │ │ └── PropertyEditorConfig.css │ │ ├── EnumDataSource │ │ │ ├── EnumDataSourceConfig.html │ │ │ ├── EnumDataSourceConfigController.js │ │ │ ├── EnumDataSourceAttribute.cs │ │ │ ├── EnumDataSourceApiController.cs │ │ │ └── EnumExtensions.cs │ │ ├── ListPicker │ │ │ ├── ListPickerSelectablePartial.html │ │ │ ├── ListPickerSelectedPartial.html │ │ │ ├── ListPickerEditorDirectives.js │ │ │ └── ListPickerConfig.html │ │ └── PrefetchListPicker │ │ │ ├── PrefetchListPickerEditor.html │ │ │ └── PrefetchListPickerConfig.html │ ├── PropertyEditors │ │ ├── BasePropertyEditor.cs │ │ ├── EnumDropDownPicker │ │ │ ├── EnumDropDownPickerPreValueEditor.cs │ │ │ └── EnumDropDownPickerPropertyEditor.cs │ │ ├── SqlLabels │ │ │ ├── SqlLabelsPreValueEditor.cs │ │ │ └── SqlLabelsPropertyEditor.cs │ │ ├── SqlDropDownPicker │ │ │ ├── SqlDropDownPickerPreValueEditor.cs │ │ │ └── SqlDropDownPickerPropertyEditor.cs │ │ ├── JsonDropDownPicker │ │ │ ├── JsonDropDownPickerPreValueEditor.cs │ │ │ └── JsonDropDownPickerPropertyEditor.cs │ │ ├── RelationLabels │ │ │ ├── RelationLabelsPreValueEditor.cs │ │ │ └── RelationLabelsPropertyEditor.cs │ │ ├── XmlDropDownPicker │ │ │ ├── XmlDropDownPickerPreValueEditor.cs │ │ │ └── XmlDropDownPickerPropertyEditor.cs │ │ ├── LuceneDropDownPicker │ │ │ ├── LuceneDropDownPickerPreValueEditor.cs │ │ │ └── LuceneDropDownPickerPropertyEditor.cs │ │ ├── DotNetDropDownPicker │ │ │ ├── DotNetDropDownPickerPreValueEditor.cs │ │ │ └── DotNetDropDownPickerPropertyEditor.cs │ │ ├── EnumRadioButtonPicker │ │ │ ├── EnumRadioButtonPickerPreValueEditor.cs │ │ │ └── EnumRadioButtonPickerPropertyEditor.cs │ │ ├── EnumLabels │ │ │ ├── EnumLabelsPreValueEditor.cs │ │ │ └── EnumLabelsPropertyEditor.cs │ │ ├── JsonLabels │ │ │ ├── JsonLabelsPreValueEditor.cs │ │ │ └── JsonLabelsPropertyEditor.cs │ │ ├── XmlLabels │ │ │ ├── XmlLabelsPreValueEditor.cs │ │ │ └── XmlLabelsPropertyEditor.cs │ │ ├── DotNetLabels │ │ │ ├── DotNetLabelsPreValueEditor.cs │ │ │ └── DotLabelsPropertyEditor.cs │ │ ├── LuceneLabels │ │ │ ├── LuceneLabelsPreValueEditor.cs │ │ │ └── LuceneLabelsPropertyEditor.cs │ │ ├── PickerPropertyEditor.cs │ │ ├── EnumCheckBoxPicker │ │ │ ├── EnumCheckBoxPickerPreValueEditor.cs │ │ │ └── EnumCheckBoxPickerPropertyEditor.cs │ │ ├── EnumPrefetchListPicker │ │ │ └── EnumPrefetchListPickerPreValueEditor.cs │ │ ├── SqlRadioButtonPicker │ │ │ └── SqlRadioButtonPickerPreValueEditor.cs │ │ ├── JsonRadioButtonPicker │ │ │ ├── JsonRadioButtonPickerPreValueEditor.cs │ │ │ └── JsonRadioButtonPickerPropertyEditor.cs │ │ ├── XmlRadioButtonPicker │ │ │ └── XmlRadioButtonPickerPreValueEditor.cs │ │ ├── DotNetRadioButtonPicker │ │ │ └── DotNetRadioButtonPickerPreValueEditor.cs │ │ ├── LuceneRadioButtonPicker │ │ │ └── LuceneRadioButtonPickerPreValueEditor.cs │ │ ├── SqlPagedListPicker │ │ │ └── SqlPagedListPickerPreValueEditor.cs │ │ ├── JsonPagedListPicker │ │ │ └── JsonPagedListPickerPreValueEditor.cs │ │ ├── XmlPagedListPicker │ │ │ └── XmlPagedListPickerPreValueEditor.cs │ │ ├── DotNetPagedListPicker │ │ │ └── DotNetPagedListPickerPreValueEditor.cs │ │ ├── LucenePagedListPicker │ │ │ └── LucenePagedListPickerPreValueEditor.cs │ │ ├── SqlCheckBoxPicker │ │ │ └── SqlCheckBoxPickerPreValueEditor.cs │ │ ├── JsonCheckBoxPicker │ │ │ └── JsonCheckBoxPickerPreValueEditor.cs │ │ ├── XmlCheckBoxPicker │ │ │ └── XmlCheckBoxPickerPreValueEditor.cs │ │ ├── JsonPrefetchListPicker │ │ │ └── JsonPrefetchListPickerPreValueEditor.cs │ │ ├── SqlPrefetchListPicker │ │ │ └── SqlPrefetchListPickerPreValueEditor.cs │ │ ├── XmlPrefetchListPicker │ │ │ └── XmlPrefetchListPickerPreValueEditor.cs │ │ ├── DotNetCheckBoxPicker │ │ │ ├── DotNetCheckBoxPickerPreValueEditor.cs │ │ │ └── DotNetCheckBoxPickerPropertyEditor.cs │ │ ├── DotNetPrefetchListPicker │ │ │ └── DotNetPrefetchListPickerPreValueEditor.cs │ │ ├── LuceneCheckBoxPicker │ │ │ └── LuceneCheckBoxPickerPreValueEditor.cs │ │ ├── LucenePrefetchListPicker │ │ │ └── LucenePrefetchListPickerPreValueEditor.cs │ │ ├── JsonTypeaheadListPicker │ │ │ └── JsonTypeaheadListPickerPreValueEditor.cs │ │ ├── SqlTypeaheadListPicker │ │ │ └── SqlTypeaheadListPickerPreValueEditor.cs │ │ ├── XmlTypeaheadListPicker │ │ │ └── XmlTypeaheadListPickerPreValueEditor.cs │ │ ├── LuceneTypeaheadPicker │ │ │ └── LuceneTypeaheadListPickerPreValueEditor.cs │ │ └── DotNetTypeaheadListPicker │ │ │ └── DotNetTypeaheadListPickerPreValueEditor.cs │ ├── Caching │ │ ├── CacheConstants.cs │ │ └── CacheInvalidation.cs │ ├── EmbeddedResource │ │ ├── EmbeddedResource.cs │ │ ├── EmbeddedResourceController.cs │ │ ├── EmbeddedResourceVirtualFileProvider.cs │ │ ├── EmbeddedResourceStartup.cs │ │ ├── EmbeddedResourceVirtualFileWriter.cs │ │ └── EmbeddedResourceVirtualFile.cs │ ├── Extensions │ │ ├── IEnumerableStringExtensions.cs │ │ ├── IPublishedContentExtensions.cs │ │ └── UmbracoHelperExtensions.cs │ ├── app.config │ ├── NuHandler.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── packages.config ├── nuPickers.Tests │ └── Properties │ │ └── AssemblyInfo.cs └── nuPickers.sln ├── .editorconfig ├── LICENSE ├── README.md ├── appveyor.yml └── .gitattributes /source/.nuget/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uComponents/nuPickers/HEAD/source/.nuget/NuGet.exe -------------------------------------------------------------------------------- /source/nuPickers/Shared/Labels/LabelsConfig.html: -------------------------------------------------------------------------------- 1 |
-------------------------------------------------------------------------------- /source/nuPickers/Shared/HiddenConstant/HiddenConstantConfig.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root=true 2 | 3 | [*] 4 | end_of_line = lf 5 | indent_style = space 6 | indent_size = 2 7 | trim_trailing_whitespace = true 8 | 9 | [*.{cs,cshtml}] 10 | indent_size = 4 -------------------------------------------------------------------------------- /source/.nuget/NuGet.Config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /source/nuPickers/Shared/DotNetDataSource/DotNetDataSourceProperty.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.Shared.DotNetDataSource 2 | { 3 | public struct DotNetDataSourceProperty 4 | { 5 | public string Name { get; set; } 6 | 7 | public string Value { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /source/nuPickers/Shared/Labels/LabelsEditor.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /source/nuPickers/Shared/CheckBoxPicker/CheckBoxPickerEditor.css: -------------------------------------------------------------------------------- 1 | .check-box-picker .check-all { 2 | background-color: #f8f8f8; 3 | } 4 | 5 | .check-box-picker .counter { 6 | font-size:smaller; 7 | } 8 | 9 | .check-box-picker hr { 10 | margin: 4px 0; 11 | } 12 | 13 | .check-box-picker label { 14 | padding:1px 2px; 15 | } 16 | -------------------------------------------------------------------------------- /source/nuPickers/Shared/DotNetDataSource/IDotNetDataSourceTypeahead.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.Shared.DotNetDataSource 2 | { 3 | public interface IDotNetDataSourceTypeahead 4 | { 5 | string Typeahead { get; set; } 6 | 7 | //IEnumerable GetEditorDataItems(int currentId, int parentId, string typeahead); 8 | } 9 | } -------------------------------------------------------------------------------- /source/nuPickers/Shared/Labels/LabelsConfigController.js: -------------------------------------------------------------------------------- 1 | 2 | angular 3 | .module("umbraco") 4 | .controller("nuPickers.Shared.Labels.LabelsConfigController", 5 | ['$rootScope', '$scope', function ($rootScope, $scope) { 6 | 7 | // if labels, then data sources don't need to ask for key data 8 | $rootScope.$broadcast('isLabels', true); 9 | 10 | }]); 11 | -------------------------------------------------------------------------------- /source/nuPickers/Shared/LayoutDirection/LayoutDirection.css: -------------------------------------------------------------------------------- 1 | 2 | ul.layout-direction 3 | { 4 | list-style-type: none; 5 | margin: 0; 6 | } 7 | 8 | ul.layout-direction.horizontal li 9 | { 10 | display:inline; 11 | } 12 | 13 | ul.layout-direction.horizontal li label { 14 | display: inline; 15 | margin-right: 10px; 16 | } 17 | 18 | ul.layout-direction.vertical li 19 | { 20 | } -------------------------------------------------------------------------------- /source/nuPickers/Shared/CustomLabel/CustomLabelConfigController.js: -------------------------------------------------------------------------------- 1 | 2 | angular 3 | .module("umbraco") 4 | .controller("nuPickers.Shared.CustomLabel.CustomLabelConfigController", 5 | ['$scope', '$http', function ($scope, $http) { 6 | 7 | $http.get('backoffice/nuPickers/CustomLabelApi/GetMacros').then(function (response) { 8 | $scope.macros = response.data; 9 | }); 10 | 11 | }]); 12 | 13 | -------------------------------------------------------------------------------- /source/nuPickers/Shared/LayoutDirection/LayoutDirectionConfig.html: -------------------------------------------------------------------------------- 1 | 5 | 6 | -------------------------------------------------------------------------------- /source/nuPickers/Shared/DropDownPicker/DropDownPickerEditor.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 9 | 10 |
-------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/BasePropertyEditor.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace nuPickers.PropertyEditors 3 | { 4 | using nuPickers.Shared.SaveFormat; 5 | using Umbraco.Core.PropertyEditors; 6 | 7 | public abstract class BasePropertyEditor : PropertyEditor 8 | { 9 | protected override PropertyValueEditor CreateValueEditor() 10 | { 11 | return new SaveFormatPropertyValueEditor(base.CreateValueEditor()); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /source/nuPickers/Shared/Editor/EditorDataItem.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.Shared.Editor 2 | { 3 | using Newtonsoft.Json; 4 | 5 | /// 6 | /// POCO model representing an item that a picker can pick (the key and a label) 7 | /// 8 | public class EditorDataItem 9 | { 10 | [JsonProperty("key")] 11 | public string Key { get; set; } 12 | 13 | [JsonProperty("label")] 14 | public string Label { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /source/nuPickers/Shared/Labels/LabelsEditorController.js: -------------------------------------------------------------------------------- 1 | 2 | angular 3 | .module("umbraco") 4 | .controller("nuPickers.Shared.Labels.LabelsEditorController", 5 | ['$scope', 'nuPickers.Shared.Editor.EditorResource', 6 | function ($scope, editorResource) { 7 | 8 | editorResource.getEditorDataItems($scope.model).then(function (response) { 9 | 10 | $scope.options = response.data.editorDataItems; 11 | 12 | }); 13 | 14 | }]); -------------------------------------------------------------------------------- /source/nuPickers/Shared/PagedListPicker/PagedListPickerConfig.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 8 |
9 | 12 |
13 |
14 | 15 |
-------------------------------------------------------------------------------- /source/nuPickers/Shared/TypeaheadListPicker/TypeaheadListPickerEditorDirectives.js: -------------------------------------------------------------------------------- 1 | 2 | angular 3 | .module("umbraco.directives") 4 | .directive('nuBlur', function () { // ng-blur isn't yet avaiable with the build of AngularJs used by Umbraco 5 | return { 6 | restrict: 'A', 7 | link: function (scope, element, attrs) { 8 | 9 | element.bind('blur', function () { 10 | scope.$apply(attrs.nuBlur); 11 | }); 12 | } 13 | } 14 | }); 15 | 16 | -------------------------------------------------------------------------------- /source/nuPickers/Caching/CacheConstants.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.Caching 2 | { 3 | internal static class CacheConstants 4 | { 5 | /// 6 | /// key appended with a dataType id - stores all the prevalues for a picker 7 | /// 8 | public const string DataTypePreValuesPrefix = "dataTypePreValues_"; 9 | 10 | /// 11 | /// key appended with a context id and property alias - stores picked keys (only applies when picker is in relations only save format) 12 | /// 13 | public const string PickedKeysPrefix = "pickedKeys_"; 14 | } 15 | } -------------------------------------------------------------------------------- /source/nuPickers/Shared/RelationDataSource/RelationDataSourceConfigController.js: -------------------------------------------------------------------------------- 1 | 2 | angular 3 | .module("umbraco") 4 | .controller("nuPickers.Shared.RelationDataSource.RelationDataSourceConfigController", 5 | ['$scope', '$http', function ($scope, $http) { 6 | 7 | $scope.model.value = $scope.model.value || new Object(); 8 | $scope.model.value.apiController = 'RelationDataSourceApi'; 9 | 10 | $http.get('backoffice/nuPickers/RelationDataSourceApi/GetRelationTypes').then(function (response) { 11 | $scope.relationTypes = response.data; 12 | }); 13 | 14 | }]); 15 | -------------------------------------------------------------------------------- /source/nuPickers/Shared/LuceneDataSource/LuceneDataSourceApiController.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.Shared.LuceneDataSource 2 | { 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using Umbraco.Web.Editors; 6 | using Umbraco.Web.Mvc; 7 | using UmbracoExamine; 8 | 9 | [PluginController("nuPickers")] 10 | public class LuceneDataSourceApiController : UmbracoAuthorizedJsonController 11 | { 12 | public IEnumerable GetExamineSearchers() 13 | { 14 | return Examine.ExamineManager.Instance.SearchProviderCollection.OfType().Select(x => x.Name); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/EnumDropDownPicker/EnumDropDownPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace nuPickers.PropertyEditors.EnumDropDownPicker 3 | { 4 | using nuPickers.EmbeddedResource; 5 | using Umbraco.Core.PropertyEditors; 6 | 7 | internal class EnumDropDownPickerPreValueEditor : PreValueEditor 8 | { 9 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "EnumDataSource/EnumDataSourceConfig.html", HideLabel = true)] 10 | public string DataSource { get; set; } 11 | 12 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 13 | public string SaveFormat { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /source/nuPickers/Shared/SqlDataSource/SqlDataSourceConfigController.js: -------------------------------------------------------------------------------- 1 | 2 | angular 3 | .module("umbraco") 4 | .controller("nuPickers.Shared.SqlDataSource.SqlDataSourceConfigController", 5 | ['$scope', '$http', function ($scope, $http) { 6 | 7 | $scope.model.value = $scope.model.value || new Object(); 8 | $scope.model.value.connectionString = $scope.model.value.connectionString || 'umbracoDbDSN'; 9 | $scope.model.value.apiController = 'SqlDataSourceApi'; 10 | 11 | $http.get('backoffice/nuPickers/SqlDataSourceApi/GetConnectionStrings').then(function (response) { 12 | $scope.connectionStrings = response.data; 13 | }); 14 | 15 | }]); 16 | 17 | -------------------------------------------------------------------------------- /source/nuPickers/Shared/JsonDataSource/JsonDataSourceConfigController.js: -------------------------------------------------------------------------------- 1 | 2 | angular 3 | .module("umbraco") 4 | .controller("nuPickers.Shared.JsonDataSource.JsonDataSourceConfigController", 5 | ['$scope', function ($scope) { 6 | 7 | // hide the key option if this is being used by labels 8 | $scope.isLabels = false; 9 | $scope.$on('isLabels', function () { $scope.isLabels = true; }); 10 | // NOTE: broadcast to tell sender that we're ready to listen not required (happens to work as in correct execution order) 11 | 12 | $scope.model.value = $scope.model.value || new Object(); 13 | $scope.model.value.apiController = 'JsonDataSourceApi'; 14 | 15 | }]); 16 | 17 | -------------------------------------------------------------------------------- /source/nuPickers/Shared/XmlDataSource/XmlDataSourceConfigController.js: -------------------------------------------------------------------------------- 1 | 2 | angular 3 | .module("umbraco") 4 | .controller("nuPickers.Shared.XmlDataSource.XmlDataSourceConfigController", 5 | ['$scope', function ($scope) { 6 | 7 | // hide the key option if this is being used by labels 8 | $scope.isLabels = false; 9 | $scope.$on('isLabels', function () { $scope.isLabels = true; }); 10 | // NOTE: broadcast to tell sender that we're ready to listen not required (happens to work as in correct execution order) 11 | 12 | $scope.model.value = $scope.model.value || new Object(); 13 | $scope.model.value.apiController = 'XmlDataSourceApi'; 14 | 15 | 16 | }]); 17 | 18 | -------------------------------------------------------------------------------- /source/nuPickers/Shared/CustomLabel/CustomLabelConfig.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 8 | 9 |
10 | 14 |
15 |
16 | 17 |
-------------------------------------------------------------------------------- /source/nuPickers/Shared/RelationDataSource/RelationDataSourceConfig.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 | 9 | 10 |
11 | 15 |
16 |
17 | 18 |
-------------------------------------------------------------------------------- /source/nuPickers/Shared/RadioButtonPicker/RadioButtonPickerEditor.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
    5 |
  • 6 | 7 | 16 | 17 |
  • 18 |
19 | 20 |
-------------------------------------------------------------------------------- /source/nuPickers/Shared/Paging/PageMarker.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.Shared.Paging 2 | { 3 | /// 4 | /// represents itemsPerPage and a page number - used to caluclate skip/take values 5 | /// 6 | internal class PageMarker 7 | { 8 | internal int ItemsPerPage { get; private set; } 9 | 10 | internal int Page { get; private set; } 11 | 12 | internal int Skip { get; private set; } 13 | 14 | internal int Take { get; private set; } 15 | 16 | internal PageMarker(int itemsPerPage, int page) 17 | { 18 | this.ItemsPerPage = itemsPerPage; 19 | this.Page = page; 20 | this.Skip = itemsPerPage * (page - 1); 21 | this.Take = itemsPerPage; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /source/nuPickers/Shared/DotNetDataSource/IDotNetDataSourceKeyed.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.Shared.DotNetDataSource 2 | { 3 | /// 4 | /// Implementing this interface will enable a dot-net-data-source to support returning returning only those options matching specific keys 5 | /// This is required when using a csv save format (that doesn't store any label data) & a data source dependant on paging or typeahead values to return data 6 | /// 7 | public interface IDotNetDataSourceKeyed 8 | { 9 | /// 10 | /// (set by nuPickers before query) 11 | /// 12 | string[] Keys { set; } 13 | 14 | //IEnumerable GetEditorDataItems(int currentId, int parentId, string[] keys); 15 | } 16 | } -------------------------------------------------------------------------------- /source/nuPickers/EmbeddedResource/EmbeddedResource.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.EmbeddedResource 2 | { 3 | internal static class EmbeddedResource 4 | { 5 | /// 6 | /// Root url for all embedded resources 7 | /// 8 | internal const string ROOT_URL = "~/App_Plugins/nuPickers/Shared/"; 9 | 10 | /// 11 | /// namespace prefix for all embedded resources 12 | /// 13 | internal const string RESOURCE_PREFIX = "nuPickers.Shared."; 14 | 15 | /// 16 | /// Custom extension so ClientDependency framework can delegate handling back to nuPickers for the embedded content 17 | /// 18 | internal const string FILE_EXTENSION = ".nu"; 19 | } 20 | } -------------------------------------------------------------------------------- /source/nuPickers/Shared/SaveFormat/SaveFormatConfigController.js: -------------------------------------------------------------------------------- 1 | 2 | angular 3 | .module("umbraco") 4 | .controller("nuPickers.Shared.SaveFormat.SaveFormatConfigController", 5 | ['$rootScope', '$scope', function ($rootScope, $scope) { 6 | 7 | $scope.relationMappingBidirectional = false; 8 | 9 | $scope.model.value = $scope.model.value || 'csv'; 10 | 11 | $scope.$on('relationMappingChanged', function (event, relationType) { 12 | $scope.relationMappingBidirectional = (relationType != null && relationType.bidirectional); 13 | 14 | if ($scope.model.value == 'relationsOnly' && !$scope.relationMappingBidirectional) { 15 | $scope.model.value = 'csv'; // fallback to csv 16 | } 17 | }); 18 | 19 | 20 | 21 | }]); 22 | -------------------------------------------------------------------------------- /source/nuPickers/Shared/SqlDataSource/SqlDataSourceApiController.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.Shared.SqlDataSource 2 | { 3 | using System.Collections.Generic; 4 | using System.Configuration; 5 | using Umbraco.Web.Editors; 6 | using Umbraco.Web.Mvc; 7 | 8 | [PluginController("nuPickers")] 9 | public class SqlDataSourceApiController : UmbracoAuthorizedJsonController 10 | { 11 | public IEnumerable GetConnectionStrings() 12 | { 13 | List connectionStrings = new List(); 14 | 15 | foreach (ConnectionStringSettings connectionString in ConfigurationManager.ConnectionStrings) 16 | { 17 | connectionStrings.Add(connectionString.Name); 18 | } 19 | 20 | return connectionStrings; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /source/nuPickers/Shared/CheckBoxPicker/CheckBoxPickerConfig.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 8 | 9 |
10 | 11 |
12 |
13 | 14 |
15 | 19 | 20 |
21 | 22 |
23 |
24 | 25 |
-------------------------------------------------------------------------------- /source/nuPickers/Shared/RelationMapping/RelationMappingConfig.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 8 | 9 |
10 | 15 |
16 |
17 | 18 |
-------------------------------------------------------------------------------- /source/nuPickers/Shared/CustomLabel/CustomLabelApiController.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.Shared 2 | { 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using umbraco.cms.businesslogic.macro; 6 | using Umbraco.Web.Editors; 7 | using Umbraco.Web.Mvc; 8 | 9 | [PluginController("nuPickers")] 10 | public class CustomLabelApiController : UmbracoAuthorizedJsonController 11 | { 12 | public IEnumerable GetMacros() 13 | { 14 | //using legacy api as no method on Umbraco.Core.Services.MacroSerivce to get all macros 15 | return Macro.GetAll() 16 | .Select(x => new 17 | { 18 | name = x.Name, 19 | alias = x.Alias 20 | }); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/SqlLabels/SqlLabelsPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.SqlLabels 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class SqlLabelsPreValueEditor : PreValueEditor 7 | { 8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "SqlDataSource/SqlDataSourceConfig.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("layoutDirection", "Layout Direction", EmbeddedResource.ROOT_URL + "LayoutDirection/LayoutDirectionConfig.html")] 15 | public string LayoutDirection { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /source/nuPickers/Shared/LuceneDataSource/LuceneDataSourceConfigController.js: -------------------------------------------------------------------------------- 1 | 2 | angular 3 | .module("umbraco") 4 | .controller("nuPickers.Shared.LuceneDataSource.LuceneDataSourceConfigController", 5 | ['$scope', '$http', function ($scope, $http) { 6 | 7 | $scope.isLabels = false; 8 | $scope.$on('isLabels', function () { $scope.isLabels = true; }); 9 | // NOTE: broadcast to tell sender that we're ready to listen not required (happens to work as in correct execution order) 10 | 11 | $http.get('backoffice/nuPickers/LuceneDataSourceApi/GetExamineSearchers').then(function (response) { 12 | $scope.examineSearchers = response.data; 13 | }); 14 | 15 | $scope.model.value = $scope.model.value || new Object(); 16 | $scope.model.value.apiController = 'LuceneDataSourceApi'; 17 | 18 | }]); 19 | 20 | -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/SqlDropDownPicker/SqlDropDownPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.SqlDropDownPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class SqlDropDownPickerPreValueEditor : PreValueEditor 7 | { 8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "SqlDataSource/SqlDataSourceConfig.html", HideLabel = true)] 9 | public string DataSource { get; set; } 10 | 11 | [PreValueField("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 12 | public string RelationMapping { get; set; } 13 | 14 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 15 | public string SaveFormat { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/JsonDropDownPicker/JsonDropDownPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.JsonDropDownPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class JsonDropDownPickerPreValueEditor : PreValueEditor 7 | { 8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "JsonDataSource/JsonDataSourceConfig.html", HideLabel = true)] 9 | public string DataSource { get; set; } 10 | 11 | [PreValueField("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 12 | public string RelationMapping { get; set; } 13 | 14 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 15 | public string SaveFormat { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/RelationLabels/RelationLabelsPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.RelationLabels 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class RelationLabelsPreValueEditor : PreValueEditor 7 | { 8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "RelationDataSource/RelationDataSourceConfig.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("layoutDirection", "Layout Direction", EmbeddedResource.ROOT_URL + "LayoutDirection/LayoutDirectionConfig.html")] 15 | public string LayoutDirection { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/XmlDropDownPicker/XmlDropDownPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.XmlDropDownPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class XmlDropDownPickerPreValueEditor : PreValueEditor 7 | { 8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "XmlDataSource/XmlDataSourceConfig.html", HideLabel = true)] 9 | public string DataSource { get; set; } 10 | 11 | [PreValueField("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 12 | public string RelationMapping { get; set; } 13 | 14 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 15 | public string SaveFormat { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /source/nuPickers/Shared/SaveFormat/SaveFormatConfig.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 7 | 8 | 12 | 13 | 17 | 18 | 22 | 23 |
-------------------------------------------------------------------------------- /source/nuPickers/Shared/DataSource/DataSourceApiResponse.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.Shared.DataSource 2 | { 3 | using Newtonsoft.Json; 4 | using nuPickers.Shared.Editor; 5 | using System.Collections.Generic; 6 | 7 | /// 8 | /// Model for the api controller response 9 | /// 10 | public class DataSourceApiResponse 11 | { 12 | /// 13 | /// collection of editor data items 14 | /// 15 | [JsonProperty("editorDataItems")] 16 | public IEnumerable EditorDataItems { get; internal set; } 17 | 18 | /// 19 | /// total of available editor data items (not all may be in the collection, for example a paged picker will request a subset) 20 | /// 21 | [JsonProperty("total")] 22 | public int Total { get; internal set; } 23 | } 24 | } -------------------------------------------------------------------------------- /source/nuPickers/Shared/RelationDataSource/RelationDataSourceApiController.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.Shared.RelationDataSource 2 | { 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using umbraco.cms.businesslogic.relation; 6 | using Umbraco.Web.Editors; 7 | using Umbraco.Web.Mvc; 8 | 9 | [PluginController("nuPickers")] 10 | public class RelationDataSourceApiController : UmbracoAuthorizedJsonController 11 | { 12 | public IEnumerable GetRelationTypes() 13 | { 14 | return RelationType.GetAll() 15 | .OrderBy(x => x.Name) 16 | .Select(x => new 17 | { 18 | key = x.Alias, 19 | label = x.Name, 20 | biDirectional = x.Dual 21 | }); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/LuceneDropDownPicker/LuceneDropDownPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.LuceneDropDownPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class LuceneDropDownPickerPreValueEditor : PreValueEditor 7 | { 8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "LuceneDataSource/LuceneDataSourceConfig.html", HideLabel = true)] 9 | public string DataSource { get; set; } 10 | 11 | [PreValueField("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 12 | public string RelationMapping { get; set; } 13 | 14 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 15 | public string SaveFormat { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/DotNetDropDownPicker/DotNetDropDownPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.DotNetDropDownPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class DotNetDropDownPickerPreValueEditor : PreValueEditor 7 | { 8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "DotNetDataSource/DotNetDataSourceConfig.html", HideLabel = true)] 9 | public string DataSource { get; set; } 10 | 11 | [PreValueField("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 12 | public string RelationMapping { get; set; } 13 | 14 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 15 | public string SaveFormat { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /source/nuPickers/Shared/DotNetDataSource/DotNetDataSourceAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.Shared.DotNetDataSource 2 | { 3 | using System; 4 | 5 | /// 6 | /// When this attribute is used, the pickers will render a corresponding config field 7 | /// 8 | [AttributeUsage(AttributeTargets.Property)] 9 | public class DotNetDataSourceAttribute : Attribute 10 | { 11 | /// 12 | /// Title for the the config option 13 | /// 14 | public string Title { get; set; } 15 | 16 | /// 17 | /// Description for the config option 18 | /// 19 | public string Description { get; set; } 20 | 21 | /// 22 | /// Initialize a new instance of 23 | /// 24 | public DotNetDataSourceAttribute() 25 | { 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /source/nuPickers/Extensions/IEnumerableStringExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.Extensions 2 | { 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using Umbraco.Core.Models; 6 | using Umbraco.Web; 7 | 8 | internal static class IEnumerableStringExtensions 9 | { 10 | /// 11 | /// TODO: migrate out of Picker obj 12 | /// parse a collection of strings, and attempt to return a collection of IPublishedContent 13 | /// 14 | /// 15 | /// a collection (populated, or empty) 16 | internal static IEnumerable AsPublishedContent(this IEnumerable keys) 17 | { 18 | UmbracoHelper umbracoHelper = new UmbracoHelper(UmbracoContext.Current); 19 | 20 | return keys 21 | .Select(x => umbracoHelper.GetPublishedContent(x)) 22 | .Where(x => x != null); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /source/nuPickers/Shared/PropertyEditor/PropertyEditorConfig.css: -------------------------------------------------------------------------------- 1 | /* 2 | used by property editor configurations with multiple fields to emulate umbraco styling 3 | 4 |
5 |
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 |
12 | 13 | 14 | 19 |
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 |
    19 |
  • 20 | 21 | 28 | 29 |
  • 30 |
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 GetRelationTypes() 14 | { 15 | return ApplicationContext.Services.RelationService.GetAllRelationTypes() 16 | .OrderBy(x => x.Name) 17 | .Select(x => new 18 | { 19 | key = x.Alias, 20 | label = x.Name, 21 | bidirectional = x.IsBidirectional 22 | }); 23 | } 24 | 25 | [HttpGet] 26 | public IEnumerable GetRelatedIds([FromUri] int contextId, [FromUri] string propertyAlias, [FromUri] string relationTypeAlias, [FromUri] bool relationsOnly) 27 | { 28 | return RelationMapping.GetRelatedIds(contextId, propertyAlias, relationTypeAlias, relationsOnly); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/SqlRadioButtonPicker/SqlRadioButtonPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.SqlRadioButtonPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class SqlRadioButtonPickerPreValueEditor : PreValueEditor 7 | { 8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "SqlDataSource/SqlDataSourceConfig.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("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 18 | public string RelationMapping { get; set; } 19 | 20 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 21 | public string SaveFormat { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/JsonRadioButtonPicker/JsonRadioButtonPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.JsonRadioButtonPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class JsonRadioButtonPickerPreValueEditor : PreValueEditor 7 | { 8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "JsonDataSource/JsonDataSourceConfig.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("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 18 | public string RelationMapping { get; set; } 19 | 20 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 21 | public string SaveFormat { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/XmlRadioButtonPicker/XmlRadioButtonPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.XmlRadioButtonPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class XmlRadioButtonPickerPreValueEditor : PreValueEditor 7 | { 8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "XmlDataSource/XmlDataSourceConfig.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("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 18 | public string RelationMapping { get; set; } 19 | 20 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 21 | public string SaveFormat { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /source/nuPickers/EmbeddedResource/EmbeddedResourceVirtualFileProvider.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.EmbeddedResource 2 | { 3 | using ClientDependency.Core.CompositeFiles; 4 | using System; 5 | 6 | /// 7 | /// 8 | /// 9 | public sealed class EmbeddedResourceVirtualFileProvider : IVirtualFileProvider 10 | { 11 | /// 12 | /// 13 | /// 14 | /// 15 | /// 16 | public bool FileExists(string virtualFile) 17 | { 18 | if (!virtualFile.EndsWith(EmbeddedResource.FILE_EXTENSION, StringComparison.InvariantCultureIgnoreCase)) return false; 19 | 20 | string resourceName = EmbeddedResourceHelper.GetResourceNameFromPath(virtualFile); 21 | 22 | return EmbeddedResourceHelper.ResourceExists(resourceName); 23 | } 24 | 25 | /// 26 | /// 27 | /// 28 | /// 29 | /// 30 | public IVirtualFile GetFile(string virtualFile) 31 | { 32 | if (!FileExists(virtualFile)) return null; 33 | 34 | return new EmbeddedResourceVirtualFile(virtualFile); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/DotNetRadioButtonPicker/DotNetRadioButtonPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.DotNetRadioButtonPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class DotNetRadioButtonPickerPreValueEditor : PreValueEditor 7 | { 8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "DotNetDataSource/DotNetDataSourceConfig.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("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 18 | public string RelationMapping { get; set; } 19 | 20 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 21 | public string SaveFormat { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/LuceneRadioButtonPicker/LuceneRadioButtonPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.LuceneRadioButtonPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class LuceneRadioButtonPickerPreValueEditor : PreValueEditor 7 | { 8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "LuceneDataSource/LuceneDataSourceConfig.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("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 18 | public string RelationMapping { 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/TypeaheadListPicker/TypeaheadListPickerEditor.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 |
12 | 20 | 21 |
22 | 23 | 24 | 25 | 26 |
27 |
-------------------------------------------------------------------------------- /source/nuPickers/Shared/PrefetchListPicker/PrefetchListPickerEditor.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 |
13 | 20 |
21 | 22 | 23 | 24 | 25 |
26 |
-------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | nuPickers 2 | ============ 3 | 4 | __Latest Release:__ 5 | 6 | [![NuGet release](https://img.shields.io/nuget/v/nuPickers.svg)](https://www.nuget.org/packages/nuPickers) 7 | [![Our Umbraco project page](https://img.shields.io/badge/our-umbraco-orange.svg)](https://our.umbraco.org/projects/backoffice-extensions/nupickers) 8 | 9 | __Latest Build:__ 10 | 11 | [![Build status](https://img.shields.io/appveyor/ci/crumpleddog/nupickers/master.svg)](https://ci.appveyor.com/project/crumpleddog/nupickers/branch/master) 12 | [![MyGet build](https://img.shields.io/myget/nupickers/vpre/nuPickers.svg)](https://www.myget.org/gallery/nupickers) 13 | [![AppVeyor Artifacts](https://img.shields.io/badge/nupickers-umbraco--bleeding--edge-orange.svg)](https://ci.appveyor.com/project/crumpleddog/nupickers/build/artifacts) 14 | 15 | __Support:__ 16 | 17 | [Documentation](https://github.com/uComponents/nuPickers/wiki) (GitHub Wiki) 18 | 19 | [Questions](https://our.umbraco.org/projects/backoffice-extensions/nupickers/questionssuggestions/) (Our Umbraco Forum) 20 | 21 | [Issue Logging](https://github.com/uComponents/nuPickers/issues) (GitHub Issues) 22 | 23 | [![Join the chat at https://gitter.im/uComponents/nuPickers](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/uComponents/nuPickers?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 24 | -------------------------------------------------------------------------------- /source/nuPickers/EmbeddedResource/EmbeddedResourceStartup.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.EmbeddedResource 2 | { 3 | using ClientDependency.Core; 4 | using System.Web.Mvc; 5 | using System.Web.Routing; 6 | using Umbraco.Core; 7 | 8 | public class EmbeddedResourceStartup : ApplicationEventHandler 9 | { 10 | protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) 11 | { 12 | base.ApplicationStarted(umbracoApplication, applicationContext); 13 | 14 | RouteTable 15 | .Routes 16 | .MapRoute( 17 | name: "nuPickersShared", 18 | url: EmbeddedResource.ROOT_URL.TrimStart("~/") + "{folder}/{file}", 19 | defaults: new 20 | { 21 | controller = "EmbeddedResource", 22 | action = "GetSharedResource" 23 | }, 24 | namespaces: new[] { "nuPickers.EmbeddedResource" }); 25 | 26 | FileWriters.AddWriterForExtension(EmbeddedResource.FILE_EXTENSION, new EmbeddedResourceVirtualFileWriter()); 27 | } 28 | 29 | protected override bool ExecuteWhenApplicationNotConfigured 30 | { 31 | get { return true; } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /source/nuPickers/Shared/PrefetchListPicker/PrefetchListPickerConfig.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 8 |
9 | 11 |
12 |
13 | 14 |
15 | 19 |
20 | 23 |
24 |
25 | 26 |
27 | 31 | 32 |
33 | 35 |
36 |
37 | 38 |
-------------------------------------------------------------------------------- /source/nuPickers/Shared/DropDownPicker/DropDownPickerEditorController.js: -------------------------------------------------------------------------------- 1 | 2 | angular 3 | .module("umbraco") 4 | .controller("nuPickers.Shared.DropDownPicker.DropDownPickerEditorController", 5 | ['$scope', 'nuPickers.Shared.Editor.EditorResource', 6 | function ($scope, editorResource) { 7 | 8 | editorResource.getEditorDataItems($scope.model).then(function (response) { 9 | $scope.dropDownPickerOptions = response.data.editorDataItems; 10 | 11 | editorResource.getPickedKeys($scope.model).then(function (pickedKeys) { 12 | if (pickedKeys[0]) { 13 | var i = 0; 14 | var found = false; 15 | 16 | while (!found && i < $scope.dropDownPickerOptions.length) { 17 | 18 | if ($scope.dropDownPickerOptions[i].key == pickedKeys[0]) { 19 | $scope.pickedOption = $scope.dropDownPickerOptions[i]; 20 | found = true; 21 | } 22 | 23 | i++; 24 | } 25 | } 26 | }); 27 | 28 | }); 29 | 30 | $scope.$on("formSubmitting", function () { 31 | $scope.model.value = editorResource.createSaveValue($scope.model.config, [$scope.pickedOption]); 32 | }); 33 | 34 | }]); -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/SqlPagedListPicker/SqlPagedListPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.SqlPagedListPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class SqlPagedListPickerPreValueEditor : PreValueEditor 7 | { 8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "SqlDataSource/SqlDataSourceConfig.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("pagedListPicker", "", EmbeddedResource.ROOT_URL + "PagedListPicker/PagedListPickerConfig.html", HideLabel = true)] 15 | public string PagedListPicker { get; set; } 16 | 17 | [PreValueField("listPicker", "", EmbeddedResource.ROOT_URL + "ListPicker/ListPickerConfig.html", HideLabel = true)] 18 | public string ListPicker { get; set; } 19 | 20 | [PreValueField("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 21 | public string RelationMapping { get; set; } 22 | 23 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 24 | public string SaveFormat { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/JsonPagedListPicker/JsonPagedListPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.JsonPagedListPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class JsonPagedListPickerPreValueEditor : 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 | [PreValueField("pagedListPicker", "", EmbeddedResource.ROOT_URL + "PagedListPicker/PagedListPickerConfig.html", HideLabel = true)] 15 | public string PagedListPicker { get; set; } 16 | 17 | [PreValueField("listPicker", "", EmbeddedResource.ROOT_URL + "ListPicker/ListPickerConfig.html", HideLabel = true)] 18 | public string ListPicker { get; set; } 19 | 20 | [PreValueField("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 21 | public string RelationMapping { get; set; } 22 | 23 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 24 | public string SaveFormat { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/XmlPagedListPicker/XmlPagedListPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.XmlPagedListPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class XmlPagedListPickerPreValueEditor : 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 | [PreValueField("pagedListPicker", "", EmbeddedResource.ROOT_URL + "PagedListPicker/PagedListPickerConfig.html", HideLabel = true)] 15 | public string PagedListPicker { get; set; } 16 | 17 | [PreValueField("listPicker", "", EmbeddedResource.ROOT_URL + "ListPicker/ListPickerConfig.html", HideLabel = true)] 18 | public string ListPicker { get; set; } 19 | 20 | [PreValueField("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 21 | public string RelationMapping { get; set; } 22 | 23 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 24 | public string SaveFormat { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /source/nuPickers/Shared/ListPicker/ListPickerSelectedPartial.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
    7 |
  • 9 | 10 | 15 | 16 | 17 |
    21 |
    22 |
  • 23 |
24 | 25 |
    26 |
  • 27 | Required 28 |
  • 29 | 30 |
  • 31 | Select 32 |
  • 33 | 34 | 37 |
38 |
-------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/DotNetPagedListPicker/DotNetPagedListPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.DotNetPagedListPicker 2 | { 3 | using Umbraco.Core.PropertyEditors; 4 | using nuPickers.EmbeddedResource; 5 | 6 | internal class DotNetPagedListPickerPreValueEditor : 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 | [PreValueField("pagedListPicker", "", EmbeddedResource.ROOT_URL + "PagedListPicker/PagedListPickerConfig.html", HideLabel = true)] 15 | public string PagedListPicker { get; set; } 16 | 17 | [PreValueField("listPicker", "", EmbeddedResource.ROOT_URL + "ListPicker/ListPickerConfig.html", HideLabel = true)] 18 | public string ListPicker { get; set; } 19 | 20 | [PreValueField("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 21 | public string RelationMapping { get; set; } 22 | 23 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 24 | public string SaveFormat { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/LucenePagedListPicker/LucenePagedListPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.LucenePagedListPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class LucenePagedListPickerPreValueEditor : 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 | [PreValueField("pagedListPicker", "", EmbeddedResource.ROOT_URL + "PagedListPicker/PagedListPickerConfig.html", HideLabel = true)] 15 | public string PagedListPicker { get; set; } 16 | 17 | [PreValueField("listPicker", "", EmbeddedResource.ROOT_URL + "ListPicker/ListPickerConfig.html", HideLabel = true)] 18 | public string ListPicker { get; set; } 19 | 20 | [PreValueField("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 21 | public string RelationMapping { get; set; } 22 | 23 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 24 | public string SaveFormat { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/SqlCheckBoxPicker/SqlCheckBoxPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.SqlCheckBoxPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class SqlCheckBoxPickerPreValueEditor : PreValueEditor 7 | { 8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "SqlDataSource/SqlDataSourceConfig.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("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("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 21 | public string RelationMapping { get; set; } 22 | 23 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 24 | public string SaveFormat { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/JsonCheckBoxPicker/JsonCheckBoxPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.JsonCheckBoxPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class JsonCheckBoxPickerPreValueEditor : PreValueEditor 7 | { 8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "JsonDataSource/JsonDataSourceConfig.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("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("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 21 | public string RelationMapping { get; set; } 22 | 23 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 24 | public string SaveFormat { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/XmlCheckBoxPicker/XmlCheckBoxPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.XmlCheckBoxPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class XmlCheckBoxPickerPreValueEditor : PreValueEditor 7 | { 8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "XmlDataSource/XmlDataSourceConfig.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("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("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 21 | public string RelationMapping { get; set; } 22 | 23 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 24 | public string SaveFormat { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/JsonPrefetchListPicker/JsonPrefetchListPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.JsonPrefetchListPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class JsonPrefetchListPickerPreValueEditor : 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 | [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("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 21 | public string RelationMapping { get; set; } 22 | 23 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 24 | public string SaveFormat { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/SqlPrefetchListPicker/SqlPrefetchListPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.SqlPrefetchListPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class SqlPrefetchListPickerPreValueEditor : PreValueEditor 7 | { 8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "SqlDataSource/SqlDataSourceConfig.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("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 21 | public string RelationMapping { get; set; } 22 | 23 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 24 | public string SaveFormat { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/XmlPrefetchListPicker/XmlPrefetchListPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.XmlPrefetchListPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class XmlPrefetchListPickerPreValueEditor : 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 | [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("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 21 | public string RelationMapping { get; set; } 22 | 23 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 24 | public string SaveFormat { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/DotNetCheckBoxPicker/DotNetCheckBoxPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.DotNetCheckBoxPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class DotNetCheckBoxPickerPreValueEditor : 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 | [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("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 21 | public string RelationMapping { get; set; } 22 | 23 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 24 | public string SaveFormat { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/DotNetPrefetchListPicker/DotNetPrefetchListPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.DotNetPrefetchListPicker 2 | { 3 | using Umbraco.Core.PropertyEditors; 4 | using nuPickers.EmbeddedResource; 5 | 6 | internal class DotNetPrefetchListPickerPreValueEditor : 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 | [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("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 21 | public string RelationMapping { get; set; } 22 | 23 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 24 | public string SaveFormat { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/LuceneCheckBoxPicker/LuceneCheckBoxPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.LuceneCheckBoxPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class LuceneCheckBoxPickerPreValueEditor : PreValueEditor 7 | { 8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "LuceneDataSource/LuceneDataSourceConfig.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("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("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 21 | public string RelationMapping { get; set; } 22 | 23 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 24 | public string SaveFormat { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/LucenePrefetchListPicker/LucenePrefetchListPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.LucenePrefetchListPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class LucenePrefetchListPickerPreValueEditor : 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 | [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("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 21 | public string RelationMapping { get; set; } 22 | 23 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 24 | public string SaveFormat { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /source/nuPickers/Shared/DotNetDataSource/DotNetDataSourceConfig.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 8 | 9 |
10 | 13 |
14 | 15 |
16 | 17 |
18 | 22 | 23 |
24 | 27 |
28 |
29 | 30 | 31 |
32 | 36 |
37 | 38 |
39 |
40 | 41 |
-------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/JsonTypeaheadListPicker/JsonTypeaheadListPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.JsonTypeaheadListPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class JsonTypeaheadListPickerPreValueEditor : PreValueEditor 7 | { 8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "JsonDataSource/JsonDataSourceConfig.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("typeaheadListPicker", "", EmbeddedResource.ROOT_URL + "TypeaheadListPicker/TypeaheadListPickerConfig.html", HideLabel = true)] 15 | public string TypeaheadListPicker { get; set; } 16 | 17 | [PreValueField("listPicker", "", EmbeddedResource.ROOT_URL + "ListPicker/ListPickerConfig.html", HideLabel = true)] 18 | public string ListPicker { get; set; } 19 | 20 | [PreValueField("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 21 | public string RelationMapping { get; set; } 22 | 23 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 24 | public string SaveFormat { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/SqlTypeaheadListPicker/SqlTypeaheadListPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.SqlTypeaheadListPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class SqlTypeaheadListPickerPreValueEditor : PreValueEditor 7 | { 8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "SqlDataSource/SqlDataSourceConfig.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("typeaheadListPicker", "", EmbeddedResource.ROOT_URL + "TypeaheadListPicker/TypeaheadListPickerConfig.html", HideLabel = true)] 15 | public string TypeaheadListPicker { get; set; } 16 | 17 | [PreValueField("listPicker", "", EmbeddedResource.ROOT_URL + "ListPicker/ListPickerConfig.html", HideLabel = true)] 18 | public string ListPicker { get; set; } 19 | 20 | [PreValueField("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 21 | public string RelationMapping { get; set; } 22 | 23 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 24 | public string SaveFormat { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/XmlTypeaheadListPicker/XmlTypeaheadListPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.XmlTypeaheadListPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class XmlTypeaheadListPickerPreValueEditor : PreValueEditor 7 | { 8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "XmlDataSource/XmlDataSourceConfig.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("typeaheadListPicker", "", EmbeddedResource.ROOT_URL + "TypeaheadListPicker/TypeaheadListPickerConfig.html", HideLabel = true)] 15 | public string TypeaheadListPicker { get; set; } 16 | 17 | [PreValueField("listPicker", "", EmbeddedResource.ROOT_URL + "ListPicker/ListPickerConfig.html", HideLabel = true)] 18 | public string ListPicker { get; set; } 19 | 20 | [PreValueField("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 21 | public string RelationMapping { get; set; } 22 | 23 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 24 | public string SaveFormat { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/LuceneTypeaheadPicker/LuceneTypeaheadListPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.LuceneTypeaheadListPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class LuceneTypeaheadListPickerPreValueEditor : PreValueEditor 7 | { 8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "LuceneDataSource/LuceneDataSourceConfig.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("typeaheadListPicker", "", EmbeddedResource.ROOT_URL + "TypeaheadListPicker/TypeaheadListPickerConfig.html", HideLabel = true)] 15 | public string TypeaheadListPicker { get; set; } 16 | 17 | [PreValueField("listPicker", "", EmbeddedResource.ROOT_URL + "ListPicker/ListPickerConfig.html", HideLabel = true)] 18 | public string ListPicker { get; set; } 19 | 20 | [PreValueField("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 21 | public string RelationMapping { get; set; } 22 | 23 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 24 | public string SaveFormat { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/DotNetTypeaheadListPicker/DotNetTypeaheadListPickerPreValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.DotNetTypeaheadListPicker 2 | { 3 | using nuPickers.EmbeddedResource; 4 | using Umbraco.Core.PropertyEditors; 5 | 6 | internal class DotNetTypeaheadListPickerPreValueEditor : PreValueEditor 7 | { 8 | [PreValueField("dataSource", "", EmbeddedResource.ROOT_URL + "DotNetDataSource/DotNetDataSourceConfig.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("typeaheadListPicker", "", EmbeddedResource.ROOT_URL + "TypeaheadListPicker/TypeaheadListPickerConfig.html", HideLabel = true)] 15 | public string TypeaheadListPicker { get; set; } 16 | 17 | [PreValueField("listPicker", "", EmbeddedResource.ROOT_URL + "ListPicker/ListPickerConfig.html", HideLabel = true)] 18 | public string ListPicker { get; set; } 19 | 20 | [PreValueField("relationMapping", "", EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfig.html", HideLabel = true)] 21 | public string RelationMapping { get; set; } 22 | 23 | [PreValueField("saveFormat", "Save Format", EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfig.html")] 24 | public string SaveFormat { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /source/nuPickers.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("nuPickers.Tests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("nuPickers.Tests")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("1e675c32-7bcc-42ff-bc95-dc480e67d3f0")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /source/nuPickers/EmbeddedResource/EmbeddedResourceVirtualFileWriter.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.EmbeddedResource 2 | { 3 | using ClientDependency.Core; 4 | using ClientDependency.Core.CompositeFiles; 5 | using ClientDependency.Core.CompositeFiles.Providers; 6 | using System; 7 | using System.IO; 8 | using System.Web; 9 | using Umbraco.Core.Logging; 10 | 11 | /// 12 | /// The embedded resource writer. 13 | /// 14 | public sealed class EmbeddedResourceVirtualFileWriter : IVirtualFileWriter 15 | { 16 | public bool WriteToStream(BaseCompositeFileProcessingProvider provider, StreamWriter sw, IVirtualFile vf, ClientDependencyType type, string origUrl, HttpContextBase http) 17 | { 18 | try 19 | { 20 | using (var readStream = vf.Open()) 21 | using (var streamReader = new StreamReader(readStream)) 22 | { 23 | var output = streamReader.ReadToEnd(); 24 | DefaultFileWriter.WriteContentToStream(provider, sw, output, type, http, origUrl); 25 | return true; 26 | } 27 | } 28 | catch (Exception exception) 29 | { 30 | LogHelper.Warn(typeof(EmbeddedResourceVirtualFileWriter), exception.Message); 31 | 32 | return false; 33 | } 34 | } 35 | 36 | /// 37 | /// Gets the file provider. 38 | /// 39 | public IVirtualFileProvider FileProvider 40 | { 41 | get { return new EmbeddedResourceVirtualFileProvider(); } 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /source/nuPickers/Shared/RadioButtonPicker/RadioButtonPickerEditorController.js: -------------------------------------------------------------------------------- 1 | 2 | angular 3 | .module("umbraco") 4 | .controller("nuPickers.Shared.RadioButtonPicker.RadioButtonPickerEditorController", 5 | ['$scope', 'nuPickers.Shared.Editor.EditorResource', 6 | function ($scope, editorResource) { 7 | editorResource.getEditorDataItems($scope.model).then(function (response) { 8 | $scope.radioButtonPickerOptions = response.data.editorDataItems; 9 | 10 | editorResource.getPickedKeys($scope.model).then(function (pickedKeys) { 11 | $scope.pickedKey = pickedKeys[0]; 12 | }); 13 | 14 | // get picked option by copying a matching one by key from the source 15 | $scope.getPickedOption = function () { 16 | 17 | var i = 0; 18 | var found = false; 19 | var pickedOption = null; 20 | do { 21 | if ($scope.radioButtonPickerOptions[i].key == $scope.pickedKey) { 22 | 23 | pickedOption = $scope.radioButtonPickerOptions[i]; 24 | found = true; 25 | } 26 | i++; 27 | 28 | } while (!found && i < $scope.radioButtonPickerOptions.length) 29 | 30 | return pickedOption; 31 | }; 32 | 33 | }); 34 | 35 | $scope.$on("formSubmitting", function () { 36 | $scope.model.value = editorResource.createSaveValue($scope.model.config, [$scope.getPickedOption()]); 37 | }); 38 | 39 | }]); -------------------------------------------------------------------------------- /source/nuPickers/Shared/ListPicker/ListPickerEditorDirectives.js: -------------------------------------------------------------------------------- 1 | 2 | angular 3 | .module("umbraco.directives") 4 | .directive('nuCursorUp', function () { 5 | return { 6 | restrict: 'A', 7 | link: function (scope, element, attrs) { 8 | 9 | element.bind('keydown keypress', function (event) { 10 | if (event.which === 38) { 11 | scope.$apply(attrs.nuCursorUp); 12 | event.preventDefault(); 13 | } 14 | }); 15 | } 16 | } 17 | }); 18 | 19 | 20 | angular 21 | .module("umbraco.directives") 22 | .directive('nuCursorDown', function () { 23 | return { 24 | restrict: 'A', 25 | link: function (scope, element, attrs) { 26 | 27 | element.bind('keydown keypress', function (event) { 28 | if (event.which === 40) { 29 | scope.$apply(attrs.nuCursorDown); 30 | event.preventDefault(); 31 | } 32 | }); 33 | } 34 | } 35 | }); 36 | 37 | angular 38 | .module("umbraco.directives") 39 | .directive('nuEnterKey', function () { 40 | return { 41 | restrict: 'A', 42 | link: function (scope, element, attrs) { 43 | 44 | element.bind('keydown keypress', function (event) { 45 | if (event.which === 13) { 46 | scope.$apply(attrs.nuCursorDown); 47 | event.preventDefault(); 48 | } 49 | }); 50 | } 51 | } 52 | }); 53 | -------------------------------------------------------------------------------- /source/nuPickers/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /source/nuPickers/EmbeddedResource/EmbeddedResourceVirtualFile.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.EmbeddedResource 2 | { 3 | using ClientDependency.Core.CompositeFiles; 4 | using System.IO; 5 | 6 | /// 7 | /// The embedded resource virtual file. 8 | /// 9 | internal class EmbeddedResourceVirtualFile : IVirtualFile 10 | { 11 | /// 12 | /// The virtual file 13 | /// 14 | private readonly string virtualFile; 15 | 16 | /// 17 | /// Initializes a new instance of the class. 18 | /// Initializes a new instance of the class. 19 | /// 20 | /// 21 | /// The virtual path to the resource represented by this instance. 22 | /// 23 | public EmbeddedResourceVirtualFile(string virtualFile) 24 | { 25 | this.virtualFile = virtualFile; 26 | } 27 | 28 | /// 29 | /// When overridden in a derived class, returns a read-only stream to the virtual resource. 30 | /// 31 | /// 32 | /// A read-only stream to the virtual file. 33 | /// 34 | public Stream Open() 35 | { 36 | string resourceName = EmbeddedResourceHelper.GetResourceNameFromPath(this.virtualFile); 37 | 38 | return EmbeddedResourceHelper.GetResource(resourceName); 39 | } 40 | 41 | /// 42 | /// Gets the path. 43 | /// 44 | public string Path 45 | { 46 | get { return this.virtualFile; } 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /source/nuPickers/NuHandler.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace nuPickers 3 | { 4 | using System; 5 | using System.IO; 6 | using System.Web; 7 | using System.Web.Routing; 8 | 9 | public class NuHandler : IHttpHandler, IRouteHandler 10 | { 11 | public bool IsReusable 12 | { 13 | get 14 | { 15 | return false; 16 | } 17 | } 18 | 19 | public void ProcessRequest(HttpContext context) 20 | { 21 | var appRelativeCurrentExecutionFilePath = context.Request.AppRelativeCurrentExecutionFilePath; 22 | var fileName = Path.GetFileName(appRelativeCurrentExecutionFilePath); 23 | var directoryName = Path.GetDirectoryName(appRelativeCurrentExecutionFilePath); 24 | 25 | if (directoryName != null) 26 | { 27 | var pos = directoryName.LastIndexOf("\\", StringComparison.Ordinal); 28 | var folder = directoryName.Substring(pos + 1); 29 | 30 | string resourceName; 31 | var resourceStream = EmbeddedResourceHelper.GetResource("nuPickers.Shared." + folder + "." + fileName, out resourceName); 32 | 33 | if (resourceStream != null) 34 | { 35 | context.Response.ContentType = MimeMapping.GetMimeMapping(resourceName); 36 | resourceStream.CopyTo(context.Response.OutputStream); 37 | } 38 | else 39 | { 40 | context.Response.StatusCode = 404; 41 | } 42 | } 43 | } 44 | 45 | public IHttpHandler GetHttpHandler(RequestContext requestContext) 46 | { 47 | return this; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /source/nuPickers/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("nuPickers")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("nuPickers")] 13 | [assembly: AssemblyCopyright("Copyright The Umbraco Community 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("edb56992-de9e-4708-a3d2-c6ca6db7aeeb")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.5.2.111")] 35 | [assembly: AssemblyVersion("1.5.2.111")] 36 | [assembly: AssemblyFileVersion("1.5.2.111")] 37 | [assembly: AssemblyInformationalVersion("1.5.2-alpha-000111")] 38 | 39 | 40 | // expose internals to the unit testing project 41 | [assembly: InternalsVisibleTo("nuPickers.Tests")] -------------------------------------------------------------------------------- /source/nuPickers/Shared/RelationMapping/RelationMappingConfigController.js: -------------------------------------------------------------------------------- 1 | 2 | angular 3 | .module("umbraco") 4 | .controller("nuPickers.Shared.RelationMapping.RelationMappingConfigController", 5 | ['$rootScope', '$scope', '$http', function ($rootScope, $scope, $http) { 6 | 7 | $http.get('backoffice/nuPickers/RelationMappingApi/GetRelationTypes').then(function (response) { 8 | $scope.relationTypes = response.data; 9 | 10 | if ($scope.model.value) { 11 | // restore any saved value 12 | for (var i = 0; i < $scope.relationTypes.length; i++) { 13 | if ($scope.relationTypes[i].key == $scope.model.value.relationTypeAlias) { 14 | $scope.selectedRelationType = $scope.relationTypes[i]; 15 | break; 16 | } 17 | } 18 | } 19 | 20 | $scope.relationTypeChanged(); 21 | }); 22 | 23 | $scope.relationTypeChanged = function () { 24 | 25 | // trigger event for SaveFormat controller to recieve 26 | $rootScope.$broadcast('relationMappingChanged', $scope.selectedRelationType); 27 | }; 28 | 29 | $scope.$on("formSubmitting", function () { 30 | 31 | if ($scope.selectedRelationType != null) { 32 | 33 | // rebuild the model.value 34 | $scope.model.value = new Object(); 35 | $scope.model.value.relationTypeAlias = $scope.selectedRelationType.key; // only need to save the key (it's alias) 36 | 37 | } else { 38 | // clear all values, as no relation type set 39 | $scope.model.value = null; 40 | } 41 | 42 | }); 43 | 44 | }]); 45 | -------------------------------------------------------------------------------- /source/nuPickers/Shared/EnumDataSource/EnumDataSourceApiController.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.Shared.EnumDataSource 2 | { 3 | using nuPickers; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Reflection; 7 | using System.Web.Http; 8 | using Umbraco.Web.Editors; 9 | using Umbraco.Web.Mvc; 10 | 11 | [PluginController("nuPickers")] 12 | public class EnumDataSourceApiController : UmbracoAuthorizedJsonController 13 | { 14 | /// 15 | /// 16 | /// 17 | /// a collection of assembly names that have enums in them 18 | public IEnumerable GetAssemblyNames() 19 | { 20 | List assemblyNames = new List(); 21 | 22 | foreach(string assemblyName in Helper.GetAssemblyNames()) 23 | { 24 | Assembly assembly = Helper.GetAssembly(assemblyName); 25 | 26 | if (assembly != null) 27 | { 28 | if (assembly.GetLoadableTypes().Any(x => x.IsEnum)) 29 | { 30 | assemblyNames.Add(assemblyName); 31 | } 32 | } 33 | } 34 | 35 | return assemblyNames; 36 | } 37 | 38 | public IEnumerable GetEnumNames([FromUri]string assemblyName) 39 | { 40 | Assembly assembly = Helper.GetAssembly(assemblyName); 41 | 42 | if (assembly != null) 43 | { 44 | return assembly 45 | .GetLoadableTypes() 46 | .Where(x => x.IsEnum) 47 | .Select(x => x.FullName); 48 | } 49 | 50 | return null; 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /source/nuPickers/Caching/CacheInvalidation.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.Caching 2 | { 3 | using Umbraco.Core; 4 | using Umbraco.Core.Events; 5 | using Umbraco.Core.Services; 6 | using Umbraco.Core.Models; 7 | 8 | public class CacheInvalidation : ApplicationEventHandler 9 | { 10 | protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) 11 | { 12 | ContentService.Saved += this.ContentService_Saved; 13 | ContentService.Deleted += this.ContentService_Deleted; 14 | 15 | DataTypeService.Saved += this.DataTypeService_Saved; 16 | DataTypeService.Deleted += this.DataTypeService_Deleted; 17 | } 18 | 19 | private void ContentService_Saved(IContentService sender, SaveEventArgs e) 20 | { 21 | e.SavedEntities.ForEach(x => Cache.Instance.Remove(y => y.StartsWith(CacheConstants.PickedKeysPrefix + x.Id.ToString()))); 22 | } 23 | 24 | private void ContentService_Deleted(IContentService sender, DeleteEventArgs e) 25 | { 26 | e.DeletedEntities.ForEach(x => Cache.Instance.Remove(y => y.StartsWith(CacheConstants.PickedKeysPrefix + x.Id.ToString()))); 27 | } 28 | 29 | private void DataTypeService_Saved(IDataTypeService sender, SaveEventArgs e) 30 | { 31 | e.SavedEntities.ForEach(x => Cache.Instance.Remove(CacheConstants.DataTypePreValuesPrefix + x.Id.ToString())); 32 | } 33 | 34 | private void DataTypeService_Deleted(IDataTypeService sender, DeleteEventArgs e) 35 | { 36 | e.DeletedEntities.ForEach(x => Cache.Instance.Remove(CacheConstants.DataTypePreValuesPrefix + x.Id.ToString())); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /source/nuPickers/Shared/LuceneDataSource/LuceneDataSourceConfig.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 8 | 9 |
10 | 13 |
14 |
15 | 16 |
17 | 21 | 22 |
23 | 27 |
28 |
29 | 30 |
31 | 35 | 36 |
37 | 40 |
41 |
42 | 43 |
44 | 48 | 49 |
50 | 53 |
54 |
55 | 56 |
-------------------------------------------------------------------------------- /source/nuPickers/Shared/SaveFormat/SaveFormatPropertyValueEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.Shared.SaveFormat 2 | { 3 | using System.Xml.Linq; 4 | using Umbraco.Core.Models; 5 | using Umbraco.Core.PropertyEditors; 6 | using Umbraco.Core.Services; 7 | 8 | /// 9 | /// This class exists so as to be able to save xml direclty into the Umbraco xml cache 10 | /// 11 | public class SaveFormatPropertyValueEditor : PropertyValueEditor 12 | { 13 | /// 14 | /// reconstruct values from original (default) property value editor 15 | /// 16 | /// 17 | public SaveFormatPropertyValueEditor(PropertyValueEditor propertyValueEditor) 18 | { 19 | this.HideLabel = propertyValueEditor.HideLabel; 20 | this.View = propertyValueEditor.View; 21 | this.ValueType = propertyValueEditor.ValueType; 22 | foreach (IPropertyValidator propertyValidator in propertyValueEditor.Validators) 23 | { 24 | this.Validators.Add(propertyValidator); 25 | } 26 | } 27 | 28 | /// 29 | /// when saving to the xml cache, if the value can be converted to xml then ensure it's not wrapped in CData 30 | /// 31 | /// 32 | /// 33 | /// 34 | /// 35 | public override XNode ConvertDbToXml(Property property, PropertyType propertyType, IDataTypeService dataTypeService) 36 | { 37 | string value = this.ConvertDbToString(property, propertyType, dataTypeService); 38 | 39 | try 40 | { 41 | return XElement.Parse(value); 42 | } 43 | catch 44 | { 45 | return new XCData(value); 46 | } 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /source/nuPickers/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /source/nuPickers/Shared/DataSource/DataSourceResource.js: -------------------------------------------------------------------------------- 1 | angular.module('umbraco.resources') 2 | .factory('nuPickers.Shared.DataSource.DataSourceResource', 3 | ['$http', 'editorState', 4 | function ($http, editorState) { 5 | 6 | return { 7 | 8 | /** 9 | * Get 'editor data items' for a property editor (none or only one of the the optional: typeahead, keys, page params should be set) 10 | * @param {Object} - the property editor model 11 | * @param {string} - optional typeahead text 12 | * @param {Array} - optional array of picked keys 13 | * @param {Number} - optional page 14 | * @returns {Object} - a promise to return an http response with data for an array of editorDataItems [{"key":"","label":""},{"key":"","label":""}] and a count when known 15 | */ 16 | getEditorDataItems: function (model, typeahead, keys, page) { 17 | 18 | var currentId = 0; 19 | var parentId = 0; 20 | 21 | if (editorState.current) { 22 | currentId = editorState.current.id; 23 | parentId = editorState.current.parentId; 24 | } 25 | 26 | return $http({ 27 | method: 'POST', 28 | url: 'backoffice/nuPickers/DataSourceApi/GetEditorDataItems', 29 | params: { 30 | 'currentId': currentId, 31 | 'parentId': parentId, 32 | 'propertyAlias': model.alias 33 | }, 34 | data: { 35 | 'config': model.config, 36 | 'typeahead': typeahead, 37 | 'keys': keys, 38 | 'page' : page 39 | } 40 | }); 41 | 42 | } 43 | 44 | }; 45 | } 46 | ]); -------------------------------------------------------------------------------- /source/nuPickers/Shared/JsonDataSource/JsonDataSourceConfig.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 8 | 9 |
10 | 11 |
12 |
13 | 14 |
15 | 19 | 20 |
21 | 24 |
25 |
26 | 27 |
28 | 32 | 33 |
34 | 37 | 38 |
39 |
40 | 41 |
42 | 46 | 47 |
48 | 51 |
52 |
53 | 54 |
-------------------------------------------------------------------------------- /source/nuPickers/Shared/ListPicker/ListPickerConfig.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 8 | 9 |
10 | 13 |
14 |
15 | 16 |
17 | 21 | 22 |
23 | 26 | 27 |
28 |
29 | 30 |
31 | 35 | 36 |
37 | 41 |
42 |
43 | 44 |
45 | 49 | 50 |
51 | 55 |
56 |
57 | 58 |
-------------------------------------------------------------------------------- /source/nuPickers/Shared/RelationDataSource/RelationDataSource.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.Shared.RelationDataSource 2 | { 3 | using DataSource; 4 | using Editor; 5 | using Paging; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using Umbraco.Core; 9 | using Umbraco.Web; 10 | 11 | public class RelationDataSource : IDataSource 12 | { 13 | public string RelationType { get; set; } 14 | 15 | bool IDataSource.HandledTypeahead { get { return false; } } 16 | 17 | IEnumerable IDataSource.GetEditorDataItems(int currentId, int parentId, string typeahead) 18 | { 19 | return this.GetEditorDataItems(currentId, parentId); 20 | } 21 | 22 | IEnumerable IDataSource.GetEditorDataItems(int currentId, int parentId, string[] keys) 23 | { 24 | return this.GetEditorDataItems(currentId, parentId).Where(x => keys.Contains(x.Key)); 25 | } 26 | IEnumerable IDataSource.GetEditorDataItems(int currentId, int parentId, PageMarker pageMarker, out int total) 27 | { 28 | var editorDataItems = this.GetEditorDataItems(currentId, parentId); 29 | 30 | total = editorDataItems.Count(); 31 | 32 | return editorDataItems.Skip(pageMarker.Skip).Take(pageMarker.Take); 33 | } 34 | 35 | private IEnumerable GetEditorDataItems(int currentId, int parentId) 36 | { 37 | var relationService = ApplicationContext.Current.Services.RelationService; 38 | 39 | return relationService.GetEntitiesFromRelations( 40 | relationService.GetByRelationTypeAlias(this.RelationType) 41 | .Where(r => r.ParentId == currentId)) 42 | .Select(x => new EditorDataItem() 43 | { 44 | Key = x.Item2.Id.ToString(), 45 | Label = x.Item2.Name.ToString() 46 | }); 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/EnumDropDownPicker/EnumDropDownPickerPropertyEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.EnumDropDownPicker 2 | { 3 | using ClientDependency.Core; 4 | using nuPickers.EmbeddedResource; 5 | using nuPickers.PropertyEditors; 6 | using Umbraco.Core.PropertyEditors; 7 | using Umbraco.Web.PropertyEditors; 8 | 9 | // EDITOR UI 10 | [PropertyEditor(PropertyEditorConstants.EnumDropDownPickerAlias, "nuPickers: Enum DropDown Picker", EmbeddedResource.ROOT_URL + "DropDownPicker/DropDownPickerEditor.html", ValueType = "TEXT")] 11 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DropDownPicker/DropDownPickerEditorController.js" + EmbeddedResource.FILE_EXTENSION)] 12 | 13 | // RESOURCES (all are referenced as EditorResource consumes the others) 14 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Editor/EditorResource.js" + EmbeddedResource.FILE_EXTENSION)] 15 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DataSource/DataSourceResource.js" + EmbeddedResource.FILE_EXTENSION)] 16 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingResource.js" + EmbeddedResource.FILE_EXTENSION)] 17 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatResource.js" + EmbeddedResource.FILE_EXTENSION)] 18 | 19 | // CONFIG 20 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "PropertyEditor/PropertyEditorConfig.css" + EmbeddedResource.FILE_EXTENSION)] 21 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "EnumDataSource/EnumDataSourceConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 22 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 23 | public class EnumDropDownPickerPropertyEditor : BasePropertyEditor 24 | { 25 | protected override PreValueEditor CreatePreValueEditor() 26 | { 27 | return new EnumDropDownPickerPreValueEditor(); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /source/nuPickers/Shared/TypeaheadListPicker/TypeaheadListPickerEditorController.js: -------------------------------------------------------------------------------- 1 | 2 | angular 3 | .module('umbraco') 4 | .controller("nuPickers.Shared.TypeaheadListPicker.TypeaheadListPickerEditorController", 5 | ['$scope', '$timeout', 'nuPickers.Shared.Editor.EditorResource', 6 | function ($scope, $timeout, editorResource) { 7 | 8 | // build selected options (typeahead doesn't have any default selectable options without first entering some typeahead text) 9 | editorResource.getPickedEditorDataItems($scope.model).then(function (editorDataItems) { 10 | $scope.$parent.selectedOptions = editorDataItems; 11 | }); 12 | 13 | //$scope.clear = function () { 14 | // $scope.typeahead = null; 15 | // $scope.selectableOptions = null; 16 | //}; 17 | 18 | var wait; // typeahead call to get options based on text input 19 | 20 | // setup a watch on the input 21 | $scope.$watch('typeahead', function (newValue, oldValue) { 22 | 23 | // cancel any existing timeout 24 | if (wait) { $timeout.cancel(wait); } 25 | 26 | if (newValue != null && newValue.length >= $scope.model.config.typeaheadListPicker.minCharacters) { 27 | 28 | wait = $timeout(function () { 29 | editorResource.getEditorDataItems($scope.model, newValue).then(function (response) { 30 | $scope.noMatch = response.data.editorDataItems.length == 0; 31 | $scope.$parent.selectableOptions = response.data.editorDataItems; 32 | }); 33 | }, 250); 34 | 35 | } else { 36 | $scope.noMatch = false; 37 | $scope.$parent.selectableOptions = []; // reset 38 | } 39 | 40 | }); 41 | 42 | if ($scope.model.config.typeaheadListPicker.limitTo > 0) { 43 | $scope.$watchCollection('selectableOptions', function () { 44 | $scope.$parent.selectableOptions = $scope.selectableOptions.slice(0, $scope.model.config.typeaheadListPicker.limitTo); 45 | }); 46 | } 47 | 48 | }]); 49 | 50 | -------------------------------------------------------------------------------- /source/nuPickers/Extensions/UmbracoHelperExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.Extensions 2 | { 3 | using Umbraco.Core.Models; 4 | using Umbraco.Web; 5 | 6 | internal static class UmbracoHelperExtensions 7 | { 8 | /// 9 | /// for a given umbraco Id, attempt to get the appropriate IPublishedContent (be that a typed content / media or member) 10 | /// 11 | /// The class on which this extension method is associated 12 | /// The Umbraco string id (expected to be a guid) to get IPublishedContent for 13 | /// null or IPublishedContent 14 | internal static IPublishedContent GetPublishedContent(this UmbracoHelper umbracoHelper, int id) 15 | { 16 | return umbracoHelper.GetPublishedContent(id.ToString()); 17 | } 18 | 19 | /// 20 | /// for a given umbraco Id, attempt to get the appropriate IPublishedContent (be that a typed content / media or member) 21 | /// 22 | /// The class on which this extension method is associated 23 | /// The Umbraco id to get IPublishedContent for 24 | /// null or IPublishedContent 25 | internal static IPublishedContent GetPublishedContent(this UmbracoHelper umbracoHelper, string id) 26 | { 27 | IPublishedContent publishedContent = null; 28 | 29 | publishedContent = umbracoHelper.TypedContent(id); 30 | 31 | if (publishedContent == null) 32 | { 33 | // fallback to attempting to get media 34 | publishedContent = umbracoHelper.TypedMedia(id); 35 | } 36 | 37 | if (publishedContent == null) 38 | { 39 | // fallback to attempting to get member 40 | try 41 | { 42 | publishedContent = umbracoHelper.TypedMember(id); 43 | } 44 | catch 45 | { 46 | // HACK: suppress Umbraco error 47 | } 48 | } 49 | 50 | return publishedContent; 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/RelationLabels/RelationLabelsPropertyEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.RelationLabels 2 | { 3 | using ClientDependency.Core; 4 | using nuPickers.EmbeddedResource; 5 | using nuPickers.PropertyEditors; 6 | using Umbraco.Core.PropertyEditors; 7 | using Umbraco.Web.PropertyEditors; 8 | 9 | // EDITOR UI 10 | [PropertyEditor(PropertyEditorConstants.RelationLabelsAlias, "nuPickers: Relation Labels", EmbeddedResource.ROOT_URL + "Labels/LabelsEditor.html", ValueType = "TEXT")] 11 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "LayoutDirection/LayoutDirection.css" + EmbeddedResource.FILE_EXTENSION)] 12 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Labels/LabelsEditorController.js" + EmbeddedResource.FILE_EXTENSION)] 13 | 14 | // RESOURCES (all are referenced as EditorResource consumes the others) 15 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Editor/EditorResource.js" + EmbeddedResource.FILE_EXTENSION)] 16 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DataSource/DataSourceResource.js" + EmbeddedResource.FILE_EXTENSION)] 17 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingResource.js" + EmbeddedResource.FILE_EXTENSION)] 18 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatResource.js" + EmbeddedResource.FILE_EXTENSION)] 19 | 20 | // CONFIG 21 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "PropertyEditor/PropertyEditorConfig.css" + EmbeddedResource.FILE_EXTENSION)] 22 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RelationDataSource/RelationDataSourceConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 23 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "CustomLabel/CustomLabelConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 24 | public class RelationLabelsPropertyEditor : BasePropertyEditor 25 | { 26 | protected override PreValueEditor CreatePreValueEditor() 27 | { 28 | return new RelationLabelsPreValueEditor(); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/SqlDropDownPicker/SqlDropDownPickerPropertyEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.SqlDropDownPicker 2 | { 3 | using ClientDependency.Core; 4 | using nuPickers.EmbeddedResource; 5 | using nuPickers.PropertyEditors; 6 | using Umbraco.Core.PropertyEditors; 7 | using Umbraco.Web.PropertyEditors; 8 | 9 | // EDITOR UI 10 | [PropertyEditor(PropertyEditorConstants.SqlDropDownPickerAlias, "nuPickers: Sql DropDown Picker", EmbeddedResource.ROOT_URL + "DropDownPicker/DropDownPickerEditor.html", ValueType = "TEXT")] 11 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DropDownPicker/DropDownPickerEditorController.js" + EmbeddedResource.FILE_EXTENSION)] 12 | 13 | // RESOURCES (all are referenced as EditorResource consumes the others) 14 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Editor/EditorResource.js" + EmbeddedResource.FILE_EXTENSION)] 15 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DataSource/DataSourceResource.js" + EmbeddedResource.FILE_EXTENSION)] 16 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingResource.js" + EmbeddedResource.FILE_EXTENSION)] 17 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatResource.js" + EmbeddedResource.FILE_EXTENSION)] 18 | 19 | // CONFIG 20 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "PropertyEditor/PropertyEditorConfig.css" + EmbeddedResource.FILE_EXTENSION)] 21 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SqlDataSource/SqlDataSourceConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 22 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 23 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 24 | public class SqlDropDownPickerPropertyEditor : BasePropertyEditor 25 | { 26 | protected override PreValueEditor CreatePreValueEditor() 27 | { 28 | return new SqlDropDownPickerPreValueEditor(); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/XmlDropDownPicker/XmlDropDownPickerPropertyEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.XmlDropDownPicker 2 | { 3 | using ClientDependency.Core; 4 | using nuPickers.EmbeddedResource; 5 | using nuPickers.PropertyEditors; 6 | using Umbraco.Core.PropertyEditors; 7 | using Umbraco.Web.PropertyEditors; 8 | 9 | // EDITOR UI 10 | [PropertyEditor(PropertyEditorConstants.XmlDropDownPickerAlias, "nuPickers: Xml DropDown Picker", EmbeddedResource.ROOT_URL + "DropDownPicker/DropDownPickerEditor.html", ValueType = "TEXT")] 11 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DropDownPicker/DropDownPickerEditorController.js" + EmbeddedResource.FILE_EXTENSION)] 12 | 13 | // RESOURCES (all are referenced as EditorResource consumes the others) 14 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Editor/EditorResource.js" + EmbeddedResource.FILE_EXTENSION)] 15 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DataSource/DataSourceResource.js" + EmbeddedResource.FILE_EXTENSION)] 16 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingResource.js" + EmbeddedResource.FILE_EXTENSION)] 17 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatResource.js" + EmbeddedResource.FILE_EXTENSION)] 18 | 19 | // CONFIG 20 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "PropertyEditor/PropertyEditorConfig.css" + EmbeddedResource.FILE_EXTENSION)] 21 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "XmlDataSource/XmlDataSourceConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 22 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 23 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 24 | public class XmlDropDownPickerPropertyEditor : BasePropertyEditor 25 | { 26 | protected override PreValueEditor CreatePreValueEditor() 27 | { 28 | return new XmlDropDownPickerPreValueEditor(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/JsonDropDownPicker/JsonDropDownPickerPropertyEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.JsonDropDownPicker 2 | { 3 | using ClientDependency.Core; 4 | using nuPickers.EmbeddedResource; 5 | using nuPickers.PropertyEditors; 6 | using Umbraco.Core.PropertyEditors; 7 | using Umbraco.Web.PropertyEditors; 8 | 9 | // EDITOR UI 10 | [PropertyEditor(PropertyEditorConstants.JsonDropDownPickerAlias, "nuPickers: Json DropDown Picker", EmbeddedResource.ROOT_URL + "DropDownPicker/DropDownPickerEditor.html", ValueType = "TEXT")] 11 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DropDownPicker/DropDownPickerEditorController.js" + EmbeddedResource.FILE_EXTENSION)] 12 | 13 | // RESOURCES (all are referenced as EditorResource consumes the others) 14 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Editor/EditorResource.js" + EmbeddedResource.FILE_EXTENSION)] 15 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DataSource/DataSourceResource.js" + EmbeddedResource.FILE_EXTENSION)] 16 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingResource.js" + EmbeddedResource.FILE_EXTENSION)] 17 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatResource.js" + EmbeddedResource.FILE_EXTENSION)] 18 | 19 | // CONFIG 20 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "PropertyEditor/PropertyEditorConfig.css" + EmbeddedResource.FILE_EXTENSION)] 21 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "JsonDataSource/JsonDataSourceConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 22 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 23 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 24 | public class JsonDropDownPickerPropertyEditor : BasePropertyEditor 25 | { 26 | protected override PreValueEditor CreatePreValueEditor() 27 | { 28 | return new JsonDropDownPickerPreValueEditor(); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /source/nuPickers/Shared/CheckBoxPicker/CheckBoxPickerEditorController.js: -------------------------------------------------------------------------------- 1 | 2 | angular 3 | .module("umbraco") 4 | .controller("nuPickers.Shared.CheckBoxPicker.CheckBoxPickerEditorController", 5 | ['$scope', 'nuPickers.Shared.Editor.EditorResource', 6 | function ($scope, editorResource) { 7 | 8 | $scope.checkAllState = false; // flag to indicate that all check boxes are currently checked 9 | $scope.checkBoxPickerOptions = []; 10 | 11 | $scope.checkAllClick = function () { 12 | $scope.checkAllState = !$scope.checkAllState; 13 | angular.forEach($scope.checkBoxPickerOptions, function (option) { 14 | option.isChecked = $scope.checkAllState; 15 | }); 16 | }; 17 | 18 | $scope.checkBoxChange = function () { 19 | $scope.checkAllState = areAllChecked(); 20 | }; 21 | 22 | $scope.getPickedOptions = function () { 23 | return $scope.checkBoxPickerOptions.filter(function (option) { return option.isChecked == true; }); 24 | }; 25 | 26 | function areAllChecked() { 27 | return $scope.getPickedOptions().length == $scope.checkBoxPickerOptions.length; 28 | }; 29 | 30 | editorResource.getEditorDataItems($scope.model).then(function (response) { 31 | 32 | $scope.checkBoxPickerOptions = response.data.editorDataItems; 33 | 34 | // restore any saved values 35 | editorResource.getPickedKeys($scope.model).then(function (pickedKeys) { 36 | for (var i = 0; i < pickedKeys.length; i++) { 37 | for (var j = 0; j < $scope.checkBoxPickerOptions.length; j++) { 38 | if (pickedKeys[i] == $scope.checkBoxPickerOptions[j].key) { 39 | $scope.checkBoxPickerOptions[j].isChecked = true; 40 | break; 41 | } 42 | } 43 | } 44 | 45 | $scope.checkAllState = areAllChecked(); 46 | 47 | }); 48 | }); 49 | 50 | $scope.$on("formSubmitting", function () { 51 | $scope.model.value = editorResource.createSaveValue($scope.model.config, $scope.getPickedOptions()); 52 | }); 53 | 54 | }]); -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/DotNetDropDownPicker/DotNetDropDownPickerPropertyEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.DotNetDropDownPicker 2 | { 3 | using ClientDependency.Core; 4 | using nuPickers.EmbeddedResource; 5 | using nuPickers.PropertyEditors; 6 | using Umbraco.Core.PropertyEditors; 7 | using Umbraco.Web.PropertyEditors; 8 | 9 | // EDITOR UI 10 | [PropertyEditor(PropertyEditorConstants.DotNetDropDownPickerAlias, "nuPickers: DotNet DropDown Picker", EmbeddedResource.ROOT_URL + "DropDownPicker/DropDownPickerEditor.html", ValueType = "TEXT")] 11 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DropDownPicker/DropDownPickerEditorController.js" + EmbeddedResource.FILE_EXTENSION)] 12 | 13 | // RESOURCES (all are referenced as EditorResource consumes the others) 14 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Editor/EditorResource.js" + EmbeddedResource.FILE_EXTENSION)] 15 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DataSource/DataSourceResource.js" + EmbeddedResource.FILE_EXTENSION)] 16 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingResource.js" + EmbeddedResource.FILE_EXTENSION)] 17 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatResource.js" + EmbeddedResource.FILE_EXTENSION)] 18 | 19 | // CONFIG 20 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "PropertyEditor/PropertyEditorConfig.css" + EmbeddedResource.FILE_EXTENSION)] 21 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DotNetDataSource/DotNetDataSourceConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 22 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 23 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 24 | public class DotNetDropDownPickerPropertyEditor : BasePropertyEditor 25 | { 26 | protected override PreValueEditor CreatePreValueEditor() 27 | { 28 | return new DotNetDropDownPickerPreValueEditor(); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /source/nuPickers/Shared/EnumDataSource/EnumExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.Shared.EnumDataSource 2 | { 3 | using System; 4 | using System.Linq; 5 | 6 | /// 7 | /// Extension methods on Enum, used to get at configured EnumDataSource Attribute values 8 | /// 9 | public static class EnumExtensions 10 | { 11 | /// 12 | /// Gets the nuPicker Key that would be used for this enum item 13 | /// 14 | /// 15 | /// the nuPicker Key 16 | public static string GetKey(this Enum enumItem) 17 | { 18 | string key = enumItem.ToString(); 19 | 20 | EnumDataSourceAttribute enumDataSourceAttribute = enumItem.GetType() 21 | .GetField(enumItem.ToString()) 22 | .GetCustomAttributes(typeof(EnumDataSourceAttribute), false) 23 | .LastOrDefault() as EnumDataSourceAttribute; 24 | 25 | if (enumDataSourceAttribute != null && enumDataSourceAttribute.Key != null) 26 | { 27 | key = enumDataSourceAttribute.Key; 28 | } 29 | 30 | return key; 31 | } 32 | 33 | /// 34 | /// Gets the nuPicker Label that would be used for this enum item 35 | /// 36 | /// 37 | /// 38 | public static string GetLabel(this Enum enumItem) 39 | { 40 | string label = enumItem.ToString(); 41 | 42 | EnumDataSourceAttribute enumDataSourceAttribute = enumItem.GetType() 43 | .GetField(enumItem.ToString()) 44 | .GetCustomAttributes(typeof(EnumDataSourceAttribute), false) 45 | .LastOrDefault() as EnumDataSourceAttribute; 46 | 47 | if (enumDataSourceAttribute != null && enumDataSourceAttribute.Label != null) 48 | { 49 | label = enumDataSourceAttribute.Label; 50 | } 51 | 52 | return label; 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/LuceneDropDownPicker/LuceneDropDownPickerPropertyEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.LuceneDropDownPicker 2 | { 3 | using ClientDependency.Core; 4 | using nuPickers.EmbeddedResource; 5 | using nuPickers.PropertyEditors; 6 | using Umbraco.Core.PropertyEditors; 7 | using Umbraco.Web.PropertyEditors; 8 | 9 | // EDITOR UI 10 | [PropertyEditor(PropertyEditorConstants.LuceneDropDownPickerAlias, "nuPickers: Lucene DropDown Picker", EmbeddedResource.ROOT_URL + "DropDownPicker/DropDownPickerEditor.html", ValueType = "TEXT")] 11 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DropDownPicker/DropDownPickerEditorController.js" + EmbeddedResource.FILE_EXTENSION)] 12 | 13 | // RESOURCES (all are referenced as EditorResource consumes the others) 14 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Editor/EditorResource.js" + EmbeddedResource.FILE_EXTENSION)] 15 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DataSource/DataSourceResource.js" + EmbeddedResource.FILE_EXTENSION)] 16 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingResource.js" + EmbeddedResource.FILE_EXTENSION)] 17 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatResource.js" + EmbeddedResource.FILE_EXTENSION)] 18 | 19 | // CONFIG 20 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "PropertyEditor/PropertyEditorConfig.css" + EmbeddedResource.FILE_EXTENSION)] 21 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "LuceneDataSource/LuceneDataSourceConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 22 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 23 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 24 | public class LuceneDropDownPickerPropertyEditor : BasePropertyEditor 25 | { 26 | protected override PreValueEditor CreatePreValueEditor() 27 | { 28 | return new LuceneDropDownPickerPreValueEditor(); 29 | } 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/SqlLabels/SqlLabelsPropertyEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.SqlLabels 2 | { 3 | using ClientDependency.Core; 4 | using nuPickers.EmbeddedResource; 5 | using nuPickers.PropertyEditors; 6 | using Umbraco.Core.PropertyEditors; 7 | using Umbraco.Web.PropertyEditors; 8 | 9 | // EDITOR UI 10 | [PropertyEditor(PropertyEditorConstants.SqlLabelsAlias, "nuPickers: Sql Labels", EmbeddedResource.ROOT_URL + "Labels/LabelsEditor.html", ValueType = "TEXT")] 11 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "LayoutDirection/LayoutDirection.css" + EmbeddedResource.FILE_EXTENSION)] 12 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Labels/LabelsEditorController.js" + EmbeddedResource.FILE_EXTENSION)] 13 | 14 | // RESOURCES (all are referenced as EditorResource consumes the others) 15 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Editor/EditorResource.js" + EmbeddedResource.FILE_EXTENSION)] 16 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DataSource/DataSourceResource.js" + EmbeddedResource.FILE_EXTENSION)] 17 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingResource.js" + EmbeddedResource.FILE_EXTENSION)] 18 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatResource.js" + EmbeddedResource.FILE_EXTENSION)] 19 | 20 | // CONFIG 21 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "PropertyEditor/PropertyEditorConfig.css" + EmbeddedResource.FILE_EXTENSION)] 22 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SqlDataSource/SqlDataSourceConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 23 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Labels/LabelsConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 24 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "CustomLabel/CustomLabelConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 25 | public class SqlLabelsPropertyEditor : BasePropertyEditor 26 | { 27 | protected override PreValueEditor CreatePreValueEditor() 28 | { 29 | return new SqlLabelsPreValueEditor(); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/EnumLabels/EnumLabelsPropertyEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.EnumLabels 2 | { 3 | using ClientDependency.Core; 4 | using nuPickers.EmbeddedResource; 5 | using nuPickers.PropertyEditors; 6 | using Umbraco.Core.PropertyEditors; 7 | using Umbraco.Web.PropertyEditors; 8 | 9 | // EDITOR UI 10 | [PropertyEditor(PropertyEditorConstants.EnumLabelsAlias, "nuPickers: Enum Labels", EmbeddedResource.ROOT_URL + "Labels/LabelsEditor.html", ValueType = "TEXT")] 11 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "LayoutDirection/LayoutDirection.css" + EmbeddedResource.FILE_EXTENSION)] 12 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Labels/LabelsEditorController.js" + EmbeddedResource.FILE_EXTENSION)] 13 | 14 | // RESOURCES (all are referenced as EditorResource consumes the others) 15 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Editor/EditorResource.js" + EmbeddedResource.FILE_EXTENSION)] 16 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DataSource/DataSourceResource.js" + EmbeddedResource.FILE_EXTENSION)] 17 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingResource.js" + EmbeddedResource.FILE_EXTENSION)] 18 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatResource.js" + EmbeddedResource.FILE_EXTENSION)] 19 | 20 | // CONFIG 21 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "PropertyEditor/PropertyEditorConfig.css" + EmbeddedResource.FILE_EXTENSION)] 22 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "EnumDataSource/EnumDataSourceConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 23 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Labels/LabelsConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 24 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "CustomLabel/CustomLabelConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 25 | public class EnumLabelsPropertyEditor : BasePropertyEditor 26 | { 27 | protected override PreValueEditor CreatePreValueEditor() 28 | { 29 | return new EnumLabelsPreValueEditor(); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/JsonLabels/JsonLabelsPropertyEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.JsonLabels 2 | { 3 | using ClientDependency.Core; 4 | using nuPickers.EmbeddedResource; 5 | using nuPickers.PropertyEditors; 6 | using Umbraco.Core.PropertyEditors; 7 | using Umbraco.Web.PropertyEditors; 8 | 9 | // EDITOR UI 10 | [PropertyEditor(PropertyEditorConstants.JsonLabelsAlias, "nuPickers: Json Labels", EmbeddedResource.ROOT_URL + "Labels/LabelsEditor.html", ValueType = "TEXT")] 11 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "LayoutDirection/LayoutDirection.css" + EmbeddedResource.FILE_EXTENSION)] 12 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Labels/LabelsEditorController.js" + EmbeddedResource.FILE_EXTENSION)] 13 | 14 | // RESOURCES (all are referenced as EditorResource consumes the others) 15 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Editor/EditorResource.js" + EmbeddedResource.FILE_EXTENSION)] 16 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DataSource/DataSourceResource.js" + EmbeddedResource.FILE_EXTENSION)] 17 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingResource.js" + EmbeddedResource.FILE_EXTENSION)] 18 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatResource.js" + EmbeddedResource.FILE_EXTENSION)] 19 | 20 | // CONFIG 21 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "PropertyEditor/PropertyEditorConfig.css" + EmbeddedResource.FILE_EXTENSION)] 22 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "JsonDataSource/JsonDataSourceConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 23 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Labels/LabelsConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 24 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "CustomLabel/CustomLabelConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 25 | public class JsonLabelsPropertyEditor : BasePropertyEditor 26 | { 27 | protected override PreValueEditor CreatePreValueEditor() 28 | { 29 | return new JsonLabelsPreValueEditor(); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/XmlLabels/XmlLabelsPropertyEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.XmlLabels 2 | { 3 | using ClientDependency.Core; 4 | using nuPickers.EmbeddedResource; 5 | using nuPickers.PropertyEditors; 6 | using Umbraco.Core.PropertyEditors; 7 | using Umbraco.Web.PropertyEditors; 8 | 9 | // EDITOR UI 10 | [PropertyEditor(PropertyEditorConstants.XmlLabelsAlias, "nuPickers: Xml Labels", EmbeddedResource.ROOT_URL + "Labels/LabelsEditor.html", ValueType = "TEXT")] 11 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "LayoutDirection/LayoutDirection.css" + EmbeddedResource.FILE_EXTENSION)] 12 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Labels/LabelsEditorController.js" + EmbeddedResource.FILE_EXTENSION)] 13 | 14 | // RESOURCES (all are referenced as EditorResource consumes the others) 15 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Editor/EditorResource.js" + EmbeddedResource.FILE_EXTENSION)] 16 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DataSource/DataSourceResource.js" + EmbeddedResource.FILE_EXTENSION)] 17 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingResource.js" + EmbeddedResource.FILE_EXTENSION)] 18 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatResource.js" + EmbeddedResource.FILE_EXTENSION)] 19 | 20 | // CONFIG 21 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "PropertyEditor/PropertyEditorConfig.css" + EmbeddedResource.FILE_EXTENSION)] 22 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "XmlDataSource/XmlDataSourceConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 23 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Labels/LabelsConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 24 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "CustomLabel/CustomLabelConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 25 | public class XmlLabelsPropertyEditor : BasePropertyEditor 26 | { 27 | protected override PreValueEditor CreatePreValueEditor() 28 | { 29 | return new XmlLabelsPreValueEditor(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/DotNetLabels/DotLabelsPropertyEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.DotNetLabels 2 | { 3 | using ClientDependency.Core; 4 | using nuPickers.EmbeddedResource; 5 | using nuPickers.PropertyEditors; 6 | using Umbraco.Core.PropertyEditors; 7 | using Umbraco.Web.PropertyEditors; 8 | 9 | // EDITOR UI 10 | [PropertyEditor(PropertyEditorConstants.DotNetLabelsAlias, "nuPickers: DotNet Labels", EmbeddedResource.ROOT_URL + "Labels/LabelsEditor.html", ValueType = "TEXT")] 11 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "LayoutDirection/LayoutDirection.css" + EmbeddedResource.FILE_EXTENSION)] 12 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Labels/LabelsEditorController.js" + EmbeddedResource.FILE_EXTENSION)] 13 | 14 | // RESOURCES (all are referenced as EditorResource consumes the others) 15 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Editor/EditorResource.js" + EmbeddedResource.FILE_EXTENSION)] 16 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DataSource/DataSourceResource.js" + EmbeddedResource.FILE_EXTENSION)] 17 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingResource.js" + EmbeddedResource.FILE_EXTENSION)] 18 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatResource.js" + EmbeddedResource.FILE_EXTENSION)] 19 | 20 | // CONFIG 21 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "PropertyEditor/PropertyEditorConfig.css" + EmbeddedResource.FILE_EXTENSION)] 22 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DotNetDataSource/DotNetDataSourceConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 23 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Labels/LabelsConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 24 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "CustomLabel/CustomLabelConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 25 | public class DotNetLabelsPropertyEditor : BasePropertyEditor 26 | { 27 | protected override PreValueEditor CreatePreValueEditor() 28 | { 29 | return new DotNetLabelsPreValueEditor(); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/LuceneLabels/LuceneLabelsPropertyEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.LuceneLabels 2 | { 3 | using ClientDependency.Core; 4 | using nuPickers.EmbeddedResource; 5 | using nuPickers.PropertyEditors; 6 | using Umbraco.Core.PropertyEditors; 7 | using Umbraco.Web.PropertyEditors; 8 | 9 | // EDITOR UI 10 | [PropertyEditor(PropertyEditorConstants.LuceneLabelsAlias, "nuPickers: Lucene Labels", EmbeddedResource.ROOT_URL + "Labels/LabelsEditor.html", ValueType = "TEXT")] 11 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "LayoutDirection/LayoutDirection.css" + EmbeddedResource.FILE_EXTENSION)] 12 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Labels/LabelsEditorController.js" + EmbeddedResource.FILE_EXTENSION)] 13 | 14 | // RESOURCES (all are referenced as EditorResource consumes the others) 15 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Editor/EditorResource.js" + EmbeddedResource.FILE_EXTENSION)] 16 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DataSource/DataSourceResource.js" + EmbeddedResource.FILE_EXTENSION)] 17 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingResource.js" + EmbeddedResource.FILE_EXTENSION)] 18 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatResource.js" + EmbeddedResource.FILE_EXTENSION)] 19 | 20 | // CONFIG 21 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "PropertyEditor/PropertyEditorConfig.css" + EmbeddedResource.FILE_EXTENSION)] 22 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "LuceneDataSource/LuceneDataSourceConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 23 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Labels/LabelsConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 24 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "CustomLabel/CustomLabelConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 25 | public class LuceneLabelsPropertyEditor : BasePropertyEditor 26 | { 27 | protected override PreValueEditor CreatePreValueEditor() 28 | { 29 | return new LuceneLabelsPreValueEditor(); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | # version format 2 | version: 1.7.2.{build} 3 | 4 | os: Visual Studio 2017 5 | 6 | cache: 7 | - packages -> src\**\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified 8 | 9 | configuration: Release 10 | 11 | branches: 12 | only: 13 | - develop 14 | - master 15 | 16 | environment: 17 | # Version Suffix 18 | version_suffix: alpha 19 | 20 | install: 21 | - ps: .\build\appveyor-semver.ps1 22 | - ps: .\build\check-release-version.ps1 23 | - ps: Update-AppveyorBuild -Version $Env:appveyor_version 24 | 25 | assembly_info: 26 | patch: true 27 | file: 'source\nuPickers**\AssemblyInfo.*' 28 | assembly_version: '$(appveyor_file_version)' 29 | assembly_file_version: '$(appveyor_file_version)' 30 | assembly_informational_version: '$(mssemver)' 31 | 32 | build_script: 33 | - cmd: >- 34 | build-appveyor.cmd 35 | 36 | cd.. 37 | 38 | artifacts: 39 | - path: artifacts\*.nupkg 40 | - path: artifacts\*.zip 41 | 42 | 43 | deploy: 44 | # MyGet Deployment for builds 45 | - provider: NuGet 46 | server: https://www.myget.org/F/nupickers/ 47 | symbol_server: https://www.myget.org/F/nupickers/symbols/api/v2/package 48 | api_key: 49 | secure: SASQGWG/4zNns7bwSSsJ5RPvKcKfJsBeEPuw69wsVPA3PO739QmzVtc5VwQwgvbr 50 | artifact: /.*\.nupkg/ 51 | on: 52 | branch: develop 53 | 54 | # MyGet Deployment for releases 55 | - provider: NuGet 56 | server: https://www.myget.org/F/nupickers/ 57 | symbol_server: https://www.myget.org/F/nupickers/symbols/api/v2/package 58 | api_key: 59 | secure: SASQGWG/4zNns7bwSSsJ5RPvKcKfJsBeEPuw69wsVPA3PO739QmzVtc5VwQwgvbr 60 | artifact: /.*\.nupkg/ 61 | on: 62 | branch: master 63 | 64 | # NuGet Deployment for releases 65 | - provider: NuGet 66 | server: 67 | api_key: 68 | secure: adk3pI9HCByZg2VRxplX9UR6qHf97bA3as6dusxLswCKI8BQQE8DO5a0frLrI+EO 69 | artifact: /.*\.nupkg/ 70 | on: 71 | branch: master 72 | appveyor_repo_tag: true # deploy on tag push only 73 | 74 | # GitHub Deployment for releases 75 | - provider: GitHub 76 | auth_token: 77 | secure: c0LwOGqoFZIieyy8CHrUtYQOD0HL0rG5tV2DS+8FHv34BKs/LSGGtmWWep5O7GbV 78 | artifact: /.*\.zip/ # upload all Zip packages to release assets 79 | draft: false 80 | prerelease: false 81 | on: 82 | branch: master 83 | appveyor_repo_tag: true # deploy on tag push only 84 | -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/EnumRadioButtonPicker/EnumRadioButtonPickerPropertyEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.EnumRadioButtonPicker 2 | { 3 | using ClientDependency.Core; 4 | using nuPickers.EmbeddedResource; 5 | using nuPickers.PropertyEditors; 6 | using Umbraco.Core.PropertyEditors; 7 | using Umbraco.Web.PropertyEditors; 8 | 9 | // EDITOR UI 10 | [PropertyEditor(PropertyEditorConstants.EnumRadioButtonPickerAlias, "nuPickers: Enum RadioButton Picker", EmbeddedResource.ROOT_URL + "RadioButtonPicker/RadioButtonPickerEditor.html", ValueType = "TEXT")] 11 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "LayoutDirection/LayoutDirection.css" + EmbeddedResource.FILE_EXTENSION)] 12 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RadioButtonPicker/RadioButtonPickerEditorController.js" + EmbeddedResource.FILE_EXTENSION)] 13 | 14 | // RESOURCES (all are referenced as EditorResource consumes the others) 15 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Editor/EditorResource.js" + EmbeddedResource.FILE_EXTENSION)] 16 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DataSource/DataSourceResource.js" + EmbeddedResource.FILE_EXTENSION)] 17 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingResource.js" + EmbeddedResource.FILE_EXTENSION)] 18 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatResource.js" + EmbeddedResource.FILE_EXTENSION)] 19 | 20 | // CONFIG 21 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "PropertyEditor/PropertyEditorConfig.css" + EmbeddedResource.FILE_EXTENSION)] 22 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "EnumDataSource/EnumDataSourceConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 23 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "CustomLabel/CustomLabelConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 24 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 25 | public class EnumRadioButtonPickerPropertyEditor : BasePropertyEditor 26 | { 27 | protected override PreValueEditor CreatePreValueEditor() 28 | { 29 | return new EnumRadioButtonPickerPreValueEditor(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /source/nuPickers/Shared/DataSource/IDataSource.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.Shared.DataSource 2 | { 3 | using nuPickers.Shared.Editor; 4 | using Paging; 5 | using System.Collections.Generic; 6 | 7 | /// 8 | /// All datasources must implement this, so that Editor.GetGetEditorDataItems() can be used by all API controllers & the Picker obj 9 | /// 10 | internal interface IDataSource 11 | { 12 | /// 13 | /// flag to indicate whether the datasource handled any type ahead text 14 | /// (if the datasource doesn't handle it directly, then the typeahead text is processed later) 15 | /// 16 | bool HandledTypeahead { get; } 17 | 18 | /// 19 | /// Get the data items to pick from 20 | /// 21 | /// the current id 22 | /// the parent id (incase it's a new item so current = 0) 23 | /// any typeahead text that the datasource can filter on (can be null) 24 | /// collection of POCOs that are used as options for a picker 25 | IEnumerable GetEditorDataItems(int currentId, int parentId, string typeahead); 26 | 27 | /// 28 | /// Get the data items for the specified keys 29 | /// 30 | /// the current id 31 | /// the parent id (incase it's a new item so current = 0) 32 | /// the collection of keys to get items for 33 | /// collection of POCOs that have been picked 34 | IEnumerable GetEditorDataItems(int currentId, int parentId, string[] keys); 35 | 36 | /// 37 | /// Get the data items for a page 38 | /// 39 | /// the current id 40 | /// the parent id (incase it's a new item so current = 0) 41 | /// specifies the itemsPerPage & page values 42 | /// the total number of items in full data collection (not just subset requested) 43 | /// collection of POCOs that are used as options for a paged picker 44 | IEnumerable GetEditorDataItems(int currentId, int parentId, PageMarker pageMarker, out int total); 45 | } 46 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/EnumCheckBoxPicker/EnumCheckBoxPickerPropertyEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.EnumCheckBoxPicker 2 | { 3 | using ClientDependency.Core; 4 | using nuPickers.EmbeddedResource; 5 | using nuPickers.PropertyEditors; 6 | using Umbraco.Core.PropertyEditors; 7 | using Umbraco.Web.PropertyEditors; 8 | 9 | // EDITOR UI 10 | [PropertyEditor(PropertyEditorConstants.EnumCheckBoxPickerAlias, "nuPickers: Enum CheckBox Picker", EmbeddedResource.ROOT_URL + "CheckBoxPicker/CheckBoxPickerEditor.html", ValueType = "TEXT")] 11 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "CheckBoxPicker/CheckBoxPickerEditor.css" + EmbeddedResource.FILE_EXTENSION)] 12 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "LayoutDirection/LayoutDirection.css" + EmbeddedResource.FILE_EXTENSION)] 13 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "CheckBoxPicker/CheckBoxPickerEditorController.js" + EmbeddedResource.FILE_EXTENSION)] 14 | 15 | // RESOURCES (all are referenced as EditorResource consumes the others) 16 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Editor/EditorResource.js" + EmbeddedResource.FILE_EXTENSION)] 17 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DataSource/DataSourceResource.js" + EmbeddedResource.FILE_EXTENSION)] 18 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingResource.js" + EmbeddedResource.FILE_EXTENSION)] 19 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatResource.js" + EmbeddedResource.FILE_EXTENSION)] 20 | 21 | // CONFIG 22 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "PropertyEditor/PropertyEditorConfig.css" + EmbeddedResource.FILE_EXTENSION)] 23 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "EnumDataSource/EnumDataSourceConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 24 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "CustomLabel/CustomLabelConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 25 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 26 | public class EnumCheckBoxPickerPropertyEditor : BasePropertyEditor 27 | { 28 | protected override PreValueEditor CreatePreValueEditor() 29 | { 30 | return new EnumCheckBoxPickerPreValueEditor(); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /source/nuPickers.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.168 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nuPickers", "nuPickers\nuPickers.csproj", "{FB665B93-6D85-4040-AB20-003B728E3ACA}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{531937B6-4B81-4A61-82B6-5C441C35E5EE}" 9 | ProjectSection(SolutionItems) = preProject 10 | .nuget\NuGet.Config = .nuget\NuGet.Config 11 | .nuget\NuGet.exe = .nuget\NuGet.exe 12 | .nuget\NuGet.targets = .nuget\NuGet.targets 13 | EndProjectSection 14 | EndProject 15 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nuPickers.Tests", "nuPickers.Tests\nuPickers.Tests.csproj", "{1E675C32-7BCC-42FF-BC95-DC480E67D3F0}" 16 | EndProject 17 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{F1369B6C-5B95-41FC-813B-36F65E6FDACF}" 18 | ProjectSection(SolutionItems) = preProject 19 | ..\build\appveyor-semver.ps1 = ..\build\appveyor-semver.ps1 20 | ..\appveyor.yml = ..\appveyor.yml 21 | ..\build-appveyor.cmd = ..\build-appveyor.cmd 22 | ..\build.cmd = ..\build.cmd 23 | ..\build\check-release-version.ps1 = ..\build\check-release-version.ps1 24 | ..\build\icon.png = ..\build\icon.png 25 | ..\build\nuPickers.proj = ..\build\nuPickers.proj 26 | ..\build\package.nuspec = ..\build\package.nuspec 27 | ..\build\package.xml = ..\build\package.xml 28 | EndProjectSection 29 | EndProject 30 | Global 31 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 32 | Debug|Any CPU = Debug|Any CPU 33 | Release|Any CPU = Release|Any CPU 34 | EndGlobalSection 35 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 36 | {FB665B93-6D85-4040-AB20-003B728E3ACA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 37 | {FB665B93-6D85-4040-AB20-003B728E3ACA}.Debug|Any CPU.Build.0 = Debug|Any CPU 38 | {FB665B93-6D85-4040-AB20-003B728E3ACA}.Release|Any CPU.ActiveCfg = Release|Any CPU 39 | {FB665B93-6D85-4040-AB20-003B728E3ACA}.Release|Any CPU.Build.0 = Release|Any CPU 40 | {1E675C32-7BCC-42FF-BC95-DC480E67D3F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 41 | {1E675C32-7BCC-42FF-BC95-DC480E67D3F0}.Debug|Any CPU.Build.0 = Debug|Any CPU 42 | {1E675C32-7BCC-42FF-BC95-DC480E67D3F0}.Release|Any CPU.ActiveCfg = Release|Any CPU 43 | {1E675C32-7BCC-42FF-BC95-DC480E67D3F0}.Release|Any CPU.Build.0 = Release|Any CPU 44 | EndGlobalSection 45 | GlobalSection(SolutionProperties) = preSolution 46 | HideSolutionNode = FALSE 47 | EndGlobalSection 48 | GlobalSection(ExtensibilityGlobals) = postSolution 49 | SolutionGuid = {A0A1243B-2892-4562-A373-278C0C93094B} 50 | EndGlobalSection 51 | EndGlobal 52 | -------------------------------------------------------------------------------- /source/nuPickers/Shared/SqlDataSource/SqlDataSource.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.Shared.SqlDataSource 2 | { 3 | using DataSource; 4 | using nuPickers.Shared.Editor; 5 | using Paging; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Linq; 9 | using System.Text.RegularExpressions; 10 | using Umbraco.Core.Persistence; 11 | 12 | public class SqlDataSource : IDataSource 13 | { 14 | private bool handledTypeahead = false; 15 | 16 | public string SqlExpression { get; set; } 17 | 18 | public string ConnectionString { get; set; } 19 | 20 | bool IDataSource.HandledTypeahead { get { return this.handledTypeahead; } } 21 | 22 | IEnumerable IDataSource.GetEditorDataItems(int currentId, int parentId, string typeahead) 23 | { 24 | return this.GetEditorDataItems(currentId == 0 ? parentId : currentId, typeahead); 25 | } 26 | 27 | IEnumerable IDataSource.GetEditorDataItems(int currentId, int parentId, string[] keys) 28 | { 29 | return this.GetEditorDataItems(currentId == 0 ? parentId : currentId).Where(x => keys.Contains(x.Key)); 30 | } 31 | 32 | IEnumerable IDataSource.GetEditorDataItems(int currentId, int parentId, PageMarker pageMarker, out int total) 33 | { 34 | var editorDataItems = this.GetEditorDataItems(currentId == 0 ? parentId : currentId); 35 | 36 | total = editorDataItems.Count(); 37 | 38 | return editorDataItems.Skip(pageMarker.Skip).Take(pageMarker.Take); 39 | } 40 | 41 | /// 42 | /// 43 | /// 44 | /// 45 | /// 46 | private IEnumerable GetEditorDataItems(int contextId, string typeahead = null) 47 | { 48 | List editorDataItems = new List(); 49 | 50 | Database database = new Database(this.ConnectionString); 51 | 52 | if (database != null) 53 | { 54 | string sql = Regex.Replace(this.SqlExpression, "\n|\r", " ") 55 | .Replace("@contextId", "@0") 56 | .Replace("@typeahead", "@1"); 57 | 58 | if (this.SqlExpression.Contains("@typeahead")) // WARNING: not a perfect check ! 59 | { 60 | this.handledTypeahead = true; 61 | } 62 | 63 | editorDataItems = database.Fetch(sql, contextId, typeahead); 64 | } 65 | 66 | return editorDataItems; 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/DotNetCheckBoxPicker/DotNetCheckBoxPickerPropertyEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.DotNetCheckBoxPicker 2 | { 3 | using ClientDependency.Core; 4 | using nuPickers.EmbeddedResource; 5 | using nuPickers.PropertyEditors; 6 | using Umbraco.Core.PropertyEditors; 7 | using Umbraco.Web.PropertyEditors; 8 | 9 | // EDITOR UI 10 | [PropertyEditor(PropertyEditorConstants.DotNetCheckBoxPickerAlias, "nuPickers: DotNet CheckBox Picker", EmbeddedResource.ROOT_URL + "CheckBoxPicker/CheckBoxPickerEditor.html", ValueType = "TEXT")] 11 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "CheckBoxPicker/CheckBoxPickerEditor.css" + EmbeddedResource.FILE_EXTENSION)] 12 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "LayoutDirection/LayoutDirection.css" + EmbeddedResource.FILE_EXTENSION)] 13 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "CheckBoxPicker/CheckBoxPickerEditorController.js" + EmbeddedResource.FILE_EXTENSION)] 14 | 15 | // RESOURCES (all are referenced as EditorResource consumes the others) 16 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Editor/EditorResource.js" + EmbeddedResource.FILE_EXTENSION)] 17 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DataSource/DataSourceResource.js" + EmbeddedResource.FILE_EXTENSION)] 18 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingResource.js" + EmbeddedResource.FILE_EXTENSION)] 19 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatResource.js" + EmbeddedResource.FILE_EXTENSION)] 20 | 21 | // CONFIG 22 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "PropertyEditor/PropertyEditorConfig.css" + EmbeddedResource.FILE_EXTENSION)] 23 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DotNetDataSource/DotNetDataSourceConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 24 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "CustomLabel/CustomLabelConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 25 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 26 | public class DotNetCheckBoxPickerPropertyEditor : BasePropertyEditor 27 | { 28 | protected override PreValueEditor CreatePreValueEditor() 29 | { 30 | return new DotNetCheckBoxPickerPreValueEditor(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /source/nuPickers/Shared/PagedListPicker/PagedListPickerEditorController.js: -------------------------------------------------------------------------------- 1 | angular 2 | .module("umbraco") 3 | .controller("nuPickers.Shared.PagedListPicker.PagedListPickerEditorController", 4 | ['$scope', 'nuPickers.Shared.Editor.EditorResource', 5 | function ($scope, editorResource) { 6 | 7 | //var itemsPerPage = $scope.model.config.pagedListPicker.itemsPerPage; 8 | $scope.currentPage = 1; 9 | $scope.pages = []; // an array of page numbers (suitable for ng-repeat) 10 | $scope.pageOptions = []; //[pageNumber][null or array of options] 11 | $scope.total = null; 12 | 13 | // watch count, as if it changes, the number of pages will need to be recalculated 14 | $scope.$watch('total', function (newValue, oldValue) { 15 | if (newValue != oldValue) { 16 | 17 | $scope.pageOptions = []; // clear any previously requested pages 18 | 19 | var totalPages = Math.ceil(newValue / $scope.model.config.pagedListPicker.itemsPerPage); 20 | var pages = []; 21 | 22 | for (var page = 1; page <= totalPages; page++) { 23 | pages.push(page); 24 | } 25 | 26 | $scope.pages = pages; 27 | } 28 | }); 29 | 30 | $scope.changePage = function (page) { 31 | $scope.currentPage = page; 32 | getEditorDataItems(); 33 | }; 34 | 35 | function getEditorDataItems() { 36 | 37 | // has this page been requested before ? 38 | if (angular.isArray($scope.pageOptions[$scope.currentPage])) 39 | { 40 | $scope.$parent.selectableOptions = $scope.pageOptions[$scope.currentPage]; 41 | } 42 | else 43 | { 44 | editorResource.getEditorDataItems($scope.model, $scope.currentPage).then(function (response) { 45 | $scope.pageOptions[$scope.currentPage] = response.data.editorDataItems; 46 | $scope.$parent.selectableOptions = response.data.editorDataItems; 47 | $scope.total = response.data.total; 48 | }); 49 | } 50 | 51 | } 52 | 53 | // get selectable options 54 | getEditorDataItems(); 55 | 56 | // get selected options 57 | editorResource.getPickedEditorDataItems($scope.model).then(function (editorDataItems) { 58 | $scope.$parent.selectedOptions = editorDataItems; 59 | }); 60 | 61 | }]); -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /source/nuPickers/PropertyEditors/JsonRadioButtonPicker/JsonRadioButtonPickerPropertyEditor.cs: -------------------------------------------------------------------------------- 1 | namespace nuPickers.PropertyEditors.JsonRadioButtonPicker 2 | { 3 | using ClientDependency.Core; 4 | using nuPickers.EmbeddedResource; 5 | using nuPickers.PropertyEditors; 6 | using Umbraco.Core.PropertyEditors; 7 | using Umbraco.Web.PropertyEditors; 8 | 9 | // EDITOR UI 10 | [PropertyEditor(PropertyEditorConstants.JsonRadioButtonPickerAlias, "nuPickers: Json RadioButton Picker", EmbeddedResource.ROOT_URL + "RadioButtonPicker/RadioButtonPickerEditor.html", ValueType = "TEXT")] 11 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "LayoutDirection/LayoutDirection.css" + EmbeddedResource.FILE_EXTENSION)] 12 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RadioButtonPicker/RadioButtonPickerEditorController.js" + EmbeddedResource.FILE_EXTENSION)] 13 | 14 | // RESOURCES (all are referenced as EditorResource consumes the others) 15 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "Editor/EditorResource.js" + EmbeddedResource.FILE_EXTENSION)] 16 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "DataSource/DataSourceResource.js" + EmbeddedResource.FILE_EXTENSION)] 17 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingResource.js" + EmbeddedResource.FILE_EXTENSION)] 18 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatResource.js" + EmbeddedResource.FILE_EXTENSION)] 19 | 20 | // CONFIG 21 | [PropertyEditorAsset(ClientDependencyType.Css, EmbeddedResource.ROOT_URL + "PropertyEditor/PropertyEditorConfig.css" + EmbeddedResource.FILE_EXTENSION)] 22 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "JsonDataSource/JsonDataSourceConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 23 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "CustomLabel/CustomLabelConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 24 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "RelationMapping/RelationMappingConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 25 | [PropertyEditorAsset(ClientDependencyType.Javascript, EmbeddedResource.ROOT_URL + "SaveFormat/SaveFormatConfigController.js" + EmbeddedResource.FILE_EXTENSION)] 26 | public class JsonRadioButtonPickerPropertyEditor : BasePropertyEditor 27 | { 28 | protected override PreValueEditor CreatePreValueEditor() 29 | { 30 | return new JsonRadioButtonPickerPreValueEditor(); 31 | } 32 | } 33 | } --------------------------------------------------------------------------------