Added helpers for input type to HTMLTag.

This commit is contained in:
Relintai 2021-11-16 11:28:30 +01:00
parent 70ffbbae20
commit fd3c3b298e
2 changed files with 134 additions and 0 deletions

View File

@ -110,6 +110,117 @@ HTMLTag *HTMLTag::charset_utf_8() {
return this;
}
HTMLTag *HTMLTag::itbutton() {
attrib("type", "button");
return this;
}
HTMLTag *HTMLTag::itcheckbox() {
attrib("type", "checkbox");
return this;
}
HTMLTag *HTMLTag::itcolor() {
attrib("type", "color");
return this;
}
HTMLTag *HTMLTag::itdate() {
attrib("type", "date");
return this;
}
HTMLTag *HTMLTag::itdatetime_local() {
attrib("type", "datetime_local");
return this;
}
HTMLTag *HTMLTag::itemail() {
attrib("type", "email");
return this;
}
HTMLTag *HTMLTag::itfile() {
attrib("type", "file");
return this;
}
HTMLTag *HTMLTag::ithidden() {
attrib("type", "hidden");
return this;
}
HTMLTag *HTMLTag::itimage() {
attrib("type", "image");
return this;
}
HTMLTag *HTMLTag::itmonth() {
attrib("type", "month");
return this;
}
HTMLTag *HTMLTag::itnumber() {
attrib("type", "number");
return this;
}
HTMLTag *HTMLTag::itpassword() {
attrib("type", "password");
return this;
}
HTMLTag *HTMLTag::itradio() {
attrib("type", "radio");
return this;
}
HTMLTag *HTMLTag::itrange() {
attrib("type", "range");
return this;
}
HTMLTag *HTMLTag::itreset() {
attrib("type", "reset");
return this;
}
HTMLTag *HTMLTag::itsearch() {
attrib("type", "search");
return this;
}
HTMLTag *HTMLTag::itsubmit() {
attrib("type", "submit");
return this;
}
HTMLTag *HTMLTag::ittel() {
attrib("type", "tel");
return this;
}
HTMLTag *HTMLTag::ittext() {
attrib("type", "text");
return this;
}
HTMLTag *HTMLTag::ittime() {
attrib("type", "time");
return this;
}
HTMLTag *HTMLTag::iturl() {
attrib("type", "url");
return this;
}
HTMLTag *HTMLTag::itweek() {
attrib("type", "week");
return this;
}
HTMLTag *HTMLTag::attrib(const String &attr, const String &val) {
result += " " + attr + "=\"" + val + "\"";

View File

@ -30,6 +30,29 @@ public:
HTMLTag *charset(const String &val);
HTMLTag *charset_utf_8();
HTMLTag *itbutton();
HTMLTag *itcheckbox();
HTMLTag *itcolor();
HTMLTag *itdate();
HTMLTag *itdatetime_local();
HTMLTag *itemail();
HTMLTag *itfile();
HTMLTag *ithidden();
HTMLTag *itimage();
HTMLTag *itmonth();
HTMLTag *itnumber();
HTMLTag *itpassword();
HTMLTag *itradio();
HTMLTag *itrange();
HTMLTag *itreset();
HTMLTag *itsearch();
HTMLTag *itsubmit();
HTMLTag *ittel();
HTMLTag *ittext();
HTMLTag *ittime();
HTMLTag *iturl();
HTMLTag *itweek();
HTMLTag *attrib(const String &attr, const String &val);
HTMLTag *start(const String &p_new_tag, const bool p_simple = false);