public static void Beautify(Element elem, string identifier, MatchOptions2 Options2) { if (elem == null) { return; } if (identifier == "ignore") { return; } Init(); string padyam = CleanHTML(elem.InnerHTML.ToUpperCase()); string html = ""; if (Options2 == null) { Options2 = MapRules.DefaultOptions(); } html = (identifier == null || identifier == "") ? Determine(padyam, Options2) : TryMatch(padyam, identifier, Options2); if (html != "") { elem.InnerHTML = "<div class='formatted'>" + html + "</div>" + "<div class='orginal'>" + elem.InnerHTML + "</div>"; } Element Close = Util.FindByClass(elem, "open"); if (Close == null) { return; } Util.RegisterClick3(Close, delegate(ElementEvent ee) { Element Anchor = ee.Target.ParentNode.ParentNode; Element Target = Util.FindByClass(Anchor, "ganaVibhajana"); OverlayDialog OD = new OverlayDialog("", Target.InnerHTML); OD.FooterText = "ఛందం<sup class='copyright'>©</sup> తో పద్యసాహిత్యం మరింత రసమయం..!! [<a target='_blank' href='http://chandam.apphb.com'>http://chandam.apphb.com</a>]"; OD.ShowClose = false; OD.Show(); }); }
public static void BeautifyAll(string identifier, Element parent, MatchOptions2 Options2) { ElementCollection List = (parent == null) ? Document.GetElementsByTagName("*") : parent.GetElementsByTagName("*"); if (List == null) { return; } Element[] L = new Element[List.Length]; for (int i = 0; i < List.Length; i++) { L[i] = List[i]; } if (Options2 == null) { Options2 = MapRules.DefaultOptions(); Options2.ShowGV = true; } for (int i = 0; i < L.Length; i++) { Element elem = L[i]; string chandam = (string)elem.GetAttribute("chandam"); string identifier2 = (string)elem.GetAttribute("chandassu"); if (chandam == "0") { continue; } if (chandam == "1" || identifier2 != "") { if (identifier2 != null && identifier2 != "") { Beautify(elem, identifier2, Options2); } else { Beautify(elem, identifier, Options2); } } } }
public static void BeautifyTags(string tag, string identifier, MatchOptions2 Options2) { ElementCollection List = Document.GetElementsByTagName(tag); Element[] L = new Element[List.Length]; for (int i = 0; i < List.Length; i++) { L[i] = List[i]; } if (Options2 == null) { Options2 = MapRules.DefaultOptions(); Options2.ShowGV = true; } foreach (Element e in L) { if (e.TagName.ToLowerCase() == "div") { return; } Beautify(e, identifier, Options2); } }