; // JavaScript Document function basename(path) { return path.replace(/\\/g,'/').replace( /.*\//, '' ); } function dirname(path) { return path.replace(/\\/g,'/').replace(/\/[^\/]*$/, '');; } function isNumber(n) { return !isNaN(parseFloat(n)) && isFinite(n); } function str_replace(searchString, replaceString, subject) { return subject.split(searchString).join(replaceString); } function extround(zahl,n_stelle) { zahl = (Math.round(zahl * n_stelle) / n_stelle); return zahl; } function ucfirst(text) { text += ''; var f = text.charAt(0).toUpperCase(); return f + text.substr(1); } function toPreis(e){ var v = $(e).val(); $(e).val( v.replace(/[^0-9.,]/g, "") ); } function toInt(e){ var v = $(e).val(); $(e).val( v.replace(/[^0-9]/g, "") ); } function strip_tags(input, allowed) { // discuss at: http://phpjs.org/functions/strip_tags/ // original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // improved by: Luke Godfrey // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // input by: Pul // input by: Alex // input by: Marc Palau // input by: Brett Zamir (http://brett-zamir.me) // input by: Bobby Drake // input by: Evertjan Garretsen // bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // bugfixed by: Onno Marsman // bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // bugfixed by: Eric Nagel // bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // bugfixed by: Tomasz Wesolowski // revised by: Rafał Kukawski (http://blog.kukawski.pl/) // example 1: strip_tags('
Kevin
Kevin van Zonneveld
', ''); // returns 2: '
Kevin van Zonneveld
' // example 3: strip_tags("Kevin van Zonneveld", ""); // returns 3: "Kevin van Zonneveld" // example 4: strip_tags('1 < 5 5 > 1'); // returns 4: '1 < 5 5 > 1' // example 5: strip_tags('1'+ucfirst([displayValues[x]])+' | '; } output += '|
'+display+' kb | '; } else { output += ''+data[i][displayValues[x]]+' | '; } } output += '
' +
element[property].replace(//g, '>') + '
'+returnString+ ''); winpop.document.close(); } return returnString; } function number_format(number, decimals, dec_point, thousands_sep) { number = (number + '') .replace(/[^0-9+\-Ee.]/g, ''); var n = !isFinite(+number) ? 0 : +number, prec = !isFinite(+decimals) ? 0 : Math.abs(decimals), sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep, dec = (typeof dec_point === 'undefined') ? '.' : dec_point, s = '', toFixedFix = function(n, prec) { var k = Math.pow(10, prec); return '' + (Math.round(n * k) / k) .toFixed(prec); }; // Fix for IE parseFloat(0.55).toFixed(0) = 0; s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)) .split('.'); if (s[0].length > 3) { s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep); } if ((s[1] || '') .length < prec) { s[1] = s[1] || ''; s[1] += new Array(prec - s[1].length + 1) .join('0'); } return s.join(dec); } ; ; // JavaScript Document var ortSearchLoader = {}; function searchByTextInput(inputField){ if(!ortSearchLoader){ ortSearchLoader.abort(); } var searchField = inputField.parents('.inputSearchField'); var searchFieldWidth = searchField.width(); var inputWidth = inputField.width(); var searchAction = inputField.attr('data-searchAction'); var formField = inputField.attr('data-formField'); var callbackChooseResult = inputField.attr('data-choose-result'); callbackChooseResult = typeof callbackChooseResult != 'undefined' && callbackChooseResult ? callbackChooseResult : ''; var hideIconSelector = inputField.attr('data-hideIconSelector'); if (typeof(hideIconSelector) != 'undefined') $(hideIconSelector).hide('fast'); searchField.find('.inputSearchLoading').show('fast'); filePath = "/inc/modules/ajax.includes.php"; ortSearchLoader = $.ajax({ type: "POST", timeout: 5000, url: filePath, data: "action="+searchAction+"&input="+formField+"&keyword="+inputField.val()+"&chooseResultCallback="+callbackChooseResult, success: function(output){ searchField.find('.inputSearchResult').remove(); if (output != '') { searchField.append('
"+basic_text+": "+error_text+"
"; alertBasicErrorMessage(error_text); $('.noInput', formContainer).each(function(e){ setBasicValues($(this)); }); return false; } else { // Zweiter Paramter == true => Formular Mit AJAX abschicken if (sendViaAjax == true) { if (typeof(returnStatus) != 'undefined' && returnStatus == true) { return (error > 0) ? false : true; } else { submitAjaxForm(formular,callback,outputDiv,adminSend,params); return false; } } else return true; } } function checkForm(f,sendViaAjax,callback,outputDiv,adminSend,params,returnStatus){ var alreadyChecked = new Array(); var error = 0; var error_text = ''; f = document.forms[$(f).attr("id")]; if(typeof(f) == "undefined") return true; $('#'+$(f).attr("id")+' input, #'+$(f).attr("id")+' select, #'+$(f).attr("id")+' textarea').each(function(e){ value = $(this).val(); basicValue = $(this).attr('data-basicValue'); if (value == basicValue && basicValue != '') { $(this).val(''); } }); if(typeof f.elements != 'undefined') var anzahlElements = f.elements.length; else var anzahlElements = 0; if (sendViaAjax == '') sendViaAjax = false; error_content = document.getElementById('message_content'); for(var i=0; i < anzahlElements; i++) { name = f.elements[i].name; type = f.elements[i].type; if(type != 'hidden') { if ($(f.elements[i]).hasClass('important')){ if ($(f.elements[i]).hasClass('noInput')) { error_text +=setErrorClassAndReturnMessage($(f.elements[i])); error++; alreadyChecked[alreadyChecked.length + 1] = f.elements[i].name; } else { if (!$(f.elements[i]).hasClass('specialCheck') && (!in_array(f.elements[i].name, alreadyChecked) || $(f.elements[i]).hasClass('notUnique'))) { if (type == 'text' || type == 'select-one' || type == 'select-multiple' || type == 'textarea') { if (f.elements[i].value == '') { error_text += setErrorClassAndReturnMessage($(f.elements[i])); error++; } alreadyChecked[alreadyChecked.length + 1] = f.elements[i].name; } if (type == 'password') { if (name == 'pw') { var pw1 = f.elements[i].value; if (pw1 == '') { error_text += setErrorClassAndReturnMessage($(f.elements[i])); error++; } else if (typeof(f.elements['pw2']) != 'undefined') { var pw2 = f.elements['pw2'].value; if (pw2 == '') { error_text += setErrorClassAndReturnMessage($(f.elements['pw2'])); error++; } if (pw1 != pw2 && pw1 != '') { setErrorClassAndReturnMessage($(f.elements[i]),""); setErrorClassAndReturnMessage($(f.elements["pw2"]),""); error_text += "Beide Passwörter müssen übereinstimmen, "; error++; } alreadyChecked[alreadyChecked.length + 1] = f.elements['pw2'].name; } if ($(f.elements['pw']).hasClass('strength') && ($(f.elements['pw']).hasClass('weak') || $(f.elements['pw']).hasClass('veryweak')) ) { setErrorClassAndReturnMessage($(f.elements["pw"]),""); error_text += "Das Passwort ist zu schwach, "; error++; } alreadyChecked[alreadyChecked.length + 1] = f.elements[i].name; } } if (type == 'radio' || type == 'checkbox') { if (!checkRadioCheckboxButton(f.elements[i].name)) { error_text += f.elements[i].title+", "; error++; } alreadyChecked[alreadyChecked.length + 1] = f.elements[i].name; } } else { if ($(f.elements[i]).hasClass('specialCheck')) { if ($(f.elements[i]).hasClass('typeEmail')) { if (f.elements[i].value == '' || strpos(f.elements[i].value,'@') == false) { setErrorClassAndReturnMessage($(f.elements[i])); error_text += "Gültige E-Mail, "; error++; } alreadyChecked[alreadyChecked.length + 1] = f.elements[i].name; } if ($(f.elements[i]).hasClass('decimalNumber')) { value = valueString = f.elements[i].value; value = value.replace(",","."); value = parseFloat(value); if (valueString == '' || isNaN(value)) { setErrorClassAndReturnMessage($(f.elements[i])); error++; } alreadyChecked[alreadyChecked.length + 1] = f.elements[i].name; } if ($(f.elements[i]).hasClass('intNumber')) { value = valueString = f.elements[i].value; value = parseInt(value); if (isNaN(value) || (valueString.indexOf(",") >= 0 || valueString.indexOf(".") >= 0 || valueString == '')) { setErrorClassAndReturnMessage($(f.elements[i])); error++; } alreadyChecked[alreadyChecked.length + 1] = f.elements[i].name; } if ($(f.elements[i]).hasClass('typeIBAN')) { if (typeof(IBAN.isValid) !== 'undefined') { value = valueString = f.elements[i].value; status = IBAN.isValid(value); if (status != true) { setErrorClassAndReturnMessage($(f.elements[i])); error_text += "Gültige IBAN, "; error++; } alreadyChecked[alreadyChecked.length + 1] = f.elements[i].name; } } if ($(f.elements[i]).hasClass('typeBIC')) { value = valueString = f.elements[i].value; regSWIFT = /^([a-zA-Z]){4}([a-zA-Z]){2}([0-9a-zA-Z]){2}([0-9a-zA-Z]{3})?$/; if(regSWIFT.test(value) == false) { setErrorClassAndReturnMessage($(f.elements[i])); error_text += "Gültige BIC, "; error++; } } } } } } } } if (error > 0) { basic_headline = 'Fehler im Formular'; basic_text = 'Bitte geben Sie alle Pflichtfelder an'; if (typeof(ERROR_MESSAGE_HEADLINE) != 'undefined') basic_headline = ERROR_MESSAGE_HEADLINE; if (typeof(ERROR_MESSAGE_TEXT_REQUIRED) != 'undefined') basic_text = ERROR_MESSAGE_TEXT_REQUIRED; error_text = error_text.substr(0,error_text.length-2); error_text = ""+basic_text+": "+error_text+"
"; alertBasicErrorMessage(error_text); $('#'+$(f).attr("id")+' .noInput').each(function(e){ setBasicValues($(this)); }); return false; } else { if (sendViaAjax == true) { if (typeof(returnStatus) != 'undefined' && returnStatus == true) { return (error > 0) ? false : true; } else { submitAjaxForm(f,callback,outputDiv,adminSend,params); return false; } } else return true; } } function countLettersAndOutput(elem,output,textlen) { text = elem.value; anzLetter = text.length; $('#'+output).html('Anzahl Zeichen: '+anzLetter); if (anzLetter > textlen) { $(elem).addClass('error_input'); } else { $(elem).removeClass('error_input'); } } function countLettersAndWordsAndOutput(elem,output,spacer,textlen,wordlen) { text = elem.value; words = text.split(spacer); anzLetter = text.length; anzWords = words.length; $('#'+output).html('Anzahl Wörter: '+anzWords+'Bitte füllen Sie alle Pflichtfelder aus!
'; } error_text = 'Error retrieving contents, please retry