Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }