cleans up a bit of code relating to U4-1412
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
Umbraco.Dialogs.EditMacro.getInstance().init({
|
||||
useAspNetMasterPages: <%=umbraco.UmbracoSettings.UseAspNetMasterPages.ToString().ToLower() %>,
|
||||
codeEditorElementId: "<%=Request.GetItemAsString("objectId")%>",
|
||||
renderingEngine: "<%=Request.GetItemAsString("renderingEngine")%>",
|
||||
renderingEngine: "<%=Request.GetItemAsString("renderingEngine", "Mvc")%>",
|
||||
macroAlias: '<%= _macroAlias %>'
|
||||
});
|
||||
});
|
||||
|
||||
@@ -130,8 +130,9 @@
|
||||
/// <summary>Initializes the class and any UI bindings</summary>
|
||||
|
||||
// Merge options with default
|
||||
this._opts = $.extend({
|
||||
this._opts = $.extend({
|
||||
// Default options go here
|
||||
renderingEngine: "Mvc"
|
||||
}, opts);
|
||||
|
||||
var self = this;
|
||||
@@ -152,8 +153,8 @@
|
||||
updateMacro: function () {
|
||||
|
||||
var macroSyntax = null;
|
||||
//if it is Mvc or empty, then use Mvc
|
||||
if (this._opts.renderingEngine == "Mvc" || this._opts.renderingEngine == "") {
|
||||
|
||||
if (this._opts.renderingEngine == "Mvc") {
|
||||
macroSyntax = this._getMacroSyntaxMvc();
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -16,8 +16,9 @@ namespace Umbraco.Web
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="valueIfNotFound">The value to return if the key is not found in the collection</param>
|
||||
/// <returns></returns>
|
||||
public static string GetItemAsString(this HttpRequest request, string key)
|
||||
public static string GetItemAsString(this HttpRequest request, string key, string valueIfNotFound = "")
|
||||
{
|
||||
return new HttpRequestWrapper(request).GetItemAsString(key);
|
||||
}
|
||||
@@ -27,11 +28,12 @@ namespace Umbraco.Web
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="valueIfNotFound">The value to return if the key is not found in the collection</param>
|
||||
/// <returns></returns>
|
||||
public static string GetItemAsString(this HttpRequestBase request, string key)
|
||||
public static string GetItemAsString(this HttpRequestBase request, string key, string valueIfNotFound = "")
|
||||
{
|
||||
var val = HttpContext.Current.Request[key];
|
||||
return !val.IsNullOrWhiteSpace() ? val : string.Empty;
|
||||
return !val.IsNullOrWhiteSpace() ? val : valueIfNotFound;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user