Got tree menu items loading async so the menu is not part of the treenode json. Created docs for using Umbraco resources and how to use promises properly. Created a helper: angularHelper.resourcePromise for use with all of our resources (still need to convert the rest). Got the legacy tree data working with seperate requests for menu items (not too easy!)

This commit is contained in:
Shannon
2013-07-09 18:51:45 +10:00
parent 371a0cc65a
commit a6acb4c558
19 changed files with 632 additions and 244 deletions

View File

@@ -28,6 +28,33 @@ namespace Umbraco.Core
[UmbracoWillObsolete("Do not use this constants. See IShortStringHelper.CleanStringForSafeAliasJavaScriptCode.")]
public const string UmbracoInvalidFirstCharacters = "01234567890";
/// <summary>
/// This will append the query string to the URL
/// </summary>
/// <param name="url"></param>
/// <param name="queryStrings"></param>
/// <returns></returns>
/// <remarks>
/// This methods ensures that the resulting URL is structured correctly, that there's only one '?' and that things are
/// delimited properly with '&'
/// </remarks>
internal static string AppendQueryStringToUrl(this string url, params string[] queryStrings)
{
//remove any prefixed '&' or '?'
for (var i = 0; i < queryStrings.Length; i++)
{
queryStrings[i] = queryStrings[i].TrimStart('?', '&').TrimEnd('&');
}
var nonEmpty = queryStrings.Where(x => !x.IsNullOrWhiteSpace()).ToArray();
if (url.Contains("?"))
{
return url + string.Join("&", nonEmpty).EnsureStartsWith('&');
}
return url + string.Join("&", nonEmpty).EnsureStartsWith('?');
}
/// <summary>
/// Encrypt the string using the MachineKey in medium trust
/// </summary>