Example #1
0
 public static string ReplaceAlertToken(string script)
 {
     if (TokenUtils.IsAlertToken(script))
     {
         script = string.Format(ScriptManager.FunctionTemplate, string.Concat("Ext.Msg.alert(", script.Substring(0, script.Length - 1).Substring(2), ");"));
     }
     return(script);
 }
Example #2
0
        public static string ParseTokens(string script, Control seed)
        {
            if (seed == null)
            {
                seed = TokenUtils.Page;
            }

            bool isRaw = (
                TokenUtils.IsAlertToken(script) ||
                TokenUtils.IsRawToken(script) ||
                TokenUtils.IsSelectToken(script));

            script = TokenUtils.ReplaceIDTokens(script, seed);
            script = TokenUtils.ReplaceSelectTokens(script);

            script = TokenUtils.ReplaceAlertToken(script);
            script = TokenUtils.ReplaceRawToken(script);
            script = TokenUtils.ReplaceFunctionToken(script);

            return((isRaw || TokenUtils.IsFunction(script)) ? string.Concat("<raw>", script) : script);
        }