Commit 29e0cd92 authored by Chenu Denis's avatar Chenu Denis
Browse files

[fix] Disable open in a new tab in top menu

- See LimeSurvey issue https://bugs.limesurvey.org/view.php?id=17586
- Need a keyboard only compatible system
parent 3aaf75ff
......@@ -16,12 +16,12 @@
<supportUrl>https://extensions.sondages.pro/themes-and-templates/skelvanilla-a11y-and-usuability/</supportUrl>
<copyright>Copyright (C) 2018-2020 Denis Chenu / Sondages Pro</copyright>
<license>GNU General Public License version 3 or later</license>
<version>10.4.6</version>
<version>10.4.7</version>
<apiVersion>3</apiVersion>
<description><![CDATA[<strong>LimeSurvey Bootstrap Vanilla Survey Theme with Accessibility and Options</strong><br>Base on vanilla theme, usage of more aria, fix some role and aria from core.<br>Allow usage of a lot of variations, list of variation can be updated. Some decoration option using boostrap class.]]></description>
<extends>vanilla</extends>
<last_update>2021-07-23 08:15:00</last_update>
-<lastUpdate>2021-07-23 08:15:00</lastUpdate>
<last_update>2021-09-24 14:17:00</last_update>
<lastUpdate>2021-09-24 14:17:00</lastUpdate>
</metadata>
<files>
......@@ -546,7 +546,6 @@
<sType type="data">token</sType>
</userforms>
</default_data>
</template_editor>
</engine>
......
......@@ -9,6 +9,7 @@ var skelVanilla = {
this.removeBack();
}
this.disableEnterSubmit();
this.topMenuAction();
if(options.errorTopLinks) {
this.errorTopLinks();
}
......@@ -211,5 +212,17 @@ var skelVanilla = {
});
}
});
},
/**
* Removing href to top menu disable the onclick with key : fix it
* See https://bugs.limesurvey.org/view.php?id=17586
**/
topMenuAction : function() {
$("[data-limesurvey-submit][role='button'],[data-limesurvey-lang][role='button'],[data-toggle='dropdown']").on('keypress', function(event) {
var keycode = (event.keyCode ? event.keyCode : event.which);
if(keycode == '13'){
$(this).trigger('click');
}
});
}
};
{% if (aSurveyInfo.bShowClearAll == true and aSurveyInfo.options.showclearall != 'off') %}
<!-- Exit and clear survey -->
<li class="{{ aSurveyInfo.class.clearalllinks }}" {{ aSurveyInfo.attr.clearalllinks }}>
<a href="#" data-limesurvey-submit='{ "clearall":"clearall" }' data-confirmedby='{ "confirm-clearall":"confirm" }' data-confirmlabel='{{gT("Please confirm you want to clear your response?" )}}' class='{{ aSurveyInfo.class.clearalllink }} animate' {{ aSurveyInfo.attr.clearalllink }}>
<a role="button" tabindex="0" data-limesurvey-submit='{ "clearall":"clearall" }' data-confirmedby='{ "confirm-clearall":"confirm" }' data-confirmlabel='{{gT("Please confirm you want to clear your response?" )}}' class='{{ aSurveyInfo.class.clearalllink }} animate' {{ aSurveyInfo.attr.clearalllink }}>
{{gT("Exit and clear survey" )}}
</a>
</li>
......
......@@ -30,8 +30,7 @@
<!-- Language Changer, top menu version -->
<li class="{{ aSurveyInfo.class.lctli }} dropdown" {{ aSurveyInfo.attr.lctli }} >
<a class="{{ aSurveyInfo.class.lctla }} dropdown-toggle animate" {{ aSurveyInfo.attr.lctla }} >
<a class="{{ aSurveyInfo.class.lctla }} dropdown-toggle animate" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" tabindex="0" >
{# NOTE: {{gT( aLCD.aListLang[aLCD.sSelected] )}}: retreives the language name of the selected language and translates it #}
{{ gT("Language:") }} {{ aLCD.aListLang[aLCD.sSelected] }}
<span class="{{ aSurveyInfo.class.lctspan }} caret" {{ aSurveyInfo.attr.lctspan }} ></span>
......@@ -41,7 +40,7 @@
{# List of available languages. #}
{% for value, lang in aLCD.aListLang %}
<li class="{{ aSurveyInfo.class.lctdropdownli }}" {{ aSurveyInfo.attr.lctdropdownli }} role="option">
<a href='#' data-limesurvey-lang='{{ value }}' class="{{ aSurveyInfo.class.lctdropdownlia }} animate" {{ aSurveyInfo.attr.lctdropdownlia }} tabindex="-1">
<a data-limesurvey-lang='{{ value }}' class="{{ aSurveyInfo.class.lctdropdownlia }} animate" role='button' {{ aSurveyInfo.attr.lctdropdownlia }} tabindex="-1">
{{gT( lang )}}
</a>
</li>
......
{% if aSurveyInfo.aNavigator.aMoveNext.value == "movesubmit" %}
<!-- Submit -->
<li class="ls-no-js-hidden">
<a href="#" data-limesurvey-submit='{ "move":"movesubmit" }' class='animate'>
<a tabindex="0" role="button" data-limesurvey-submit='{ "move":"movesubmit" }' class='animate'>
{{ gT('Submit') }}
</a>
</li>
{% else %}
<!-- Submit -->
<li class="ls-no-js-hidden">
<a href="#" data-limesurvey-submit='{ "move":"movenext" }' class='animate'>
<a tabindex="0" role="button" data-limesurvey-submit='{ "move":"movenext" }' class='animate'>
{{ gT('Next') }}
</a>
</li>
......
{% if aSurveyInfo.aNavigator.aMovePrev.show %}
<!-- Previous -->
<li class="ls-no-js-hidden">
<a href="#" data-limesurvey-submit='{ "move":"moveprev" }' class='animate'>
<a role="button" tabindex="0" data-limesurvey-submit='{ "move":"moveprev" }' class='animate'>
{{ gT('Previous') }}
</a>
</li>
......
{#
This file is part of LimeSurvey
Copyright (C) 2018 The LimeSurvey Project Team
This file render group index
#}
<div class="list-group index-button-full">
<div class="list-group-item">
<div class="h4 list-group-item-heading">{{ gT("Question index") }}</div>
......
{# Question index in group by group mode #}
{% if (aSurveyInfo.aQuestionIndex.bShow == true) %}
{% if aSurveyInfo.format == 'G' %}
<!-- Question index, group, {{ aSurveyInfo.aQuestionIndex.type }} -->
<li class="{{ aSurveyInfo.class.indexmenugli }} dropdown index-menu-{{ aSurveyInfo.aQuestionIndex.type }}" {{ aSurveyInfo.attr.indexmenugli }} >
<a class="{{ aSurveyInfo.class.indexmenuglia }} dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" tabindex="0" >
{{ gT("Question index") }}
<span class="{{ aSurveyInfo.class.indexmenugspan }} caret" {{ aSurveyInfo.attr.indexmenugspan }}></span>
</a>
<ul class="{{ aSurveyInfo.class.indexmenusgul }} dropdown-menu" {{ aSurveyInfo.attr.indexmenusgul }}>
{# TODO: move back this logic to SurveyRuntime, and provide a ready to use indexItem.statusClass #}
{% for step, indexItem in aSurveyInfo.aQuestionIndex.items %}
{% set statusClass = '' %}
{% if attribute(indexItem.stepStatus, 'index-item-unanswered') is defined and attribute(indexItem.stepStatus, 'index-item-unanswered') == true %}
{% set statusClass = statusClass ~ ' bg-warning' %}
{% endif %}
{% if attribute(indexItem.stepStatus, 'index-item-error') is defined and attribute(indexItem.stepStatus, 'index-item-error') == true %}
{% set statusClass = statusClass ~ ' bg-danger' %}
{% endif %}
{% if attribute(indexItem.stepStatus, 'index-item-current') is defined and attribute(indexItem.stepStatus, 'index-item-current') == true %}
{% set statusClass = statusClass ~ ' disabled' %}
{% endif %}
<li class="{{ indexItem.coreClass }} {{ statusClass }}" {{ aSurveyInfo.attr.indexmenusgli }} role="option">
<a data-limesurvey-submit='{{ indexItem.submit }}' class='animate' role="button" tabindex="-1">
{{ indexItem.text }}
</a>
</li>
{% endfor %}
</ul>
</li>
{% endif %}
{# Question index in question by question mode #}
{% if aSurveyInfo.format == 'S' %}
<!-- Question index, question by question, {{ aSurveyInfo.aQuestionIndex.type }} -->
<li class="{{ aSurveyInfo.class.indexmenusli }} dropdown index-menu-{{ aSurveyInfo.aQuestionIndex.type }}" {{ aSurveyInfo.attr.indexmenusli }}>
<a class="{{ aSurveyInfo.class.indexmenuslia }} dropdown-toggle animate" {{ aSurveyInfo.attr.indexmenuslia }}>
{{ gT("Question index") }}
<span class="{{ aSurveyInfo.class.indexmenusspan }} caret" {{ aSurveyInfo.attr.indexmenusspan }}></span>
</a>
<!-- TODO: Remove this when support is added -->
<ul class="{{ aSurveyInfo.class.indexmenusddul }} dropdown-menu" {{ aSurveyInfo.attr.indexmenusddul }}>
{% for group in aSurveyInfo.aQuestionIndex.items %}
{# TODO: move back this logic to SurveyRuntime, and provide a ready to use indexItem.statusClass #}
<li>
<div class="{{ aSurveyInfo.class.indexmenusddh }} dropdown-header" {{ aSurveyInfo.attr.indexmenusddh }}>
{{ flatEllipsizeText(group.text, true, 30, " &hellip; ", 0.6 ) }}
<span class="{{ aSurveyInfo.class.indexmenusddspan }} caret" {{ aSurveyInfo.class.indexmenusddspan }}></span>
</div>
<ul class="{{ aSurveyInfo.class.indexmenusddul }} dropdown-menu" {{ aSurveyInfo.attr.indexmenusddul }}>
{% for step, indexItem in group.questions %}
{% set statusClass = '' %}
{% if attribute(indexItem.stepStatus, 'index-item-unanswered') is defined and attribute(indexItem.stepStatus, 'index-item-unanswered') == true %}
{% set statusClass = statusClass ~ ' bg-warning' %}
{% endif %}
{% if attribute(indexItem.stepStatus, 'index-item-error') is defined and attribute(indexItem.stepStatus, 'index-item-error') == true %}
{% set statusClass = statusClass ~ ' bg-danger' %}
{% endif %}
{% if attribute(indexItem.stepStatus, 'index-item-current') is defined and attribute(indexItem.stepStatus, 'index-item-current') == true %}
{% set statusClass = statusClass ~ ' disabled' %}
{% endif %}
<li class="{{ indexItem.coreClass }} {{statusClass}}" {{ aSurveyInfo.attr.indexmenussli }}>
<a href="#" data-limesurvey-submit='{{ indexItem.submit }}' class='animate' role="button" tabindex="-1">
{{ flatEllipsizeText(indexItem.text, true, 30, " &hellip; ", 0.6 ) }}
</a>
</li>
{% endfor %}
</ul>
</li>
{% endfor %}
{% if aSurveyInfo.aQuestionIndex.type == 'full' %}
<li>
{{ gT("Question by question mode not yet supported.") }}
</li>
{% endif %}
</ul>
</li>
{% endif %}
{% endif %}
{#
LimeSurvey
Copyright (C) 2007-2017 The LimeSurvey Project Team / Louis Gac
All rights reserved.
License: GNU/GPL License v2 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.
(¯`·._.·(¯`·._.· Save/Load buttons ·._.·´¯)·._.·´¯)
Display the buttons to load/save a survey.
There are many cases when those button are not shown:
via survey configuration, at start page, when survey is completed, etc
#}
{% if aSurveyInfo.aNavigator.load.show == "Y" %}
<!-- Load unfinished survey button -->
<li class="{{ aSurveyInfo.class.loadlinksli }}" {{ aSurveyInfo.attr.loadlinksli }}>
<a href="#" data-limesurvey-submit='{ "loadall":"loadall" }' class='{{ aSurveyInfo.class.loadlinkslia }} animate' {{ aSurveyInfo.attr.loadlinkslia }}>
{{ gT('Load unfinished survey') }}
</a>
</li>
{% endif %}
{% if aSurveyInfo.aNavigator.save.show == "Y" %}
<!-- Resume later button -->
<li class="{{ aSurveyInfo.class.savelinksli }}" {{ aSurveyInfo.attr.savelinksli }}>
<a role="button" tabindex="0" data-limesurvey-submit='{ "saveall":"saveall" }' class='{{ aSurveyInfo.class.savelinkslia }} animate'>
{{ gT('Resume later') }}
</a>
{% if(aSurveyInfo.saved.text and aSurveyInfo.options.showpopups > 0) %}
<div class="alert-popup"></div>
{{ registerScript("saveflashmessage","
$('.alert-popup').popover({
title: '" ~ aSurveyInfo.saved.title ~ "',
content: '<div>" ~ aSurveyInfo.saved.text ~ "</div>',
html: true,
container: 'body',
placement: 'bottom',
delay: { 'show': 500, 'hide': 100 },
trigger: 'click',
}).popover('show');
setTimeout(function(){ $('.alert-popup').popover('destroy'); }, 3500);
", "POS_POSTSCRIPT" ) }}
{% endif %}
</li>
{% endif %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment