var changedContent = false; var trv_dialogContentChanged = false; var trv_multiContentChanged = new Object(); var trv_core_progressFetch = new Object(); var trv_core_progressInlineFetch = new Object(); Date.now = Date.now || function() { return +new Date(); }; $(function() { initTooltip();}); /**********************************************************************************************/ function initTooltip() { if ($.isFunction($.fn.tooltip)) { $('.trovarit_tooltip[title]').tooltip({ showURL: false, id: "trovarit_tooltip", showBody: "; ", fade: 250 }); $('.trovarit_tooltip_width[title]').tooltip({ showURL: false, id: "trovarit_tooltip", showBody: "; ", fade: 250, extraClass: "tooltip_width" }); } } /**********************************************************************************************/ function showBockscreenProgressBar(alternativeLable) { if (alternativeLable != null) { $(".trv_uploadProgressbar").parent().prev().text(alternativeLable); } $(".trv_uploadProgressbar").progressbar({ value: false, change: function() { $(".trv_uploadProgressbar .progress-label").text( $(".trv_uploadProgressbar").progressbar( "value" ) + "%" ); } }); $(".trv_uploadProgressbar").append('
'); $("#trv_blockScreenProgress").show(); } /**********************************************************************************************/ function hideBockscreenProgressBar() { $(".trv_uploadProgressbar .ui-progressbar-overlay").remove(); $("#trv_blockScreenProgress").hide(); } /**********************************************************************************************/ function setBockscreenText(text) { if (isScreenBlocked) { $("table td.trovarit_wait_dialog").html(text); } } /**********************************************************************************************/ function setBockscreenProgressValue(setPercent) { if (setPercent >= 0) { if (setPercent == 0 && $(".trv_uploadProgressbar .progress-label").text() == "") { $(".trv_uploadProgressbar .progress-label").text("0%"); } $(".trv_uploadProgressbar .ui-progressbar-overlay").remove(); } else if($(".trv_uploadProgressbar .ui-progressbar-overlay").length == 0) { $(".trv_uploadProgressbar").append('
'); } $(".trv_uploadProgressbar").progressbar( "option", {value:setPercent}); } /**********************************************************************************************/ function callOnEnter(e,functionToCall,argArray) { var keycode; if (window.event) keycode = window.event.keyCode; else if (e) keycode = e.which; else return true; if (keycode == 13) { if ((argArray == null) || (argArray == "")) { argArray = new Array(); } functionToCall.apply(this, argArray); return false; } else return true; } /**********************************************************************************************/ function submitEnter(myfield,e) { var keycode; if (window.event) keycode = window.event.keyCode; else if (e) keycode = e.which; else return true; if (keycode == 13) { myfield.form.submit(); return false; } else return true; } /**********************************************************************************************/ function confirmDialog(title, onYesClick, question, height, width, onNoClick, position) { if (height == null) { height="auto"; } if (width == null) { width=350; } if (onNoClick == null) { onNoClick=""; } if (position == null) { position="center"; } var currentTime = Date.now(); $("body").append(""); var dialogContent = "
question
YES NO
"; dialogContent = dialogContent.replace(/-CurrentTimeID-/g, currentTime); dialogContent = dialogContent.replace(/onYesClick/, onYesClick); dialogContent = dialogContent.replace(/onNoClick/, onNoClick); dialogContent = dialogContent.replace(/question/, question); $("#trv_core_confirm_dialog_"+currentTime).html(dialogContent); $("#trv_core_confirm_dialog_"+currentTime).dialog({ close: function(event, ui) { $(this).dialog('destroy'); $("#trv_core_confirm_dialog_"+currentTime).remove(); }, resizable: false, draggable: false, height: height, width: width, bgiframe: true, modal: true, position: position, title: title }); return currentTime; } /**********************************************************************************************/ function infoDialog(title, content, height, width, onCloseClick, position, alternativeButtonText, isErrorInfo) { if (height == null) { height="auto"; } if (width == null) { width=400; } if (onCloseClick == null) { onCloseClick=""; } if (position == null) { position="center"; } var currentTime = Date.now(); $("body").append(""); var dialogContent = "
boxcontent
CLOSE
"; if (alternativeButtonText != null) { dialogContent = dialogContent.replace("CLOSE", alternativeButtonText); } if (isErrorInfo == true) { dialogContent = dialogContent.replace(/trovarit_dialog_info/, 'trovarit_dialog_error'); } if (height!="auto") { dialogContent = dialogContent.replace(/height: 150px/, 'height: '+(height-100)+'px;'); } else { dialogContent = dialogContent.replace(/height: 150px/, ''); } dialogContent = dialogContent.replace(/-CurrentTimeID-/g, currentTime); dialogContent = dialogContent.replace(/boxcontent/, content); $("#trv_core_info_dialog_"+currentTime).html(dialogContent); $("#trv_core_info_dialog_"+currentTime).dialog({ close: function(event, ui) { if (typeof shortcut == "object") { shortcut.remove("Return"); } eval(onCloseClick); $(this).dialog('destroy'); $("#trv_core_info_dialog_"+currentTime).remove(); }, resizable: false, draggable: false, height: height, minHeight: 130, width: width, bgiframe: true, modal: true, position: position, title: title }); } /**********************************************************************************************/ function checkCookiesActive() { $.post( "https://smartrfi.it-matchmaker.com/core/ajax/ajax.php?PHPSESSID=f20c55a06ad936cb33481652d5baabff", { type: "CHECK_COOKIES", app_language: "en", page_charset: "utf-8" }, function(html) { if (html != 1) { $(".trovarit_cookies_error").html(html); } }); } /**********************************************************************************************/ function encode_utf8( s ) { return unescape( encodeURIComponent( s ) ); } /**********************************************************************************************/ function decode_utf8( s ) { return decodeURIComponent( escape( s ) ); } /**********************************************************************************************/ function addslashes(str) { str=str.replace(/\\/g,'\\\\'); str=str.replace(/\"/g,'\\"'); str=str.replace(/\0/g,'\\0'); str=str.replace(/\n/g,''); str=str.replace(/\t/g,''); return str; } function stripslashes(str) { str=str.replace(/\\'/g,'\''); str=str.replace(/\\"/g,'"'); str=str.replace(/\\0/g,'\0'); str=str.replace(/\\\\/g,'\\'); return str; } /**********************************************************************************************/ function exportTableToExcel(tableID, savename) { if (savename == null || savename == '') { savename = "export" } if ($('#'+tableID).length > 0) { blockScreen(); var headerData = '"header":['; $('#'+tableID+' >thead>tr>th:not(.noExport)').each(function (index, element) { if ($(element).find("span").length != 0 && $(element).html().indexOf("data-index")==-1) { var idTH = $(element).attr("id"); var headerSet = 0; $('#'+idTH+' span:not(.noExport) ').each(function (secondIndex, test) { headerData += '"'+addslashes($(this).text().replace(/^\s+|\s+$/g, ''))+'",'; headerSet = 1; }); if(headerSet == 0) { headerData += '"'+addslashes($(this).text().replace(/^\s+|\s+$/g, ''))+'",'; } } else { headerData += '"'+addslashes($(this).text().replace(/^\s+|\s+$/g, ''))+'",'; } }); headerData = headerData.slice(0, -1) + '],'; var tableData = '"data": ['; $('#'+tableID+'>tbody>tr:visible:not([class*=repated-header])').each(function (i) { var rowData = '['; $(">td:not(.noExport)",this).each(function(j) { var tdContent = ""; tdContent = addslashes($(".exportThis",this).text().replace(/^\s+|\s+$/g, '')); if (tdContent == "") { tdContent = addslashes($(".sortThis",this).text().replace(/^\s+|\s+$/g, '')); } rowData += '"'+tdContent+'",'; }); rowData = rowData.slice(0, -1) + '],'; tableData = tableData + rowData; }); tableData = tableData.slice(0, -1) + ']'; alldata = "{"+headerData+tableData+"}"; $.post( "https://smartrfi.it-matchmaker.com/core/ajax/ajax.php?PHPSESSID=f20c55a06ad936cb33481652d5baabff", { type: "CREATE_EXCEL_FROM_TABLE", page_charset: "utf-8", app_language: "en", data: alldata, savename: savename }, function(data) { unblockScreen(); if (data.length != 32) { infoDialog("ERROR", data); } else { var tempChangedContent = changedContent; var tempDialogContentChanged = trv_dialogContentChanged; if (tempChangedContent) { contentChanged(false); } if (tempDialogContentChanged) { dialogContentChanged(false); } location.href = "https://smartrfi.it-matchmaker.com/core/get_generated_file.php?file="+data; if (tempChangedContent) { contentChanged(true); } if (tempDialogContentChanged) { dialogContentChanged(true); } } }); } else { infoDialog("ERROR", "The table with this ID does not exist!"); } } /**********************************************************************************************/ function tableToolbarFilter(tableID, callbackAfterSet) { if (!excelFilterExists(tableID)) { blockScreen(true); setTimeout(function(){callTableToolbarFilter(tableID,callbackAfterSet);}, 150); } else { $("div.trovarit_excel_filter_dialog").dialog('close'); if (eval(tableID+"_filter").getData().length) { eval(tableID+"_filter").clearExcelFilterData(); eval(tableID+"_filter").setFilter(); } } } /**********************************************************************************************/ function excelFilterExists(tableID) { return $('#'+tableID+' .trovarit_table_excel_filter').length > 0; } /**********************************************************************************************/ function callTableToolbarFilter(tableID,callbackAfterSet) { if (!excelFilterExists(tableID)) { var filterText = $('input#'+tableID+'_input_filter').val().trim(); $('table#'+tableID+'>tbody>tr:visible').removeHighlight(); if (!filterText.length && $("table#"+tableID+">tbody>tr:hidden").length) { $('table#'+tableID+'>tbody>tr').show(); setToolbarInfo(tableID, false); reinitTablesorter(tableID, false); } else if (filterText.length) { $('table#'+tableID+'>tbody>tr:containsNC("'+filterText+'")').show(); $('table#'+tableID+'>tbody>tr:not(:containsNC("'+filterText+'"))').hide(); $('table#'+tableID+'>tbody>tr:visible').highlight(filterText); setToolbarInfo(tableID, false); reinitTablesorter(tableID, false); } if (callbackAfterSet != null) { eval(callbackAfterSet); } unblockScreen(true); } } $.extend($.expr[":"], { "containsNC": function(elem, i, match, array) { return (elem.textContent || elem.innerText || "").toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0; } }); /**********************************************************************************************/ function setToolbarInfo(tableID, initTotalCount) { if ($('table#'+tableID+'>tbody>tr:not([class*="table_toolbar_no_count"])').length == 0) { $('#'+tableID+'_visible_count').text(0); } else { $('#'+tableID+'_visible_count').text($('table#'+tableID+'>tbody>tr:not([class*="table_toolbar_no_count"]):visible').length); } if (initTotalCount) { $('#'+tableID+'_all_count').text($('table#'+tableID+'>tbody>tr:not([class*="table_toolbar_no_count"])').length); } } /**********************************************************************************************/ function tableToolbarFilterReset(tableID,callbackAfterSet) { if (!excelFilterExists(tableID)) { $('input#'+tableID+'_input_filter').val(""); } tableToolbarFilter(tableID,callbackAfterSet); } /**********************************************************************************************/ function addTableToolbar(tableID, filename, legendeContent, helpLink, disableExcelFilter) { if (disableExcelFilter == null) { disableExcelFilter = false; } if (($('#'+tableID).length == 1) && ($('#'+tableID).prev().attr("class") != "trovarit_table_toolbar_container")) { $.post( "https://smartrfi.it-matchmaker.com/core/ajax/ajax.php?PHPSESSID=f20c55a06ad936cb33481652d5baabff", { type: "GET_TABLE_TOOLBAR", page_charset: "utf-8", app_language: "en", tableID: tableID, filename: filename, disableExcelFilter: disableExcelFilter, legendeTemplate: legendeContent, helpLink: helpLink }, function(html) { $('#'+tableID).before(html); }); } else { infoDialog("ERROR", "The table with this ID does not exist!"); } } /**********************************************************************************************/ function addTableExcelFilter(tableID, callbackAfterFilter,callbackAfterFilterToggle) { if (($('#'+tableID).length) && !excelFilterExists(tableID)) { var dialogPositions = ""; $('#'+tableID+'>thead:first th').each(function() { dialogPositions = dialogPositions + ($(this).is(":visible")?1:0).toString()+";"; }); $.trv_postJson({ url: "https://smartrfi.it-matchmaker.com/core/ajax/ajax.php?PHPSESSID=f20c55a06ad936cb33481652d5baabff", ajax_type: "ADD_EXCEL_TABLE_FILTER", disableErrorOnReload: true, parameter: { page_charset: "utf-8", app_language: "en", appName: "homepage_de", tableID: tableID, callbackAfterFilter: callbackAfterFilter, dialogPositions: dialogPositions.rtrim(";") }, onSuccess: function(data) { $('#'+tableID+'>thead:first').prepend(data.filterContent); if (callbackAfterFilterToggle != null) { eval(callbackAfterFilterToggle); } if (data.filterData != "") { eval(tableID+"_filter").setJsonFilter(data.filterData); eval(tableID+"_filter").filterTable(); } } }); } else { infoDialog("ERROR", "The table with this ID does not exist!"); } } /**********************************************************************************************/ function reinitTablesorter(tableID, tableUpdate = true) { if ($("table#"+tableID).length) { if (tableUpdate) { $("table#"+tableID).trigger("update"); $("table#"+tableID).trigger("appendCache"); } if ($("table#"+tableID)[0].config != null) { $("table#"+tableID).trigger("sorton", [$("table#"+tableID)[0].config.sortList]); } setZebraTableSorter(tableID); } } /**********************************************************************************************/ function initTablesorter(tableID, sortRow, sortDescending,sortList) { if (sortRow == null) { sortRow = 0; } if (sortDescending == null) { sortDescending = 0; } var sortArray = [[sortRow,sortDescending]]; if (sortList != null) sortArray = sortList; $('table#'+tableID).tablesorter({ widgets: ['zebra'], sortList: sortArray, delayInit: true, textExtraction: function(node) { return $("span.sortThis", node).text(); } }); setZebraTableSorter(tableID); } function setZebraTableSorter(tableID) { if ($('table#'+tableID+'>tbody>tr:visible').length == 1) { setTableZebra(tableID); } } function initTablesorterWithChilds(tableID, sortRow, sortDescending, collapsed) { if (sortRow == null) { sortRow = 0; } if (sortDescending == null) { sortDescending = 0; } $('table#'+tableID).collapsible("td.collapsible", {collapse: collapsed}); $('table#'+tableID).tablesorter ({ sortList: [[sortRow,sortDescending]], widgets: ['zebra'], headers: {0: {sorter: false}}, textExtraction: function(node) {return $("span.sortThis", node).text();} }); setZebraTableSorter(tableID); } /**********************************************************************************************/ function initFormValidator(formID, errorClass, ignoreElements) { if (errorClass == null) { errorClass = "trovarit_validation_error"; } if (ignoreElements == null) { ignoreElements = ":hidden"; } return $("#"+formID).validate({ meta: "validate", errorClass: errorClass, ignore: ignoreElements, errorPlacement: function(error, element) { } }); } /**********************************************************************************************/ function isFormValid(formID, position, isIFrame, focusErrorClassAfterClose, showFirstTabWithError, alternativeMessage) { if ($('#'+formID).length > 0) { if ($('#'+formID).valid()) { return true; } else { if (isIFrame == true) { setIframeTop(); } if (focusErrorClassAfterClose != null) { focusErrorClassAfterClose = "$('."+focusErrorClassAfterClose+":first').focus();"; } if (showFirstTabWithError == true) { findFirstTabWithError(formID); } if (alternativeMessage != null && alternativeMessage != "") { infoDialog("ERROR", alternativeMessage, null, null, focusErrorClassAfterClose,position); } else { infoDialog("ERROR","Please fill in all mandatory fields!", null, null, focusErrorClassAfterClose,position); } return false; } } else { infoDialog("ERROR", "isFormValid(): No form with the id '"+formID+"' found!", null, null, null,position); } } /**********************************************************************************************/ function findFirstTabWithError(formID) { $("#"+formID+" ul.tabs li.tabs a").each(function(tabIndex, domEle) { if ($(this).parents(".trv_core_tabs").find($(this).attr("href")).find(".trv_core_input_white_validator_error:first").length == 1) { $(this).parents(".trv_core_tabs").tabs("select",tabIndex); return false; } }); } /**********************************************************************************************/ function dialogContentChanged(changed) { multiContentChanged(changed); } /**********************************************************************************************/ function multiContentChanged(changed,contentID) { if (changed) { if (contentID != null) { trv_multiContentChanged[contentID] = changed; } trv_dialogContentChanged = changed; setUnload(changed); } else { if (contentID != null) { delete trv_multiContentChanged[contentID]; } if (Object.keys(trv_multiContentChanged).length == 0) { trv_dialogContentChanged = changed; setUnload(changed); } } } /**********************************************************************************************/ function contentChanged(changed) { changedContent = changed; setUnload(changed); } /**********************************************************************************************/ function setUnload(enabled, infoText) { if (enabled) { if (!isSetUnload()) { $("a.trv_core_show_block_screen").unbind("click"); $(window).bind('beforeunload', function() { if (infoText == null) { return 'Changes to the data have not been saved yet!'; } else { return infoText; } }); $("body").data('setBeforeUnload',true); } } else if(!changedContent && !trv_dialogContentChanged && Object.keys(trv_multiContentChanged).length == 0) { if (isSetUnload()) { $(window).unbind('beforeunload'); $("a.trv_core_show_block_screen").bind("click", function(){blockScreen();}); $("body").data('setBeforeUnload',false); } } } /**********************************************************************************************/ function isSetUnload() { return $("body").data('setBeforeUnload')==true?true:false; } /**********************************************************************************************/ function trv_confirmClose(onYesFunction,type,isIFrame,contentID) { if ((type == 1 && (trv_dialogContentChanged || (contentID != null && trv_multiContentChanged[contentID]))) || (type == 0 && changedContent)) { isIFrame = (isIFrame == null || !isIFrame) ? 0:1; var position = getIFramePosition(isIFrame); var disableContentChanged = "dialogContentChanged(false);" if (contentID != null && type == 1) { disableContentChanged = "multiContentChanged(false,'"+contentID+"');" } if (type == 0) { disableContentChanged = "contentChanged(false);" } confirmDialog("CONFIRMATION",disableContentChanged+onYesFunction,"Data has been changed and not been saved!

Continue anyway?",null,400,null,position); return false; } else if (type == 1 || type == 0) { eval(onYesFunction); return true; } } /**********************************************************************************************/ function addValidatorCombobox() { jQuery.validator.addMethod("selectCombobox", function(value, element) { if (value == "") { return false; } return true; }, " "); } /**********************************************************************************************/ function addValidatorPositivNumber() { jQuery.validator.addMethod("numberPositiv", function(value, element) { return this.optional(element) || /^(?:0|[1-9][0-9]*)(?:[,][0-9]+)?$/.test(value); }, " "); } /**********************************************************************************************/ function addValidatorDateDE() { jQuery.validator.addMethod("dateDE", function(value, element) { var check = false; var re = /^\d{2}\.\d{2}\.\d{4}$/; if(value == "") { check = true; } else if( re.test(value)) { var adata = value.split('.'); var gg = parseInt(adata[0],10); var mm = parseInt(adata[1],10); var aaaa = parseInt(adata[2],10); var xdata = new Date(aaaa,mm-1,gg); if ( ( xdata.getFullYear() == aaaa ) && ( xdata.getMonth () == mm - 1 ) && ( xdata.getDate() == gg ) ) check = true; else check = false; } else check = false; return this.optional(element) || check; }, " "); } /**********************************************************************************************/ function addValidatorCurrency() { jQuery.validator.addMethod("currency", function(value, element) { if(value != "") { return String(value).search (/^-?\d{1,3}(?:,?\d{3})*(?:\.\d{1,2})?$/) != -1; } else { return true; } }, " "); } /**********************************************************************************************/ // this function Valitate a phone number. The right form must be +länderkennung(max 3 zahlen) (vorwahl(max 5 zahlen))nummer function addValidatorPhoneNumber() { jQuery.validator.addMethod("phoneNumber", function(value, element) { if (value != '' ) { var regPhone = new RegExp(/^\+[\d]{1,3} [\d (]{2,6}[)][\d]+$/); if (value.match(regPhone) == null) { return false; } return true; } return true; }, " "); } /**********************************************************************************************/ String.prototype.rtrim = function(chars) { chars = chars || "\\s"; return this.replace(new RegExp("[" + chars + "]+$", "g"), ""); } /**********************************************************************************************/ String.prototype.ltrim = function(chars) { chars = chars || "\\s"; return this.replace(new RegExp("^[" + chars + "]+", "g"), ""); } /**********************************************************************************************/ String.prototype.trim = function(chars) { return this.ltrim(chars).rtrim(chars); } /**********************************************************************************************/ /**********************************************************************************************/ function getTableCellText(tableCell) { if (jQuery(".multiSelectFilterData",tableCell).length) { var cellText = jQuery(".multiSelectFilterData",tableCell).text().trim(); return cellText.split("#;#"); } else { return (jQuery(".exportThis",tableCell).text().trim() || jQuery(".sortThis",tableCell).text().trim() || tableCell.textContent.trim() || ''); } } /**********************************************************************************************/ if(!Array.indexOf){ Array.prototype.indexOf = function(obj){ for(var i=0; i < this.length; i++){ if(this[i]==obj){ return i; } } return -1; } } /**********************************************************************************************/ function removeTableExcelFilter(tableID) { if (excelFilterExists(tableID)) { setExcelFilterVisible(tableID,0); if (eval(tableID+"_filter").hasExcelFilterData()) { $("#"+tableID+">tbody>tr").show(); setToolbarInfo(tableID,false); reinitTablesorter(tableID, false); } eval(tableID+"_filter = null"); $("div.trovarit_excel_filter_dialog").dialog('close'); $('table#'+tableID+'>thead>tr:first').remove(); } } /**********************************************************************************************/ function removeExcelFilterData(tableID) { $.post( "https://smartrfi.it-matchmaker.com/core/ajax/ajax.php?PHPSESSID=f20c55a06ad936cb33481652d5baabff", { type: "REMOVE_EXCEL_TABLE_FILTER_DATA", app_language: "en", appName: "homepage_de", tableID: tableID }); } /**********************************************************************************************/ function saveExcelFilterData(tableID,filterData) { $.post( "https://smartrfi.it-matchmaker.com/core/ajax/ajax.php?PHPSESSID=f20c55a06ad936cb33481652d5baabff", { type: "SAVE_EXCEL_TABLE_FILTER_DATA", page_charset: "utf-8", app_language: "en", appName: "homepage_de", tableID: tableID, filterData: filterData }); } /**********************************************************************************************/ function setExcelFilterVisible(tableID, filterVisible) { $.post( "https://smartrfi.it-matchmaker.com/core/ajax/ajax.php?PHPSESSID=f20c55a06ad936cb33481652d5baabff", { type: "SET_EXCEL_TABLE_FILTER_VISIBLE", page_charset: "utf-8", app_language: "en", appName: "homepage_de", tableID: tableID, filterVisible: filterVisible }); } /**********************************************************************************************/ function getExcelFilterVisible(tableID,callbackAfterFilter,callbackAfterFilterToggle) { $.post( "https://smartrfi.it-matchmaker.com/core/ajax/ajax.php?PHPSESSID=f20c55a06ad936cb33481652d5baabff", { type: "GET_EXCEL_TABLE_FILTER_VISIBLE", page_charset: "utf-8", app_language: "en", appName: "homepage_de", tableID: tableID }, function(data) { if (data == 1 && !excelFilterExists(tableID)) { toggleTableExcelFilter(tableID,callbackAfterFilter,callbackAfterFilterToggle); } }); } /**********************************************************************************************/ function toggleTableExcelFilter(tableID, callbackAfterFilter,callbackAfterFilterToggle) { blockScreen(true); if (excelFilterExists(tableID)) { removeTableExcelFilter(tableID); $('#'+tableID+'_excel_filter').removeClass('trovarit_toolbar_button_active'); eval(tableID+"_toggleSearch(true);"); if (callbackAfterFilterToggle != null) { eval(callbackAfterFilterToggle); } } else { $('input#'+tableID+'_input_filter').val(""); blockScreen(true);callTableToolbarFilter(tableID); addTableExcelFilter(tableID, callbackAfterFilter,callbackAfterFilterToggle); $('#'+tableID+'_excel_filter').addClass('trovarit_toolbar_button_active'); eval(tableID+"_toggleSearch(false);"); } unblockScreen(true); } /**********************************************************************************************/ function excelFilter(tableID, callbackAfterFilter) { var filterData = new Array(); var tableID = tableID; var colMapping = new Array(); var callbackAfterFilter = callbackAfterFilter; this.getFilterDialog = function(element,position) { if ($("div.trovarit_excel_filter_dialog:visible").length == 1) { $("div.trovarit_excel_filter_dialog").dialog('close'); } else { blockScreen(true); $.post( "https://smartrfi.it-matchmaker.com/core/ajax/ajax.php?PHPSESSID=f20c55a06ad936cb33481652d5baabff", { type: "GET_EXCEL_FILTER_DIALOG", page_charset: "utf-8", app_language: "en", tableID: tableID, position: position, possibleFilter: JSON.stringify(this.getAllFilterData(element,position)) }, function(data) { openExcelSelectDialog(element,data, tableID, position); }); } } /**********************************************************************************************/ this.filterTable = function() { blockScreen(true); eval("setTimeout(function(){"+tableID+"_filter.filterTableNow();}, 150)"); } /**********************************************************************************************/ function openExcelSelectDialog(element,content, tableID,position) { var posElement = $(element).parent().parent(); $("body").append("
"); $("div.trovarit_excel_filter_dialog").hide().html(content); var pageOffsetTop = window.pageYOffset || document.documentElement && document.documentElement.scrollTop || document.body.scrollTop; var pageOffsetLeft = window.pageXOffset || document.documentElement && document.documentElement.scrollLeft || document.body.scrollLeft; var dialogWidth = 330; var dialogLeft = posElement.offset().left-1; if (dialogLeft+dialogWidth > ($('#'+tableID).position().left+$('#'+tableID).innerWidth())) { dialogLeft = posElement.offset().left+posElement.innerWidth()-dialogWidth-pageOffsetLeft-1; } $("div.trovarit_excel_filter_dialog").dialog({ close: function(event, ui) { $(this).dialog('destroy'); $("div.trovarit_excel_filter_dialog").remove(); }, resize: function(event, ui) { var tableHeight = $('.trovarit_excel_filter_dialog.ui-dialog-content').height()-$('.trovarit_excel_filter_dialog.ui-dialog-content .trovarit_table_toolbar_container').height()-8; $('div#trovarit_excel_filter_select').height(tableHeight); }, resizable: true, draggable: true, height: 300, width: 370, minWidth: 300, dialogClass: 'trovarit_filter_dialog', position: [Math.round(dialogLeft),Math.round(posElement.offset().top+posElement.innerHeight()-pageOffsetTop)+3], bgiframe: true, modal: false, buttons: { "Del.": function() { $("#trovarit_excel_filter_select input:checked").removeAttr("checked");eval(tableID+"_filter").setFilter(position);$(this).dialog('close');},"Cancel": function() { $(this).dialog("close"); },"OK": function() { eval(tableID+"_filter").setFilter(position);$(this).dialog('close'); } } }); } /**********************************************************************************************/ function getExcelFilterData(position, filterData) { if (position == null) { return filterData; } else { return filterData[position]; } } /**********************************************************************************************/ this.getData = function() { return filterData; } /**********************************************************************************************/ this.setData = function(newFilterData) { filterData = newFilterData; } /**********************************************************************************************/ this.setExcelFilterData = function(position, filter) { filterData[position] = filter; } /**********************************************************************************************/ this.clearExcelFilterData = function() { filterData = new Array(); } /**********************************************************************************************/ this.hasExcelFilterData = function() { for ( i=0; i < filterData.length; i++ ) { if (filterData[i] != 'undefined' && filterData[i] != null) { return true; } } return false; } /**********************************************************************************************/ this.getExcelFilterCount = function() { var filterCount = 0; for ( i=0; i < filterData.length; i++ ) { if (filterData[i] != 'undefined' && filterData[i] != null) { filterCount++; } } return filterCount; } /**********************************************************************************************/ this.getAllFilterData = function(element,position) { var filterData = {}; var table = $(element).parents(".trovarit_sort_table"); $("tbody tr td:nth-child("+position+")",table).each(function() { var rowText = getTableCellText(this); var isVisible = $(this).is(":visible"); var rowData = {}; if (rowText instanceof Array) { for( var k=0; k < rowText.length; k++ ) { rowText[k]=rowText[k].replace(/(\r\n|\n|\r)/gm,"").trim(); if (filterData[rowText[k]] == null) { filterData[rowText[k]] = {"isVisible": isVisible}; } else if (isVisible) { filterData[rowText[k]].isVisible = true; } } } else { rowText=rowText.replace(/(\r\n|\n|\r)/gm,"").trim(); if (filterData[rowText] == null) { filterData[rowText] = {"isVisible": isVisible}; } else if (isVisible) { filterData[rowText].isVisible = true; } } }); return filterData; } /**********************************************************************************************/ this.setCheckedDialogFilter = function(position) { var values = getExcelFilterData(position,filterData); if ((values != null) && (values != 'undefined')) { $.each(values, function(key, value) { $("input[value='"+value.replace(/\'/g,"\\'")+"']").attr("checked","checked"); }); } } /**********************************************************************************************/ this.setFilterHeader = function() { if (this.hasExcelFilterData()) { $.each(filterData, function(col, value) { if (value != 'undefined' && value != null) { $('#'+tableID+' thead .trv_excel_filter-'+(col-1)).addClass("trovarit_table_excel_filter_active"); $('#'+tableID+' thead .trv_excel_filter-'+(col-1)+" .trv_core_header_lable").text(value.length); $('#'+tableID+' thead .trv_excel_filter-'+(col-1)+" .trv_core_excel_filter_delete_header").show(); } else { $('#'+tableID+' thead .trv_excel_filter-'+(col-1)).removeClass("trovarit_table_excel_filter_active"); $('#'+tableID+' thead .trv_excel_filter-'+(col-1)+" .trv_core_header_lable").text(""); $('#'+tableID+' thead .trv_excel_filter-'+(col-1)+" .trv_core_excel_filter_delete_header").hide(); } }); } else { $('#'+tableID+' thead .trovarit_table_excel_filter').removeClass("trovarit_table_excel_filter_active"); $('#'+tableID+' thead .trovarit_table_excel_filter .trv_core_header_lable').text(""); $('#'+tableID+' thead .trovarit_table_excel_filter .trv_core_excel_filter_delete_header').hide(); } } /**********************************************************************************************/ this.setFilter = function(position) { var filterArray = new Array(); $("input[name='filter']:checked").each(function(key, value) { filterArray.push($(this).val()); }); if (filterArray.length == 0) { filterArray = null; } this.setExcelFilterData(position,filterArray); if (filterData.length == 0) { removeExcelFilterData(tableID); } else { saveExcelFilterData(tableID, this.getJsonFilter()); } this.filterTable(); } /**********************************************************************************************/ this.setHeaderLabel = function() { $.each(getExcelFilterData(position, filterData), function(key, value) { $("input[value='"+value+"']").attr("checked","checked"); }); } /**********************************************************************************************/ this.getFilterPositions = function() { var positions = new Array(); $.each(filterData, function(key, value) { if (value != 'undefined' && value != null) { positions.push(key); } }); return positions; } /**********************************************************************************************/ this.getJsonFilter = function() { var jsonString = '{"length":'+filterData.length+','; $.each(filterData, function(key, value) { if (value != 'undefined' && value != null) { jsonString += '"'+key+'":['; $.each(value, function(innerKey, innerValue) { jsonString += '"'+addslashes(innerValue)+'",'; }); jsonString = jsonString.rtrim(","); jsonString += '],'; } }); jsonString = jsonString.rtrim(","); jsonString += '}'; return jsonString; } /**********************************************************************************************/ this.setJsonFilter = function(jsonString) { var data = $.parseJSON(jsonString); this.clearExcelFilterData(); for(var i=0; i< data["length"]; i++) { if (data[i] != 'undefined' && data[i] != null) { this.setExcelFilterData(i,data[i]); } } } /**********************************************************************************************/ this.filterTableNow = function() { this.setFilterHeader(); $("#"+tableID+">tbody>tr").removeClass("trv_found"); if (this.hasExcelFilterData()) { var colPositions = this.getFilterPositions(); var foundRowsArray = new Array; var preselectFilter = new Array; $.each(colPositions, function(keyCol,colPosition) { preselectFilter.push(["#"+tableID+">tbody>tr>td:nth-child("+colPosition+")",":tableCellContains('"+filterData[colPosition].join("','")+"')"]); }); $.each(preselectFilter, function(index,selector) { var innerRows = new Array(); $(selector[0]).filter(selector[1]).each(function(){ innerRows.push($(this).parents("tr:first")); }); foundRowsArray.push(innerRows); }); var foundRows = foundRowsArray.shift().reduce(function(res, v) { if (!trv_isObjectInArray(v,res) && foundRowsArray.every(function(a) { return trv_isObjectInArray(v,a); })) res.push(v[0]); return res; }, []); $(foundRows).addClass("trv_found").show(); $("#"+tableID+">tbody>tr:visible:not('.trv_found')").hide(); } else { $("#"+tableID+">tbody>tr").show(); } setToolbarInfo(tableID,false); reinitTablesorter(tableID, false); if (callbackAfterFilter != null) { eval(callbackAfterFilter); } unblockScreen(true); } } function trv_isObjectInArray(obj, searchArray) { returnValue = false; $.each(searchArray, function(index,arrayObject) { if (obj.is(arrayObject)) { returnValue = true; return; } }); return returnValue; } jQuery.expr[':'].tableCellContains = function(obj, index, meta, stack){ var theList = []; if (meta[3].indexOf("','") !== -1) { theList = meta[3].substring(1, meta[3].length-1).split("','"); } else { theList.push(meta[3]); } if (jQuery(".multiSelectFilterData",obj).length) { var content = jQuery(".multiSelectFilterData",obj).text().trim(); } else { var content = (jQuery(".exportThis",obj).text().trim() || jQuery(".sortThis",obj).text().trim() || obj.textContent.trim() || ''); } content = content.replace(/(\r\n|\n|\r)/gm,""); if (content.indexOf("#;#") !== -1) { content = content.split("#;#"); if (theList.length == 1) { return content.indexOf(theList[0]) !== -1; } else { returnVal = false; $.each(content, function (index, searchText) { if (theList.indexOf(searchText) !== -1) { returnVal = true; return; } }); return returnVal; } } else { return theList.indexOf(content) !== -1; } }; /**********************************************************************************************/ function setTableZebra(tableID) { $("#"+tableID+">tbody>tr:not([class*='table_toolbar_no_count']):visible:even").removeClass("even odd").addClass("odd"); $("#"+tableID+">tbody>tr:not([class*='table_toolbar_no_count']):visible:odd").removeClass("even odd").addClass("even"); } /**********************************************************************************************/ function setIframeTop(jquerySelectorTag, offsetPixel) { var topPosition = 0; if (jquerySelectorTag == null) { jquerySelectorTag = "body,html,document"; } else { topPosition = $(jquerySelectorTag).position().top; } if (offsetPixel != null) { topPosition += offsetPixel; } $("body").append(''); $('#trv_top_scroll_dummy').focus(); $('#trv_top_scroll_dummy').remove(); } /**********************************************************************************************/ function getIFramePosition(isIFrame) { var position = "center"; if (isIFrame) { position = ['center',20]; setIframeTop(); } return position; } /**********************************************************************************************/ $.fn.animateHighlight = function(highlightColor, duration, onComplete) { var highlightBg = highlightColor || "#FF6060"; var animateMs = duration || 2000; var originalBg = this.css("backgroundColor"); this.stop().css("background-color", highlightBg).animate({backgroundColor: originalBg}, animateMs, function() {$(this).css({"background-color":""});eval(onComplete)}); }; /**********************************************************************************************/ function trv_setPiwik(url,title) { if (typeof _paq !== 'undefined') { _paq.push(['trackPageView',title]); } } /**********************************************************************************************/ $.extend({ getUrlVars: function(){ var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for(var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars; }, getUrlVar: function(name){ return $.getUrlVars()[name]; } }); /**********************************************************************************************/ $(document).ready( function() { var trvShowInfo = $.getUrlVar('trvShowInfo'); var isIFrame = $.getUrlVar('isIFrame'); $("._blank").attr("target", "_blank"); if (trvShowInfo != null && trvShowInfo.length > 0) { isIFrame = (isIFrame == null || !isIFrame) ? 0:1; var position = getIFramePosition(isIFrame); infoDialog("INFORMATION",decodeURIComponent(trvShowInfo),null,null,null, position); } }); /**********************************************************************************************/ function showServiceWarning() { var serviceContainer = '
'; $(".trv_core_service_warning_container").html(serviceContainer); } /**********************************************************************************************/ function trv_printTable(tableID) { if ($('#'+tableID).prev().attr("class") != "trv_core_print_additional_info") { $('#'+tableID).before('
'); } if ($('#'+tableID).prev(".trv_core_print_additional_info").find(".trv_core_print_logo").length == 0) { $('#'+tableID).prev().prepend('
Printed on:
Number of entries:
'); } $('#'+tableID).prev().find(".trv_core_print_row_count").text($('#'+tableID+"_visible_count").text()); $('#'+tableID).prev().find(".trv_core_print_lable_create_date").text(trv_core_get_current_date()); $('#'+tableID).parent().printElement( { printMode:'popup', leaveOpen:true, overrideElementCSS:['https://smartrfi.it-matchmaker.com/core/styles/table_print.css', {href:'https://smartrfi.it-matchmaker.com/core/styles/table_print.css',media:'print'}, 'https://smartrfi.it-matchmaker.com/core/modules/bar_chart/styles/bar_chart_print.css', {href:'https://smartrfi.it-matchmaker.com/core/modules/bar_chart/styles/bar_chart_print.css',media:'print'}] }); } /**********************************************************************************************/ function trv_core_get_current_date() { var now = new Date(); var month = (now.getMonth()+1)<10?"0"+(now.getMonth()+1):(now.getMonth()+1); var day = now.getDate()<10?"0"+now.getDate():now.getDate(); var year = now.getFullYear(); var hour = now.getHours()<10?"0"+now.getHours():now.getHours(); var min = now.getMinutes()<10?"0"+now.getMinutes():now.getMinutes(); return day+"."+month+"."+year+" - "+hour+":"+min; } /**********************************************************************************************/ function ie_fix_HrefJSLinks() { if (navigator.appVersion.indexOf("MSIE") != -1) { $('a').filter(function() { return (/^javascript\:/i).test($(this).attr('href')); }).each(function() { var hrefscript = $(this).attr('href'); hrefscript = hrefscript.substr(11); $(this).data('hrefscript', hrefscript); }).click(function() { var hrefscript = $(this).data('hrefscript'); eval(hrefscript); return false; }).attr('href', '#'); } } /**********************************************************************************************/ $.fn.focusToEnd = function(addSpaceAtEnd) { return this.each(function() { var v = $(this).val(); if (addSpaceAtEnd == true && v.length > 0) { v = v.rtrim()+" "; } $(this).focus().val("").val(v); }); }; function initTinyMCE(selector,afterInit, readonly_status, showTableEdit, showAddUserNameAndDate, showSerialLetterVariables, enableFullScreen) { var tablePlugin = ""; var tableToolbar = ""; var userNameAndDatePlugin = ""; var userNameAndDateToolbar = ""; var serialLetterVariablesPlugin = ""; var serialLetterVariablesToolbar = ""; var fullscreenPlugin = ""; var fullscreenToolbar = ""; if (selector == null) { selector = "textarea"; } if(readonly_status == null) { readonly_status = false; } if(showTableEdit == null) { showTableEdit = false; } if(showAddUserNameAndDate == null) { showAddUserNameAndDate = false; } if(enableFullScreen == null) { enableFullScreen = false; } if (showTableEdit) { tablePlugin = " table"; tableToolbar = " | table"; } if (showAddUserNameAndDate) { userNameAndDatePlugin = "user_and_date "; userNameAndDateToolbar = "user_and_date_on_top user_and_date_cursor | "; } if (showSerialLetterVariables != null) { serialLetterVariablesPlugin = " serial_letter_variables "; serialLetterVariablesToolbar = " | serial_letter_variables "; } if (enableFullScreen) { fullscreenPlugin = " fullscreen "; fullscreenToolbar = " | fullscreen"; } tinymce.baseURL = "https://smartrfi.it-matchmaker.com/core/jscripts/tinymce/"; tinymce.suffix = '.min'; tinymce.init({ readonly: readonly_status, selector: selector, skin_url: 'https://smartrfi.it-matchmaker.com/core/jscripts/tinymce/skins/lightgray', entity_encoding : "raw", elementpath: false, resize:true, branding: false, content_css: 'https://smartrfi.it-matchmaker.com/core/styles/tinymce_content_fix.css', menubar : false, plugins: [ userNameAndDatePlugin+"advlist autolink lists charmap hr searchreplace wordcount visualblocks visualchars code textcolor paste preview noneditable link"+tablePlugin+serialLetterVariablesPlugin+fullscreenPlugin ], toolbar: userNameAndDateToolbar+"undo redo | visualblocks | formatselect fontsizeselect forecolor | bold italic underline strikethrough | removeformat | alignleft aligncenter alignright alignjustify | hr | cut copy paste pastetext | bullist numlist | searchreplace | code preview | link"+tableToolbar+serialLetterVariablesToolbar+fullscreenToolbar, paste_word_valid_elements: "@[style],-strong/b,-em/i,-span,-p,-ol,-ul,-li,-table,-tr,-td[colspan|rowspan],-th,-thead,-tfoot,-tbody,-a[href|name],sub,sup,strike,br,u", setup : function(editor) { editor.on("change", tinyOnChangeHandler); editor.on("init", afterInit); } }); } function tinyOnChangeHandler() { //JB 11.08.2014: Platzhalter, damit es keinen Fehler gibt, wenn die Funktion nicht gesetzt wird } function trv_getPossibleSerialLetterVars() { //JB 14.08.2018: Platzhalter, damit es keinen Fehler gibt, wenn die Funktion nicht gesetzt wird } function trv_core_jump_top() { if ($(".ui-dialog-titlebar").length > 0) { setIframeTop('.ui-dialog-titlebar:last'); } else { setIframeTop(); } } function trv_setLastViewedTableRowMarker(tableRowID) { $('tr#'+tableRowID).parent().find("tr").removeClass("trv_core_last_viewed_marker"); $('tr#'+tableRowID).addClass("trv_core_last_viewed_marker"); } function trv_number_format(nummer,nachkommastellen,seperator,tausender_seperator) { var isNegativNummer = false; if (nummer < 0) { isNegativNummer = true; nummer = nummer * (-1); } nummer = Math.round( nummer * Math.pow(10, nachkommastellen) ) / Math.pow(10, nachkommastellen); str_nummer = nummer+""; arr_int = str_nummer.split("."); if(!arr_int[0]) arr_int[0] = "0"; if(!arr_int[1]) arr_int[1] = ""; if(arr_int[1].length < nachkommastellen){ nachkomma = arr_int[1]; for(i=arr_int[1].length+1; i <= nachkommastellen; i++){ nachkomma += "0"; } arr_int[1] = nachkomma; } if(tausender_seperator != "" && arr_int[0].length > 3){ Begriff = arr_int[0]; arr_int[0] = ""; for(j = 3; j < Begriff.length ; j+=3){ Extrakt = Begriff.slice(Begriff.length - j, Begriff.length - j + 3); arr_int[0] = tausender_seperator + Extrakt + arr_int[0] + ""; } str_first = Begriff.substr(0, (Begriff.length % 3 == 0)?3:(Begriff.length % 3)); arr_int[0] = str_first + arr_int[0]; } return (isNegativNummer?"-":"")+arr_int[0]+seperator+arr_int[1]; } function nl2br (str) { var breakTag = '
'; return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag + '$2'); } (function ( $ ) { jQuery.trv_postJson = function (options) { var fullPath = "NVlFXzhjbUlsYDx5b3JMaH1gU0hFcyNEX2RVeSx9Q0ZkSjJMQDJJOCE-JUd-VyVncEA7WkYpKlM9V087QXdGYzM2S2tpSCoy"; var logAjaxError = function (url,parameter,errorStatus,errorStatusText,errorResponseText,requestStatusText) { var errorData = new Object(); errorData["errorStatus"] = errorStatus; errorData["errorStatusText"] = errorStatusText; errorData["errorResponseText"] = errorResponseText; errorData["requestStatusText"] = requestStatusText; $.post( "https://smartrfi.it-matchmaker.com/core/ajax/ajax.php?PHPSESSID=f20c55a06ad936cb33481652d5baabff",{ ajax_type: "LOG_AJAX_ERROR", full_path: fullPath, url: url, parameter: $.toJSON(parameter), error: $.toJSON(errorData) }); } var toggleSaveInfo = function(actionType) { if (settings.showSavingInfoIn != null) { trv_toggleSaveInfo($(settings.showSavingInfoIn),actionType,settings.alternativeSavingInfoText); } } var settings = $.extend({ disableErrorOnReload: false, errorDailogPosition: "top", errorDailogWidth: 950, errorDailogCenterText: false, alternativeErrorMessage: null, blockScreen: true, ajax_type: null, showSavingInfoIn: null, // must be element alternativeSavingInfoText: null, module_name: null, url: null, ajaxFile: "ajax.php", full_path: fullPath, parameter: null, onSuccess: function(data) {}, onErrorFirst:function(data) {} }, options ); if (settings.blockScreen) { blockScreen(true); } toggleSaveInfo("show"); if (settings.parameter == null) { settings.parameter = new Object(); } if (settings.full_path != null) { settings.parameter.full_path = settings.full_path; } if (settings.ajax_type != null) { settings.parameter.ajax_type = settings.ajax_type; } if (settings.url == null) { if (settings.module_name == null) { settings.url = "/ajax/"+settings.ajaxFile+"?PHPSESSID=f20c55a06ad936cb33481652d5baabff"; } else { settings.url = "https://smartrfi.it-matchmaker.com/core/modules/"+settings.module_name+"/ajax/"+settings.ajaxFile+"?app_language=en&PHPSESSID=f20c55a06ad936cb33481652d5baabff"; } } var internalErrorText = "INTERNAL ERROR: Perhaps your Internet connection has been interrupted?

Please try to repeat your action ...
"; $.post( settings.url, settings.parameter, function(data, status, xhr) { if (status == "success") { toggleSaveInfo("hide"); if (data === null || (!isNaN(parseFloat(data)) && typeof(data) !== 'object')) { settings.onErrorFirst.call(this,xhr); unblockScreen(); infoDialog("ERROR",settings.alternativeErrorMessage || internalErrorText,null,600,null,settings.errorDailogPosition); var info = "Number returned"; if (data == null) { info = "NULL returned"; } logAjaxError(settings.url,settings.parameter,xhr.status,xhr.statusText,"",info); } else if (data.postJsonMessage != null) { settings.onErrorFirst.call(this,xhr); var messageTitle = "ERROR"; var messageDialogWidth = 400; if (data.postJsonMessageTitle != null) { messageTitle = data.postJsonMessageTitle; } if (data.postJsonMessageDialogWidth != null) { messageDialogWidth = data.postJsonMessageDialogWidth; } unblockScreen(); infoDialog(messageTitle,data.postJsonMessage,null,messageDialogWidth,null,settings.errorDailogPosition,null,!settings.errorDailogCenterText); } else { settings.onSuccess.call(this,data); } } if (status == "error" || status == "timeout" || status == "parsererror") { settings.onErrorFirst.call(this,xhr); var statusResponseText = xhr.responseText; if (statusResponseText == "" || statusResponseText == null) { statusResponseText = internalErrorText; } toggleSaveInfo("hide"); unblockScreen(); infoDialog("ERROR",settings.alternativeErrorMessage || (status+"
"+xhr.statusText+" ("+xhr.status+")
"+statusResponseText),null,settings.errorDailogWidth,null,settings.errorDailogPosition,null,!settings.errorDailogCenterText); logAjaxError(settings.url,settings.parameter,xhr.status,xhr.statusText,statusResponseText,status); } if (settings.blockScreen) { unblockScreen(true); } },"json").error(function (error) { settings.onErrorFirst.call(this,error); if (!settings.disableErrorOnReload || (settings.disableErrorOnReload && error.readyState != 0 && error.status != 0)) { toggleSaveInfo("hide"); unblockScreen(); var responseText = error.responseText; if (responseText == "" || responseText == null) { responseText = internalErrorText; } infoDialog("ERROR",settings.alternativeErrorMessage || responseText,null,settings.errorDailogWidth,null,settings.errorDailogPosition,null,!settings.errorDailogCenterText); logAjaxError(settings.url,settings.parameter,error.status,error.statusText,responseText,"Is not a JSON string"); } }); } $.fn.trv_load = function (options) { var fullPath = "NVlFXzhjbUlsYDx5b3JMaH1gU0hFcyNEX2RVeSx9Q0ZkSjJMQDJJOCE-JUd-VyVncEA7WkYpKlM9V087QXdGYzM2S2tpSCoy"; var logLoadError = function (url,errorStatus,errorStatusText,errorResponseText,requestStatusText) { var errorData = new Object(); errorData["errorStatus"] = errorStatus; errorData["errorStatusText"] = errorStatusText; errorData["errorResponseText"] = errorResponseText; errorData["requestStatusText"] = requestStatusText; $.post( "https://smartrfi.it-matchmaker.com/core/ajax/ajax.php?PHPSESSID=f20c55a06ad936cb33481652d5baabff",{ ajax_type: "LOG_LOAD_ERROR", full_path: fullPath, url: url, error: $.toJSON(errorData) }); } var settings = $.extend({ disableErrorOnReload: false, errorDailogPosition: "top", errorDailogWidth: 750, errorDailogCenterText: false, blockScreen: true, div_id: null, path: null }, options ); var internalErrorText = "INTERNAL ERROR: Perhaps your Internet connection has been interrupted?

Please try to repeat your action ...
"; $("#"+settings.div_id).load(settings.path, function(response, status, xhr) { if(status == "error" || status == "timeout" || status == "parsererror") { unblockScreen(); var responseText = xhr.responseText; if (responseText == "" || responseText == null) { responseText = internalErrorText; } infoDialog("ERROR",responseText,null,null,null,null,null,null); logLoadError('https://smartrfi.it-matchmaker.com',xhr.status,xhr.statusText,responseText,"Something is wrong in "+settings.div_id, 'NVlFXzhjbUlsYDx5b3JMaH1gU0hFcyNEX2RVeSx9Q0ZkSjJMQDJJOCE-JUd-VyVncEA7WkYpKlM9V087QXdGYzM2S2tpSCoy'); $("#"+settings.div_id).remove(); } } ); return this; }; $.fn.trv_tinyMCE_isLengthValid = function(showInvalidInfo) { var invalidText = "At least one text input exceeds the allowed length or is a mandatory field and must contain an entry.

Please correct your input ..."; var allValid = true; var foundElement = this; $(tinyMCE.editors).each(function(index,editor){ $(foundElement).each(function() { var textLength = editor.getContent().length; var textRequired = $(editor.targetElm).hasClass("{validate: {required:true}}"); if ($(editor.targetElm).get(0) == $(this).get(0) && (!editor.plugins.charcount_with_limit.isLengthValid() || (textRequired && textLength == 0))) { if (textRequired && textLength == 0) { var statusPanel = editor.theme.panel.find('#statusbar'); statusPanel.addClass("charcount_limit"); } allValid = false; return false; } }) if (!allValid) return false; }) if (!allValid && showInvalidInfo) { infoDialog("ERROR",invalidText,null,500); } return allValid; } $.fn.trv_tinyMCE_destroy = function(){ var foundElement = this; $(tinyMCE.editors).each(function(index,editor){ $(foundElement).each(function() { if ($(editor.targetElm).get(0) == $(this).get(0)) { editor.destroy(); } }) }) } $.fn.trv_tinyMCE_init = function(options){ var settings = $.extend({ readOnly: false, enableFullscreen: false, enableMedia: false, showTableEdit: false, enablePasteImages: false, showAddUserNameAndDate: false, showSerialLetterVariables: false, maxChar: 0, afterInit: function(data) {}, onChange:function(data) {} }, options ); var tablePlugin = ""; var tableToolbar = ""; var userNameAndDatePlugin = ""; var userNameAndDateToolbar = ""; var serialLetterVariablesPlugin = ""; var serialLetterVariablesToolbar = ""; var fullscreenPlugin = ""; var fullscreenToolbar = ""; var mediaPlugin = ""; var mediaToolbar = ""; if (settings.showTableEdit) { tablePlugin = " table"; tableToolbar = " | table"; } if (settings.enableFullscreen) { fullscreenPlugin = " fullscreen "; fullscreenToolbar = " | fullscreen"; } if (settings.showAddUserNameAndDate) { userNameAndDatePlugin = "user_and_date "; userNameAndDateToolbar = "user_and_date_on_top user_and_date_cursor | "; } if (settings.showSerialLetterVariables) { serialLetterVariablesPlugin = " serial_letter_variables "; serialLetterVariablesToolbar = " | serial_letter_variables "; } if (settings.enableMedia) { mediaPlugin = " media "; mediaToolbar = " | media "; } tinymce.baseURL = "https://smartrfi.it-matchmaker.com/core/jscripts/tinymce"; tinymce.suffix = '.min'; tinymce.init({ readonly: settings.readOnly, selector: this.selector, content_css: 'https://smartrfi.it-matchmaker.com/core/styles/tinymce_content_fix.css', branding: false, skin_url: 'https://smartrfi.it-matchmaker.com/core/jscripts/tinymce/skins/lightgray', entity_encoding : "raw", elementpath: false, resize: true, paste_data_images: settings.enablePasteImages, menubar : false, max_char: settings.maxChar, plugins: [ userNameAndDatePlugin+"advlist autolink lists charmap hr searchreplace charcount_with_limit visualblocks visualchars code textcolor paste preview noneditable link"+tablePlugin+serialLetterVariablesPlugin+fullscreenPlugin+mediaPlugin ], toolbar: userNameAndDateToolbar+"undo redo | visualblocks | formatselect fontsizeselect forecolor | bold italic underline strikethrough | removeformat | alignleft aligncenter alignright alignjustify | hr | cut copy paste pastetext | bullist numlist | searchreplace | code preview | link"+tableToolbar+serialLetterVariablesToolbar+fullscreenToolbar+mediaToolbar, paste_word_valid_elements: "@[style],-strong/b,-em/i,-span,-p,-ol,-ul,-li,-table,-tr,-td[colspan|rowspan],-th,-thead,-tfoot,-tbody,-a[href|name],sub,sup,strike,br,u", setup : function(editor) { editor.on("change", settings.onChange); editor.on("init", settings.afterInit); } }); } $.fn.trv_scrollTo = function( target, options, callback ){ if(typeof options == 'function' && arguments.length == 2){ callback = options; options = target; } var settings = $.extend({ scrollTarget : target, offsetTop : 50, duration : 500, easing : 'swing' }, options); return this.each(function(){ var scrollPane = $(this); var scrollTarget = (typeof settings.scrollTarget == "number") ? settings.scrollTarget : $(settings.scrollTarget); var scrollY = (typeof scrollTarget == "number") ? scrollTarget : scrollTarget.offset().top + scrollPane.scrollTop() - parseInt(settings.offsetTop); scrollPane.animate({scrollTop : scrollY }, parseInt(settings.duration), settings.easing, function(){ if (typeof callback == 'function') { callback.call(this); } }); }); } }( jQuery )); function trv_toggleSaveInfo(element,actionType,alternativeText) { var infoText = "Data is stored ..."; if (actionType == null) { actionType = "auto"; } if (alternativeText != null) { infoText = alternativeText; } $(element).each(function() { var elementHeight = $(this).innerHeight(); var elementWidth = $(this).innerWidth(); var tableRowStyle = ''; var saveInfoPanel = '
'+infoText+'
'; if ($(this).css("position") == "static") { $(this).css("position","relative"); } if ($(this).find(".trv_core_save_info_overlay").length == 0 && (actionType == "show" || actionType == "auto")) { $(this).append(saveInfoPanel); } else if (actionType == "hide" || actionType == "auto") { $(this).find(".trv_core_save_info_overlay").remove(); } }); } function trv_searchTree(treeID,searchText) { if ($("#"+treeID).length > 0) { $("#"+treeID).jstree(true).search(searchText); } } function trv_core_startProgressFetch(progressID, alternativeLable) { showBockscreenProgressBar(alternativeLable); trv_core_progressFetch.currentProgressValue = 0; trv_core_progressFetch.progressID = progressID; trv_core_progressFetch.instance = setInterval(function() { $.get( "https://smartrfi.it-matchmaker.com/core/ajax/progress.php?id="+trv_core_progressFetch.progressID, function(data) { data = parseInt(data); if (data >= 0 && data <= 100 && data >= trv_core_progressFetch.currentProgressValue) { setBockscreenProgressValue(data); trv_core_progressFetch.currentProgressValue = data; } }); }, 150); } function trv_core_stopProgressBar() { if (trv_core_progressFetch != null) { clearInterval(trv_core_progressFetch.instance); hideBockscreenProgressBar(); trv_core_progressFetch = new Object(); } } function trv_core_startProgressInlilneFetch(progressID) { trv_core_progressInlineFetch.currentProgressValue = 0; trv_core_progressInlineFetch.progressID = progressID; trv_core_progressInlineFetch.instance = setInterval(function() { $.get( "https://smartrfi.it-matchmaker.com/core/ajax/progress.php?id="+trv_core_progressInlineFetch.progressID, function(data) { if (data.startsWith("intervall")) { if (trv_core_progressInlineFetch.intervall == null || (trv_core_progressInlineFetch.intervall != null && data != trv_core_progressInlineFetch.intervall.intervalName)) { trv_core_startIntervallProgressInline(data); } } else { if (trv_core_progressInlineFetch.intervall != null) { trv_core_stopIntervallProgressInline(); } trv_core_setProgressInline(data); } }); }, 150); } function trv_core_setProgressInline(percentValue) { percentValue = parseInt(percentValue); if (percentValue >= 0 && percentValue <= 100 && percentValue > trv_core_progressInlineFetch.currentProgressValue) { $(".trv_core_progress_inline_line").width(percentValue+"%").text(percentValue+"%"); trv_core_progressInlineFetch.currentProgressValue = percentValue; } } function trv_core_stopIntervallProgressInline() { if (trv_core_progressInlineFetch.intervall != null) { clearInterval(trv_core_progressInlineFetch.intervall.instance); trv_core_progressInlineFetch.intervall = null; } } function trv_core_startIntervallProgressInline(intervallData) { trv_core_stopIntervallProgressInline(); trv_core_progressInlineFetch.intervall = new Object(); trv_core_progressInlineFetch.intervall.intervalName = intervallData; $splitIntervallData = intervallData.split("-"); $startStop = $splitIntervallData[1].split("_"); trv_core_progressInlineFetch.intervall.currentProgressValue = parseInt($startStop[0]); trv_core_progressInlineFetch.intervall.intervalEnd = parseInt($startStop[1]); trv_core_progressInlineFetch.intervall.updateMilliseconds = parseInt($splitIntervallData[2]); trv_core_progressInlineFetch.intervall.instance = setInterval(function() { if (trv_core_progressInlineFetch.intervall.currentProgressValue == trv_core_progressInlineFetch.intervall.intervalEnd) { trv_core_stopIntervallProgressInline(); } else { trv_core_setProgressInline(trv_core_progressInlineFetch.intervall.currentProgressValue); trv_core_progressInlineFetch.intervall.currentProgressValue++; } }, trv_core_progressInlineFetch.intervall.updateMilliseconds); } function trv_core_stopProgressInline() { if (trv_core_progressInlineFetch != null) { trv_core_stopIntervallProgressInline(); clearInterval(trv_core_progressInlineFetch.instance); trv_core_progressInlineFetch = new Object(); } } function trv_core_calculate_table_sum(tableID) { if ($("#"+tableID+" tfoot tr.trv_core_table_row_sum").length) { $("#"+tableID+" tfoot tr.trv_core_table_row_sum td.trv_core_sum_this").each(function(index,element){ var colSum = 0; var countDigits = 0; $("#"+tableID+" tbody tr:visible td:nth-child("+($(element).data("column")+1)+")").each(function(indexRow, tableData){ var content = $('*:not(:has(*)):visible', tableData).text().trim(); if (content != "") { var splitDigits = content.split(","); content = content.replace(/\./g,"").replace(",","."); if (splitDigits[1] != null) { if (splitDigits[1].length != countDigits) { countDigits = splitDigits[1].length; } } colSum += parseFloat(content); } }); if ($(element).data("sum-digits") != null) { countDigits = $(element).data("sum-digits"); } colSum = trv_number_format(colSum,countDigits,countDigits > 0?",":"","."); if (colSum.indexOf("NaN") != -1) { colSum = "Not an number"; } $(element).text(colSum); }); } } function trv_core_getRawNumber(value,returnFormated,numberDecimalDigits) { var returnValue = ""; if (value.trim() != "") { value = value.split(","); $.each(value, function(position,numberValue) { value[position] = numberValue.replace(/[^0-9]/g,''); }); if (value.length > 1) { var returnValue = ""; $.each(value, function(position,numberValue) { returnValue = returnValue+numberValue; if (position == 0) { returnValue = returnValue+"."; } }); if (numberDecimalDigits == null) { numberDecimalDigits = returnValue.split("."); numberDecimalDigits = numberDecimalDigits.length > 1?numberDecimalDigits[1].length:0; numberDecimalDigits = numberDecimalDigits > 3?3:numberDecimalDigits; } if (returnFormated) { returnValue = $.number(returnValue, numberDecimalDigits, "," ,"."); } else { returnValue = $.number(returnValue, numberDecimalDigits, "," ,""); } } else { if (returnFormated) { returnValue = $.number(value[0], numberDecimalDigits, "," ,"."); } else { returnValue = value[0]; } } } return returnValue; } function isInputNumber(event,element) { var hasKomma = $(element).val().indexOf(",") > -1; if ((event.keyCode > 36 && event.keyCode < 58) || (event.keyCode > 95 && event.keyCode < 106) || event.keyCode == 110|| event.keyCode == 8 || event.keyCode == 13 || event.keyCode == 9 || (event.keyCode == 188 && !hasKomma) || event.keyCode == 27 || event.keyCode == 35 || event.keyCode == 36 || (event.ctrlKey && event.keyCode == 65) || (event.ctrlKey && event.keyCode == 86) || (event.ctrlKey && event.keyCode == 67)) { return true; } return false; } /**********************************************************************************************/ function addValidatorNumberPositivDigits() { jQuery.validator.addMethod("numberPositivDigits", function(value, element, parameter) { const testExpression = new RegExp('^(?:0|[1-9][0-9]*)(?:[,][0-9]{1,'+parameter+'})?$'); return this.optional(element) || testExpression.test(value); }, " "); } /**********************************************************************************************/ function addValidatorNumberDigits() { jQuery.validator.addMethod("numberDigits", function(value, element, parameter) { const testExpression = new RegExp('^-?(?:0|[-1-9][0-9]*)(?:[,][0-9]{1,'+parameter+'})?$'); return this.optional(element) || testExpression.test(value); }, " "); } jQuery.expr[':'].icontains = function(a, i, m) { return jQuery(a).text().toLowerCase() .indexOf(m[3].toLowerCase()) >= 0; }; function checkUsernameModule(userName, inputFormID, errorClass, showSelectDialog, isIFrame, callbackOnValidUserName, checkUpperCase) { var position = getIFramePosition(isIFrame); if (checkUpperCase == null) { checkUpperCase = 1; } checkUpperCase = checkUpperCase?1:0; $.trv_postJson({ errorDailogPosition: position, module_name: "check_username", ajax_type: "CHECK_USER_NAME", parameter: { userName: userName, checkUpperCase: checkUpperCase }, onSuccess: function(data) { if (data.userValid == 1) { $("#"+inputFormID).removeClass(errorClass); if(callbackOnValidUserName != null && (typeof callbackOnValidUserName == "function")) { callbackOnValidUserName(); } } else if (data.userValid == 0) { $("#"+inputFormID).addClass(errorClass); if (showSelectDialog) { openSelectNewUserNameDialog(userName, inputFormID, errorClass, isIFrame); } } } }); } function openSelectNewUserNameDialog(userName, inputFormID, errorClass, isIFrame) { if ($("#trv_module_dialog_check_user_name").length == 0) { blockScreen(); isIFrame = (isIFrame == null || !isIFrame) ? 0:1; var position = getIFramePosition(isIFrame); $("body").append(""); $("#trv_module_dialog_check_user_name").load("https://smartrfi.it-matchmaker.com/core/modules/check_username/components/dialog_select_user_name.php?userName="+encodeURI(userName)+"&inputFormID="+encodeURI(inputFormID)+"&errorClass="+encodeURI(errorClass)+"&full_path=NVlFXzhjbUlsYDx5b3JMaH1gU0hFcyNEX2RVeSx9Q0ZkSjJMQDJJOCE-JUd-VyVncEA7WkYpKlM9V087QXdGYzM2S2tpSCoy&app_language=en&PHPSESSID=f20c55a06ad936cb33481652d5baabff").dialog({ close: function(event, ui) { $(this).dialog('destroy'); $("#trv_module_dialog_check_user_name").remove(); $("#"+inputFormID).focus(); $("#"+inputFormID).select(); }, closeOnEscape: true, resizable: false, position: position, minHeight: 300, height: 'auto', width: 400, modal: true, bgiframe: true, title: "Choose different user name" }); } } function openModuleContactDialog(mailSubject,isIFrame,useSessionData,mailAdressSelector,mailAdressCCSelector,mailAdressBCCSelector,portalName,userCoreHeaderImages,additionalText) { if ($("#trv_module_dialog_contact").length == 0) { var width = '530'; width = window.innerWidth<= '850'?'94%':width; blockScreen(); mailAdressSelector = mailAdressSelector == null?"":mailAdressSelector; mailAdressCCSelector = mailAdressCCSelector == null?"":mailAdressCCSelector; mailAdressBCCSelector = mailAdressBCCSelector == null?"":mailAdressBCCSelector; portalName = portalName == null?"":portalName; additionalText = additionalText == null?"":additionalText; userCoreHeaderImages = userCoreHeaderImages == null || userCoreHeaderImages == 1?1:0; var dialogHeight = 470; useSessionData = (useSessionData == null || !useSessionData) ? 0:1; mailSubject = (mailSubject == null) ? "":mailSubject; isIFrame = (isIFrame == null || !isIFrame) ? 0:1; var position = getIFramePosition(isIFrame); if (useSessionData) { dialogHeight = 330; } $("body").append(""); $("#trv_module_dialog_contact").load("https://smartrfi.it-matchmaker.com/core/modules/contact/components/dialog_contact.php?userCoreHeaderImages="+encodeURIComponent(userCoreHeaderImages)+"&portalName="+encodeURIComponent(portalName)+"&additionalText="+encodeURIComponent(additionalText)+"&mailAdressSelector="+encodeURIComponent(mailAdressSelector)+"&mailAdressCCSelector="+encodeURIComponent(mailAdressCCSelector)+"&mailAdressBCCSelector="+encodeURIComponent(mailAdressBCCSelector)+"&isIFrame="+isIFrame+"&useSessionData="+useSessionData+"&mailSubject="+encodeURIComponent(mailSubject)+"&full_path=NVlFXzhjbUlsYDx5b3JMaH1gU0hFcyNEX2RVeSx9Q0ZkSjJMQDJJOCE-JUd-VyVncEA7WkYpKlM9V087QXdGYzM2S2tpSCoy&app_language=en&PHPSESSID=f20c55a06ad936cb33481652d5baabff").dialog({ close: function(event, ui) { moduleContactContentChanged(false); $(this).dialog('destroy'); $("#trv_module_dialog_contact").remove(); }, beforeClose: function(event, ui) { return closeContactDialog(isIFrame); }, open: function(event, ui) { $("#trv_module_dialog_contact").css("height", "inherit"); if (isIFrame && typeof setIFrameHeight === "function") { setTimeout(function() { var dialogHeight = $("#trv_module_dialog_contact").parents(".ui-dialog").height(); if (dialogHeight > $('html').outerHeight( true )) { setIFrameHeight(dialogHeight+50); } },600); } }, closeOnEscape: false, resizable: false, position: position, minHeight: dialogHeight, height: 'auto', width: width, modal: true, bgiframe: true, title: "Contact" }); } } function moduleContactSend(isIFrame,mailAdressSelector,mailAdressCCSelector,mailAdressBCCSelector) { isIFrame = (isIFrame == null || !isIFrame) ? 0:1; var position = getIFramePosition(isIFrame); if (isFormValid('trv_module_contact_form',position, isIFrame,'trv_core_input_white_validator_error')) { mailAdressSelector = mailAdressSelector == null?"":mailAdressSelector; mailAdressCCSelector = mailAdressCCSelector == null?"":mailAdressCCSelector; mailAdressBCCSelector = mailAdressBCCSelector == null?"":mailAdressBCCSelector; $.trv_postJson({ module_name: "contact", ajax_type: "SEND_CONTACT", parameter: { mailAdressSelector: mailAdressSelector, mailAdressCCSelector: mailAdressCCSelector, mailAdressBCCSelector: mailAdressBCCSelector, contactData: $('#trv_module_contact_form').serialize() }, onSuccess: function(data) { moduleContactContentChanged(false); $("#trv_module_dialog_contact").dialog("close"); infoDialog("INFORMATION","Your message was sent.
We will contact you as soon as possible.",null,null,null, position); } }); } } var moduleContactContentChangedVar = false; function moduleContactContentChanged(changed) { moduleContactContentChangedVar = changed; setUnload(changed, "The contact form was filled in but not submitted!"); } function closeContactDialog(isIFrame) { if (moduleContactContentChangedVar) { confirmCloseContactDialog(isIFrame); return false; } return true; } function confirmCloseContactDialog(isIFrame) { isIFrame = (isIFrame == null || !isIFrame) ? 0:1; var position = getIFramePosition(isIFrame); confirmDialog("CONFIRMATION","moduleContactContentChanged(false);$('#trv_module_dialog_contact').dialog('close');","The contact form was filled in but not submitted!

Cancel?",null,400,null,position); } function trv_upload_deleteFile(parameter, callAfterSucess, isIFrame) { var position = getIFramePosition(isIFrame); $.trv_postJson({ errorDailogPosition: position, module_name: "document_manager", ajax_type: "DELETE_FILE", parameter: { parameter: parameter }, onSuccess: function(data) { eval(callAfterSucess); } }); } function trv_upload_removeSelectedUploadFile(uploadName) { var oldFile = eval("current_file_link_"+uploadName); if (oldFile != "") { $('#input_'+uploadName).html(oldFile); $('#input_'+uploadName).parent().attr("title",oldFile.replace(/(<([^>]+)>)/ig,"")); } else { $('#input_'+uploadName).html(""); $('#input_'+uploadName).parent().removeAttr("title"); } eval("file_changed_"+uploadName+" = false"); } function trv_upload_verifyAllowedFileType(fileName, allowedExtensions, isIFrame) { var fileExtension = "."+fileName.split('.').pop().toLowerCase(); allowedExtensions = allowedExtensions.split(","); if (jQuery.inArray(fileExtension, allowedExtensions)!=-1) { return true; } else { var position = getIFramePosition(isIFrame); infoDialog("ERROR", "'"+fileName+"'

Wrong file type!

Please use one of these: "+allowedExtensions.join(", ")+"", null,600, null, position); return false; } } /** * AJAX Upload ( http://valums.com/ajax-upload/ ) * Copyright (c) Andrew Valums * Licensed under the MIT license */ (function () { /** * Attaches event to a dom element. * @param {Element} el * @param type event name * @param fn callback This refers to the passed element */ function addEvent(el, type, fn){ if (el.addEventListener) { el.addEventListener(type, fn, false); } else if (el.attachEvent) { el.attachEvent('on' + type, function(){ fn.call(el); }); } else { throw new Error('not supported or DOM not loaded'); } } /** * Attaches resize event to a window, limiting * number of event fired. Fires only when encounteres * delay of 100 after series of events. * * Some browsers fire event multiple times when resizing * http://www.quirksmode.org/dom/events/resize.html * * @param fn callback This refers to the passed element */ function addResizeEvent(fn){ var timeout; addEvent(window, 'resize', function(){ if (timeout){ clearTimeout(timeout); } timeout = setTimeout(fn, 100); }); } // Needs more testing, will be rewriten for next version // getOffset function copied from jQuery lib (http://jquery.com/) if (document.documentElement.getBoundingClientRect){ // Get Offset using getBoundingClientRect // http://ejohn.org/blog/getboundingclientrect-is-awesome/ var getOffset = function(el){ var box = el.getBoundingClientRect(); var doc = el.ownerDocument; var body = doc.body; var docElem = doc.documentElement; // for ie var clientTop = docElem.clientTop || body.clientTop || 0; var clientLeft = docElem.clientLeft || body.clientLeft || 0; // In Internet Explorer 7 getBoundingClientRect property is treated as physical, // while others are logical. Make all logical, like in IE8. var zoom = 1; if (body.getBoundingClientRect) { var bound = body.getBoundingClientRect(); zoom = (bound.right - bound.left) / body.clientWidth; } if (zoom > 1) { clientTop = 0; clientLeft = 0; } var top = box.top / zoom + (window.pageYOffset || docElem && docElem.scrollTop / zoom || body.scrollTop / zoom) - clientTop, left = box.left / zoom + (window.pageXOffset || docElem && docElem.scrollLeft / zoom || body.scrollLeft / zoom) - clientLeft; return { top: top, left: left }; }; } else { // Get offset adding all offsets var getOffset = function(el){ var top = 0, left = 0; do { top += el.offsetTop || 0; left += el.offsetLeft || 0; el = el.offsetParent; } while (el); return { left: left, top: top }; }; } /** * Returns left, top, right and bottom properties describing the border-box, * in pixels, with the top-left relative to the body * @param {Element} el * @return {Object} Contains left, top, right,bottom */ function getBox(el){ var left, right, top, bottom; var offset = getOffset(el); left = offset.left; top = offset.top; right = left + el.offsetWidth; bottom = top + el.offsetHeight; return { left: left, right: right, top: top, bottom: bottom }; } /** * Helper that takes object literal * and add all properties to element.style * @param {Element} el * @param {Object} styles */ function addStyles(el, styles){ for (var name in styles) { if (styles.hasOwnProperty(name)) { el.style[name] = styles[name]; } } } /** * Function places an absolutely positioned * element on top of the specified element * copying position and dimentions. * @param {Element} from * @param {Element} to */ function copyLayout(from, to){ var box = getBox(from); addStyles(to, { position: 'absolute', left : box.left + 'px', top : box.top + 'px', width : from.offsetWidth + 'px', height : from.offsetHeight + 'px' }); } /** * Creates and returns element from html chunk * Uses innerHTML to create an element */ var toElement = (function(){ var div = document.createElement('div'); return function(html){ div.innerHTML = html; var el = div.firstChild; return div.removeChild(el); }; })(); /** * Function generates unique id * @return unique id */ var getUID = (function(){ var id = 0; return function(){ return 'ValumsAjaxUpload' + id++; }; })(); /** * Get file name from path * @param {String} file path to file * @return filename */ function fileFromPath(file){ return file.replace(/.*(\/|\\)/, ""); } /** * Get file extension lowercase * @param {String} file name * @return file extenstion */ function getExt(file){ return (-1 !== file.indexOf('.')) ? file.replace(/.*[.]/, '') : ''; } function hasClass(el, name){ var re = new RegExp('\\b' + name + '\\b'); return re.test(el.className); } function addClass(el, name){ if ( ! hasClass(el, name)){ el.className += ' ' + name; } } function removeClass(el, name){ var re = new RegExp('\\b' + name + '\\b'); el.className = el.className.replace(re, ''); } function removeNode(el){ el.parentNode.removeChild(el); } /** * Easy styling and uploading * @constructor * @param button An element you want convert to * upload button. Tested dimentions up to 500x500px * @param {Object} options See defaults below. */ window.AjaxUpload = function(button, options){ this._settings = { // Location of the server-side upload script action: 'upload.php', // File upload name name: 'userfile', // Select & upload multiple files at once FF3.6+, Chrome 4+ multiple: false, // Additional data to send data: {}, // Submit file as soon as it's selected autoSubmit: true, acceptFiles: '', // The type of data that you're expecting back from the server. // html and xml are detected automatically. // Only useful when you are using json data as a response. // Set to "json" in that case. responseType: false, // Class applied to button when mouse is hovered hoverClass: 'hover', // Class applied to button when button is focused focusClass: 'focus', // Class applied to button when AU is disabled disabledClass: 'disabled', // When user selects a file, useful with autoSubmit disabled // You can return false to cancel upload onChange: function(file, extension){ }, // Callback to fire before file is uploaded // You can return false to cancel upload onSubmit: function(file, extension){ }, // Fired when file upload is completed // WARNING! DO NOT USE "FALSE" STRING AS A RESPONSE! onComplete: function(file, response){ } }; // Merge the users options with our defaults for (var i in options) { if (options.hasOwnProperty(i)){ this._settings[i] = options[i]; } } // button isn't necessary a dom element if (button.jquery){ // jQuery object was passed button = button[0]; } else if (typeof button == "string") { if (/^#.*/.test(button)){ // If jQuery user passes #elementId don't break it button = button.slice(1); } button = document.getElementById(button); } if ( ! button || button.nodeType !== 1){ throw new Error("Please make sure that you're passing a valid element"); } if ( button.nodeName.toUpperCase() == 'A'){ // disable link addEvent(button, 'click', function(e){ if (e && e.preventDefault){ e.preventDefault(); } else if (window.event){ window.event.returnValue = false; } }); } // DOM element this._button = button; // DOM element this._input = null; // If disabled clicking on button won't do anything this._disabled = false; // if the button was disabled before refresh if will remain // disabled in FireFox, let's fix it this.enable(); this._rerouteClicks(); }; // assigning methods to our class AjaxUpload.prototype = { setData: function(data){ this._settings.data = data; }, disable: function(){ addClass(this._button, this._settings.disabledClass); this._disabled = true; var nodeName = this._button.nodeName.toUpperCase(); if (nodeName == 'INPUT' || nodeName == 'BUTTON'){ this._button.setAttribute('disabled', 'disabled'); } // hide input if (this._input){ if (this._input.parentNode) { // We use visibility instead of display to fix problem with Safari 4 // The problem is that the value of input doesn't change if it // has display none when user selects a file this._input.parentNode.style.visibility = 'hidden'; } } }, enable: function(){ removeClass(this._button, this._settings.disabledClass); this._button.removeAttribute('disabled'); this._disabled = false; }, /** * Creates invisible file input * that will hover above the button *
*/ _createInput: function(){ var self = this; var input = document.createElement("input"); input.setAttribute('type', 'file'); input.setAttribute('name', this._settings.name); if (this._settings.acceptFiles != '') { input.setAttribute('accept', this._settings.acceptFiles); } if(this._settings.multiple) input.setAttribute('multiple', 'multiple'); addStyles(input, { 'position' : 'absolute', // in Opera only 'browse' button // is clickable and it is located at // the right side of the input 'right' : 0, 'margin' : 0, 'padding' : 0, 'fontSize' : '480px', // in Firefox if font-family is set to // 'inherit' the input doesn't work 'fontFamily' : 'sans-serif', 'cursor' : 'pointer', 'zIndex': 10000 }); var div = document.createElement("div"); addStyles(div, { 'display' : 'block', 'position' : 'absolute', 'overflow' : 'hidden', 'margin' : 0, 'padding' : 0, 'opacity' : 0, // Make sure browse button is in the right side // in Internet Explorer 'direction' : 'ltr', //Max zIndex supported by Opera 9.0-9.2 'zIndex': 2147483583 }); // Make sure that element opacity exists. // Otherwise use IE filter if ( div.style.opacity !== "0") { if (typeof(div.filters) == 'undefined'){ throw new Error('Opacity not supported by the browser'); } div.style.filter = "alpha(opacity=0)"; } addEvent(input, 'change', function(){ if ( ! input || input.value === ''){ return; } // Get filename from input, required // as some browsers have path instead of it var file = fileFromPath(input.value); if (false === self._settings.onChange.call(self, file, getExt(file))){ self._clearInput(); return; } // Submit form when value is changed if (self._settings.autoSubmit) { self.submit(); } }); addEvent(input, 'mouseover', function(){ addClass(self._button, self._settings.hoverClass); }); addEvent(input, 'mouseout', function(){ removeClass(self._button, self._settings.hoverClass); removeClass(self._button, self._settings.focusClass); if (input.parentNode) { // We use visibility instead of display to fix problem with Safari 4 // The problem is that the value of input doesn't change if it // has display none when user selects a file input.parentNode.style.visibility = 'hidden'; } }); addEvent(input, 'focus', function(){ addClass(self._button, self._settings.focusClass); }); addEvent(input, 'blur', function(){ removeClass(self._button, self._settings.focusClass); }); div.appendChild(input); document.body.appendChild(div); this._input = input; }, _clearInput : function(){ if (!this._input){ return; } // this._input.value = ''; Doesn't work in IE6 removeNode(this._input.parentNode); this._input = null; this._createInput(); removeClass(this._button, this._settings.hoverClass); removeClass(this._button, this._settings.focusClass); }, /** * Function makes sure that when user clicks upload button, * the this._input is clicked instead */ _rerouteClicks: function(){ var self = this; // IE will later display 'access denied' error // if you use using self._input.click() // other browsers just ignore click() addEvent(self._button, 'mouseover', function(){ if (self._disabled){ return; } if ( ! self._input){ self._createInput(); } var div = self._input.parentNode; copyLayout(self._button, div); div.style.visibility = 'visible'; }); // commented because we now hide input on mouseleave /** * When the window is resized the elements * can be misaligned if button position depends * on window size */ //addResizeEvent(function(){ // if (self._input){ // copyLayout(self._button, self._input.parentNode); // } //}); }, /** * Creates iframe with unique name * @return {Element} iframe */ _createIframe: function(){ // We can't use getTime, because it sometimes return // same value in safari :( var id = getUID(); // We can't use following code as the name attribute // won't be properly registered in IE6, and new window // on form submit will open // var iframe = document.createElement('iframe'); // iframe.setAttribute('name', id); var iframe = toElement('') .dialog({ autoOpen: false, modal: true, width:750, height:750, title: "Subscribe to newsletter" }); $dialog.dialog('open'); } function trv_homepage_admin_cancel_newsletter_form() { $("#trv_module_homepage_admin_newsletter_form_box").remove(); } function trv_homepage_admin_send_newsletter_form() { if($("#trv_module_homepage_admin_newsletter_form").valid()) { $.post( "https://smartrfi.it-matchmaker.com/core/modules/homepage_admin/ajax/ajax.php?full_path=NVlFXzhjbUlsYDx5b3JMaH1gU0hFcyNEX2RVeSx9Q0ZkSjJMQDJJOCE-JUd-VyVncEA7WkYpKlM9V087QXdGYzM2S2tpSCoy&app_language=en&PHPSESSID=f20c55a06ad936cb33481652d5baabff", { ajax_type: "SAVE_NEWSLETTER_SUBSCRIPTION_DATA", NewsletterFormData: $('#trv_module_homepage_admin_newsletter_form').serialize() }, function(result) { unblockScreen(); data = JSON.parse(result); if (data.success == 1) { infoDialog("ERROR","Fehler: Bei der Übermittlung Ihrer Anmeldung ist ein Fehler aufgetreten! Bitte versuchen Sie es noch einmal oder nehmen Sie Kontakt zu unserem Support auf!",null,750,null,null,null,true); } else { infoDialog("Trovarit nwsletter registration","Ihre Newsletter-Anmeldung wurde erfolgreich gespeichert!",null,750,null,null,null,true); trv_homepage_admin_cancel_newsletter_form(); } } ); } return false; } function trv_homepage_admin_open_guided_tours_anmeldung() { title = 'Anmeldung Guided Tours'; $("body").append(""); $("#trv_module_homepage_admin_guided_tours_anmeldung_box").load("https://smartrfi.it-matchmaker.com/core/modules/homepage_admin/components/guided_tours_anmeldung.php?full_path=NVlFXzhjbUlsYDx5b3JMaH1gU0hFcyNEX2RVeSx9Q0ZkSjJMQDJJOCE-JUd-VyVncEA7WkYpKlM9V087QXdGYzM2S2tpSCoy&app_language=en&PHPSESSID=f20c55a06ad936cb33481652d5baabff").dialog({ close: function(event, ui) { $(this).dialog('destroy'); $("#trv_module_homepage_admin_guided_tours_anmeldung_box").remove(); }, closeOnEscape: true, resizable: false, height: 'auto', minHeight: 350, width: 850, modal: true, bgiframe: true, title: title, position: ['center',60] }); blockScreen(); } function trv_homepage_admin_send_guided_tours_anmeldung_form() { if(isFormValid('trv_module_homepage_admin_guided_tours_anmeldung_form',null, false,'trv_core_input_white_validator_error')) { $.post( "https://smartrfi.it-matchmaker.com/core/modules/homepage_admin/ajax/ajax.php?full_path=NVlFXzhjbUlsYDx5b3JMaH1gU0hFcyNEX2RVeSx9Q0ZkSjJMQDJJOCE-JUd-VyVncEA7WkYpKlM9V087QXdGYzM2S2tpSCoy&app_language=en&PHPSESSID=f20c55a06ad936cb33481652d5baabff", { ajax_type: "SAVE_GUIDED_TOURS_ANMELDUNG_DATA", GuidedToursFormData: $('#trv_module_homepage_admin_guided_tours_anmeldung_form').serialize() }, function(result) { unblockScreen(); data = JSON.parse(result); if (data.success == 1) { infoDialog("Anmeldung Guided Tours","Ihre Anmeldung wurde erfolgreich abgeschickt!",null,750,null,null,null,true); trv_homepage_admin_cancel_guided_tours_anmeldung_form(); } else { infoDialog("ERROR","Fehler: Bei der Übermittlung Ihrer Anmeldung ist ein Fehler aufgetreten! Bitte versuchen Sie es noch einmal oder nehmen Sie Kontakt zu unserem Support auf!",null,750,null,null,null,true); } } ); } return false; } function trv_homepage_admin_cancel_guided_tours_anmeldung_form() { $("#trv_module_homepage_admin_guided_tours_anmeldung_box").remove(); } function trv_homepage_admin_open_wordpress_form() { title = 'Anmeldung ERP-Challenge'; $("body").append(""); $("#trv_module_homepage_admin_wordpress_form_box").load("https://smartrfi.it-matchmaker.com/core/modules/homepage_admin/components/wordpress_form.php?full_path=NVlFXzhjbUlsYDx5b3JMaH1gU0hFcyNEX2RVeSx9Q0ZkSjJMQDJJOCE-JUd-VyVncEA7WkYpKlM9V087QXdGYzM2S2tpSCoy&app_language=en&PHPSESSID=f20c55a06ad936cb33481652d5baabff").dialog({ close: function(event, ui) { $(this).dialog('destroy'); $("#trv_module_homepage_admin_wordpress_form_box").remove(); }, closeOnEscape: true, resizable: false, height: 'auto', minHeight: 250, width: 700, modal: true, bgiframe: true, title: title, position: ['center',60] }); blockScreen(); } function trv_homepage_admin_send_wordpress_form() { if($('#trv_module_homepage_admin_wordpress_form').valid()) { $.post( "https://smartrfi.it-matchmaker.com/core/modules/homepage_admin/ajax/ajax.php?full_path=NVlFXzhjbUlsYDx5b3JMaH1gU0hFcyNEX2RVeSx9Q0ZkSjJMQDJJOCE-JUd-VyVncEA7WkYpKlM9V087QXdGYzM2S2tpSCoy&app_language=en&PHPSESSID=f20c55a06ad936cb33481652d5baabff", { ajax_type: "SAVE_WORDPRESS_FORM_DATA", GuidedToursFormData: $('#trv_module_homepage_admin_wordpress_form').serialize() }, function(result) { unblockScreen(); data = JSON.parse(result); if (data.success == 1) { infoDialog("Anmeldung erfolgreich","Vielen Dank für Ihre Anmeldung. Wir prüfen die Verfügbarkeit und senden Ihnen in kürze eine Mail mit den Webinardaten.",null,750,null,null,null,true); trv_homepage_admin_cancel_wordpress_form(); } else { infoDialog("ERROR","Fehler: Bei der Übermittlung Ihrer Anmeldung ist ein Fehler aufgetreten! Bitte versuchen Sie es noch einmal oder nehmen Sie Kontakt zu unserem Support auf!",null,750,null,null,null,true); } } ); } } function trv_homepage_admin_cancel_wordpress_form() { $("#trv_module_homepage_admin_wordpress_form_box").remove(); } function copyDocumentUrl(url, id){ $.post( "https://smartrfi.it-matchmaker.com/core/modules/homepage_admin/ajax/ajax.php?id="+id+"&full_path=NVlFXzhjbUlsYDx5b3JMaH1gU0hFcyNEX2RVeSx9Q0ZkSjJMQDJJOCE-JUd-VyVncEA7WkYpKlM9V087QXdGYzM2S2tpSCoy&app_language=en&PHPSESSID=f20c55a06ad936cb33481652d5baabff", { ajax_type: "SAVE_ONE_TIME_DOWNLOAD" }, function(result) { copyStringToClipboard(result); document.getElementById('copy_'+id).innerHTML = '
Der Download-Link wurde kopiert!'; } ); setTimeout(function(){ document.getElementById('copy_'+id).innerHTML = ''; }, 3000); } function copyStringToClipboard (str) { // Create new element var el = document.createElement('textarea'); // Set value (string to be copied) el.value = str; // Set non-editable to avoid focus and move outside of view el.setAttribute('readonly', ''); el.style = {position: 'absolute', left: '-9999px'}; document.body.appendChild(el); // Select text inside element el.select(); // Copy text to clipboard document.execCommand('copy'); // Remove temporary element document.body.removeChild(el); } function copyFreeDownload(articleID){ alert(articleID); var str = "www.it-matchmaker.local/?fid="+articleID; // Create new element var el = document.createElement('textarea'); // Set value (string to be copied) el.value = str; // Set non-editable to avoid focus and move outside of view el.setAttribute('readonly', ''); el.style = {position: 'absolute', left: '-9999px'}; document.body.appendChild(el); // Select text inside element el.select(); // Copy text to clipboard document.execCommand('copy'); // Remove temporary element document.body.removeChild(el); } function trv_module_homepage_admin_checkTyp(val){ if(val=='Sponsored Whitepaper'){ $("#client_sponsored_whitepaper_select").show(); $("#client_sponsored_whitepaper_new").show(); }else{ $("#client_sponsored_whitepaper_select").hide(); $("#client_sponsored_whitepaper_new").hide(); } } function trv_module_homepage_admin_keywords() { $('#trv_keyword_wrapper').toggle(); } function trv_module_homepage_admin_copy(txt) { copyStringToClipboard(txt); document.getElementById('copy_id_'+txt).innerHTML = '
Die ID wurde kopiert!'; setTimeout(function(){ document.getElementById('copy_id_'+txt).innerHTML = ''; }, 3000); } function trv_module_homepage_admin_search_keywords(txt) { var txt = txt.toLowerCase().trim(); $(".trv_downloadcenter_hover").each(function (index) { if (!index) return; $(this).find("td").each(function () { var id = $(this).text().toLowerCase().trim(); var not_found = (id.indexOf(txt) == -1); $(this).closest('tr').toggle(!not_found); return not_found; }); }); } function trv_module_homepage_admin_show_users_webinar_leads(id){ var stat= document.getElementById("userwrapper_"+id).style.display; if(stat=='none' || stat==''){ document.getElementById("userwrapper_"+id).style.display='contents'; document.getElementById("webinarwrapper_"+id).style.color='white'; document.getElementById("webinarwrapper_"+id).style.fontWeight='bold'; document.getElementById("webinarwrapper_"+id).style.background='#A63E00'; }else{ document.getElementById("userwrapper_"+id).style.display='none'; document.getElementById("webinarwrapper_"+id).style.color='#A63E00'; document.getElementById("webinarwrapper_"+id).style.fontWeight='normal'; document.getElementById("webinarwrapper_"+id).style.background='none'; document.getElementById("webinarwrapper_"+id).style.color='#555'; } } function trv_ha_removeEmail(email){ $('.trv_is_email').each(function(){ if($(this).text().trim() == email){ $(this).parents('tr').fadeOut(); } }); } function trv_ha_LeadToZero(id, type, typeID, counter){ var email = $('#user_mail_hidden_'+id).text().trim(); if(confirm('Soll der Nutzer mit ID: '+id+' und E-Mailadresse: '+email+' auf 0 gesetzt werden? Es wird kein Lead an Minerva geschickt!')) { $('#trv_loader').css('display','block'); $.trv_postJson({ ajax_type: "SEND_TO_ZERO", module_name: "homepage_admin", //showSavingInfoIn: $(element).parent(), blockScreen: false, parameter: { id: id, type: type, type_id: typeID, email: email }, onSuccess: function(data) { $('#trv_loader').css('display','none'); trv_ha_removeEmail(email); } }); } } function trv_ha_LeadToMinerva(id, type, typeID, counter, googleID){ var score = $('#score_'+id+'_'+counter).val(); var email = $('#user_mail_hidden_'+id).text().trim(); if(confirm('Soll der Nutzer mit ID: '+id+' und E-Mailadresse: '+email+' weitergeleitet werden an Minerva mit einem Score von: '+score+'?')) { $('#trv_loader').css('display','block'); $.trv_postJson({ ajax_type: "SEND_MINERVA", module_name: "homepage_admin", //showSavingInfoIn: $(element).parent(), blockScreen: false, parameter: { score: score, id: id, type: type, type_id: typeID, email: email, glAdID: googleID }, onSuccess: function(data) { $('#trv_loader').css('display','none'); //alert("Die Daten wurden erfolgreich an Minerva uebertragen."); trv_ha_removeEmail(email); } }); } } function trv_workshop_LeadToMinerva(id, type, typeID, counter, googleID){ //var score = $('#score_'+id+'_'+counter).val(); var email = $('#user_mail_hidden_'+id).text().trim(); //console.log(email); if(confirm('Soll der Nutzer mit ID: '+id+' und E-Mailadresse: '+email+' weitergeleitet werden an Minerva?')) { $('#trv_loader').css('display','block'); $.trv_postJson({ ajax_type: "SEND_MINERVA", module_name: "homepage_admin", //showSavingInfoIn: $(element).parent(), blockScreen: false, parameter: { id: id, type: type, type_id: typeID, email: email, glAdID: googleID }, onSuccess: function(data) { $('#trv_loader').css('display','none'); $('#seen_'+id).html('V'); alert("Die Daten wurden erfolgreich an Minerva uebertragen."); trv_ha_removeEmail(email); } }); } } function trv_ha_saveScore(id, element){ $.trv_postJson({ ajax_type: "SAVE_SCORE", module_name: "homepage_admin", showSavingInfoIn: $(element).parent(), blockScreen: false, parameter: { score: $('#score_'+id).val(), id: id, email: $('#user_mail_hidden_'+id).html() }, onSuccess: function(data) { $('#score_info_'+id).html('Score wurde gespeichert'); } }); } function trv_ha_saveScoreOracle(id, element, counter){ var score = $('#score_'+id+'_'+counter).val(); //console.log("ID: "+id+" | Element: "+element+" | Counter: "+counter+""); $.trv_postJson({ ajax_type: "SAVE_SCORE_ORACLE", module_name: "homepage_admin", showSavingInfoIn: $(element).parent(), blockScreen: false, parameter: { score: score, id: id, email: $('#user_mail_hidden_'+id).html() }, onSuccess: function(data) { $('#score_info_'+id).html('Score wurde gespeichert'); } }); } function trv_update_webinar_seen(id){ $.trv_postJson({ ajax_type: "WEBINAR_SEEN", module_name: "homepage_admin", blockScreen: false, parameter: { id: id }, onSuccess: function(data) { $('#webinar_seen_button_'+id).html('✔'); } }); } $(document).ready(function() { HTTP_GET_VARS=new Array(); strGET=document.location.search.substr(1,document.location.search.length); if(strGET!='') { gArr=strGET.split('&'); for(i=0;i1){v=vArr[1];} HTTP_GET_VARS[unescape(vArr[0])]=unescape(v); } } if(HTTP_GET_VARS["webhash"]) { var isIFrame =0; var userHash=HTTP_GET_VARS["webhash"]; //alert(userHash); // trv_module_homepage_admin_open_webinar_booking('366','');return false; if ($("#trv_module_homepage_admin_dialog_webinar_booking_editor").length == 0) { title = 'Complete webinar registration'; $("body").append(""); $("#trv_module_homepage_admin_dialog_webinar_booking_editor").load("https://smartrfi.it-matchmaker.com/core/modules/homepage_admin/components/webinar_booking_editor_dsgvo.php?hash="+userHash+"&full_path=NVlFXzhjbUlsYDx5b3JMaH1gU0hFcyNEX2RVeSx9Q0ZkSjJMQDJJOCE-JUd-VyVncEA7WkYpKlM9V087QXdGYzM2S2tpSCoy&app_language=en&PHPSESSID=f20c55a06ad936cb33481652d5baabff").dialog({ close: function(event, ui) { $(this).dialog('destroy'); $("#trv_module_homepage_admin_dialog_webinar_booking_editor").remove(); }, beforeClose: function(event, ui) { if (trv_dialogContentChanged) { return trv_confirmClose("$('#trv_module_homepage_admin_dialog_webinar_booking_editor').dialog('close')",1); } }, closeOnEscape: false, resizable: false, height: 'auto', minHeight: 300, width: 550, modal: true, bgiframe: true, title: title, position: ['center',60] }); blockScreen(); } return false; } }); function trv_module_homepage_admin_open_workshop_editor(webinarID) { if ($("#trv_module_homepage_admin_dialog_webinar_editor").length == 0) { if(webinarID>0) { title = ''; } else { title = ''; } $("body").append(""); $("#trv_module_homepage_admin_dialog_webinar_editor").load("https://smartrfi.it-matchmaker.com/core/modules/homepage_admin/components/workshop_editor.php?webinarID="+webinarID+"&full_path=NVlFXzhjbUlsYDx5b3JMaH1gU0hFcyNEX2RVeSx9Q0ZkSjJMQDJJOCE-JUd-VyVncEA7WkYpKlM9V087QXdGYzM2S2tpSCoy&app_language=en&PHPSESSID=f20c55a06ad936cb33481652d5baabff").dialog({ close: function(event, ui) { $(this).dialog('destroy'); $("#trv_module_homepage_admin_dialog_webinar_editor").remove(); }, beforeClose: function(event, ui) { if (trv_dialogContentChanged) { return trv_confirmClose("$('#trv_module_homepage_admin_dialog_webinar_editor').dialog('close')",1); } }, closeOnEscape: false, resizable: false, height: 'auto', minHeight: 300, width: 550, modal: true, bgiframe: true, title: title, position: ['center',60] }); blockScreen(); } return false; } function trv_module_homepage_admin_save_workshop_editor() { if($('#trv_module_homepage_admin_dialog_webinar_editor_form').valid()) { if (isFormValid('trv_module_homepage_admin_dialog_webinar_editor_form') && $("#trv_module_homepage_admin_dialog_webinar_editor_form textarea").trv_tinyMCE_isLengthValid(true)) { if ($("#trv_module_homepage_admin_webinars_short_description").length) { $("#trv_module_homepage_admin_webinars_short_description").val(tinymce.get('trv_module_homepage_admin_webinars_short_description').getContent()); } if ($("#trv_module_homepage_admin_webinars_privacy_agreement").length) { $("#trv_module_homepage_admin_webinars_privacy_agreement").val(tinymce.get('trv_module_homepage_admin_webinars_privacy_agreement').getContent()); } } //console.log($("#inputOpenTaskMassnahme").val(tinymce.get('inputOpenTaskMassnahme').getContent())); $.trv_postJson({ blockScreen:false, module_name: "homepage_admin", ajax_type: "EDIT_WORKSHOP", parameter: { webinarFormData: $('#trv_module_homepage_admin_dialog_webinar_editor_form').serialize() }, onSuccess: function(data) { if ($("#trv_webinar_row_"+data.webinarID).length == 1) { $("#trv_webinar_row_"+data.webinarID).replaceWith(data.tableRow); } else { $('#trv_module_homepage_admin_webinars_table tbody').append(data.tableRow); } reinitTablesorter('trv_module_homepage_admin_webinars_table'); setToolbarInfo("trv_module_homepage_admin_webinars_table", true); dialogContentChanged(false); trv_module_homepage_admin_close_webinar_editor(); } }); } else { infoDialog("ERROR","Please fill in all mandatory fields!"); } } function showWorkshopForm(id){ var stat = document.getElementById("workshopform_"+id).style.maxHeight; if(stat == '0px' || stat == '') { document.getElementById("workshopform_"+id).style.maxHeight = '20000px'; } else { document.getElementById("workshopform_"+id).style.maxHeight = '0px'; } } function trv_workshop_send_registration(id) { var error=0; var formFields = ['anrede_', 'vorname_', 'nachname_', 'email_', 'unternehmen_', 'strasse_', 'plz_', 'land_']; $.each(formFields, function( index, value ) { if ($('#'+value+id).val().replace(/^\s+|\s+$/g, "").length != 0){ $('#'+value+id).css('border','1px solid #E4E4E4'); }else{ $('#'+value+id).css('border','1px solid red'); error+=1; $('#'+value+id).val(''); } }); if(!$('#dsgvo_'+id).prop('checked')){ $('#dsgvo_wrapper_'+id).css('border','1px solid red'); error+=1; }else{ $('#dsgvo_wrapper_'+id).css('border','1px solid #E4E4E4'); } if(error==0) { if ($('#dsgvo_'+id).prop('checked')) { if($('#trv_module_homepage_admin_registration_form_workshops').valid()) { console.log($('#trv_module_homepage_admin_registration_form_workshops').serialize()); $.post( "https://smartrfi.it-matchmaker.com/core/modules/homepage_admin/ajax/ajax.php?app_language=en&PHPSESSID=f20c55a06ad936cb33481652d5baabff", { ajax_type: "REGISTER_WORKSHOP", full_path: "NVlFXzhjbUlsYDx5b3JMaH1gU0hFcyNEX2RVeSx9Q0ZkSjJMQDJJOCE-JUd-VyVncEA7WkYpKlM9V087QXdGYzM2S2tpSCoy", workshopID: id, formData: $('#trv_module_homepage_admin_registration_form_workshops').serialize(), pageLink: location.href }, function(data) { $('#sendingresult_'+id).html(""); $('#dsgvo_'+id).prop('checked', false); $('#telefon_'+id).val(''); $('#position_'+id).val(''); $('#titel_'+id).val(''); $.each(formFields, function( index, value ) { $('#'+value+id).val(''); }); console.log(data); }); } } else { $('#sendingresult_'+id).html(""); } }else{ $('#sendingresult_'+id).html(""); } } /*! jQuery Timepicker Addon - v1.5.2 - 2015-03-15 * http://trentrichardson.com/examples/timepicker * Copyright (c) 2015 Trent Richardson; Licensed MIT */ (function(e){"function"==typeof define&&define.amd?define(["jquery","jquery.ui"],e):e(jQuery)})(function($){if($.ui.timepicker=$.ui.timepicker||{},!$.ui.timepicker.version){$.extend($.ui,{timepicker:{version:"1.5.2"}});var Timepicker=function(){this.regional=[],this.regional[""]={currentText:"Now",closeText:"Done",amNames:["AM","A"],pmNames:["PM","P"],timeFormat:"HH:mm",timeSuffix:"",timeOnlyTitle:"Choose Time",timeText:"Time",hourText:"Hour",minuteText:"Minute",secondText:"Second",millisecText:"Millisecond",microsecText:"Microsecond",timezoneText:"Time Zone",isRTL:!1},this._defaults={showButtonPanel:!0,timeOnly:!1,timeOnlyShowDate:!1,showHour:null,showMinute:null,showSecond:null,showMillisec:null,showMicrosec:null,showTimezone:null,showTime:!0,stepHour:1,stepMinute:1,stepSecond:1,stepMillisec:1,stepMicrosec:1,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMin:0,minuteMin:0,secondMin:0,millisecMin:0,microsecMin:0,hourMax:23,minuteMax:59,secondMax:59,millisecMax:999,microsecMax:999,minDateTime:null,maxDateTime:null,maxTime:null,minTime:null,onSelect:null,hourGrid:0,minuteGrid:0,secondGrid:0,millisecGrid:0,microsecGrid:0,alwaysSetTime:!0,separator:" ",altFieldTimeOnly:!0,altTimeFormat:null,altSeparator:null,altTimeSuffix:null,altRedirectFocus:!0,pickerTimeFormat:null,pickerTimeSuffix:null,showTimepicker:!0,timezoneList:null,addSliderAccess:!1,sliderAccessArgs:null,controlType:"slider",oneLine:!1,defaultValue:null,parse:"strict",afterInject:null},$.extend(this._defaults,this.regional[""])};$.extend(Timepicker.prototype,{$input:null,$altInput:null,$timeObj:null,inst:null,hour_slider:null,minute_slider:null,second_slider:null,millisec_slider:null,microsec_slider:null,timezone_select:null,maxTime:null,minTime:null,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMinOriginal:null,minuteMinOriginal:null,secondMinOriginal:null,millisecMinOriginal:null,microsecMinOriginal:null,hourMaxOriginal:null,minuteMaxOriginal:null,secondMaxOriginal:null,millisecMaxOriginal:null,microsecMaxOriginal:null,ampm:"",formattedDate:"",formattedTime:"",formattedDateTime:"",timezoneList:null,units:["hour","minute","second","millisec","microsec"],support:{},control:null,setDefaults:function(e){return extendRemove(this._defaults,e||{}),this},_newInst:function($input,opts){var tp_inst=new Timepicker,inlineSettings={},fns={},overrides,i;for(var attrName in this._defaults)if(this._defaults.hasOwnProperty(attrName)){var attrValue=$input.attr("time:"+attrName);if(attrValue)try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}overrides={beforeShow:function(e,t){return $.isFunction(tp_inst._defaults.evnts.beforeShow)?tp_inst._defaults.evnts.beforeShow.call($input[0],e,t,tp_inst):void 0},onChangeMonthYear:function(e,t,i){$.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)&&tp_inst._defaults.evnts.onChangeMonthYear.call($input[0],e,t,i,tp_inst)},onClose:function(e,t){tp_inst.timeDefined===!0&&""!==$input.val()&&tp_inst._updateDateTime(t),$.isFunction(tp_inst._defaults.evnts.onClose)&&tp_inst._defaults.evnts.onClose.call($input[0],e,t,tp_inst)}};for(i in overrides)overrides.hasOwnProperty(i)&&(fns[i]=opts[i]||null);tp_inst._defaults=$.extend({},this._defaults,inlineSettings,opts,overrides,{evnts:fns,timepicker:tp_inst}),tp_inst.amNames=$.map(tp_inst._defaults.amNames,function(e){return e.toUpperCase()}),tp_inst.pmNames=$.map(tp_inst._defaults.pmNames,function(e){return e.toUpperCase()}),tp_inst.support=detectSupport(tp_inst._defaults.timeFormat+(tp_inst._defaults.pickerTimeFormat?tp_inst._defaults.pickerTimeFormat:"")+(tp_inst._defaults.altTimeFormat?tp_inst._defaults.altTimeFormat:"")),"string"==typeof tp_inst._defaults.controlType?("slider"===tp_inst._defaults.controlType&&$.ui.slider===void 0&&(tp_inst._defaults.controlType="select"),tp_inst.control=tp_inst._controls[tp_inst._defaults.controlType]):tp_inst.control=tp_inst._defaults.controlType;var timezoneList=[-720,-660,-600,-570,-540,-480,-420,-360,-300,-270,-240,-210,-180,-120,-60,0,60,120,180,210,240,270,300,330,345,360,390,420,480,525,540,570,600,630,660,690,720,765,780,840];null!==tp_inst._defaults.timezoneList&&(timezoneList=tp_inst._defaults.timezoneList);var tzl=timezoneList.length,tzi=0,tzv=null;if(tzl>0&&"object"!=typeof timezoneList[0])for(;tzl>tzi;tzi++)tzv=timezoneList[tzi],timezoneList[tzi]={value:tzv,label:$.timepicker.timezoneOffsetString(tzv,tp_inst.support.iso8601)};return tp_inst._defaults.timezoneList=timezoneList,tp_inst.timezone=null!==tp_inst._defaults.timezone?$.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone):-1*(new Date).getTimezoneOffset(),tp_inst.hour=tp_inst._defaults.hourtp_inst._defaults.hourMax?tp_inst._defaults.hourMax:tp_inst._defaults.hour,tp_inst.minute=tp_inst._defaults.minutetp_inst._defaults.minuteMax?tp_inst._defaults.minuteMax:tp_inst._defaults.minute,tp_inst.second=tp_inst._defaults.secondtp_inst._defaults.secondMax?tp_inst._defaults.secondMax:tp_inst._defaults.second,tp_inst.millisec=tp_inst._defaults.millisectp_inst._defaults.millisecMax?tp_inst._defaults.millisecMax:tp_inst._defaults.millisec,tp_inst.microsec=tp_inst._defaults.microsectp_inst._defaults.microsecMax?tp_inst._defaults.microsecMax:tp_inst._defaults.microsec,tp_inst.ampm="",tp_inst.$input=$input,tp_inst._defaults.altField&&(tp_inst.$altInput=$(tp_inst._defaults.altField),tp_inst._defaults.altRedirectFocus===!0&&tp_inst.$altInput.css({cursor:"pointer"}).focus(function(){$input.trigger("focus")})),(0===tp_inst._defaults.minDate||0===tp_inst._defaults.minDateTime)&&(tp_inst._defaults.minDate=new Date),(0===tp_inst._defaults.maxDate||0===tp_inst._defaults.maxDateTime)&&(tp_inst._defaults.maxDate=new Date),void 0!==tp_inst._defaults.minDate&&tp_inst._defaults.minDate instanceof Date&&(tp_inst._defaults.minDateTime=new Date(tp_inst._defaults.minDate.getTime())),void 0!==tp_inst._defaults.minDateTime&&tp_inst._defaults.minDateTime instanceof Date&&(tp_inst._defaults.minDate=new Date(tp_inst._defaults.minDateTime.getTime())),void 0!==tp_inst._defaults.maxDate&&tp_inst._defaults.maxDate instanceof Date&&(tp_inst._defaults.maxDateTime=new Date(tp_inst._defaults.maxDate.getTime())),void 0!==tp_inst._defaults.maxDateTime&&tp_inst._defaults.maxDateTime instanceof Date&&(tp_inst._defaults.maxDate=new Date(tp_inst._defaults.maxDateTime.getTime())),tp_inst.$input.bind("focus",function(){tp_inst._onFocus()}),tp_inst},_addTimePicker:function(e){var t=$.trim(this.$altInput&&this._defaults.altFieldTimeOnly?this.$input.val()+" "+this.$altInput.val():this.$input.val());this.timeDefined=this._parseTime(t),this._limitMinMaxDateTime(e,!1),this._injectTimePicker(),this._afterInject()},_parseTime:function(e,t){if(this.inst||(this.inst=$.datepicker._getInst(this.$input[0])),t||!this._defaults.timeOnly){var i=$.datepicker._get(this.inst,"dateFormat");try{var s=parseDateTimeInternal(i,this._defaults.timeFormat,e,$.datepicker._getFormatConfig(this.inst),this._defaults);if(!s.timeObj)return!1;$.extend(this,s.timeObj)}catch(a){return $.timepicker.log("Error parsing the date/time string: "+a+"\ndate/time string = "+e+"\ntimeFormat = "+this._defaults.timeFormat+"\ndateFormat = "+i),!1}return!0}var n=$.datepicker.parseTime(this._defaults.timeFormat,e,this._defaults);return n?($.extend(this,n),!0):!1},_afterInject:function(){var e=this.inst.settings;$.isFunction(e.afterInject)&&e.afterInject.call(this)},_injectTimePicker:function(){var e=this.inst.dpDiv,t=this.inst.settings,i=this,s="",a="",n=null,r={},l={},o=null,c=0,u=0;if(0===e.find("div.ui-timepicker-div").length&&t.showTimepicker){var m=" ui_tpicker_unit_hide",d='
'+'
"+t.timeText+"
"+'
';for(c=0,u=this.units.length;u>c;c++){if(s=this.units[c],a=s.substr(0,1).toUpperCase()+s.substr(1),n=null!==t["show"+a]?t["show"+a]:this.support[s],r[s]=parseInt(t[s+"Max"]-(t[s+"Max"]-t[s+"Min"])%t["step"+a],10),l[s]=0,d+='
'+t[s+"Text"]+"
"+'
',n&&t[s+"Grid"]>0){if(d+='
',"hour"===s)for(var h=t[s+"Min"];r[s]>=h;h+=parseInt(t[s+"Grid"],10)){l[s]++;var p=$.datepicker.formatTime(this.support.ampm?"hht":"HH",{hour:h},t);d+='"}else for(var _=t[s+"Min"];r[s]>=_;_+=parseInt(t[s+"Grid"],10))l[s]++,d+='";d+="
'+p+"'+(10>_?"0":"")+_+"
"}d+="
"}var f=null!==t.showTimezone?t.showTimezone:this.support.timezone;d+='
'+t.timezoneText+"
",d+='
',d+="
";var g=$(d);for(t.timeOnly===!0&&(g.prepend('
'+t.timeOnlyTitle+"
"+"
"),e.find(".ui-datepicker-header, .ui-datepicker-calendar").hide()),c=0,u=i.units.length;u>c;c++)s=i.units[c],a=s.substr(0,1).toUpperCase()+s.substr(1),n=null!==t["show"+a]?t["show"+a]:this.support[s],i[s+"_slider"]=i.control.create(i,g.find(".ui_tpicker_"+s+"_slider"),s,i[s],t[s+"Min"],r[s],t["step"+a]),n&&t[s+"Grid"]>0&&(o=100*l[s]*t[s+"Grid"]/(r[s]-t[s+"Min"]),g.find(".ui_tpicker_"+s+" table").css({width:o+"%",marginLeft:t.isRTL?"0":o/(-2*l[s])+"%",marginRight:t.isRTL?o/(-2*l[s])+"%":"0",borderCollapse:"collapse"}).find("td").click(function(){var e=$(this),t=e.html(),a=parseInt(t.replace(/[^0-9]/g),10),n=t.replace(/[^apm]/gi),r=e.data("for");"hour"===r&&(-1!==n.indexOf("p")&&12>a?a+=12:-1!==n.indexOf("a")&&12===a&&(a=0)),i.control.value(i,i[r+"_slider"],s,a),i._onTimeChange(),i._onSelectHandler()}).css({cursor:"pointer",width:100/l[s]+"%",textAlign:"center",overflow:"hidden"}));if(this.timezone_select=g.find(".ui_tpicker_timezone").append("").find("select"),$.fn.append.apply(this.timezone_select,$.map(t.timezoneList,function(e){return $("