Exemple #1
0
 public static ScriptElement Script(string srcOrCode) {
     var result = new ScriptElement();
     if (srcOrCode.Contains("{") || srcOrCode.Contains("[")) {
         result.Value = srcOrCode;
     }
     else {
         result.Src = srcOrCode;
     }
     return result;
 }
Exemple #2
0
 public static ScriptElement RequireJs(string main = null, string requireJs = null) {
     if (string.IsNullOrWhiteSpace(requireJs)) {
         requireJs = "scripts/require.js";
     }
     if (string.IsNullOrWhiteSpace(main)) {
         main = "scripts/main.js";
     }
     var result = new ScriptElement {DataMain = main, Src = requireJs};
     return result;
 }
Exemple #3
0
        public static ScriptElement Script(string srcOrCode)
        {
            var result = new ScriptElement();

            if (srcOrCode.Contains("{") || srcOrCode.Contains("["))
            {
                result.Value = srcOrCode;
            }
            else
            {
                result.Src = srcOrCode;
            }
            return(result);
        }
Exemple #4
0
        public static ScriptElement RequireJs(string main = null, string requireJs = null)
        {
            if (string.IsNullOrWhiteSpace(requireJs))
            {
                requireJs = "scripts/require.js";
            }
            if (string.IsNullOrWhiteSpace(main))
            {
                main = "scripts/main.js";
            }
            var result = new ScriptElement {
                DataMain = main, Src = requireJs
            };

            return(result);
        }