From 6576809d6bbf17da5cad6e51f94b66fc70f89f70 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 25 Jun 2022 14:33:00 +0200 Subject: [PATCH] Merged override methods to one int HTMLBuilder. --- modules/web/html/html_builder_bind.cpp | 851 ++++++++++++------------- modules/web/html/html_builder_bind.h | 103 +-- 2 files changed, 428 insertions(+), 526 deletions(-) diff --git a/modules/web/html/html_builder_bind.cpp b/modules/web/html/html_builder_bind.cpp index 036e692c5..577170da3 100644 --- a/modules/web/html/html_builder_bind.cpp +++ b/modules/web/html/html_builder_bind.cpp @@ -881,11 +881,34 @@ Ref<_HTMLBuilder> _HTMLBuilder::doctype(const String &val) { return Ref<_HTMLBuilder>(this); } -Ref<_HTMLTag> _HTMLBuilder::a() { +Ref<_HTMLTag> _HTMLBuilder::a(const String &href, const String &cls, const String &id) { write_tag(); - return tag->start("a"); + tag->start("a"); + + if (href != "") { + tag->href(href); + } + + if (cls != "") { + tag->cls(cls); + } + + if (id != "") { + tag->id(id); + } + + return tag; } + +Ref<_HTMLBuilder> _HTMLBuilder::fa(const String &href, const String &body, const String &cls, const String &id) { + a(href, cls, id); + w(body); + ca(); + + return Ref<_HTMLBuilder>(this); +} + Ref<_HTMLTag> _HTMLBuilder::abbr() { write_tag(); @@ -1078,10 +1101,28 @@ Ref<_HTMLTag> _HTMLBuilder::dir() { // Not supported in HTML5. Use