uawdijnntqw1x1x1
IP : 216.73.216.130
Hostname : it-staging-server
Kernel : Linux it-staging-server 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
forge
/
stage.sksb.smartcon-survey.com
/
public
/
98561
/
..
/
..
/
resources
/
.
/
js
/
survey.js
/
/
window.$ = window.jQuery = require('jquery') window.Survey = require('survey-jquery') window.initializeSurvey = function (containerId, surveyString, url, inv, csrf, topic_id) { let rowSurvey = injectPlaceHolders(JSON.stringify(surveyString)); const jsonSurvey = JSON.parse(rowSurvey); if (jsonSurvey.f2_validate) { window.f2Validate = jsonSurvey.f2_validate; } const survey = new Survey.Model(jsonSurvey); survey.locale = "de"; survey.onComplete.add(function (sender) { $.ajax(url, { type: "POST", data: { _token: csrf, inv: inv, data: sender.data, topic_id: topic_id, }, statusCode: { 404: function (responseObject, textStatus, jqXHR) { }, 503: function (responseObject, textStatus, errorThrown) { }, }, }) .done(function (data) { console.log(data); if (jsonSurvey.completeText !== 'Abschließen') { window.location.reload(); } }) .fail(function (jqXHR, textStatus) { console.log("Something went wrong: " + textStatus); }); }); survey.onValidateQuestion.add(function (sender, options) { if (window.f2Validate && options.name === 'f2') { window.f2Validate = false; } }); $("#" + containerId).Survey({ model: survey, showCompletedPage: true, showPrevButton: false, focusFirstQuestionAutomatic: false }); } window.initializeTestSurvey = function (containerId, surveyString) { let rowSurvey = injectPlaceHolders(JSON.stringify(surveyString)); const jsonSurvey = JSON.parse(rowSurvey); if (jsonSurvey.f2_validate) { window.f2Validate = jsonSurvey.f2_validate; } const survey = new Survey.Model(jsonSurvey); survey.locale = "de"; survey.onComplete.add(function (sender) { console.log("Daten:"); console.log(sender.data); }); survey.onValidateQuestion.add(function (sender, options) { if (window.f2Validate && options.name === 'f2') { window.f2Validate = false; } }); $("#" + containerId).Survey({ model: survey, showCompletedPage: true, showPrevButton: false, focusFirstQuestionAutomatic: false }); } const greeting = function () { const currentTime = new Date(); const hours = currentTime.getHours(); if (hours < 11) { return "Morgen" } if (hours > 18) { return "Abend"; } return "Tag"; } const injectPlaceHolders = function (surveyString) { surveyString = surveyString.replace("[daytime]", greeting()); surveyString = surveyString.replace( "[link]", "<a class='underline' href='https://www.smartcon-survey.com/smc_Datenschutzerklaerung.pdf' target='_blank'>hier</a>" ) surveyString = surveyString.replace( "[link_en]", "<a class='underline' href='https://www.smartcon-survey.com/smc_Datenschutzerklaerung_en.pdf' target='_blank'>here</a>" ) return surveyString; } window.changeTextColors = (elementsClass, textsToRed, textsToGreen) => { const keyWords = { green: textsToGreen, red: textsToRed }; const intVal = setInterval(function () { const svStringViewer = document.querySelectorAll(elementsClass); if (svStringViewer.length > 1) { for (var i = 0; i < svStringViewer.length; i++) { if (keyWords.red.indexOf(svStringViewer[i].innerText) !== -1) { svStringViewer[i].style.color = "#ed3535"; } else if (keyWords.green.indexOf(svStringViewer[i].innerText) !== -1) { svStringViewer[i].style.color = "#0eb90e"; } } clearInterval(intVal); } }, 100); }
/home/forge/stage.sksb.smartcon-survey.com/public/98561/../../resources/./js/survey.js