Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiepollock committed Apr 10, 2017
2 parents 2756457 + f6d51e8 commit 6ff55d6
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 7 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ An Umbraco Package collection of property editors to be used with [Umbraco CMS](

The main focus of this project is to provide tools to aid authors in general styling & alignment of content & background imagery.

The original idea is inspired by and credited to [@andersburla](https://github.com/andersburla) & the [Tea Solutions](https://teasolutions.net/) team.
## Credit
The original idea is inspired by and credited to [@andersburla](https://twitter.com/andersburla) & the [Tea Solutions](https://teasolutions.net/) team.

## Installation & usage

Download the package from Our Umbraco or install the nuget package. (links pending inital release)
Download the package via one of the following:

Alternatively checkout the [latest build artifacts on Appveyor](https://ci.appveyor.com/project/jamiepollock/umbraco-grid-settings/build/artifacts).
- NuGet [![NuGet release](https://img.shields.io/nuget/v/Our.Umbraco.GridSettings.svg)](https://www.nuget.org/packages/Our.Umbraco.GridSettings)
- Our Umbraco [![Our Umbraco project page](https://img.shields.io/badge/our-umbraco-orange.svg)](https://our.umbraco.org/projects/backoffice-extensions/grid-settings/)
- Appveyor [![Appveyor Build](https://ci.appveyor.com/api/projects/status/wna1x7t9rveb876w?svg=true)](https://ci.appveyor.com/project/jamiepollock/umbraco-grid-settings/build/artifacts)

**Note:** Version 0.2.0+ will only be compatible with Umbraco v7.5.4.

### Usage

Expand Down
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
os: Visual Studio 2015

# Version format
version: 0.1.1.{build}
version: 0.2.0.{build}

cache:
- src\packages -> **\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified
Expand All @@ -14,7 +14,6 @@ branches:
# UMBRACO_PACKAGE_PRERELEASE_SUFFIX if a rtm release build this should be blank, otherwise if empty will default to alpha
# example UMBRACO_PACKAGE_PRERELEASE_SUFFIX=beta
init:
- set UMBRACO_PACKAGE_PRERELEASE_SUFFIX=beta

build_script:
- build-appveyor.cmd
Expand Down
2 changes: 1 addition & 1 deletion build/build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<!-- SHARED PROPERTIES -->
<PropertyGroup>
<PackageName>Our.Umbraco.GridSettings</PackageName>
<MinUmbracoVersion>7.3.0</MinUmbracoVersion>
<MinUmbracoVersion>7.5.4</MinUmbracoVersion>
<Readme>A backoffice plugin to add additional property editors for Umbraco Grid row &amp; column settings</Readme>
<AuthorName>Jamie Pollock</AuthorName>
<AuthorUrl>https://github.com/jamiepollock/Umbraco-Grid-Settings/graphs/contributors</AuthorUrl>
Expand Down
47 changes: 47 additions & 0 deletions docs/Usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Here are sample usages of the currently supported property editors. You are not

### Background Position

- **Introduced in**: [v0.1.0-beta](https://github.com/jamiepollock/umbraco-grid-settings/releases/tag/v0.1.0-beta)
- **Typical CSS Property**: background-position
- **Supported values**:
- **Vertical**: top, center & bottom
Expand All @@ -31,6 +32,7 @@ Here are sample usages of the currently supported property editors. You are not

### Background Repeat

- **Introduced in**: [v0.1.0-beta](https://github.com/jamiepollock/umbraco-grid-settings/releases/tag/v0.1.0-beta)
- **Typical CSS Property**: background-repeat
- **Supported values**:
- no-repeat
Expand All @@ -52,6 +54,7 @@ Here are sample usages of the currently supported property editors. You are not

### Background Size

- **Introduced in**: [v0.1.0-beta](https://github.com/jamiepollock/umbraco-grid-settings/releases/tag/v0.1.0-beta)
- **Typical CSS Property**: background-size
- **Supported values**:
- auto
Expand All @@ -72,6 +75,7 @@ Here are sample usages of the currently supported property editors. You are not

### Color Picker

- **Introduced in**: [v0.1.0-beta](https://github.com/jamiepollock/umbraco-grid-settings/releases/tag/v0.1.0-beta)
- **Typical CSS Property**: background-color, color (anything which expects a hexcode color)
- **Supported values**: Developer provided prevalues (see below). The value or string must be a valid hexcode color value. Non-hexcode color values are not supported.
- **Editor**: Simple color picker (reupurposing the Approved Color Picker editor)
Expand Down Expand Up @@ -124,6 +128,7 @@ Here are sample usages of the currently supported property editors. You are not

### Text Align

- **Introduced in**: [v0.1.0-beta](https://github.com/jamiepollock/umbraco-grid-settings/releases/tag/v0.1.0-beta)
- **Typical CSS Property**: text-align
- **Supported values**:
- left
Expand All @@ -141,4 +146,46 @@ Here are sample usages of the currently supported property editors. You are not
"view": "/App_Plugins/Our.Umbraco.GridSettings/editors/TextAlign/view.html"
}
...
```

### Class Color Picker

Class Color Picker is for cases where an developer will want to return a class value rather than a hexcode color.

This could be used in cases where the hexcode color is simply a representation of the idea of what that class looks like.

Basicially it will return "green" rather than "#00ff00" as its value. This means the label & value are switched from what is used in the Color Picker property editor.

- **Introduced in**: [v0.2.0](https://github.com/jamiepollock/umbraco-grid-settings/releases/tag/v0.2.0)
- **Typical CSS Property**: class
- **Supported values**: Developer provided prevalues (see below).
- label: A valid hexcode color value. Non-hexcode color values are not supported.
- value: The class value to be rendered in Grid markup
- **Editor**: Simple color picker (reupurposing the Approved Color Picker editor)

**Note**: This property editor only supports key value pair prevalues and there is only available for Umbraco v7.5.4. Providing string values will produce a handled error.

#### Background Color Picker

```json
{
"label": "Set background color",
"description": "Set the row background color",
"key": "background-color",
"view": "/App_Plugins/Our.Umbraco.GridSettings/editors/ClassColorPicker/view.html",
"prevalues": [
{
"label": "#0000ff",
"value": "Blue"
},
{
"label": "#00ff00",
"value": "Green"
},
{
"label": "#ff0000",
"value": "Red"
}
]
},
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
(function () {
'use strict';

var controller = function ($scope, notificationsService) {
$scope.colors = [];
var stringPreValues = $scope.model.prevalues.filter(function (item) { return typeof (item) === 'string'; });

if (stringPreValues.length > 0) {
notificationsService.error("Configuration Error", "Class Color Picker (" + $scope.model.label + ") must only have key value pair prevalues.");
} else {
$scope.colors = $scope.model.prevalues;
}

$scope.setValue = function (value) {
$scope.model.value = value;
}

$scope.isValue = function (value) {
return value === $scope.model.value;
}
};

angular.module("umbraco").controller("Our.Umbraco.GridSettings.ClassColorPickerController", controller);
})();
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div ng-controller="Our.Umbraco.GridSettings.ClassColorPickerController">
<ul class="thumbnails color-picker">
<li ng-repeat="item in colors" ng-class="{active: isValue(item.value)}" title="{{item.value}}">
<a ng-click="setValue(item.value)" class="thumbnail" hex-bg-color="{{item.label}}">
<!-- -->
</a>
</li>
</ul>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"/App_Plugins/Our.Umbraco.GridSettings/editors/BackgroundPosition/controller.js",
"/App_Plugins/Our.Umbraco.GridSettings/editors/BackgroundRepeat/controller.js",
"/App_Plugins/Our.Umbraco.GridSettings/editors/BackgroundSize/controller.js",
"/App_Plugins/Our.Umbraco.GridSettings/editors/ClassColorPicker/controller.js",
"/App_Plugins/Our.Umbraco.GridSettings/editors/ColorPicker/controller.js",
"/App_Plugins/Our.Umbraco.GridSettings/editors/TextAlign/controller.js"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
<Content Include="App_Plugins\Our.Umbraco.GridSettings\editors\BackgroundSize\controller.js" />
<Content Include="App_Plugins\Our.Umbraco.GridSettings\editors\BackgroundSize\view.html" />
<Content Include="App_Plugins\Our.Umbraco.GridSettings\editors\ColorPicker\controller.js" />
<Content Include="App_Plugins\Our.Umbraco.GridSettings\editors\ColorPicker\view.css" />
<Content Include="App_Plugins\Our.Umbraco.GridSettings\editors\ColorPicker\view.html" />
<Content Include="App_Plugins\Our.Umbraco.GridSettings\editors\TextAlign\controller.js" />
<Content Include="App_Plugins\Our.Umbraco.GridSettings\editors\TextAlign\view.html" />
Expand Down

0 comments on commit 6ff55d6

Please sign in to comment.