示例#1
0
文件: Packager.cs 项目: PavelPZ/REW
 static IEnumerable<IEnumerable<string>> htmlNewEA(ConfigLow cfg) {
   yield return Consts.htmlJsLib;
   if (cfg.target == Targets.web) yield return Consts.htmlLogin;
   if (cfg.target == Targets.web) yield return Consts.htmlAdmin;
   yield return Consts.htmlCourse;
   yield return Consts.htmlSchool;
 }
示例#2
0
文件: Packager.cs 项目: PavelPZ/REW
 //Files z q:\LMCom\rew\Web4\JsLib\EA\img\, q:\LMCom\rew\Web4\JsLib\css\img\, Schools\EAImgMp3\framework\controls\symbols, 
 static IEnumerable<IEnumerable<string>> cssBitmaps(ConfigLow cfg) {
   yield return new string[] { @"JsLib\EA\img", @"JsLib\css\img", @"Schools\EAImgMp3\framework\controls\symbols", /*@"BS3\fonts\",*/ @"font-awesome\font\" }.
     Select(pth => Directory.CreateDirectory(basicPath + pth)).
     SelectMany(d => d.EnumerateFiles().Select(f => f.DirectoryName.Substring(basicPath.Length) + "\\" + f.Name));
 }
示例#3
0
文件: Packager.cs 项目: PavelPZ/REW
 static IEnumerable<IEnumerable<string>> cssIE7(ConfigLow cfg) {
   switch (cfg.version) {
     case versions.debug:
       yield return Consts.cssBootstrapIE7;
       break;
     case versions.minified:
     case versions.not_minified:
       yield return new string[] { cssMinifiedIE7 + (cfg.version == versions.minified ? ".min" : null) + ".css" };
       break;
   }
 }
示例#4
0
文件: Packager.cs 项目: PavelPZ/REW
 static IEnumerable<IEnumerable<string>> cssNewEA(ConfigLow cfg) {
   switch (cfg.version) {
     case versions.debug:
       yield return Consts.cssBootstrap;
       yield return Consts.cssFontAwesome;
       yield return Consts.cssEA;
       yield return Consts.cssJsLib;
       if (cfg.target == Targets.web) yield return Consts.cssLogin;
       if (cfg.target == Targets.web) yield return Consts.cssAdmin;
       yield return Consts.cssCourse;
       yield return Consts.cssSchool;
       break;
     case versions.minified:
     case versions.not_minified:
       yield return cssMinifiedEx[cfg.target].Select(m => m + (cfg.version == versions.minified ? ".min" : null) + ".css");
       break;
   }
 }
示例#5
0
文件: Packager.cs 项目: PavelPZ/REW
 static IEnumerable<IEnumerable<string>> jsNewEA(ConfigLow cfg) {
   switch (cfg.version) {
     case versions.debug:
       yield return Consts.jsExternal;
       yield return Consts.jsModel;
       if (cfg.target == Targets.web) yield return Consts.jsLogin;
       if (cfg.target == Targets.web) yield return Consts.jsAdmin;
       if (cfg.target == Targets.scorm) yield return Consts.jsScorm;
       yield return Consts.jsCourse;
       yield return Consts.jsSchool;
       yield return Consts.jsEA;
       break;
     case versions.minified:
     case versions.not_minified:
       yield return jsMinifiedEx[cfg.target].Select(m => m + (cfg.version == versions.minified ? ".min" : null) + ".js");
       break;
   }
 }
示例#6
0
文件: Packager.cs 项目: PavelPZ/REW
 static void cssMinify(ConfigLow cfg, string resultFn, params string[][] groups) {
   StringBuilder sb = new StringBuilder();
   foreach (var fn in groups.Where(g => g != null).SelectMany(g => g)) sb.AppendLine(File.ReadAllText(basicPath + fn));
   writeFile(basicPath + resultFn + ".css", sb.ToString());
   var comp = new CssCompressor().Compress(sb.ToString());
   writeFile(basicPath + resultFn + ".min.css", comp);
 }
示例#7
0
文件: Packager.cs 项目: PavelPZ/REW
 static void jsMinify(ConfigLow cfg, string resultFn, StringBuilder err, params string[][] groups) {
   StringBuilder sb = new StringBuilder();
   foreach (var fn in groups.Where(g => g != null).SelectMany(g => g)) sb.AppendLine(File.ReadAllText(basicPath + fn));
   writeFile(basicPath + resultFn + ".js", sb.ToString());
   var comp = new JavaScriptCompressor() { ErrorReporter = new JSErrorReporter(resultFn, err) }.Compress(sb.ToString());
   writeFile(basicPath + resultFn + ".min.js", comp);
 }
示例#8
0
文件: Packager.cs 项目: PavelPZ/REW
 //Common files: CSS, JS, CSS bitmaps
 static IEnumerable<Consts.file> commonFiles(ConfigLow cfg) {
   return cssNewEA(cfg).Concat(jsNewEA(cfg)).Concat(cssBitmaps(cfg)).SelectMany(s => s).Select(fn => new Consts.file(fn));
 }
示例#9
0
文件: Packager.cs 项目: PavelPZ/REW
 static string langInclude(ConfigLow cfg) { //Include lang JS souboru do home stranky
   if (cfg.target == Targets.web) {
     return cfg.lang == null ? null : string.Format(cLangFiles, cfg.langStr);
   }
   return string.Format(cLangFiles, "{#lang}");
 }