PageSourceSearch

https://www.hs-nordhausen.de/wp-content/cache/min/8/34fc09a1a3f9/w…/js/public-conditions.js?ver=1787298865

js hs-nordhausen.de collected 2026-09-24 20:45:12 UTC 6,815 bytes, 15 lines download raw bytes

1var greyd=greyd||{};greyd.forms=greyd.forms||{};greyd.forms.conditions=new function(){this.listeners=[];this.id_pre='___id';this.types={text:['text','email','tel','url','number','time','date','datetime-local','week','month'],};this.init=function(form){if(typeof $==='undefined')$=jQuery;class Greyd_Conditional_Form{constructor(form){if(!form||form.length===0)return;var listeners=[];const conditionBlocks=form.find('.condition_block');if(!conditionBlocks||conditionBlocks.length===0)return;conditionBlocks.each(function(){const conditionData=greyd.forms.conditions.getConditionData($(this));if(conditionData&&conditionData.conditions){conditionData.conditions.forEach(function(condition){const input=greyd.forms.tools.getFieldByName(condition.name,form);if(input.length>0&&!greyd.forms.conditions.arrayContainsInput(input,listeners)){listeners.push(input)}})}});if(!listeners.length)return;$.each(listeners,function(){const name=$(this).attr('name');$(this).on("change input",function(){greyd.forms.conditions.inputChanged(name,form)});greyd.forms.conditions.inputChanged(name,form)});form.on("reset",function(e){greyd.forms.conditions.onFormReset($(this))});form.find('.condition_wrapper').each(function(){const $wrapper=$(this);$wrapper.on('nextStep prevStep exactStep',function(){var $container=$wrapper.find('.condition_block');if($container.hasClass('show')){setTimeout(function(){greyd.forms.conditions.showOrHideCondition($container,!0)},50)}})})}}
2new Greyd_Conditional_Form(form)};this.inputChanged=function(name,form){if(greydFormSettings.wp_debug)console.log('Input "'+name+'" changed');name=greyd.forms.tools.getCleanName(name);setTimeout(function(){form.find('.condition_block[data-condition*="%'+name+'%"]').each(function(){greyd.forms.conditions.checkConditionInputs($(this),form)})},0)};this.checkConditionInputs=function(container,form){var conditionData=greyd.forms.conditions.getConditionData(container);if(!conditionData)return;var isMatching=conditionData.operator==='and'?!0:!1;conditionData.conditions.forEach(function(condition){var currentValue=greyd.forms.tools.getVal(greyd.forms.tools.getFieldByName(condition.name,form));var conditionIsMatching=greyd.forms.conditions.matchCondition(conditionData.operator,currentValue,condition.operator,condition.value);if(greydFormSettings.wp_debug){}
3if(conditionData.operator==='and'){if(conditionIsMatching){}else{isMatching=!1;return!1}}else{if(conditionIsMatching){isMatching=!0;return!1}else{}}});this.showOrHideCondition(container,isMatching)};this.showOrHideCondition=function(container,show){if(typeof show==='undefined')show=!0;var wrapper=container.parent('.condition_wrapper');var animate=wrapper.hasClass('slide');if(animate){var oldHeight=container.height();wrapper.css('height',oldHeight)}
4if(show)greyd.forms.conditions.showConditionField(container);else greyd.forms.conditions.hideConditionField(container);if(animate){var childWrapper=container.find(".condition_wrapper");if(childWrapper.length&&show){childWrapper.css('height','')}
5var newHeight=show?container.height():0;let parentWrapper=wrapper.parents(".condition_wrapper");if(parentWrapper.length&&show){parentWrapper.css({height:"auto"})}
6var heightDiff=newHeight-oldHeight;if(heightDiff!==0){wrapper.removeClass('open');wrapper.css({height:newHeight});setTimeout(function(){container.parent().addClass('open')},400);wrapper.closest('form').trigger('heightChange',[wrapper,heightDiff])}}};this.showConditionField=function(field){field.removeClass('hide').addClass('show');setTimeout(function(){field.css('opacity',1)},0);field.find('input, select, textarea').each(function(){$(this).prop('disabled',!1);$(this).attr('novalue',!1);if($(this).data('required')==='required'){$(this).prop('required',!0)}
7greyd.forms.tools.changeDependingFormTags(this)})};this.hideConditionField=function(field){field.removeClass('show').addClass('hide').css('opacity',0);field.find('input, select, textarea').each(function(){$(this).prop('disabled',!0);$(this).attr('novalue',!0);if($(this).prop('required'))$(this).prop('required',!1);greyd.forms.tools.changeDependingFormTags(this)})};this.onFormReset=function(form){var containers=form.find('.condition_wrapper:not([data-after="hold"]) .condition_block');containers.each(function(){greyd.forms.conditions.checkConditionInputs($(this),form)})};this.matchCondition=function(operator,value,type,needed){operator=operator&&operator.length?operator:'or';value=typeof value==='undefined'?'':value;type=type&&type.length?type:'is';needed=typeof needed==='undefined'?'':needed;if(typeof value==="string"){value=value.replace(/\s|_/g,"").toLowerCase()}
8if(typeof needed==="string"){needed=needed.replace(/\s|_/g,"").toLowerCase()}
9if(greydFormSettings.wp_debug){}
10if(operator==='or'){switch(type){case "is":case "equal":if(value==needed)return!0;break;case "has":if(String(value).indexOf(needed)>=0)return!0;break;case "empty":if(!String(value).length||value==='off')return!0;break;case "not_empty":if(String(value).length&&value!=='off')return!0;break;case "is_not":if(value!==needed)return!0;break;case "greater":if(parseFloat(value)>parseFloat(needed))return!0;break;case "greater_equal":if(parseFloat(value)>=parseFloat(needed))return!0;break;case "smaller":if(parseFloat(value)<parseFloat(needed))return!0;break;case "smaller_equal":if(parseFloat(value)<=parseFloat(needed))return!0;break}
11return!1}else if(operator==='and'){switch(type){case "is":case "equal":if(value!=needed)return!1;break;case "has":if(String(value).indexOf(needed)===-1)return!1;break;case "empty":if(String(value).length&&value!=='off')return!1;break;case "not_empty":if(!String(value).length||value==='off')return!1;break;case "is_not":if(value===needed)return!1;break;case "greater":if(parseFloat(value)<=parseFloat(needed))return!1;break;case "greater_equal":if(parseFloat(value)<parseFloat(needed))return!1;break;case "smaller":if(parseFloat(value)>=parseFloat(needed))return!1;break;case "smaller_equal":if(parseFloat(value)>parseFloat(needed))return!1;break}
12return!0}
13return!1};this.arrayContainsInput=function(obj,array){var i;for(i=0;i<array.length;i++){if(array[i][0]===obj[0]&&array[i].context===obj.context){return!0}}
14return!1};this.getConditionData=function(container){var conditionData=container.data('condition');if(!conditionData||conditionData.length===0)return!1;var conditions=[],operator='';if(conditionData.indexOf('||')>-1){operator='or';conditions=conditionData.split('||')}else if(conditionData.indexOf('&&')>-1){operator='and';conditions=conditionData.split('&&')}else{conditions=[conditionData]}
15conditions.forEach(function(condition){var fieldname=[0]});return{operator:operator,conditions:conditions.map(function(condition){var split=condition.replace(/(^%|%$)/g,'').split('%%');return{name:split[0],operator:split[1],value:split[2]??''}})}}}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.