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 @@ + + + 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 @@ +