Commit 9ef77409 authored by jan.koester's avatar jan.koester
Browse files

test

parent cb1277b8
Loading
Loading
Loading
Loading
+8 −0
Changes for plugins/survey/survey.cpp: 8 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -1175,6 +1175,7 @@ namespace blogi {

                if (q.type == "radio") {
                    for (const auto &opt : q.options) {
                        if (opt.value.empty() && opt.label.empty()) continue;
                        html << "<div class=\"option\"><label><input type=\"radio\" name=\"" << q.id
                             << "\" value=\"" << opt.value << "\"";
                        if (!opt.excludes.empty()) html << " data-excludes=\"" << opt.excludes << "\"";
@@ -1182,6 +1183,7 @@ namespace blogi {
                    }
                } else if (q.type == "checkbox") {
                    for (const auto &opt : q.options) {
                        if (opt.value.empty() && opt.label.empty()) continue;
                        html << "<div class=\"option\"><label><input type=\"checkbox\" name=\"" << q.id
                             << "\" value=\"" << opt.value << "\"";
                        if (!opt.excludes.empty()) html << " data-excludes=\"" << opt.excludes << "\"";
@@ -1190,6 +1192,7 @@ namespace blogi {
                } else if (q.type == "select") {
                    html << "<select name=\"" << q.id << "\"><option value=\"\">-- Select --</option>";
                    for (const auto &opt : q.options) {
                        if (opt.value.empty() && opt.label.empty()) continue;
                        html << "<option value=\"" << opt.value << "\"";
                        if (!opt.excludes.empty()) html << " data-excludes=\"" << opt.excludes << "\"";
                        html << ">" << opt.label << "</option>";
@@ -1425,6 +1428,11 @@ namespace blogi {
                 << "var rm=e.target.closest?e.target.closest('.file-remove'):null;"
                 << "if(rm){var name=rm.getAttribute('data-name'),imgId=rm.getAttribute('data-imgid');"
                 << "if(name&&imgId)removeImage(name,imgId);}});"
                 // update exclusion state when inputs change
                 << "root.addEventListener('change',function(e){"
                 << "var t=e.target;"
                 << "if(t.type==='radio'||t.type==='checkbox'||t.tagName==='SELECT'){"
                 << "for(var i=0;i<totalSteps;i++){updateStepNav(i);}}});"
                 << "})();"
                 << "</script>";