Commit ec2b4ae0 authored by Chenu Denis's avatar Chenu Denis

[fix] Css for upload dialog : move variation to cssframework/css

[feature] More easy to update favicon
[fix] a11y No empty button for warning
parent df61ff1b
......@@ -14,10 +14,10 @@
<authorUrl>http://www.sondages.pro</authorUrl>
<copyright>Copyright (C) 2018 Denis Chenu / Sondages Pro</copyright>
<license>GNU General Public License version 2 or later</license>
<version>3.2.2</version>
<version>3.3.0</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>
<last_update>2019-01-08 14:27:13</last_update>
<last_update>2019-01-15 22:53:22</last_update>
<extends>vanilla</extends>
</metadata>
......@@ -26,25 +26,21 @@
<remove>css/ajaxify.css</remove>
<remove>scripts/ajaxify.js</remove>
<remove>bootstrap.css</remove>
<remove>bootstrap.min.css</remove>
<remove>bootstrap.min.css</remove>
<remove>yiistrap.css</remove>
<remove>awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css</remove>
<remove>awesome-bootstrap-checkbox/awesome-bootstrap-checkbox-rtl.css</remove>
<remove>noto.css</remove>
<remove>template-core.css</remove>
<add>css/skelvanilla.css</add>
<remove>css/theme.css</remove>
<remove>css/custom.css</remove>
<add>css/theme.css</add>
<add>css/custom.css</add>
</css>
<js>
<remove>scripts/ajaxify.js</remove>
<remove>pjax.js</remove>
<add>scripts/aria-live.js</add>
<add>scripts/theme-vanilla.js</add>
<add>scripts/skelvanilla.js</add>
<remove>scripts/theme.js</remove>
<remove>scripts/custom.js</remove>
<add>scripts/theme.js</add>
<add>scripts/custom.js</add>
</js>
</files>
<!-- css/lsboostrap.css + css/theme.css + css/custom.css and scripts/theme.js, scripts/custom.js added in global_layout -->
......@@ -71,7 +67,6 @@
<helpcolor>text-info</helpcolor>
<validitycolor>text-info</validitycolor>
<fixedheader>off</fixedheader>
<variation>default</variation>
<availablevariations>{
"contrast": {
"name": "Contrast",
......@@ -209,6 +204,18 @@
</packages>
<!-- Here datas about how LimeSurvey should load the theme -->
<engine>
<cssframework>
<name>bootstrap</name>
<css replace="css/bootstrap.css">css/lsbootstrap.css</css>
</cssframework>
<viewdirectory>views</viewdirectory>
<filesdirectory>files</filesdirectory>
<packages>
<add>moment</add>
</packages>
<template_editor>
<screens>
<question>
......
/* an empty boostrap.css file to fake Template test */
......@@ -20,24 +20,28 @@ var ThemeOptions = function(){
// #TemplateConfiguration_options is the id of the Options field in advanced option
// getter for generalInherit
var generalInherit = function(){return $('#TemplateConfiguration_options').val() === 'inherit'; };
var generalInherit = function(){
return $('#TemplateConfiguration_options').val() === 'inherit';
};
//parse the options as set in the advanced form
var parseOptionObject = function(){
// If no general inherit, then pass the value of the "Options" field in advanced option to the object optionObject
if($('#TemplateConfiguration_options').length>0 && !generalInherit()){
try{
optionObject = JSON.parse($('#TemplateConfiguration_options').val());
} catch(e){ console.ls ? console.ls.error('No valid option field!') : console.log('No valid option field!'); }
} catch(e){
console.ls ? console.ls.error('No valid option field!') : console.log('No valid option field!');
}
}
};
// Show/Hide fields on generalInherit
// To hide a simple option on generalInherit: just add the class "action_hide_on_inherit" to the rows continaing it
var startupGeneralInherit = function(){
if(!inheritPossible) return false;
if (generalInherit()){
$('#general_inherit_on').prop('checked',true).trigger('change').closest('label').addClass('active');
$('.action_hide_on_inherit').addClass('hidden');
......@@ -48,9 +52,9 @@ var ThemeOptions = function(){
// So this function find the selectors in the forum, and pass their values to the advanced options
var updateFieldSettings = function(){
if($('#general_inherit_on').prop('checked')){
$('#TemplateConfiguration_options').val('inherit');
$('#TemplateConfiguration_cssframework_css').val('inherit');
return;
}
globalForm.find('.selector_option_value_field').each(function(i,item){
......@@ -58,7 +62,6 @@ var ThemeOptions = function(){
if($(item).prop('disabled')){
$(item).val((inheritPossible ? 'inherit' : false));
}
optionObject[$(item).attr('name')] = $(item).val();
});
......@@ -82,7 +85,6 @@ var ThemeOptions = function(){
});
var newOptionObject = $.extend(true, {}, optionObject);
delete newOptionObject.general_inherit;
$('#TemplateConfiguration_options').val(JSON.stringify(newOptionObject));
};
......@@ -167,6 +169,32 @@ var ThemeOptions = function(){
updateFieldSettings();
};
var manageCssFrameworkField = function(){
var currentTheme = 'inherit';
var currentCssFrameworkObject = 'inherit';
if($('#TemplateConfiguration_cssframework_css').length>0){
currentCssFrameworkObject = $('#TemplateConfiguration_cssframework_css').val();
}
if(currentCssFrameworkObject != 'inherit') {
try{
currentTheme = JSON.parse(currentCssFrameworkObject).replace[0][1];
} catch(e){
currentTheme = "css/lsbootstrap.css";
}
}
console.log(currentTheme);
$('#simple_edit_cssframework_css').val(currentTheme);
$('#simple_edit_cssframework_css').on("change",function() {
if($(this).val() == 'inherit') {
$('#TemplateConfiguration_cssframework_css').val('inherit');
} else {
currentCssFrameworkObject = {};
currentCssFrameworkObject.replace = [["css/bootstrap.css",$(this).val()]];
$('#TemplateConfiguration_cssframework_css').val(JSON.stringify(currentCssFrameworkObject));
}
});
};
///////////////
// HotSwap methods
// -- These methods connect an input directly to the value in the optionsObject
......@@ -282,8 +310,8 @@ var ThemeOptions = function(){
prepareSelectField();
prepareTextField();
parseParentSwitchFields();
prepareFontField();
//prepareFontField();
manageCssFrameworkField();
bind();
};
......
This diff is collapsed.
{#
If you extend a template, and want to add custom headers (js, css, scripts, meta etc), you'd rather do it here.
#}
<link rel="icon" type="image/png" sizes="32x32" href="{{ imageSrc('files/favicon-32x32.png') }}">
<link rel="icon" type="image/png" sizes="96x96" href="{{ imageSrc('files/favicon-96x96.png') }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ imageSrc('files/favicon-16x16.png') }}">
\ No newline at end of file
......@@ -14,13 +14,6 @@
This file generates the headers.
Most of the time, it is not the right place to add your own JS/CSS - instead, use the config.xml file for that.
#}<head>
{% if ( aSurveyInfo.options.variation == 'default' or not aSurveyInfo.options.variation ) %}
{{ registerTemplateCssFile('css/lsbootstrap.css') }}
{% else %}
{{ registerTemplateCssFile(aSurveyInfo.options.variation) }}
{% endif %}
{{ registerTemplateCssFile('css/theme.css') }}{{ registerTemplateCssFile('css/custom.css') }}
{{ registerTemplateScript('scripts/theme.js',"POS_HEAD") }}{{ registerTemplateScript('scripts/custom.js',"POS_HEAD") }}
{% if(aSurveyInfo.jYesNo) %}
{{ registerScript('activateConfirmLanguage',"$.extend(LSvar.lang," ~ aSurveyInfo.jYesNo ~ ")", "POS_BEGIN") }}
{% endif %}
......@@ -35,9 +28,6 @@
{% if(aSurveyInfo.errorHtml.messages) %}[ {{ gT('Error') }} ]{% endif %}
{{ pagetitle ?: flatString(processString(aSurveyInfo.surveyls_title,1)) }}
</title>
<link rel="icon" type="image/png" sizes="32x32" href="{{ imageSrc('files/favicon-32x32.png') }}">
<link rel="icon" type="image/png" sizes="96x96" href="{{ imageSrc('files/favicon-96x96.png') }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ imageSrc('files/favicon-16x16.png') }}">
<script type="text/javascript">
if(window.basicThemeScripts === undefined){
window.basicThemeScripts = new ThemeScripts();
......
{#
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.
(¯`·._.·(¯`·._.· Warnings ·._.·´¯)·._.·´¯)
Show various warnings on top of the form
Error Html warnings can be:
- One or more mandatory questions have not been answered. You cannot proceed until these have been completed.
- One or more questions have not been answered in a valid manner. You cannot proceed until these answers are valid.
- One or more uploaded files are not in proper format/size. You cannot proceed until these files are valid.
The easiest way to change the text in the warnings is to create a new translation.
These warnings are complementary to the popup ones. If you're using popups (set in config file), and then don't want to show these alerts, you can uncomment the hiddenClass checker
#}
{# Preview mode warning #}
{% if aSurveyInfo.active != 'Y' %}
<!-- Preview mode warning -->
<div class="{{ aSurveyInfo.class.activealert }} alert alert-warning alert-dismissible fade in alert-dismissible" {{ aSurveyInfo.attr.activealert }} >
<button {{ aSurveyInfo.attr.activealertbutton }} class="{{ aSurveyInfo.class.activealertbutton }} close" ><span aria-hidden="true">×</span><span class="sr-only">{{ gT("Close") }}</span></button>
{{ gT("This survey is currently not active. You will not be able to save your responses.") }}
</div>
{% endif %}
{# Survey data policy not accepted warning #}
{% if aSurveyInfo.datasecuritynotaccepted == true %}
<!-- Preview mode warning -->
<div class="{{ aSurveyInfo.class.activealert }} alert alert-danger alert-dismissible fade in alert-dismissible" {{ aSurveyInfo.attr.activealert }} >
<button {{ aSurveyInfo.attr.activealertbutton }} class="{{ aSurveyInfo.class.activealertbutton }} close" ><span aria-hidden="true">×</span><span class="sr-only">{{ gT("Close") }}</span></button>
{{ aSurveyInfo.datasecurity_error }}
</div>
{% endif %}
{# Error Html warnings #}
{% if aSurveyInfo.errorHtml.show %}
<p class=' {# Uncomment to hide when popup is on { aSurveyInfo.errorHtml.hiddenClass } #} fade in alert-dismissible alert alert-danger {{ aSurveyInfo.class.errorHtml }} ' role='alert'>
<button {{ aSurveyInfo.attr.errorHtmlbutton }} class="{{ aSurveyInfo.class.errorHtmlbutton }} close" ><span aria-hidden="true">×</span><span class="sr-only">{{ gT("Close") }}</span></button>
{% for aMessage in aSurveyInfo.errorHtml.messages %}
<!-- Error Html warnings -->
{{ aMessage }}
<br/>
{% endfor %}
</p>
{% 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