private static Element Call(bool register, string name, params object[] arguments) { if (register) { DomHelper.RegisterScript(name, arguments); return(null); } return(DomHelper.ReturnElement(name, arguments)); }
/// <summary> /// Creates new DOM element(s) and overwrites the contents of el with them. /// </summary> /// <param name="el">The context element</param> /// <param name="o">The DOM object spec (and children)</param> public static Element Overwrite(Element el, string o) { return(DomHelper.Call(false, "overwrite", new JRawValue(el.Descriptor), o, true)); }
/// <summary> /// Creates new DOM element(s) and overwrites the contents of el with them. /// </summary> /// <param name="el">The context element</param> /// <param name="o">The DOM object spec (and children)</param> public static Element Overwrite(Element el, DomObject o) { return(DomHelper.Call(false, "overwrite", new JRawValue(el.Descriptor), new JRawValue(o.Serialize()), true)); }
/// <summary> /// Creates new DOM element(s) and inserts them as the first child of el. /// </summary> /// <param name="el">The context element</param> /// <param name="o">The DOM object spec (and children)</param> public static Element InsertFirst(Element el, string o) { return(DomHelper.Call(false, "insertFirst", new JRawValue(el.Descriptor), o, true)); }
/// <summary> /// Creates new DOM element(s) and inserts them as the first child of el. /// </summary> /// <param name="el">The context element</param> /// <param name="o">The DOM object spec (and children)</param> public static Element InsertFirst(Element el, DomObject o) { return(DomHelper.Call(false, "insertFirst", new JRawValue(el.Descriptor), new JRawValue(o.Serialize()), true)); }
/// <summary> /// Applies a style specification to an element. /// </summary> /// <param name="el">The element to apply styles to</param> /// <param name="styles">A style specification.</param> public static void ApplyStyles(Element el, Dictionary <string, string> styles) { DomHelper.Call(true, "applyStyles", new JRawValue(el.Descriptor), styles); }
/// <summary> /// Creates new DOM element(s) and appends them to el. /// </summary> /// <param name="el">The context element</param> /// <param name="o">Raw HTML blob</param> public static Element Append(Element el, string o) { return(DomHelper.Call(false, "append", new JRawValue(el.Descriptor), o, true)); }
/// <summary> /// Creates new DOM element(s) and appends them to el. /// </summary> /// <param name="el">The context element</param> /// <param name="o">The DOM object spec (and children) or raw HTML blob</param> public static Element Append(Element el, DomObject o) { return(DomHelper.Call(false, "append", new JRawValue(el.Descriptor), new JRawValue(new ClientConfig().Serialize(o)), true)); }