Added the rest of the standard rel attributes to HTMLBuilder.

This commit is contained in:
Relintai 2022-02-06 14:41:23 +01:00
parent 3a834204d8
commit 02563831fc
2 changed files with 90 additions and 3 deletions

View File

@ -559,6 +559,78 @@ HTMLTag *HTMLTag::rel_stylesheet() {
return this;
}
HTMLTag *HTMLTag::rel_alternate() {
attrib("rel", "alternate");
return this;
}
HTMLTag *HTMLTag::rel_author() {
attrib("rel", "author");
return this;
}
HTMLTag *HTMLTag::rel_bookmark() {
attrib("rel", "bookmark");
return this;
}
HTMLTag *HTMLTag::rel_external() {
attrib("rel", "external");
return this;
}
HTMLTag *HTMLTag::rel_help() {
attrib("rel", "help");
return this;
}
HTMLTag *HTMLTag::rel_next() {
attrib("rel", "next");
return this;
}
HTMLTag *HTMLTag::rel_nofollow() {
attrib("rel", "nofollow");
return this;
}
HTMLTag *HTMLTag::rel_noopener() {
attrib("rel", "noopener");
return this;
}
HTMLTag *HTMLTag::rel_noreferrer() {
attrib("rel", "noreferrer");
return this;
}
HTMLTag *HTMLTag::rel_prev() {
attrib("rel", "prev");
return this;
}
HTMLTag *HTMLTag::rel_search() {
attrib("rel", "search");
return this;
}
HTMLTag *HTMLTag::rel_tag() {
attrib("rel", "tag");
return this;
}
HTMLTag *HTMLTag::charset(const String &val) {
attrib("charset", val);
@ -2690,7 +2762,7 @@ HTMLBuilder *HTMLBuilder::input_checkbox(const String &name, const String &value
}
t->checked(checked);
return this;
}
@ -3236,7 +3308,7 @@ HTMLBuilder *HTMLBuilder::input_hidden(const String &name, const String &value)
HTMLBuilder *HTMLBuilder::csrf_token(const String &token) {
if (token == "") {
//don't waste html characters if it's an empty string anyway
// don't waste html characters if it's an empty string anyway
return this;
}

View File

@ -119,8 +119,23 @@ public:
HTMLTag *type(const String &val);
HTMLTag *placeholder(const String &val);
HTMLTag *fora(const String &val); // for attrib -> for is reserved keyword
HTMLTag *rel(const String &val);
HTMLTag *rel_stylesheet();
HTMLTag *rel_alternate();
HTMLTag *rel_author();
HTMLTag *rel_bookmark();
HTMLTag *rel_external();
HTMLTag *rel_help();
HTMLTag *rel_license();
HTMLTag *rel_next();
HTMLTag *rel_nofollow();
HTMLTag *rel_noopener();
HTMLTag *rel_noreferrer();
HTMLTag *rel_prev();
HTMLTag *rel_search();
HTMLTag *rel_tag();
HTMLTag *charset(const String &val);
HTMLTag *charset_utf_8();
@ -453,7 +468,7 @@ public:
HTMLTag *form_post();
HTMLBuilder *form_get(const String &action, const String &cls = "", const String &id = "");
HTMLBuilder *form_post(const String &action, const String &cls = "", const String &id = "");
//will add a csrf token from request
// will add a csrf token from request
HTMLBuilder *form_post(const String &action, Request *request, const String &cls = "", const String &id = "");
HTMLTag *input_button();