From 34a60dcf762ef59afd77ec4a3e1bf65b74b74b3f Mon Sep 17 00:00:00 2001 From: MikeTschudi Date: Fri, 6 May 2016 12:13:54 -0700 Subject: [PATCH] Added number and single-line text survey form types --- js/app/survey.js | 32 ++++++++++++++++++++++++++++++++ styles.css | 22 ++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/js/app/survey.js b/js/app/survey.js index ba6c14d..e4460ed 100644 --- a/js/app/survey.js +++ b/js/app/survey.js @@ -220,6 +220,10 @@ define([], function () { question += survey._createListChoice(iQuestion, questionInfo, isReadOnly); } else if (questionInfo.style === "dropdown") { question += survey._createDropdownChoice(iQuestion, questionInfo, isReadOnly); + } else if (questionInfo.style === "number") { + question += survey._createNumberInput(iQuestion, questionInfo, isReadOnly); + } else if (questionInfo.style === "text") { + question += survey._createTextLineInput(iQuestion, questionInfo, isReadOnly); } question += survey._wrapupQuestion(); $(surveyContainer).append(question); @@ -327,6 +331,34 @@ define([], function () { return list; }, + /** + * Creates a survey question's response response item's HTML: a number input field. + * @param {number} iQuestion Zero-based question number + * @param {object} questionInfo Survey question, which contains question, field, style, domain, important + * @param {boolean} isReadOnly Indicates if survey form elements are read-only + * @return {object} HTML for radio buttons + * @private + */ + _createNumberInput: function (iQuestion, questionInfo, isReadOnly) { + // + var list = ""; + return list; + }, + + /** + * Creates a survey question's response response item's HTML: a single-line text input field. + * @param {number} iQuestion Zero-based question number + * @param {object} questionInfo Survey question, which contains question, field, style, domain, important + * @param {boolean} isReadOnly Indicates if survey form elements are read-only + * @return {object} HTML for radio buttons + * @private + */ + _createTextLineInput: function (iQuestion, questionInfo, isReadOnly) { + // + var list = ""; + return list; + }, + /** * Completes the HTML for a survey question. * @return {object} HTML for the end of its div diff --git a/styles.css b/styles.css index 9751b22..f22b64b 100644 --- a/styles.css +++ b/styles.css @@ -73,6 +73,28 @@ body { white-space: normal; min-height: 2.6em; } +.number-input { + font-size: 12px; + font-weight: bold; + color: #007ac2; + background-color: #fff; + border: 1px solid #007ac2; + white-space: normal; + min-height: 2.6em; + padding-left: 4px; + max-width: 100%; +} +.text-input { + font-size: 12px; + font-weight: bold; + color: #007ac2; + background-color: #fff; + border: 1px solid #007ac2; + white-space: normal; + min-height: 2.6em; + padding-left: 4px; + width: 100%; +} .modal-header { font-weight: bolder; }