From 497edb8d9471c05ace0868e2d6c2f092dca7c030 Mon Sep 17 00:00:00 2001 From: nacho Date: Sun, 30 Dec 2018 15:59:26 -0700 Subject: add restore defaults btn --- ncp-web/css/ncp.css | 2 +- ncp-web/elements.php | 37 ++++++++++++++++++++++++++++++++++--- ncp-web/index.php | 2 +- ncp-web/js/ncp.js | 16 ++++++++++++---- 4 files changed, 48 insertions(+), 9 deletions(-) (limited to 'ncp-web') diff --git a/ncp-web/css/ncp.css b/ncp-web/css/ncp.css index 87fa4808..c5ae5727 100644 --- a/ncp-web/css/ncp.css +++ b/ncp-web/css/ncp.css @@ -1337,6 +1337,6 @@ a#versionlink:hover { color: white; } -.pwd-btn { +.pwd-btn, .default-btn { cursor: pointer; } diff --git a/ncp-web/elements.php b/ncp-web/elements.php index aa853280..2a6c5734 100644 --- a/ncp-web/elements.php +++ b/ncp-web/elements.php @@ -25,7 +25,29 @@ HTML; // default to text input if (!array_key_exists('type', $param)) { - $ret .= ""; + $suggest = ''; + if (array_key_exists('suggest', $param)) + $suggest = $param['suggest']; + + $default = ''; + if (array_key_exists('default', $param)) + $default = $param['default']; + + $ret .= " + "; + + if (array_key_exists('default', $param)) + { + $ret .= ""; + } + + $ret .= ""; } // checkbox @@ -34,14 +56,23 @@ HTML; $checked = ""; if ($param['value'] == 'yes') $checked = 'checked'; - $ret .= ""; + $ret .= " + "; } // password else if ($param['type'] == 'password') { $ret .= ""; - $ret .= ""; + $ret .= ""; $ret .= ""; $ret .= ""; } diff --git a/ncp-web/index.php b/ncp-web/index.php index b2452ac0..7e9e5604 100644 --- a/ncp-web/index.php +++ b/ncp-web/index.php @@ -117,7 +117,7 @@ HTML;