From 40d1099fbd81efb8df884336b5325f99cc9bf5b6 Mon Sep 17 00:00:00 2001 From: per ploug Date: Mon, 12 May 2014 13:07:44 +0200 Subject: [PATCH] grid modifications --- src/Umbraco.Web.UI.Client/.bowerrc | 3 - src/Umbraco.Web.UI.Client/bower.json | 2 +- src/Umbraco.Web.UI.Client/gruntFile.js | 17 ++ .../directives/grid/grid.rte.directive.js | 5 +- .../src/views/propertyeditors/grid/grid.html | 197 ++++++++++-------- .../PropertyEditors/GridPropertyEditor.cs | 5 +- 6 files changed, 131 insertions(+), 98 deletions(-) delete mode 100644 src/Umbraco.Web.UI.Client/.bowerrc diff --git a/src/Umbraco.Web.UI.Client/.bowerrc b/src/Umbraco.Web.UI.Client/.bowerrc deleted file mode 100644 index 17bf34b679..0000000000 --- a/src/Umbraco.Web.UI.Client/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "directory" : "lib" -} \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/bower.json b/src/Umbraco.Web.UI.Client/bower.json index 0eb44dfac9..0fcdd89b3b 100644 --- a/src/Umbraco.Web.UI.Client/bower.json +++ b/src/Umbraco.Web.UI.Client/bower.json @@ -17,6 +17,6 @@ ], "dependencies": { "typeahead.js": "~0.10.2", - "codemirror": "~4.1.0" + "ace-builds": "~1.1.3" } } diff --git a/src/Umbraco.Web.UI.Client/gruntFile.js b/src/Umbraco.Web.UI.Client/gruntFile.js index 316a1442f6..3fa6feeb5b 100644 --- a/src/Umbraco.Web.UI.Client/gruntFile.js +++ b/src/Umbraco.Web.UI.Client/gruntFile.js @@ -114,6 +114,23 @@ module.exports = function (grunt) { files: [{ dest: '<%= distdir %>/assets', src : '**', expand: true, cwd: 'src/assets/' }] }, + + bower: { + files: [ + { + dest: 'lib/typeahead/typeahead.bundle.min.js', + src: 'bower_components/typeahead.js/dist/typeahead.bundle.min.js' + }, + { + dest: 'lib/ace/', + src: '**', + expand: true, + cwd: 'bower_components/ace-builds/src-min-noconflict/' + } + ] + }, + + installer: { files: [{ dest: '<%= distdir %>/views/install', src : '**/*.html', expand: true, cwd: 'src/installer/steps' }] }, diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/grid/grid.rte.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/grid/grid.rte.directive.js index 828fe1c3a6..621a67a699 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/grid/grid.rte.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/grid/grid.rte.directive.js @@ -5,7 +5,8 @@ angular.module("umbraco") uniqueId: '=', value: '=', ctrlOp: '&', - ctrlCl: '&' + ctrlCl: '&', + configuration:"=" }, template: "", replace: true, @@ -13,11 +14,13 @@ angular.module("umbraco") var initTiny = function () { + //we always fetch the default one, and then override parts with our own tinyMceService.configuration().then(function (tinyMceConfig) { //config value from general tinymce.config file var validElements = tinyMceConfig.validElements; var fallbackStyles = [{title: "Page header", block: "h2"}, {title: "Section header", block: "h3"}, {title: "Paragraph header", block: "h4"}, {title: "Normal", block: "p"}, {title: "Quote", block: "blockquote"}, {title: "Code", block: "code"}]; + //These are absolutely required in order for the macros to render inline //we put these as extended elements because they get merged on top of the normal allowed elements by tiny mce var extendedValidElements = "@[id|class|style],-div[id|dir|class|align|style],ins[datetime|cite],-ul[class|style],-li[class|style],-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],-h3[id|dir|class|align|style],-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|style|dir|class|align]"; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.html index 5fb3e195e2..8c19015b8d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.html @@ -15,117 +15,130 @@ +
-
- -
+
+
+ +
+ +
+ +
+
+
+ +
+
+
+ +
+ +
-
+
+
+ ng-repeat="cell in row.cells"> -
+
-
-
-
-
-
-
-
-
-
-
-
-
+ +
-
+
+ +
+ +
+ +
+ +
-
+
+ +
-
+
+ +
+
-
-
+
+ +
+
+
- ng-repeat="cell in row.cells"> + +
-
+ +
- -
+
-
-
- -
-
- -
-
- -
-
- -
-
+ +
+ +
-
-
- -
-
-
+ +
+
+ + {{control.macro.macroAlias}} +
+
- -
- - - -
- -
- - -
- -
- - -
-
- - {{control.macro.macroAlias}} -
-
- -
+