1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 05:25:56 +00:00

bookmarklets: cleanup

This commit is contained in:
Andrew Dolgov
2021-02-18 13:16:55 +03:00
parent 75435aa960
commit a2c75257f1
2 changed files with 40 additions and 35 deletions

View File

@@ -23,7 +23,7 @@
}
function button_tag(string $value, string $type, array $attributes = []) {
return "<button dojoType=\"dijit.form.Button\" ".attributes_to_string($attributes)." type=\"$type\">".htmlspecialchars($value)."</button>";
return "<button dojoType=\"dijit.form.Button\" ".attributes_to_string($attributes)." type=\"$type\">$value</button>";
}
function submit_tag(string $value, array $attributes = []) {
@@ -34,6 +34,10 @@
return button_tag($value, "", array_merge(["onclick" => "App.dialogOf(this).hide()"], $attributes));
}
function icon(string $icon, array $attributes = []) {
return "<i class=\"material-icons\" ".attributes_to_string($attributes).">$icon</i>";
}
function select_tag(string $name, $value, array $values, array $attributes = [], string $id = "") {
$attributes_str = attributes_to_string($attributes);
$dojo_type = strpos($attributes_str, "dojoType") === false ? "dojoType='fox.form.Select'" : "";