summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-10-05 00:33:40 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-10-05 00:33:40 (EDT)
commit1d24356e2d1e4ac241873b31ea9d251badf1d58c (patch)
treed00a8e50782144f72db791989e2b1fdfda9020de
parent8b4d08aef9af49ec8b983b7aab71d70d660e411a (diff)
downloadmarquee-1d24356e2d1e4ac241873b31ea9d251badf1d58c.zip
marquee-1d24356e2d1e4ac241873b31ea9d251badf1d58c.tar.gz
marquee-1d24356e2d1e4ac241873b31ea9d251badf1d58c.tar.bz2
mq_html_input_number_i(): New function
-rw-r--r--src/html.c11
-rw-r--r--src/html.h4
2 files changed, 15 insertions, 0 deletions
diff --git a/src/html.c b/src/html.c
index 3738c6f..1255bb4 100644
--- a/src/html.c
+++ b/src/html.c
@@ -545,6 +545,17 @@ mq_html_input_text(const gchar *name, const gchar *label, const gchar *value)
}
gchar *
+mq_html_input_number_i(const gchar *name, const gchar *label,
+ gint min, gint step, gint max, gint value)
+{
+ return g_strdup_printf("<label for=\"%s\"><span>%s</span>"
+ "<input type=\"number\" name=\"%s\" id=\"%s\""
+ " min=\"%d\" step=\"%d\" max=\"%d\" value=\"%d\">"
+ "</label>\n",
+ name, label, name, name, min, step, max, value);
+}
+
+gchar *
mq_html_input_radio(const gchar *name, const gchar *label, gboolean checked)
{
return g_strdup_printf("<label for=\"%s\"><span>%s</span>"
diff --git a/src/html.h b/src/html.h
index cfbbbb9..8dffe85 100644
--- a/src/html.h
+++ b/src/html.h
@@ -58,6 +58,10 @@ gchar *
mq_html_input_text(const gchar *name, const gchar *label, const gchar *value);
gchar *
+mq_html_input_number_i(const gchar *name, const gchar *label,
+ gint min, gint step, gint max, gint value);
+
+gchar *
mq_html_input_radio(const gchar *name, const gchar *label, gboolean checked);
gchar *