You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
165 lines
3.7 KiB
165 lines
3.7 KiB
4 years ago
|
|
||
|
/**
|
||
|
* This function fires when the active tabs changes
|
||
|
* */
|
||
|
function delactiveclasses(){
|
||
|
$("#cookie-tab-button").removeClass("mdc-tab--active");
|
||
|
$("#privacy-tab-button").removeClass("mdc-tab--active");
|
||
|
$("#about-tab-button").removeClass("mdc-tab--active");
|
||
|
$("#span-cookie").removeClass("mdc-tab-indicator--active");
|
||
|
$("#span-privacy").removeClass("mdc-tab-indicator--active");
|
||
|
$("#span-about").removeClass("mdc-tab-indicator--active");
|
||
|
$("#auswertenv2").removeClass("privacyfade");
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
/**
|
||
|
* This function hides all defined div inside a popup
|
||
|
* */
|
||
|
function hide_all(){
|
||
|
$("#privacy-div").hide();
|
||
|
$("#zsf-div").hide();
|
||
|
$("#about-div").hide();
|
||
|
$("#privacy-div").hide();
|
||
|
$("#settings-back").hide();
|
||
|
$("#settings-div").hide();
|
||
|
$("#cookie-cards").hide();
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* This function hides buttons
|
||
|
* */
|
||
|
function hide_all_button(){
|
||
|
$("#auswertenv2").hide();
|
||
|
$("#auswerten-longer").hide();
|
||
|
$("#more").hide();
|
||
|
$("#settings").hide();
|
||
|
$("#back").hide();
|
||
|
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* This function initilize the pop-up window.
|
||
|
*/
|
||
|
function first_init(is_dsgvo){
|
||
|
$("#auswerten-longer").hide();
|
||
|
$("#privacy-card").hide();
|
||
|
$("#about-card").hide();
|
||
|
$(".animation-container").hide();
|
||
|
$("#auswerten-longer").hide();
|
||
|
$("#auswertenv2").hide();
|
||
|
$("#auswerten").hide();
|
||
|
$("#p_hint_for_press_privacy").hide();
|
||
|
$("#settings").hide();
|
||
|
$("#settings-back").hide();
|
||
|
$("#settings-div").hide();
|
||
|
$("#settings-back").hide();
|
||
|
|
||
|
|
||
|
delactiveclasses();
|
||
|
if(is_dsgvo){
|
||
|
state_privacycheck(is_dsgvo);
|
||
|
} else {
|
||
|
state_cookies();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* This function load the cookie part of the popup
|
||
|
*/
|
||
|
function state_cookies(){
|
||
|
delactiveclasses();
|
||
|
hide_all();
|
||
|
hide_all_button();
|
||
|
$("#cookie-tab-button").addClass("mdc-tab--active");
|
||
|
$("#span-cookie").addClass("mdc-tab-indicator--active");
|
||
|
|
||
|
|
||
|
$("#cookie-cards").show();
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* This function load the priavy check tab inside the popup window
|
||
|
* dependig if the user has a privacy statment open,
|
||
|
* it shows a massege for summarization or random law.
|
||
|
*/
|
||
|
function state_privacycheck(dsgvo){
|
||
|
delactiveclasses();
|
||
|
hide_all();
|
||
|
hide_all_button();
|
||
|
if (dsgvo){
|
||
|
$("#privacy-tab-button").addClass("mdc-tab--active");
|
||
|
$("#privacy-tab-button").attr("aria-selected", "true")
|
||
|
$("#span-privacy").addClass("mdc-tab-indicator--active");
|
||
|
$("#privacy-div").show();
|
||
|
$("#privacy-card").show();
|
||
|
$("#p_hint_for_press_privacy").show();
|
||
|
$("#auswertenv2").addClass("privacyfade");
|
||
|
$("#auswertenv2").show();
|
||
|
$("#more").hide();
|
||
|
|
||
|
} else {
|
||
|
|
||
|
$("#privacy-tab-button").addClass("mdc-tab--active");
|
||
|
$("#privacy-tab-button").attr("aria-selected", "true")
|
||
|
$("#span-privacy").addClass("mdc-tab-indicator--active");
|
||
|
$("#privacy-div").empty();
|
||
|
console.log(get_a_right());
|
||
|
$("#privacy-div").append(get_a_right());
|
||
|
$("#privacy-div").show();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* This function creates the more tab inside the popup window
|
||
|
*/
|
||
|
function state_more(){
|
||
|
delactiveclasses();
|
||
|
hide_all();
|
||
|
hide_all_button();
|
||
|
$("#about-tab-button").addClass("mdc-tab--active");
|
||
|
$("#span-about").addClass("mdc-tab-indicator--active");
|
||
|
$("#about-div").show();
|
||
|
$("#about-card").show();
|
||
|
$("#weiteres").show();
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* This function defines a settings state_change_switch
|
||
|
* it is not used but can be used in the future
|
||
|
*/
|
||
|
function state_settings(){
|
||
|
$("#about-card").hide();
|
||
|
$("#settings").hide();
|
||
|
$("#weiteres").hide();
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* This function defines the states of the switches inside the settings
|
||
|
* it is not used but can be used in the future
|
||
|
*/
|
||
|
function del_switch_classes(){
|
||
|
$("#switch-eng").removeClass("mdc-switch--checked");
|
||
|
$("#switch-ger").removeClass("mdc-switch--checked");
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* This function fires if a state of a switch is changed.
|
||
|
* it is not used but can be used in the future
|
||
|
*/
|
||
|
function state_change_switch(){
|
||
|
|
||
|
}
|
||
|
|
||
|
|