public LoadedContent LoadFeatures(string xmlFile) { var csscontent = new LoadedContent(); string xmlcontent = File.ReadAllText(string.Concat(CSS_BASE_DIR, xmlFile)); XmlDocument doc = new XmlDocument(); doc.LoadXml(xmlcontent); XmlNodeList files = doc.GetElementsByTagName("files"); StringBuilder sb = new StringBuilder(); foreach (XmlElement file in files) { XmlNodeList links = file.GetElementsByTagName("link"); foreach (XmlElement link in links) { String source = link.Attributes["href"].Value; string filename = string.Concat(CSS_BASE_DIR, source); csscontent.filenames.Add(filename); string content = File.ReadAllText(filename); sb.Append(content); } } #if DEBUG csscontent.content = sb.ToString(); #else csscontent.content = MyMin.parse(sb.ToString(), false, true); #endif return(csscontent); }
public LoadedContent LoadFeatures(string featurePath, string xmlFile) { var jscontent = new LoadedContent(); string xmlcontent = File.ReadAllText(string.Concat(JAVASCRIPT_BASE_DIR, featurePath, "/", xmlFile)); XmlDocument doc = new XmlDocument(); doc.LoadXml(xmlcontent); XmlNodeList files = doc.GetElementsByTagName("files"); StringBuilder sb = new StringBuilder(); foreach (XmlElement file in files) { XmlNodeList libraries = file.GetElementsByTagName("script"); foreach (XmlElement script in libraries) { String source = script.Attributes["src"].Value; string filename = string.Concat(JAVASCRIPT_BASE_DIR, featurePath, "/", source); jscontent.filenames.Add(filename); string content = File.ReadAllText(filename); sb.Append(content); } } #if DEBUG jscontent.content = sb.ToString(); #else // can't use closure at the moment because it messes up jqgrid jscontent.content = MyMin.parse(sb.ToString(), false, false); #endif return(jscontent); }
public string LoadViewJavascript(string path) { var jslocation = string.Concat(JAVASCRIPT_BASE_DIR, path, ".js"); string jscontent = File.ReadAllText(jslocation); #if DEBUG return(jscontent); #else //string minified = compress.getJSMachine(jscontent); string minified = MyMin.parse(jscontent, false, false); return(minified); #endif }
static public System.String parse(System.String input) { return(MyMin.parse(input, true)); }