private static string ParseDependency(string line) { string path = null; if (line == null) { return(null); } if (line.StartsWith("/// <depends")) { // old way: /// <depends path="$skin/scripts/jquery/jquery.js" /> var startidx = line.IndexOf('"'); var endidx = line.LastIndexOf('"'); path = line.Substring(startidx + 1, endidx - startidx - 1); } else if (line.StartsWith("//")) { // new way: var linePart = line.Substring(2).Trim(); if (linePart.StartsWith(_usingStr)) { // // using $skin/scripts/jquery/jquery.js path = linePart.Substring(_usingStr.Length).Trim(); } else if (linePart.StartsWith(_resourceStr)) { // // resource UserBrowse var className = linePart.Substring(_resourceStr.Length).Trim(); path = ResourceScripter.GetResourceUrl(className); } } return(path); }
// Events ////////////////////////////////////////////////////// protected override void OnInit(EventArgs e) { UITools.AddPickerCss(); UITools.AddScript(UITools.ClientScriptConfigurations.MSAjaxPath); UITools.AddScript(UITools.ClientScriptConfigurations.jQueryPath); UITools.AddScript(UITools.ClientScriptConfigurations.SNWebdavPath); UITools.AddScript(UITools.ClientScriptConfigurations.SNPickerPath); UITools.AddScript(UITools.ClientScriptConfigurations.SNWallPath); UITools.AddScript(ResourceScripter.GetResourceUrl("ActionMenu")); base.OnInit(e); }
private static string ParseDependency(string line) { string path = null; if (line == null) { return(null); } if (line.StartsWith("/// <depends")) { // old way: /// <depends path="$skin/scripts/jquery/jquery.js" /> var startidx = line.IndexOf('"'); var endidx = line.LastIndexOf('"'); path = line.Substring(startidx + 1, endidx - startidx - 1); } else if (line.StartsWith("//")) { // new way: var linePart = line.Substring(2).Trim(); if (linePart.StartsWith(_usingStr)) { // // using $skin/scripts/jquery/jquery.js path = linePart.Substring(_usingStr.Length).Trim(); } else if (linePart.StartsWith(_resourceStr)) { // // resource UserBrowse var className = linePart.Substring(_resourceStr.Length).Trim(); path = ResourceScripter.GetResourceUrl(className); } else { string tempCategory; // template script will be resolved later on-the-fly, when the context is available if (HtmlTemplate.TryParseTemplateCategory(linePart, out tempCategory)) { path = linePart; } } } return(path); }