diff --git a/customize.dist/messages.js b/customize.dist/messages.js
index fd8a5f879..b05dd3f1b 100755
--- a/customize.dist/messages.js
+++ b/customize.dist/messages.js
@@ -157,6 +157,7 @@ define(req, function(AppConfig, Default, Language) {
}
};
+ Messages.form_footerInfo = "This form and your answers are protected with end-to-end encryption
Only the form author can read the data
To learn more and create your own forms visit the CryptPad website"; // XXX
return Messages;
});
diff --git a/www/form/app-form.less b/www/form/app-form.less
index 37cd22686..f4d694575 100644
--- a/www/form/app-form.less
+++ b/www/form/app-form.less
@@ -213,7 +213,26 @@
display: flex;
align-items: center;
justify-content: center;
+ flex-direction: column;
padding: 20px 20px 150px 20px;
+ .cp-form-view-footer-text {
+ text-align: center;
+ line-height: 180%;
+ margin-bottom: 2rem;
+ svg.cp-form-footer-icon {
+ margin: 0 0.3rem 0.1rem 0;
+ width: 1em;
+ vertical-align: text-bottom;
+ color: @cryptpad_color_link;
+ }
+ a {
+ color: @cryptpad_color_link;
+ text-decoration: none;
+ &:hover {
+ text-decoration: underline;
+ }
+ }
+ }
div.cp-form-view-logo {
padding: 10px;
font-size: 40px;
@@ -912,7 +931,7 @@
align-items: baseline;
border-radius: @variables_radius;
margin-top: 0.5rem;
- padding: 1px;
+ padding: 1px;
.CodeMirror {
cursor: default;
flex: 1;
@@ -1483,10 +1502,10 @@
.cp-form-response-modal {
.cp-form-markdown-editor-wrapper {
border: 1px solid @cp_forms-border;
- border-radius: @variables_radius;
+ border-radius: @variables_radius;
}
.CodeMirror {
- border-radius: 0 0 @variables_radius @variables_radius;
+ border-radius: 0 0 @variables_radius @variables_radius;
}
}
@@ -1552,4 +1571,3 @@
.charts_main();
}
-
diff --git a/www/form/inner.js b/www/form/inner.js
index 759f3f10b..e78774300 100644
--- a/www/form/inner.js
+++ b/www/form/inner.js
@@ -270,7 +270,7 @@ define([
},
content: Messages['form_poll_'+t]
};
- });
+ });
var dropdownConfig = {
text: '', // Button initial text
options: options, // Entries displayed in the menu
@@ -314,7 +314,7 @@ define([
dateFormat: dateFormat,
defaultDate: val ? new Date(val) : undefined
});
- }
+ }
// if this element was active before the remote change, restore cursor
var setCursor = function () {
@@ -543,7 +543,7 @@ define([
$(el).find('input').focus();
return;
- }
+ }
$(add).click();
return;
} else {
@@ -559,12 +559,12 @@ define([
$(element).find('input').focus();
} else {
$container.find('input')[i].value = selectedDates[i].toLocaleDateString();
- }
+ }
}
} else if ($container.find('input')[0]) {
$container.find('input')[0].value = '';
- }
- }
+ }
+ }
$container.find('input').each(function (i, input) {
if (input._flatpickr) {
@@ -1189,7 +1189,7 @@ define([
toggleRow,
block
]);
-
+
return [
outerWrapper,
cancelBlock
@@ -1882,10 +1882,10 @@ define([
});
return res;
},
- reset: function () {
+ reset: function () {
$(tag).find('input').each(function (i, input) {
var $i = $(input);
- if (Util.isChecked($i)) {
+ if (Util.isChecked($i)) {
$i.prop('checked', false);
}
});
@@ -2018,10 +2018,10 @@ define([
});
return res;
},
- reset: function () {
+ reset: function () {
$(tag).find('input').each(function (i, input) {
var $i = $(input);
- if (Util.isChecked($i)) {
+ if (Util.isChecked($i)) {
$i.prop('checked', false);
}
});
@@ -2252,7 +2252,7 @@ define([
reset: function () {
$(tag).find('input').each(function (i, input) {
var $i = $(input);
- if (Util.isChecked($i)) {
+ if (Util.isChecked($i)) {
$i.prop('checked', false);
}
});
@@ -2406,7 +2406,7 @@ define([
lines.forEach(checkDisabled);
$(tag).find('input').each(function (i, input) {
var $i = $(input);
- if (Util.isChecked($i)) {
+ if (Util.isChecked($i)) {
$i.prop('checked', false);
}
});
@@ -2752,7 +2752,7 @@ define([
tag: tag,
isEmpty: function () {
var v = this.getValue();
- if (!v || !v.values) { return true; }
+ if (!v || !v.values) { return true; }
// Poll is considered empty if user hasn't interacted with it
return !hasInteracted;
},
@@ -3346,7 +3346,9 @@ define([
$(logo).click(function () {
APP.framework._.sfCommon.gotoURL('/');
});
- var footer = h('div.cp-form-view-footer', [logo]);
+ var content = UI.setHTML(h('div.cp-form-view-footer-text'), Messages.form_footerInfo);
+ content.insertBefore(Icons.get('lock', {'class': 'cp-form-footer-icon', 'aria-hidden': true}), content.firstChild);
+ var footer = h('div.cp-form-view-footer', [content, logo]);
return footer;
};
@@ -3422,7 +3424,7 @@ define([
});
sorted.forEach(function (uid) {
var answer = answers[uid];
-
+
var viewOnly = content.answers.cantEdit || APP.isClosed;
var action = h(viewOnly ? 'button.btn.btn-secondary' : 'button.btn.btn-primary', [
@@ -4307,7 +4309,7 @@ define([
};
});
}
-
+
content.form[_uid] = {
q: content.form[uid].q,
opts: opts,
@@ -4510,7 +4512,7 @@ define([
});
});
-
+
var shownContent = [];
var shownPages = [];
pgcontent.forEach(function(page) {
@@ -4527,7 +4529,7 @@ define([
};
var pageContainer = h('div.cp-form-page-container');
-
+
var $page = $(pageContainer);
_content.push(pageContainer);
var refreshPage = APP.refreshPage = function (current, direction) {
@@ -4585,7 +4587,7 @@ define([
var shownContent = checkPages[0];
var shownPages = checkPages[1];
$(state).text(Messages._getKey('form_page', [shownPages.indexOf(_content[current-1])+1, shownContent.length]));
-
+
});
if (shownPages.indexOf(_content[current-1])+1 === shownContent.length) { $(right).css('visibility', 'hidden'); }
@@ -5138,7 +5140,7 @@ define([
var endDateStr = h('div.cp-form-status');
var $endDate = $(endDateContainer);
var $endDateStr = $(endDateStr);
-
+
var refreshEndDate = function () {
$endDate.empty();
@@ -5377,7 +5379,7 @@ define([
if (state) {
$container.removeClass('cp-no-drag');
} else {
- $container.addClass('cp-no-drag');
+ $container.addClass('cp-no-drag');
}
};
};
@@ -5777,7 +5779,7 @@ define([
]);
var editButtons = h('div.cp-form-edit-buttons-container', [ preview, edit, del ]);
- var toggleRow = h('div.cp-markdown-toggle-row');
+ var toggleRow = h('div.cp-markdown-toggle-row');
var markdownWrapper = h('div.cp-form-markdown-editor-wrapper', t);
var editDiv, previewDiv;
var div = h('div.cp-form-block.editable.nodrag.cp-form-submit-message', [