diff --git a/src/Umbraco.Web.UI.Client/gruntFile.js b/src/Umbraco.Web.UI.Client/gruntFile.js index 0aabcb0d59..0a48b63e3f 100644 --- a/src/Umbraco.Web.UI.Client/gruntFile.js +++ b/src/Umbraco.Web.UI.Client/gruntFile.js @@ -114,7 +114,10 @@ module.exports = function (grunt) { }, vs: { - files: [{ dest: '<%= vsdir %>', src : '**', expand: true, cwd: '<%= distdir %>' }] + files: [{ dest: '<%= vsdir %>/js', src : '**', expand: true, cwd: '<%= distdir %>/js/' }] + }, + packages: { + files: [{ dest: '<%= vsdir %>/../App_Plugins', src : '**', expand: true, cwd: 'src/packages/' }] } }, diff --git a/src/Umbraco.Web.UI.Client/lib/umbraco/compat.js b/src/Umbraco.Web.UI.Client/lib/umbraco/compat.js new file mode 100644 index 0000000000..187fe7a0ef --- /dev/null +++ b/src/Umbraco.Web.UI.Client/lib/umbraco/compat.js @@ -0,0 +1,22 @@ +/* contains random bits and pieces we neede to make the U6 UI behave */ +jQuery(document).ready(function () { + scaleScrollables("body"); + + jQuery(window).bind("resize", function () { + scaleScrollables("body"); + }); +}); + + +function scaleScrollables(selector){ + jQuery(".umb-scrollable").each(function () { + var el = jQuery(this); + var totalOffset = 0; + var offsety = el.data("offset-y"); + + if (offsety != undefined) + totalOffset += offsety; + + el.height($(window).height() - (el.offset().top + totalOffset)); + }); +} \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/common/services/dialog.service.js b/src/Umbraco.Web.UI.Client/src/common/services/dialog.service.js index d261492945..5aebead137 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/dialog.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/dialog.service.js @@ -12,103 +12,113 @@ angular.module('umbraco.services') modalClass = options.modalClass || "umb-modalcolumn", templateUrl = options.template || "views/common/notfound.html"; - var callback = options.callback; - var $modal = $(''); - var id = templateUrl.replace('.html', '').replace(/[\/|\.|:]/g, "-") + '-' + scope.$id; - - $modal - .attr('id', id) - .addClass(animationClass) - .addClass(modalClass); + var callback = options.callback; + var $modal = $(''); + var id = templateUrl.replace('.html', '').replace(/[\/|\.|:]/g, "-") + '-' + scope.$id; - $rootScope.$on("closeDialogs", function () { - $modal.modal("hide"); - }); + $modal + .attr('id', id) + .addClass(animationClass) + .addClass(modalClass); + + $rootScope.$on("closeDialogs", function () { + $modal.modal("hide"); + + $modal.remove(); + $("#" + $modal.attr("id")).remove(); + }); + + + if(options.iframe) { + var html = $(""); + $modal.html(html); + $('body').append($modal); + + if(width){ + $modal.css("width", width); + } - if(options.iframe) { - var html = $(""); - $modal.html(html); - $('body').append($modal); - //Autoshow - if (options.show) { - $modal.modal('show'); - } - - return $modal; - } else { + if (options.show) { + $modal.modal('show'); + } + + return $modal; + } else { return $q.when($templateCache.get(templateUrl) || $http.get(templateUrl, { cache: true }).then(function (res) { return res.data; })) - .then(function onSuccess(template) { + .then(function onSuccess(template) { - // Build modal object - $modal - .html(template); + // Build modal object + $modal + .html(template); - $('body').append($modal); + $('body').append($modal); - // Compile modal content - $timeout(function () { - $compile($modal)(scope); - }); + // Compile modal content + $timeout(function () { + $compile($modal)(scope); + }); - //Scope to handle data from the modal form - scope.dialogData = {}; - scope.dialogData.selection = []; + //Scope to handle data from the modal form + scope.dialogData = {}; + scope.dialogData.selection = []; - // Provide scope display functions - scope.$modal = function (name) { - $modal.modal(name); - }; + // Provide scope display functions + scope.$modal = function (name) { + $modal.modal(name); + }; - scope.hide = function () { - $modal.modal('hide'); - $('body').remove($modal); - }; + scope.hide = function () { + $modal.modal('hide'); + + $modal.remove(); + $("#" + $modal.attr("id")).remove(); + }; - scope.show = function () { - $modal.modal('show'); - }; + scope.show = function () { + $modal.modal('show'); + }; - scope.submit = function (data) { - $modal.modal('hide'); - $('body').remove($modal); + scope.submit = function (data) { + if(callback){ + callback(data); + } - callback(data); - }; + $modal.modal('hide'); - scope.select = function (item) { - if (scope.dialogData.selection.indexOf(item) < 0) { - scope.dialogData.selection.push(item); - } - }; + $modal.remove(); + $("#" + $modal.attr("id")).remove(); + }; - scope.dismiss = scope.hide; + scope.select = function (item) { + if (scope.dialogData.selection.indexOf(item) < 0) { + scope.dialogData.selection.push(item); + } + }; - // Emit modal events - angular.forEach(['show', 'shown', 'hide', 'hidden'], function (name) { - $modal.on(name, function (ev) { - scope.$emit('modal-' + name, ev); - }); - }); + scope.dismiss = scope.hide; - // Support autofocus attribute - $modal.on('shown', function (event) { - $('input[autofocus]', $modal).first().trigger('focus'); - }); + // Emit modal events + angular.forEach(['show', 'shown', 'hide', 'hidden'], function (name) { + $modal.on(name, function (ev) { + scope.$emit('modal-' + name, ev); + }); + }); + + // Support autofocus attribute + $modal.on('shown', function (event) { + $('input[autofocus]', $modal).first().trigger('focus'); + }); //Autoshow - if (options.show) { - $modal.modal('show'); + if (options.show) { + $modal.modal('show'); } - $rootScope.$on("closeDialogs", function () { - $modal.modal("hide"); - }); - //Return the modal object - return $modal; - }); + return $modal; + }); } diff --git a/src/Umbraco.Web.UI.Client/src/less/grid.less b/src/Umbraco.Web.UI.Client/src/less/grid.less index e7e8dd6ec1..d108949056 100644 --- a/src/Umbraco.Web.UI.Client/src/less/grid.less +++ b/src/Umbraco.Web.UI.Client/src/less/grid.less @@ -5,7 +5,6 @@ html, body { height: 100%; - overflow: hidden } body { @@ -13,7 +12,6 @@ body { padding: 0; height: 100%; width: 100%; - overflow: hidden } .padded { diff --git a/src/Umbraco.Web.UI.Client/src/less/hacks.less b/src/Umbraco.Web.UI.Client/src/less/hacks.less index 46be9f5589..866dbb3b99 100644 --- a/src/Umbraco.Web.UI.Client/src/less/hacks.less +++ b/src/Umbraco.Web.UI.Client/src/less/hacks.less @@ -3,6 +3,9 @@ /* CONTAINS ALL HACKS AND OTHER QUICK-FIXES THAT WE MUST HANDLE BEFORE A RELEASE */ +/*ensures dialogs doesnt have side-by-side labels */ +.umbracoDialog .controls-row{margin-left: 0px !important;} + .controls-row img { max-width: none; } diff --git a/src/Umbraco.Web.UI.Client/src/packages/SimpleEditor/PropertyEditors/Views/simpleeditor.html b/src/Umbraco.Web.UI.Client/src/packages/SimpleEditor/PropertyEditors/Views/simpleeditor.html new file mode 100644 index 0000000000..7224ff2629 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/SimpleEditor/PropertyEditors/Views/simpleeditor.html @@ -0,0 +1,29 @@ +
+ + +

{{content.name}}

+http://localhost/{{content.name}} +

{{tab.properties[1].value}}

+
+ + diff --git a/src/Umbraco.Web.UI.Client/src/packages/SimpleEditor/PropertyEditors/js/simpleeditor.js b/src/Umbraco.Web.UI.Client/src/packages/SimpleEditor/PropertyEditors/js/simpleeditor.js new file mode 100644 index 0000000000..37630a55da --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/SimpleEditor/PropertyEditors/js/simpleeditor.js @@ -0,0 +1,6 @@ +(function () { + angular.module("umbraco").controller("Umbraco.Editors.SimpleEditorController", + function ($rootScope, $scope, notificationsService, dialogService) { + + }); +})(); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/packages/SimpleEditor/package.manifest b/src/Umbraco.Web.UI.Client/src/packages/SimpleEditor/package.manifest new file mode 100644 index 0000000000..e1047ffe80 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/SimpleEditor/package.manifest @@ -0,0 +1,14 @@ +{ + propertyEditors: [ + { + id: "0BA0F832-D759-4526-9B3E-95BBFC98F82E", + name: "My Simple Editor", + editor: { + view: "~/App_Plugins/SimpleEditor/PropertyEditors/Views/simpleeditor.html" + } + } + ], + javascript: [ + '~/App_Plugins/SimpleEditor/PropertyEditors/Js/SimpleEditor.js' + ] +} \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/packages/property editors/mntp/mntp.html b/src/Umbraco.Web.UI.Client/src/packages/property editors/mntp/mntp.html new file mode 100644 index 0000000000..21fc1837a0 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/property editors/mntp/mntp.html @@ -0,0 +1,18 @@ +
+ + +

+
\ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/packages/property editors/mntp/mntp.js b/src/Umbraco.Web.UI.Client/src/packages/property editors/mntp/mntp.js new file mode 100644 index 0000000000..65395bcb2f --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/property editors/mntp/mntp.js @@ -0,0 +1,16 @@ +//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("uComponents.Editors.MNTPController", + function($scope, dialogService){ + + alert("node!"); + + $scope.openContentPicker =function(value){ + var d = dialogService.contentPicker({scope: $scope, callback: populate}); + }; + + function populate(data){ + $scope.model.value = data.selection; + } +}); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/packages/property editors/package.manifest b/src/Umbraco.Web.UI.Client/src/packages/property editors/package.manifest new file mode 100644 index 0000000000..6fd9ba44bf --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/property editors/package.manifest @@ -0,0 +1,15 @@ +{ + propertyEditors: [ + { + id: "7e062c13-7c41-4ad9-b389-41d88aeef87c", + name: "Multinode treepicker", + editor: { + view: "~/App_Plugins/property editors/mntp/mntp.html" + } + } + ] + , + javascript: [ + '~/App_Plugins/property editors/mntp/mntp.js' + ] +} \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js index 3d330a758f..96fa452a2c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js @@ -33,10 +33,7 @@ angular.module("umbraco") var imagePropVal = umbImageHelper.getImagePropertyVaue({imageModel: img, scope: $scope}); var data = { - src: (imagePropVal != null && imagePropVal != "") - ? imagePropVal - : "nothing.jpg", - style: 'width: 100px; height: 100px', + src: (imagePropVal != null && imagePropVal != "") ? imagePropVal: "nothing.jpg", id: '__mcenew' }; diff --git a/src/Umbraco.Web.UI/umbraco/masterpages/umbracoDialog.Master b/src/Umbraco.Web.UI/umbraco/masterpages/umbracoDialog.Master index 4d8d1cee79..599bb9ac5b 100644 --- a/src/Umbraco.Web.UI/umbraco/masterpages/umbracoDialog.Master +++ b/src/Umbraco.Web.UI/umbraco/masterpages/umbracoDialog.Master @@ -10,7 +10,7 @@ - + @@ -18,20 +18,18 @@ + - -
- diff --git a/src/Umbraco.Web.UI/umbraco/masterpages/umbracoPage.Master b/src/Umbraco.Web.UI/umbraco/masterpages/umbracoPage.Master index f9c061eb12..bd5cd28fe7 100644 --- a/src/Umbraco.Web.UI/umbraco/masterpages/umbracoPage.Master +++ b/src/Umbraco.Web.UI/umbraco/masterpages/umbracoPage.Master @@ -26,6 +26,7 @@ + diff --git a/src/Umbraco.Web.UI/umbraco/settings/scripts/editScript.aspx b/src/Umbraco.Web.UI/umbraco/settings/scripts/editScript.aspx index d9ee1f6a9f..4fce8917f4 100644 --- a/src/Umbraco.Web.UI/umbraco/settings/scripts/editScript.aspx +++ b/src/Umbraco.Web.UI/umbraco/settings/scripts/editScript.aspx @@ -39,19 +39,23 @@ - - + + + + + + + + - - - + - + diff --git a/src/Umbraco.Web.UI/umbraco/settings/stylesheet/editstylesheet.aspx b/src/Umbraco.Web.UI/umbraco/settings/stylesheet/editstylesheet.aspx index 5ed8dd435e..90fdc33385 100644 --- a/src/Umbraco.Web.UI/umbraco/settings/stylesheet/editstylesheet.aspx +++ b/src/Umbraco.Web.UI/umbraco/settings/stylesheet/editstylesheet.aspx @@ -36,17 +36,21 @@ - + + + + + + + + - - - - + diff --git a/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx b/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx index 2253dae9cc..403875452d 100644 --- a/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx +++ b/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx @@ -52,7 +52,14 @@ - + + + + + + + + @@ -67,11 +74,10 @@ - - - - + - + + + diff --git a/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx.cs b/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx.cs index b0f9b57c7e..9fea5e1f51 100644 --- a/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx.cs +++ b/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx.cs @@ -21,7 +21,7 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views public partial class EditView : global::umbraco.BasePages.UmbracoEnsuredPage { private Template _template; - protected MenuIconI SaveButton; + public MenuButton SaveButton; public EditView() { @@ -151,11 +151,20 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views } Panel1.hasMenu = true; + var editor = Panel1.NewTabPage(ui.Text("template")); + editor.Controls.Add(Pane8); + + var props = Panel1.NewTabPage(ui.Text("properties")); + props.Controls.Add(Pane7); + + + SaveButton = Panel1.Menu.NewButton(); + SaveButton.Icon = "save"; + SaveButton.OnClientClick = "doSubmit()"; + SaveButton.Text = ui.Text("save"); + SaveButton.ButtonType = MenuButtonType.Primary; + SaveButton.ID = "save"; - SaveButton = Panel1.Menu.NewIcon(); - SaveButton.ImageURL = SystemDirectories.Umbraco + "/images/editor/save.gif"; - SaveButton.AltText = ui.Text("save"); - SaveButton.ID = "save"; Panel1.Text = ui.Text("edittemplate"); pp_name.Text = ui.Text("name", base.getUser()); @@ -163,8 +172,7 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views pp_masterTemplate.Text = ui.Text("mastertemplate", base.getUser()); // Editing buttons - Panel1.Menu.InsertSplitter(); - MenuIconI umbField = Panel1.Menu.NewIcon(); + MenuIconI umbField = editorSource.Menu.NewIcon(); umbField.ImageURL = UmbracoPath + "/images/editor/insField.gif"; umbField.OnClickCommand = ClientTools.Scripts.OpenModalWindow( @@ -174,7 +182,7 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views // TODO: Update icon - MenuIconI umbDictionary = Panel1.Menu.NewIcon(); + MenuIconI umbDictionary = editorSource.Menu.NewIcon(); umbDictionary.ImageURL = GlobalSettings.Path + "/images/editor/dictionaryItem.gif"; umbDictionary.OnClickCommand = ClientTools.Scripts.OpenModalWindow( @@ -188,7 +196,7 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views ClientCallbackInsertMacroMarkup = "function(alias) {editViewEditor.insertMacroMarkup(alias);}", ClientCallbackOpenMacroModel = "function(alias) {editViewEditor.openMacroModal(alias);}" }; - Panel1.Menu.InsertNewControl(macroSplitButton, 40); + editorSource.Menu.InsertNewControl(macroSplitButton, 40); if (_template == null) { diff --git a/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx.designer.cs b/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx.designer.cs index 3ed3a392b9..4f523639a3 100644 --- a/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx.designer.cs +++ b/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx.designer.cs @@ -28,7 +28,34 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views { /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::umbraco.uicontrols.UmbracoPanel Panel1; + protected global::umbraco.uicontrols.TabView Panel1; + + /// + /// Pane8 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::umbraco.uicontrols.Pane Pane8; + + /// + /// pp_source control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::umbraco.uicontrols.PropertyPanel pp_source; + + /// + /// editorSource control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::umbraco.uicontrols.CodeArea editorSource; /// /// Pane7 control. @@ -92,23 +119,5 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.DropDownList MasterTemplate; - - /// - /// pp_source control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.PropertyPanel pp_source; - - /// - /// editorSource control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.CodeArea editorSource; } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/scripts/editScript.aspx b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/scripts/editScript.aspx index 14d049c27d..089f28ea47 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/scripts/editScript.aspx +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/scripts/editScript.aspx @@ -34,20 +34,23 @@ - + + + + + + - - - + - +