Renames canvas editor into grid again

This commit is contained in:
per ploug
2014-10-07 13:39:18 +02:00
parent bba4db46d2
commit b6fd0489e2
32 changed files with 78 additions and 220 deletions

View File

@@ -1,5 +1,5 @@
angular.module("umbraco")
.directive('canvasRte', function (tinyMceService, stylesheetResource, angularHelper, assetsService, $q, $timeout) {
angular.module("umbraco.directives")
.directive('gridRte', function (tinyMceService, stylesheetResource, angularHelper, assetsService, $q, $timeout) {
return {
scope: {
uniqueId: '=',
@@ -75,7 +75,7 @@ angular.module("umbraco")
}));
});
}else{
stylesheets.push("views/propertyeditors/canvas/config/canvas.default.rtestyles.css");
stylesheets.push("views/propertyeditors/grid/config/grid.default.rtestyles.css");
styleFormats = fallbackStyles;
}

View File

@@ -1,7 +1,7 @@
angular.module('umbraco.services')
.factory('canvasService', function ($http, $q){
.factory('gridService', function ($http, $q){
var configPath = "../config/canvas.editors.config.js";
var configPath = "../config/grid.editors.config.js";
var service = {
getGridEditors: function () {
return $http.get(configPath);

View File

@@ -1,8 +0,0 @@
<div
unique-id="control.$uniqueId"
value="control.value"
canvas-rte configuration="model.config.rte">
hey
</div>

View File

@@ -1,5 +1,5 @@
angular.module("umbraco")
.controller("Umbraco.PropertyEditors.Canvas.EmbedController",
.controller("Umbraco.PropertyEditors.Grid.EmbedController",
function ($scope, $rootScope, $timeout, dialogService) {
$scope.setEmbed = function(){
@@ -16,3 +16,4 @@ angular.module("umbraco")
}
}, 200);
});

View File

@@ -1,4 +1,4 @@
<div ng-controller="Umbraco.PropertyEditors.Canvas.EmbedController">
<div ng-controller="Umbraco.PropertyEditors.Grid.EmbedController">
<div class="usky-editor-placeholder" ng-click="setEmbed()" ng-if="control.value === null">
<i class="icon icon-movie-alt"></i>
@@ -7,3 +7,4 @@
<div ng-if="control.value" ng-bind-html-unsafe="control.value"></div>
</div>

View File

@@ -1,5 +1,5 @@
angular.module("umbraco")
.controller("Umbraco.PropertyEditors.Canvas.MacroController",
.controller("Umbraco.PropertyEditors.Grid.MacroController",
function ($scope, $rootScope, $timeout, dialogService, macroResource, macroService, $routeParams) {
$scope.title = "Click to insert macro";
@@ -40,3 +40,4 @@ angular.module("umbraco")
}
}, 200);
});

View File

@@ -1,4 +1,4 @@
<div ng-controller="Umbraco.PropertyEditors.Canvas.MacroController">
<div ng-controller="Umbraco.PropertyEditors.Grid.MacroController">
<div class="usky-editor-placeholder" ng-click="setMacro()">
<div ng-if="!preview">
@@ -14,3 +14,4 @@
</div>
</div>

View File

@@ -1,5 +1,5 @@
angular.module("umbraco")
.controller("Umbraco.PropertyEditors.Canvas.MediaController",
.controller("Umbraco.PropertyEditors.Grid.MediaController",
function ($scope, $rootScope, $timeout, dialogService) {
$scope.setImage = function(){
@@ -21,3 +21,4 @@ angular.module("umbraco")
}
}, 200);
});

View File

@@ -1,4 +1,4 @@
<div ng-controller="Umbraco.PropertyEditors.Canvas.MediaController">
<div ng-controller="Umbraco.PropertyEditors.Grid.MediaController">
<div class="usky-editor-placeholder" ng-click="setImage()" ng-if="control.value === null">
<i class="icon icon-picture"></i>
@@ -7,10 +7,10 @@
<div ng-if="control.value">
<img
ng-if="control.value"
ng-if="control.value"
ng-click="setImage()"
ng-src="{{control.value.image}}"
ng-src="{{control.value.image}}"
class="fullSizeImage" />
<input type="text" class="caption" ng-model="control.value.caption" placeholder="Image caption..."/>
</div>
</div>
</div>

View File

@@ -0,0 +1,5 @@
<div
unique-id="control.$uniqueId"
value="control.value"
grid-rte configuration="model.config.rte">
</div>

View File

@@ -1,5 +1,5 @@
angular.module("umbraco")
.controller("Umbraco.PropertyEditors.Canvas.TextStringController",
.controller("Umbraco.PropertyEditors.Grid.TextStringController",
function ($scope, $rootScope, $timeout, dialogService) {
$scope.adjustSize = function(ev){
@@ -15,3 +15,4 @@ angular.module("umbraco")
}
});

View File

@@ -1,4 +1,4 @@
<div ng-controller="Umbraco.PropertyEditors.Canvas.TextStringController">
<div ng-controller="Umbraco.PropertyEditors.Grid.TextStringController">
<textarea
class="textstring input-block-level" id="{{control.uniqueId}}_text"
ng-keyup="adjustSize($event)" ng-model="control.value"

View File

@@ -1,8 +1,8 @@
angular.module("umbraco")
.controller("Umbraco.PropertyEditors.CanvasController",
function ($scope, $http, assetsService, $rootScope, dialogService, canvasService, mediaResource, imageHelper, $timeout) {
.controller("Umbraco.PropertyEditors.GridController",
function ($scope, $http, assetsService, $rootScope, dialogService, gridService, mediaResource, imageHelper, $timeout) {
// Canvas status variables
// Grid status variables
$scope.currentRow = null;
$scope.currentCell = null;
$scope.currentToolsControl = null;
@@ -214,7 +214,7 @@ angular.module("umbraco")
// Init row value
row = $scope.initRow(row);
// Push the new row
// Push the new row
if(row){
section.rows.push(row);
}
@@ -490,13 +490,13 @@ angular.module("umbraco")
control.$editorPath = control.editor.view;
}else{
//use convention
control.$editorPath = "views/propertyeditors/canvas/editors/" + control.editor.view + ".html";
control.$editorPath = "views/propertyeditors/grid/editors/" + control.editor.view + ".html";
}
}
};
canvasService.getGridEditors().then(function(response){
gridService.getGridEditors().then(function(response){
$scope.availableEditors = response.data;
$scope.contentReady = true;

View File

@@ -1,4 +1,4 @@
<div ng-controller="Umbraco.PropertyEditors.CanvasController" class="usky-grid">
<div ng-controller="Umbraco.PropertyEditors.GridController" class="usky-grid">
<div ng-if="contentReady">
<!-- Template picker -->
@@ -125,7 +125,7 @@
</a>
</div>
<div ng-if="overlayMenu.show && overlayMenu.key == area.$uniqueId" ng-include="'views/propertyeditors/canvas/dialogs/additem.html'"></div>
<div ng-if="overlayMenu.show && overlayMenu.key == area.$uniqueId" ng-include="'views/propertyeditors/grid/dialogs/additem.html'"></div>
</div>
</div>
@@ -193,7 +193,7 @@
</a>
</div>
<div ng-show="overlayMenu.show && overlayMenu.key == control.$uniqueId" ng-include="'views/propertyeditors/canvas/dialogs/additem.html'"></div>
<div ng-show="overlayMenu.show && overlayMenu.key == control.$uniqueId" ng-include="'views/propertyeditors/grid/dialogs/additem.html'"></div>
</div>
</div>
@@ -250,3 +250,6 @@
</div>
</div>

View File

@@ -1,6 +1,6 @@
angular.module("umbraco")
.controller("Umbraco.PropertyEditors.CanvasPrevalueEditorController",
function ($scope, $http, assetsService, $rootScope, dialogService, mediaResource, canvasService, imageHelper, $timeout) {
.controller("Umbraco.PropertyEditors.GridPrevalueEditorController",
function ($scope, $http, assetsService, $rootScope, dialogService, mediaResource, gridService, imageHelper, $timeout) {
var emptyModel = {
columns: 12,
@@ -76,7 +76,7 @@ angular.module("umbraco")
$scope.model.value.templates.splice(index, 1);
};
$scope.closeTemplate = function(){
//clean-up
_.forEach($scope.currentTemplate.sections, function(section, index){
if(section.grid <= 0){
@@ -140,7 +140,7 @@ angular.module("umbraco")
$scope.model.value.layouts.splice(index, 1);
};
$scope.closeLayout = function(){
//clean-up
_.forEach($scope.currentLayout.areas, function(area, index){
if(area.grid <= 0){
@@ -150,7 +150,7 @@ angular.module("umbraco")
$scope.currentLayout = undefined;
};
/****************
area
@@ -187,14 +187,15 @@ angular.module("umbraco")
$scope.scaleDown = function(section){
var remove = (section.grid > 1) ? 1 : section.grid;
section.grid = section.grid-remove;
};
};
$scope.toggleCollection = function(collection, toggle){
if(toggle){
collection = [];
}else{
delete collection;
}
}
};
$scope.percentage = function(spans){
return ((spans / $scope.model.value.columns) * 100).toFixed(1);
};
@@ -226,12 +227,12 @@ angular.module("umbraco")
/****************
editors
*****************/
canvasService.getGridEditors().then(function(response){
gridService.getGridEditors().then(function(response){
$scope.editors = response.data;
});
/* init grid data */
/* init grid data */
if (!$scope.model.value || $scope.model.value === "" || !$scope.model.value.templates) {
$scope.model.value = emptyModel;
} else {
@@ -240,4 +241,4 @@ angular.module("umbraco")
}
}
})
});

View File

@@ -1,10 +1,10 @@
<div ng-controller="Umbraco.PropertyEditors.CanvasPrevalueEditorController" class="usky-grid usky-grid-configuration">
<div ng-controller="Umbraco.PropertyEditors.GridPrevalueEditorController" class="usky-grid usky-grid-configuration">
<div style="width: 600px">
<div class="control-group uSky-templates" ng-if="!currentTemplate">
<umb-control-group label="Canvas layouts" description="Layouts are the overall work area for the canvas editor, usually you only need one or two differnt layouts" hide-label="false">
<umb-control-group label="Grid layouts" description="Layouts are the overall work area for the grid editor, usually you only need one or two differnt layouts" hide-label="false">
<ul class="unstyled"
ui-sortable
@@ -297,7 +297,7 @@
</div>
<div style="max-width: 600px">
<umb-control-group label="Columns" hide-label="false">
<umb-control-group label="Columns" hide-label="false" description="Total combined number of columns in the grid layout">
<input type="text" class="" ng-model="model.value.columns" />
</umb-control-group>
</div>