V8: kill usercontrol support, cleanup macros (#4329)
This commit is contained in:
committed by
Sebastiaan Janssen
parent
74a1bb9123
commit
2036da5e84
@@ -40,7 +40,7 @@ function macroService() {
|
||||
|
||||
/**
|
||||
* @ngdoc function
|
||||
* @name umbraco.services.macroService#generateWebFormsSyntax
|
||||
* @name umbraco.services.macroService#generateMacroSyntax
|
||||
* @methodOf umbraco.services.macroService
|
||||
* @function
|
||||
*
|
||||
@@ -82,35 +82,6 @@ function macroService() {
|
||||
|
||||
return macroString;
|
||||
},
|
||||
|
||||
/**
|
||||
* @ngdoc function
|
||||
* @name umbraco.services.macroService#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 = '<umbraco:Macro ';
|
||||
|
||||
if (args.macroParamsDictionary) {
|
||||
|
||||
_.each(args.macroParamsDictionary, function (val, key) {
|
||||
var keyVal = key + "=\"" + (val ? val : "") + "\" ";
|
||||
macroString += keyVal;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
macroString += "Alias=\"" + args.macroAlias + "\" runat=\"server\"></umbraco:Macro>";
|
||||
|
||||
return macroString;
|
||||
},
|
||||
|
||||
/**
|
||||
* @ngdoc function
|
||||
@@ -180,10 +151,7 @@ function macroService() {
|
||||
});
|
||||
|
||||
//get the syntax based on the rendering engine
|
||||
if (renderingEngine && renderingEngine === "WebForms") {
|
||||
syntax = this.generateWebFormsSyntax({ macroAlias: macroAlias, macroParamsDictionary: paramDictionary });
|
||||
}
|
||||
else if (renderingEngine && renderingEngine === "Mvc") {
|
||||
if (renderingEngine && renderingEngine === "Mvc") {
|
||||
syntax = this.generateMvcSyntax({ macroAlias: macroAlias, macroParamsDictionary: paramDictionary });
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -108,34 +108,6 @@ describe('macro service tests', function () {
|
||||
toBe("<?UMBRACO_MACRO macroAlias=\"myMacro\" />");
|
||||
|
||||
});
|
||||
|
||||
it('can generate syntax for webforms', function () {
|
||||
|
||||
var syntax = macroService.generateWebFormsSyntax({
|
||||
macroAlias: "myMacro",
|
||||
macroParamsDictionary: {
|
||||
param1: "value1",
|
||||
param2: "value2",
|
||||
param3: "value3"
|
||||
}
|
||||
});
|
||||
|
||||
expect(syntax).
|
||||
toBe("<umbraco:Macro param1=\"value1\" param2=\"value2\" param3=\"value3\" Alias=\"myMacro\" runat=\"server\"></umbraco:Macro>");
|
||||
|
||||
});
|
||||
|
||||
it('can generate syntax for webforms with no params', function () {
|
||||
|
||||
var syntax = macroService.generateWebFormsSyntax({
|
||||
macroAlias: "myMacro",
|
||||
macroParamsDictionary: {}
|
||||
});
|
||||
|
||||
expect(syntax).
|
||||
toBe("<umbraco:Macro Alias=\"myMacro\" runat=\"server\"></umbraco:Macro>");
|
||||
|
||||
});
|
||||
|
||||
it('can generate syntax for MVC', function () {
|
||||
|
||||
@@ -167,4 +139,4 @@ describe('macro service tests', function () {
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user