diff --git a/src/Umbraco.Web.UI.Client/lib/umbraco/LegacyUmbClientMgr.js b/src/Umbraco.Web.UI.Client/lib/umbraco/LegacyUmbClientMgr.js index 5ff0db913a..ab0458ed46 100644 --- a/src/Umbraco.Web.UI.Client/lib/umbraco/LegacyUmbClientMgr.js +++ b/src/Umbraco.Web.UI.Client/lib/umbraco/LegacyUmbClientMgr.js @@ -175,7 +175,7 @@ Umbraco.Sys.registerNamespace("Umbraco.Application"); }, /** This is used to launch an angular based modal window instead of the legacy window */ - openAngularModalWindow: function (options, onCloseCallback) { + openAngularModalWindow: function (options) { //get our angular navigation service var injector = getRootInjector(); @@ -249,8 +249,6 @@ Umbraco.Sys.registerNamespace("Umbraco.Application"); //instead of calling just the dialog service we funnel it through the global //event emitter getRootScope().$emit("closeDialogs", event); - - //dialogService.closeAll(rVal); } }, _debug: function(strMsg) { 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 af086eb608..5c370fcde1 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 @@ -38,8 +38,6 @@ angular.module('umbraco.services') for (var i = 0; i < dialogs.length; i++) { var dialog = dialogs[i]; dialog.close(args); - - //removeDialog(dialog, args); dialogs.splice(i, 1); } } @@ -266,10 +264,8 @@ angular.module('umbraco.services') */ close: function (dialog, args) { if(dialog){ - dialog.close(); - } - - //removeDialog(dialog, args); + dialog.close(args); + } }, /** diff --git a/src/Umbraco.Web.UI.Client/src/common/services/macro.service.js b/src/Umbraco.Web.UI.Client/src/common/services/macro.service.js new file mode 100644 index 0000000000..9a1f4b7483 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/common/services/macro.service.js @@ -0,0 +1,79 @@ +/** + * @ngdoc service + * @name umbraco.services.macroService + * + * + * @description + * A service to return macro information such as generating syntax to insert a macro into an editor + */ +function macroService() { + + return { + + /** + * @ngdoc function + * @name generateWebFormsSyntax + * @methodOf umbraco.services.macroService + * @function + * + * @description + * generates the syntax for inserting a macro into a webforms templates + * + * @param {object} args an object containing the macro alias and it's parameter values + */ + generateWebFormsSyntax: function(args) { + + var macroString = '"; + + return macroString; + }, + + /** + * @ngdoc function + * @name generateMvcSyntax + * @methodOf umbraco.services.macroService + * @function + * + * @description + * generates the syntax for inserting a macro into an mvc template + * + * @param {object} args an object containing the macro alias and it's parameter values + */ + generateMvcSyntax: function (args) { + + var macroString = "@Umbraco.RenderMacro(\"" + args.macroAlias + "\""; + + if (args.macroParams && args.macroParams.length > 0) { + macroString += ", new {"; + for (var i = 0; i < args.macroParams.length; i++) { + + var keyVal = args.macroParams[i].alias + "=\"" + (args.macroParams[i].value ? args.macroParams[i].value : "") + "\""; + + macroString += keyVal; + + if (i < args.macroParams.length - 1) { + macroString += ", "; + } + } + macroString += "}"; + } + + macroString += ")"; + return macroString; + } + + }; + +} + +angular.module('umbraco.services').factory('macroService', macroService); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/common/services/util.service.js b/src/Umbraco.Web.UI.Client/src/common/services/util.service.js index fe70bf67c8..f3d9f1498a 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/util.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/util.service.js @@ -28,41 +28,38 @@ angular.module('umbraco.services').factory('legacyJsLoader', legacyJsLoader); function umbPropEditorHelper() { return { /** - * @ngdoc function - * @name getImagePropertyValue - * @methodOf umbraco.services.umbPropertyEditorHelper - * @function - * - * @description - * Returns the correct view path for a property editor, it will detect if it is a full virtual path but if not then default to the internal umbraco one - * - * @param {string} input the view path currently stored for the property editor - */ - getViewPath: function (input, isPreValue) { + * @ngdoc function + * @name getImagePropertyValue + * @methodOf umbraco.services.umbPropertyEditorHelper + * @function + * + * @description + * Returns the correct view path for a property editor, it will detect if it is a full virtual path but if not then default to the internal umbraco one + * + * @param {string} input the view path currently stored for the property editor + */ + getViewPath: function(input, isPreValue) { var path = String(input); if (path.startsWith('/')) { //This is an absolute path, so just leave it return path; - } - else { - + } else { + if (path.indexOf("/") >= 0) { //This is a relative path, so just leave it return path; - } - else { + } else { if (!isPreValue) { //i.e. views/propertyeditors/fileupload/fileupload.html return "views/propertyeditors/" + path + "/" + path + ".html"; - } - else { + } else { //i.e. views/prevalueeditors/requiredfield.html return "views/prevalueeditors/" + path + ".html"; } } - + } } }; diff --git a/src/Umbraco.Web.UI.Client/src/views/directives/umb-editor.html b/src/Umbraco.Web.UI.Client/src/views/directives/umb-editor.html index 3cb344e6fe..cb7f084650 100644 --- a/src/Umbraco.Web.UI.Client/src/views/directives/umb-editor.html +++ b/src/Umbraco.Web.UI.Client/src/views/directives/umb-editor.html @@ -1,3 +1,3 @@ -
- +
+
\ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/textarea.html b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/textarea.html index 2321f3dd8d..ed4c1490d2 100644 --- a/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/textarea.html +++ b/src/Umbraco.Web.UI.Client/src/views/prevalueeditors/textarea.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.html index c07baa10f1..4b6d47b459 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.html @@ -1,4 +1,4 @@ -
+