Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Jan 19, 2024
2 parents f088b47 + d757850 commit 40837f4
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 12 deletions.
14 changes: 7 additions & 7 deletions assets/scripts/admin/listresponse.js
Expand Up @@ -63,12 +63,6 @@ function onDocumentReadyListresponse() {

}

$(window).bind("load", function () {
onDocumentReadyListresponse();
reinstallResponsesFilterDatePicker();
initColumnFilter();
});

$(document).off('pjax:scriptcomplete.listresponse').on('pjax:scriptcomplete.listresponse', onDocumentReadyListresponse);
$(document).off('bindscroll.listresponse').on('bindscroll.listresponse', reinstallResponsesFilterDatePicker);

Expand Down Expand Up @@ -109,6 +103,12 @@ function initColumnFilter() {

function afterAjaxResponsesReload() {
reinstallResponsesFilterDatePicker();
bindListItemclick();
initColumnFilter();
}

$(window).bind("load", function () {
onDocumentReadyListresponse();
reinstallResponsesFilterDatePicker();
initColumnFilter();
});

Expand Up @@ -29,9 +29,34 @@

<div class='{{ aSurveyInfo.class.maincolformdiva }}' {{ aSurveyInfo.attr.maincolformdiva }}>
{% if aSurveyInfo.aForm.token == null %}
<input class='{{ aSurveyInfo.class.maincolformdivainput }} form-control ls-important-field' {{ aSurveyInfo.attr.maincolformdivainput }} placeholder="{{ gT("Enter access code") }}">
<div class='input-group ls-important-field'>
<input
class='{{ aSurveyInfo.class.maincolformdivainput }} form-control'
{{ aSurveyInfo.attr.maincolformdivainput }}
placeholder="{{ gT("Enter access code") }}"
>
<button type="button" class="input-group-text ls-no-js-hidden" id="ls-toggle-token-show" data-passwordstate="hidden">
<i class="fa fa-eye ls-password-hidden" aria-hidden="true"></i><span class="visually-hidden ls-password-hidden">gT("Show code")</span>
<i class="fa fa-eye-slash d-none ls-password-shown" aria-hidden="true"></i><span class="visually-hidden d-none ls-password-shown">gT("Hide code")</span>
</button>
</div>
<script>
$("#ls-toggle-token-show").on('click', function () {
if ($(this).data('passwordstate') == "hidden") {
$(this).prev("input").attr('type', 'text');
$(this).find('.ls-password-hidden').addClass('d-none');
$(this).find('.ls-password-shown').removeClass('d-none');
$(this).data('passwordstate', 'shown');
} else {
$(this).prev("input").attr('type', 'password');
$(this).find('.ls-password-hidden').removeClass('d-none');
$(this).find('.ls-password-shown').addClass('d-none');
$(this).data('passwordstate', 'hidden');
}
});
</script>
{% else %}

{# token is OK (no need update) , captcha not #}
{% set passwordFieldHtmlOptions = {
'id' : 'token',
'required' : true,
Expand Down
27 changes: 24 additions & 3 deletions themes/survey/vanilla/views/subviews/logincomponents/token.twig
Expand Up @@ -34,10 +34,31 @@

<div class='{{ aSurveyInfo.class.maincolformdiva }}' {{ aSurveyInfo.attr.maincolformdiva }}>
{% if aSurveyInfo.aForm.token == null %}
<input
class='{{ aSurveyInfo.class.maincolformdivainput }} form-control' {{ aSurveyInfo.attr.maincolformdivainput }} >
<div class='input-group'>
<input
class='{{ aSurveyInfo.class.maincolformdivainput }} form-control' {{ aSurveyInfo.attr.maincolformdivainput }} >
<button type="button" class="input-group-text ls-no-js-hidden" id="ls-toggle-token-show" data-passwordstate="hidden">
<i class="fa fa-eye ls-password-hidden" aria-hidden="true"></i><span class="visually-hidden ls-password-hidden">gT("Show code")</span>
<i class="fa fa-eye-slash d-none ls-password-shown" aria-hidden="true"></i><span class="visually-hidden d-none ls-password-shown">gT("Hide code")</span>
</button>
</div>
<script>
$("#ls-toggle-token-show").on('click', function () {
if ($(this).data('passwordstate') == "hidden") {
$(this).prev("input").attr('type', 'text');
$(this).find('.ls-password-hidden').addClass('d-none');
$(this).find('.ls-password-shown').removeClass('d-none');
$(this).data('passwordstate', 'shown');
} else {
$(this).prev("input").attr('type', 'password');
$(this).find('.ls-password-hidden').removeClass('d-none');
$(this).find('.ls-password-shown').addClass('d-none');
$(this).data('passwordstate', 'hidden');
}
});
</script>
{% else %}

{# token is OK, captcha not #}
{% set passwordFieldHtmlOptions = {
'id' : 'token',
'required' : true,
Expand Down

0 comments on commit 40837f4

Please sign in to comment.