Changes property editor controller namespace to be PropertyEditors instead of just Editors

This commit is contained in:
Shannon
2013-10-09 20:02:39 +11:00
parent d255b3a6a3
commit 659cba563a
48 changed files with 70 additions and 137 deletions
@@ -58,7 +58,7 @@ h1.headline{height: 40px; padding: 30px 0 0 20px;}
position: absolute;
padding: 0px 0px 0px 20px;
}
.umb-panel-header h1, {
.umb-panel-header h1 {
margin: 0;
font-size: @fontSizeMedium;
font-weight: 400;
@@ -71,7 +71,6 @@ h1.headline{height: 40px; padding: 30px 0 0 20px;}
.umb-headline-editor-wrapper input {
background: none;
border: none;
width: auto;
margin: -9px 0 0 0;
padding: 0 0 2px 0;
border-radius: 0;
@@ -1,74 +1,26 @@
<form ng-controller="Umbraco.Editors.Member.CreateController" novalidate name="memberCreate" ng-submit="submitMember()">
<div class="umb-dialog-body with-footer">
<div class="umb-pane">
<div class="umb-dialog-body with-footer" ng-controller="Umbraco.Editors.Member.CreateController">
<div class="umb-pane">
<h5>Create a new member</h5>
<h5>Create a new member</h5>
<ul class="umb-actions umb-actions-child">
<div ng-switch="currentStep">
<li ng-repeat="docType in allowedTypes">
<a href="#members/member/edit/{{currentNode.id}}?doctype={{docType.alias}}&create=true" ng-click="nav.hideNavigation()">
<ul class="umb-actions" ng-switch-when="1">
<li class="action">
<ul class="umb-actions-child">
<i class="large {{docType.icon}}"></i>
<li ng-repeat="docType in allowedTypes">
<a href="" ng-click="selectMemberType(docType.alias)">
<i class="large {{docType.icon}}"></i>
<span class="menu-label">{{docType.name}}
<span class="menu-label">{{docType.name}}
<small>{{docType.description}}</small>
</span>
</a>
</li>
</ul>
</li>
</ul>
<div class="umb-panel" val-show-validation ng-switch-when="2">
<div class="umb-pane">
<div class="control-group umb-control-group" ng-class="{error: memberCreate.name.$invalid}">
<label class="control-label" for="inputName">Name</label>
<input type="text" name="name" id="inputName" class="umb-editor" required placeholder="Name" ng-model="memberModel.name" />
<span class="help-block text-right" val-msg-for="name" val-toggle-msg="required">Required</span>
</div>
<div class="control-group umb-control-group" ng-class="{error: memberCreate.login.$invalid}">
<label class="control-label" for="inputLogin">Login name</label>
<input type="text" name="login" id="inputLogin" class="umb-editor" required placeholder="Login" ng-model="memberModel.login" />
<span class="help-block text-right" val-msg-for="login" val-toggle-msg="required">Required</span>
</div>
<div class="control-group umb-control-group" ng-class="{error: memberCreate.email.$invalid}">
<label class="control-label" for="inputEmail">Email</label>
<input type="email" name="email" id="inputEmail" class="umb-editor" required placeholder="Email" ng-model="memberModel.email" />
<span class="help-block text-right" val-msg-for="email" val-toggle-msg="required">Required</span>
<span class="help-block text-right" val-msg-for="email" val-toggle-msg="email">Invalid email</span>
</div>
<div class="control-group umb-control-group" ng-class="{error: memberCreate.password.$invalid}">
<label class="control-label" for="inputPassword">Password</label>
<input type="text" name="password" id="inputPassword" class="umb-editor" required placeholder="Password" ng-model="memberModel.password" />
<span class="help-block text-right" val-msg-for="password" val-toggle-msg="required">Required</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="umb-dialog-footer btn-toolbar umb-btn-toolbar" ng-switch="currentStep">
<div class="umb-dialog-footer btn-toolbar umb-btn-toolbar" ng-switch-when="1">
<button type="button" class="btn" ng-click="nav.hideDialog()">Do something else</button>
</div>
<div class="umb-dialog-footer btn-toolbar umb-btn-toolbar" ng-switch-when="2">
<button type="button" class="btn btn-link" ng-click="close()">Cancel</button>
<button type="submit" class="btn btn-primary">Ok</button>
</div>
</span>
</a>
</li>
</ul>
</div>
</div>
</form>
<div class="umb-dialog-footer btn-toolbar umb-btn-toolbar" >
<button type="button" class="btn" ng-click="nav.hideDialog()">Do something else</button>
</div>
@@ -7,34 +7,7 @@
* The controller for the member creation dialog
*/
function memberCreateController($scope, $routeParams, memberTypeResource, iconHelper) {
$scope.currentStep = 1;
$scope.memberModel = null;
$scope.memberType = null;
$scope.submitMember = function () {
//we need to broadcast the saving event for the toggle validators to work
$scope.$broadcast("saving");
//ensure the drop down is dirty so the styles validate
$scope.memberCreate.$setDirty(true);
if ($scope.memberCreate.$invalid) {
return;
}
alert("whoohoo!");
//#media/media/edit/{{currentNode.id}}?doctype={{docType.alias}}&create=true
};
$scope.selectMemberType = function (alias) {
$scope.memberType = alias;
$scope.currentStep = 2;
};
memberTypeResource.getTypes($scope.currentNode.id).then(function (data) {
$scope.allowedTypes = iconHelper.formatContentTypeIcons(data);
});
@@ -13,7 +13,7 @@ function MemberEditController($scope, $routeParams, $q, $timeout, $window, membe
if ($routeParams.create) {
//we are creating so get an empty member item
memberResource.getScaffold($routeParams.id, $routeParams.doctype)
memberResource.getScaffold($routeParams.doctype)
.then(function(data) {
$scope.loaded = true;
$scope.content = data;
@@ -23,4 +23,4 @@ function booleanEditorController($scope, $rootScope, assetsService) {
};
}
angular.module("umbraco").controller("Umbraco.Editors.BooleanController", booleanEditorController);
angular.module("umbraco").controller("Umbraco.PropertyEditors.BooleanController", booleanEditorController);
@@ -1,3 +1,3 @@
<div class="umb-editor umb-boolean" ng-controller="Umbraco.Editors.BooleanController">
<div class="umb-editor umb-boolean" ng-controller="Umbraco.PropertyEditors.BooleanController">
<input type="checkbox" ng-model="renderModel.value" id="{{model.alias}" />
</div>
@@ -1,4 +1,4 @@
angular.module("umbraco").controller("Umbraco.Editors.CheckboxListController",
angular.module("umbraco").controller("Umbraco.PropertyEditors.CheckboxListController",
function($scope) {
if (!angular.isObject($scope.model.config.items)) {
@@ -1,4 +1,4 @@
<div class="umb-editor umb-checkboxlist" ng-controller="Umbraco.Editors.CheckboxListController">
<div class="umb-editor umb-checkboxlist" ng-controller="Umbraco.PropertyEditors.CheckboxListController">
<ul class="unstyled">
<li ng-repeat="item in selectedItems">
@@ -1,4 +1,4 @@
angular.module("umbraco").controller("Umbraco.Editors.CodeMirrorController",
angular.module("umbraco").controller("Umbraco.PropertyEditors.CodeMirrorController",
function ($scope, $rootScope, assetsService) {
/*
@@ -1,4 +1,4 @@
<div ng-controller="Umbraco.Editors.CodeMirrorController">
<div ng-controller="Umbraco.PropertyEditors.CodeMirrorController">
<textarea id="{{model.alias}}">{{model.value}}</textarea>
<pre>{{model.value}}</pre>
</div>
@@ -4,4 +4,4 @@ function ColorPickerController($scope) {
};
}
angular.module("umbraco").controller("Umbraco.Editors.ColorPickerController", ColorPickerController);
angular.module("umbraco").controller("Umbraco.PropertyEditors.ColorPickerController", ColorPickerController);
@@ -1,4 +1,4 @@
<div ng-controller="Umbraco.Editors.ColorPickerController">
<div ng-controller="Umbraco.PropertyEditors.ColorPickerController">
<ul class="thumbnails color-picker">
<li ng-repeat="(key, val) in model.config.items" ng-class="{active: model.value === val}">
@@ -1,7 +1,7 @@
//this controller simply tells the dialogs service to open a mediaPicker window
//with a specified callback, this callback will receive an object with a selection on it
angular.module('umbraco')
.controller("Umbraco.Editors.ContentPickerController",
.controller("Umbraco.PropertyEditors.ContentPickerController",
function($scope, dialogService, entityResource, $log, iconHelper){
$scope.ids = $scope.model.value.split(',');
@@ -1,4 +1,4 @@
<div ng-controller="Umbraco.Editors.ContentPickerController" class="umb-editor umb-contentpicker">
<div ng-controller="Umbraco.PropertyEditors.ContentPickerController" class="umb-editor umb-contentpicker">
<ul class="unstyled">
<li ng-repeat="node in renderModel">
@@ -1,4 +1,4 @@
angular.module("umbraco").controller("Umbraco.Editors.DatepickerController",
angular.module("umbraco").controller("Umbraco.PropertyEditors.DatepickerController",
function ($scope, notificationsService, assetsService) {
//setup the default config
@@ -1,4 +1,4 @@
<div class="umb-editor umb-datepicker" ng-controller="Umbraco.Editors.DatepickerController">
<div class="umb-editor umb-datepicker" ng-controller="Umbraco.PropertyEditors.DatepickerController">
<div class="input-append date datepicker" id="{{model.alias}}">
<input name="datepicker" data-format="{{model.config.format}}" type="text"
ng-model="model.value"
@@ -1,4 +1,4 @@
angular.module("umbraco").controller("Umbraco.Editors.DropdownController",
angular.module("umbraco").controller("Umbraco.PropertyEditors.DropdownController",
function($scope) {
//setup the default config
@@ -1,4 +1,4 @@
<div ng-controller="Umbraco.Editors.DropdownController" ng-switch="model.config.multiple">
<div ng-controller="Umbraco.PropertyEditors.DropdownController" ng-switch="model.config.multiple">
<select name="dropDownList"
class="umb-editor umb-dropdown"
@@ -0,0 +1,6 @@
angular.module("umbraco")
.controller("Umbraco.PropertyEditors.EmailController",
function($rootScope, $scope, dialogService, $routeParams, contentResource, contentTypeResource, editorContextService, notificationsService) {
});
@@ -0,0 +1,3 @@
<input type="email" name="textbox" ng-model="model.value" id="{{model.alias}}" class="umb-editor umb-textstring textstring" val-server="value" />
<span class="help-inline" val-msg-for="textbox" val-toggle-msg="email">Invalid email</span>
<span class="help-inline" val-msg-for="textbox" val-toggle-msg="valServer"></span>
@@ -120,5 +120,5 @@ function fileUploadController($scope, $element, $compile, imageHelper, fileManag
});
};
angular.module("umbraco").controller('Umbraco.Editors.FileUploadController', fileUploadController);
angular.module("umbraco").controller('Umbraco.PropertyEditors.FileUploadController', fileUploadController);
@@ -1,4 +1,4 @@
<div class="umb-editor umb-fileupload" ng-controller="Umbraco.Editors.FileUploadController">
<div class="umb-editor umb-fileupload" ng-controller="Umbraco.PropertyEditors.FileUploadController">
<div ng-hide="clearFiles">
<div class="file-uploader">
@@ -10,7 +10,7 @@ angular.module("umbraco")
}
};
})
.controller("Umbraco.Editors.FolderBrowserController",
.controller("Umbraco.PropertyEditors.FolderBrowserController",
function ($rootScope, $scope, assetsService, $routeParams, $timeout, $element, $location, umbRequestHelper, mediaResource, imageHelper) {
var dialogOptions = $scope.$parent.dialogOptions;
@@ -1,4 +1,4 @@
<form ng-controller="Umbraco.Editors.FolderBrowserController" id="fileupload"
<form ng-controller="Umbraco.PropertyEditors.FolderBrowserController" id="fileupload"
style="width: 100%"
method="POST" enctype="multipart/form-data"
class="umb-editor umb-folderbrowser"
@@ -1,5 +1,5 @@
angular.module("umbraco")
.controller("Umbraco.Editors.GoogleMapsController",
.controller("Umbraco.PropertyEditors.GoogleMapsController",
function ($rootScope, $scope, notificationsService, dialogService, assetsService, $log, $timeout) {
assetsService.loadJs('http://www.google.com/jsapi')
@@ -1,3 +1,3 @@
<div ng-controller="Umbraco.Editors.GoogleMapsController" class="umb-editor umb-googlemaps">
<div ng-controller="Umbraco.PropertyEditors.GoogleMapsController" class="umb-editor umb-googlemaps">
<div class="" style="height: 400px;" id="{{model.alias}}_map"></div>
</div>
@@ -1,7 +1,7 @@
'use strict';
//this controller simply tells the dialogs service to open a mediaPicker window
//with a specified callback, this callback will receive an object with a selection on it
angular.module("umbraco").controller("Umbraco.Editors.GridController",
angular.module("umbraco").controller("Umbraco.PropertyEditors.GridController",
function($rootScope, $scope, dialogService, $log){
//we most likely will need some iframe-motherpage interop here
@@ -1,3 +1,3 @@
<div class="umb-editor umb-grid" ng-controller="Umbraco.Editors.GridController" auto-scale="10">
<div class="umb-editor umb-grid" ng-controller="Umbraco.PropertyEditors.GridController" auto-scale="10">
<iframe style="width: 100%; height: 100%;" src="views/propertyeditors/grid/iframe.html"></iframe>
</div>
@@ -1,5 +1,5 @@
angular.module("umbraco")
.controller("Umbraco.Editors.ListViewController",
.controller("Umbraco.PropertyEditors.ListViewController",
function ($rootScope, $scope, $routeParams, contentResource, contentTypeResource, editorContextService, notificationsService) {
$scope.selected = [];
@@ -1,5 +1,5 @@
<div class="umb-editor umb-listview" ng-controller="Umbraco.Editors.ListViewController">
<div class="umb-editor umb-listview" ng-controller="Umbraco.PropertyEditors.ListViewController">
<div class="row-fluid">
<div class="umb-sub-header">
@@ -1,6 +1,6 @@
//this controller simply tells the dialogs service to open a mediaPicker window
//with a specified callback, this callback will receive an object with a selection on it
angular.module('umbraco').controller("Umbraco.Editors.MediaPickerController",
angular.module('umbraco').controller("Umbraco.PropertyEditors.MediaPickerController",
function($rootScope, $scope, dialogService, mediaResource, imageHelper, $log) {
@@ -1,4 +1,4 @@
<div class="umb-editor umb-mediapicker" ng-controller="Umbraco.Editors.MediaPickerController">
<div class="umb-editor umb-mediapicker" ng-controller="Umbraco.PropertyEditors.MediaPickerController">
<ul class="thumbnails umb-thumbnails">
<li class="umb-thumbnail thumbnail">
@@ -31,4 +31,4 @@
}
angular.module("umbraco").controller("Umbraco.Editors.MultipleTextBoxController", MultipleTextBoxController);
angular.module("umbraco").controller("Umbraco.PropertyEditors.MultipleTextBoxController", MultipleTextBoxController);
@@ -1,4 +1,4 @@
<div class="umb-editor umb-multiple-textbox" ng-controller="Umbraco.Editors.MultipleTextBoxController">
<div class="umb-editor umb-multiple-textbox" ng-controller="Umbraco.PropertyEditors.MultipleTextBoxController">
<div class="control-group" ng-repeat="item in model.value">
<input type="text" name="item_{{$index}}" ng-model="item.value" />
@@ -45,4 +45,4 @@ function ReadOnlyValueController($rootScope, $scope, $filter) {
});
}
angular.module('umbraco').controller("Umbraco.Editors.ReadOnlyValueController", ReadOnlyValueController);
angular.module('umbraco').controller("Umbraco.PropertyEditors.ReadOnlyValueController", ReadOnlyValueController);
@@ -1,3 +1,3 @@
<div class="umb-editor umb-readonlyvalue" ng-controller="Umbraco.Editors.ReadOnlyValueController">
<div class="umb-editor umb-readonlyvalue" ng-controller="Umbraco.PropertyEditors.ReadOnlyValueController">
{{displayvalue}}
</div>
@@ -1,5 +1,5 @@
angular.module("umbraco")
.controller("Umbraco.Editors.RelatedLinksController",
.controller("Umbraco.PropertyEditors.RelatedLinksController",
function ($rootScope, $scope, dialogService, $routeParams, contentResource, contentTypeResource, editorContextService, notificationsService) {
$scope.newCaption = '';
@@ -1,4 +1,4 @@
<div class="umb-editor umb-relatedlinks" ng-controller="Umbraco.Editors.RelatedLinksController">
<div class="umb-editor umb-relatedlinks" ng-controller="Umbraco.PropertyEditors.RelatedLinksController">
<div class="row-fluid">
<table class="table table-striped">
<thead>
@@ -1,5 +1,5 @@
angular.module("umbraco")
.controller("Umbraco.Editors.RTEController",
.controller("Umbraco.PropertyEditors.RTEController",
function ($rootScope, $element, $scope, dialogService, $log, imageHelper, assetsService, $timeout, tinyMceService, angularHelper) {
tinyMceService.configuration().then(function(tinyMceConfig){
@@ -1,3 +1,3 @@
<div ng-controller="Umbraco.Editors.RTEController" class="umb-editor umb-rte">
<div ng-controller="Umbraco.PropertyEditors.RTEController" class="umb-editor umb-rte">
<textarea ng-model="model.value" rows="10" id="{{model.alias}}_rte"></textarea>
</div>
@@ -1,5 +1,5 @@
angular.module("umbraco")
.controller("Umbraco.Editors.TagsController",
.controller("Umbraco.PropertyEditors.TagsController",
function ($rootScope, $scope, $log, assetsService) {
assetsService.loadJs(
@@ -1,4 +1,4 @@
<div ng-controller="Umbraco.Editors.TagsController" class="umb-editor umb-tags">
<div ng-controller="Umbraco.PropertyEditors.TagsController" class="umb-editor umb-tags">
<div ng-model="model.value" id="{{model.alias}}_tags" class="tag-list">
<div class="tags">
@@ -1,6 +1,6 @@
//this controller simply tells the dialogs service to open a mediaPicker window
//with a specified callback, this callback will receive an object with a selection on it
angular.module('umbraco').controller("Umbraco.Editors.EmbeddedContentController",
angular.module('umbraco').controller("Umbraco.PropertyEditors.EmbeddedContentController",
function($rootScope, $scope, $log){
$scope.showForm = false;
@@ -1,4 +1,4 @@
<div ng-controller="Umbraco.Editors.EmbeddedContentController">
<div ng-controller="Umbraco.PropertyEditors.EmbeddedContentController">
<ul>
<li ng-repeat="item in model.value">
{{item[0].value}}...
@@ -1,4 +1,4 @@
angular.module('umbraco').controller("Umbraco.Editors.UrlListController",
angular.module('umbraco').controller("Umbraco.PropertyEditors.UrlListController",
function($rootScope, $scope, $filter) {
function formatDisplayValue() {
@@ -1,4 +1,4 @@
<div ng-controller="Umbraco.Editors.UrlListController">
<div ng-controller="Umbraco.PropertyEditors.UrlListController">
<ul class="nav nav-stacked">
<li ng-repeat="value in renderModel">
<a href="{{value.url}}" target="{{value.urlTarget}}"><i class="icon-out"></i> {{value.url}}</a>
@@ -1,4 +1,4 @@
angular.module('umbraco').controller("Umbraco.Editors.UserPickerController",
angular.module('umbraco').controller("Umbraco.PropertyEditors.UserPickerController",
function($rootScope, $scope, $log, userResource){
userResource.getAll().then(function (userArray) {
@@ -1,5 +1,5 @@
<select
ng-controller="Umbraco.Editors.UserPickerController"
ng-controller="Umbraco.PropertyEditors.UserPickerController"
name="{{ model.alias }}"
ng-model=" model.value"
ng-options="user.id as user.name for user in users">