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( "http://it-matchmaker-2020--en--r.portal.it-matchmaker.com/core/ajax/ajax.php?PHPSESSID=21cea78e07fed5cac4afbdbc6057b6e2", { 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( "http://it-matchmaker-2020--en--r.portal.it-matchmaker.com/core/ajax/ajax.php?PHPSESSID=21cea78e07fed5cac4afbdbc6057b6e2", { 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 = "http://it-matchmaker-2020--en--r.portal.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( "http://it-matchmaker-2020--en--r.portal.it-matchmaker.com/core/ajax/ajax.php?PHPSESSID=21cea78e07fed5cac4afbdbc6057b6e2", { 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: "http://it-matchmaker-2020--en--r.portal.it-matchmaker.com/core/ajax/ajax.php?PHPSESSID=21cea78e07fed5cac4afbdbc6057b6e2", ajax_type: "ADD_EXCEL_TABLE_FILTER", disableErrorOnReload: true, parameter: { page_charset: "utf-8", app_language: "en", appName: "itm-portal", 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( "http://it-matchmaker-2020--en--r.portal.it-matchmaker.com/core/ajax/ajax.php?PHPSESSID=21cea78e07fed5cac4afbdbc6057b6e2", { type: "REMOVE_EXCEL_TABLE_FILTER_DATA", app_language: "en", appName: "itm-portal", tableID: tableID }); } /**********************************************************************************************/ function saveExcelFilterData(tableID,filterData) { $.post( "http://it-matchmaker-2020--en--r.portal.it-matchmaker.com/core/ajax/ajax.php?PHPSESSID=21cea78e07fed5cac4afbdbc6057b6e2", { type: "SAVE_EXCEL_TABLE_FILTER_DATA", page_charset: "utf-8", app_language: "en", appName: "itm-portal", tableID: tableID, filterData: filterData }); } /**********************************************************************************************/ function setExcelFilterVisible(tableID, filterVisible) { $.post( "http://it-matchmaker-2020--en--r.portal.it-matchmaker.com/core/ajax/ajax.php?PHPSESSID=21cea78e07fed5cac4afbdbc6057b6e2", { type: "SET_EXCEL_TABLE_FILTER_VISIBLE", page_charset: "utf-8", app_language: "en", appName: "itm-portal", tableID: tableID, filterVisible: filterVisible }); } /**********************************************************************************************/ function getExcelFilterVisible(tableID,callbackAfterFilter,callbackAfterFilterToggle) { $.post( "http://it-matchmaker-2020--en--r.portal.it-matchmaker.com/core/ajax/ajax.php?PHPSESSID=21cea78e07fed5cac4afbdbc6057b6e2", { type: "GET_EXCEL_TABLE_FILTER_VISIBLE", page_charset: "utf-8", app_language: "en", appName: "itm-portal", 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( "http://it-matchmaker-2020--en--r.portal.it-matchmaker.com/core/ajax/ajax.php?PHPSESSID=21cea78e07fed5cac4afbdbc6057b6e2", { 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:['http://it-matchmaker-2020--en--r.portal.it-matchmaker.com/core/styles/table_print.css', {href:'http://it-matchmaker-2020--en--r.portal.it-matchmaker.com/core/styles/table_print.css',media:'print'}, 'http://it-matchmaker-2020--en--r.portal.it-matchmaker.com/core/modules/bar_chart/styles/bar_chart_print.css', {href:'http://it-matchmaker-2020--en--r.portal.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 = "http://it-matchmaker-2020--en--r.portal.it-matchmaker.com/core/jscripts/tinymce/"; tinymce.suffix = '.min'; tinymce.init({ readonly: readonly_status, selector: selector, skin_url: 'http://it-matchmaker-2020--en--r.portal.it-matchmaker.com/core/jscripts/tinymce/skins/lightgray', entity_encoding : "raw", elementpath: false, resize:true, branding: false, content_css: 'http://it-matchmaker-2020--en--r.portal.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 = "NVlFXzhjbUlsYDx5b3JMaH1gPksraD43NSs8Yy1FfXtCIF1wNWplPEkpSGFCe05rKHx9ST13UzZ6a3N8WmQhMHFDYUg,"; 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( "http://it-matchmaker-2020--en--r.portal.it-matchmaker.com/core/ajax/ajax.php?PHPSESSID=21cea78e07fed5cac4afbdbc6057b6e2",{ 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=21cea78e07fed5cac4afbdbc6057b6e2"; } else { settings.url = "http://it-matchmaker-2020--en--r.portal.it-matchmaker.com/core/modules/"+settings.module_name+"/ajax/"+settings.ajaxFile+"?app_language=en&PHPSESSID=21cea78e07fed5cac4afbdbc6057b6e2"; } } 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 = "NVlFXzhjbUlsYDx5b3JMaH1gPksraD43NSs8Yy1FfXtCIF1wNWplPEkpSGFCe05rKHx9ST13UzZ6a3N8WmQhMHFDYUg,"; 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( "http://it-matchmaker-2020--en--r.portal.it-matchmaker.com/core/ajax/ajax.php?PHPSESSID=21cea78e07fed5cac4afbdbc6057b6e2",{ 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('http://it-matchmaker-2020--en--r.portal.it-matchmaker.com',xhr.status,xhr.statusText,responseText,"Something is wrong in "+settings.div_id, 'NVlFXzhjbUlsYDx5b3JMaH1gPksraD43NSs8Yy1FfXtCIF1wNWplPEkpSGFCe05rKHx9ST13UzZ6a3N8WmQhMHFDYUg,'); $("#"+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 = "http://it-matchmaker-2020--en--r.portal.it-matchmaker.com/core/jscripts/tinymce"; tinymce.suffix = '.min'; tinymce.init({ readonly: settings.readOnly, selector: this.selector, content_css: 'http://it-matchmaker-2020--en--r.portal.it-matchmaker.com/core/styles/tinymce_content_fix.css', branding: false, skin_url: 'http://it-matchmaker-2020--en--r.portal.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( "http://it-matchmaker-2020--en--r.portal.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( "http://it-matchmaker-2020--en--r.portal.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; }; /*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */ (function(r,G,f,v){var J=f("html"),n=f(r),p=f(G),b=f.fancybox=function(){b.open.apply(this,arguments)},I=navigator.userAgent.match(/msie/i),B=null,s=G.createTouch!==v,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},q=function(a){return a&&"string"===f.type(a)},E=function(a){return q(a)&&0
',image:'',iframe:'",error:'

The requested content cannot be loaded.
Please try again later.

',closeBtn:'',next:'',prev:''},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0, openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1, isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var k={},g,h,j,m,l;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k, c.metadata())):k=c);g=d.href||k.href||(q(c)?c:null);h=d.title!==v?d.title:k.title||"";m=(j=d.content||k.content)?"html":d.type||k.type;!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null));q(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":q(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift()));j||("inline"===m?g?j=f(q(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&(!g&& k.isDom)&&(m="inline",j=c));f.extend(k,{href:g,type:m,content:j,title:h,selector:l});a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==v&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current|| b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer= setTimeout(b.next,b.current.playSpeed))},c=function(){d();p.unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==v&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,k;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({},e.dim,k)))},update:function(a){var d= a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(B),B=null);b.isOpen&&!B&&(B=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),B=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigger("onUpdate")), b.update())},hideLoading:function(){p.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('
').click(b.cancel).appendTo("body");p.bind("keydown.loading",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||!1,d={x:n.scrollLeft(), y:n.scrollTop()};a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&r.innerWidth?r.innerWidth:n.width(),d.h=s&&r.innerHeight?r.innerHeight:n.height());return d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb");p.unbind(".fb");n.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(n.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&p.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k=e.target||e.srcElement; if(27===c&&b.coming)return!1;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]")))&&f.each(d,function(d,k){if(1h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==c&&!j&&1g||0>k)b.next(0>g?"up":"right");d.preventDefault()}}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,e){if(e&&b.helpers[d]&&f.isFunction(b.helpers[d][a]))b.helpers[d][a](f.extend(!0, {},b.helpers[d].defaults,e),c)});p.trigger(a)}},isImage:function(a){return q(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return q(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=l(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&(d.padding=[c,c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1, mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=!0;if("image"===c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio= !0);"iframe"===c&&s&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,w(d.padding[a]))});b.trigger("onReady");if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href"); "image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width=this.width/b.opts.pixelRatio;b.coming.height=this.height/b.opts.pixelRatio;b._afterLoad()};a.onerror=function(){this.onload= this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href); f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);s||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a=b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload, e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,k,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());b.unbindEvents();e=a.content;c=a.type;k=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin, outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("
").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('
').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",!1)}));break;case "image":e=a.tpl.image.replace("{href}", g);break;case "swf":e='',h="",f.each(a.swf,function(a,b){e+='';h+=" "+a+'="'+b+'"'}),e+='"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow");a.inner.css("overflow","yes"===k?"scroll": "no"===k?"hidden":k);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.prevMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth,p=h.maxHeight,s=h.scrolling,q=h.scrollOutside? h.scrollbarWidth:0,x=h.margin,y=l(x[1]+x[3]),r=l(x[0]+x[2]),v,z,t,C,A,F,B,D,H;e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");x=l(k.outerWidth(!0)-k.width());v=l(k.outerHeight(!0)-k.height());z=y+x;t=r+v;C=E(c)?(a.w-z)*l(c)/100:c;A=E(j)?(a.h-t)*l(j)/100:j;if("iframe"===h.type){if(H=h.content,h.autoHeight&&1===H.data("ready"))try{H[0].contentWindow.document.location&&(g.width(C).height(9999),F=H.contents().find("body"),q&&F.css("overflow-x","hidden"),A=F.outerHeight(!0))}catch(G){}}else if(h.autoWidth|| h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(C),h.autoHeight||g.height(A),h.autoWidth&&(C=g.width()),h.autoHeight&&(A=g.height()),g.removeClass("fancybox-tmp");c=l(C);j=l(A);D=C/A;m=l(E(m)?l(m,"w")-z:m);n=l(E(n)?l(n,"w")-z:n);u=l(E(u)?l(u,"h")-t:u);p=l(E(p)?l(p,"h")-t:p);F=n;B=p;h.fitToView&&(n=Math.min(a.w-z,n),p=Math.min(a.h-t,p));z=a.w-y;r=a.h-r;h.aspectRatio?(c>n&&(c=n,j=l(c/D)),j>p&&(j=p,c=l(j*D)),cz||y>r)&&(c>m&&j>u)&&!(19n&&(c=n,j=l(c/D)),g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height();else c=Math.max(m,Math.min(c,c-(a-z))),j=Math.max(u,Math.min(j,j-(y-r)));q&&("auto"===s&&jz||y>r)&&c>m&&j>u;c=h.aspectRatio?cu&&j
').appendTo(b.coming?b.coming.parent:a.parent);this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(n.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay",function(a){if(f(a.target).hasClass("fancybox-overlay"))return b.isActive? b.close():d.close(),!1});this.overlay.css(a.css).show()},close:function(){var a,b;n.unbind("resize.overlay");this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),a=n.scrollTop(),b=n.scrollLeft(),this.el.removeClass("fancybox-lock"),n.scrollTop(a).scrollLeft(b));f(".fancybox-overlay").remove().hide();f.extend(this,{overlay:null,fixed:!1})},update:function(){var a="100%",b;this.overlay.width(a).height("100%");I?(b=Math.max(G.documentElement.offsetWidth,G.body.offsetWidth), p.width()>b&&(a=p.width())):p.width()>n.width()&&(a=p.width());this.overlay.width(a).height(p.height())},onReady:function(a,b){var e=this.overlay;f(".fancybox-overlay").stop(!0,!0);e||this.create(a);a.locked&&(this.fixed&&b.fixed)&&(e||(this.margin=p.height()>n.height()?f("html").css("margin-right").replace("px",""):!1),b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){var e,c;b.locked&&(!1!==this.margin&&(f("*").filter(function(){return"fixed"=== f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),e=n.scrollTop(),c=n.scrollLeft(),this.el.addClass("fancybox-lock"),n.scrollTop(e).scrollLeft(c));this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d= b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(q(e)&&""!==f.trim(e)){d=f('
'+e+"
");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),I&&d.width(d.width()),d.wrapInner(''),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d, e=f(this),c=this.selector||"",k=function(g){var h=f(this).blur(),j=d,k,l;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&(""!==l&&"nofollow"!==l)&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+'"]'),j=h.index(this)),a.index=j,!1!==b.open(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",k):p.undelegate(c,"click.fb-start").delegate(c+ ":not('.fancybox-item, .fancybox-nav')","click.fb-start",k);this.filter("[data-fancybox-start=1]").trigger("click");return this};p.ready(function(){var a,d;f.scrollbarWidth===v&&(f.scrollbarWidth=function(){var a=f('
').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===v){a=f.support;d=f('
').appendTo("body");var e=20=== d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")});a=f(r).width();J.addClass("fancybox-lock-test");d=f(r).width();J.removeClass("fancybox-lock-test");f("").appendTo("head")})})(window,document,jQuery); 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("http://it-matchmaker-2020--en--r.portal.it-matchmaker.com/core/modules/check_username/components/dialog_select_user_name.php?userName="+encodeURI(userName)+"&inputFormID="+encodeURI(inputFormID)+"&errorClass="+encodeURI(errorClass)+"&full_path=NVlFXzhjbUlsYDx5b3JMaH1gPksraD43NSs8Yy1FfXtCIF1wNWplPEkpSGFCe05rKHx9ST13UzZ6a3N8WmQhMHFDYUg,&app_language=en&PHPSESSID=21cea78e07fed5cac4afbdbc6057b6e2").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 openModuleCommentDialog(commentText,onSaveFunction,maxChars,readonly,isIFrame,alternativeTitle,additionalTitle, htmltextmode,height,width,showTinyMCE, showAddUserNameAndDate, additionalInfo, enableFullScreen) { if ($("#trv_module_dialog_comment").length == 0) { blockScreen(true); showTinyMCE = (showTinyMCE == null || !showTinyMCE) ? 0:1; showAddUserNameAndDate = (showAddUserNameAndDate == null || !showAddUserNameAndDate) ? 0:1; if (width == null) { if (showTinyMCE) { width = 830; } else { width = 500; } } if (height == null) { height = 300; } if (maxChars == null) { maxChars = 3800; } readonly = (readonly == null || !readonly) ? 0:1; enableFullScreen = (enableFullScreen == null || !enableFullScreen) ? 0:1; isIFrame = (isIFrame == null || !isIFrame) ? 0:1; var position = getIFramePosition(isIFrame); if (showTinyMCE) { position = "top"; } $("body").append(""); $("#trv_module_dialog_comment").load("http://it-matchmaker-2020--en--r.portal.it-matchmaker.com/core/modules/comment/components/dialog_comment.php?onSaveFunction="+onSaveFunction+"&maxChars="+maxChars+"&isIFrame="+isIFrame+"&readonly="+readonly+"&height="+height+"&showTinyMCE="+showTinyMCE+"&full_path=NVlFXzhjbUlsYDx5b3JMaH1gPksraD43NSs8Yy1FfXtCIF1wNWplPEkpSGFCe05rKHx9ST13UzZ6a3N8WmQhMHFDYUg,&app_language=en&PHPSESSID=21cea78e07fed5cac4afbdbc6057b6e2", function() { if(htmltextmode) { $("#trv_module_dialog_comment textarea").html(commentText).text(); } else { $("#trv_module_dialog_comment textarea").val(commentText); } if (readonly) { $("#trv_module_comment_dialog_char_count").html($("#trv_module_dialog_comment textarea").val().length); } else if (!showTinyMCE) { moduleCommentCountCommentChars(maxChars); } if (additionalTitle != null) { $("#additionalTitle_box").html("

"+additionalTitle+"

"); $("#additionalTitle_box").addClass("trv_module_comment_info"); } if (additionalInfo != null) { $("#additionalTitle_box").html($("#additionalTitle_box").html()+additionalInfo); $("#additionalTitle_box").addClass("trv_module_comment_info"); } var dialogTitle = "Comment"; if (alternativeTitle != null) { dialogTitle = alternativeTitle; } $("#trv_module_dialog_comment").dialog({ close: function(event, ui) { if (showTinyMCE) { tinymce.execCommand('mceRemoveEditor',true,'trvModuleCommentInputComment'); } multiContentChanged(false,'core_module_comment'); $(this).dialog('destroy'); $("#trv_module_dialog_comment").remove(); }, beforeClose: function(event, ui) { if (trv_multiContentChanged.core_module_comment) { return trv_confirmClose("$('#trv_module_dialog_comment').dialog('close')",1,isIFrame,"core_module_comment"); } }, open: function(event, ui) { if (showTinyMCE) { initTinyMCE("#trvModuleCommentInputComment", function(){ if (!readonly) { moduleCommentCountCommentChars(maxChars, false, true); } setTimeout(function(){tinymce.execCommand('mceFocus',false,'trvModuleCommentInputComment');}, 150); unblockScreen(true); }, readonly,false,showAddUserNameAndDate, null,enableFullScreen); } else { unblockScreen(true); } }, closeOnEscape: readonly, resizable: false, position: position, minHeight: height, height: 'auto', width: width, modal: true, bgiframe: true, title: dialogTitle, zIndex: 8000, stack: false }); }); } } function moduleCommentCountCommentChars(maxChars, getOnlyCount, showTinyMCE) { if (maxChars == null) { maxChars = 3800; } if (getOnlyCount == null) { getOnlyCount = false; } if (showTinyMCE) { var count = maxChars - tinymce.get('trvModuleCommentInputComment').getContent().length; } else { var count = maxChars - $("#trv_module_dialog_comment textarea").val().length; } if (!getOnlyCount) { var info = count; if (count < 0) { info = ""+count+""; } $("#trv_module_comment_dialog_char_count").html(info); } return count; } // 4.8.2 (2018-08-09) !function(){"use strict";var e,t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v=function(){for(var e=[],t=0;t+~]|"+ut+")"+ut+"*"),gt=new RegExp("="+ut+"*([^\\]'\"]*?)"+ut+"*\\]","g"),pt=new RegExp(lt),ht=new RegExp("^"+st+"$"),vt={ID:new RegExp("^#("+st+")"),CLASS:new RegExp("^\\.("+st+")"),TAG:new RegExp("^("+st+"|[*])"),ATTR:new RegExp("^"+ct),PSEUDO:new RegExp("^"+lt),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ut+"*(even|odd|(([+-]|)(\\d*)n|)"+ut+"*(?:([+-]|)"+ut+"*(\\d+)|))"+ut+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+ut+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ut+"*((?:-\\d)?\\d*)"+ut+"*\\)|)(?=[^-]|$)","i")},bt=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,Ct=/^[^{]+\{\s*\[native \w/,xt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,wt=/[+~]/,Nt=/'|\\/g,Et=new RegExp("\\\\([\\da-f]{1,6}"+ut+"?|("+ut+")|.)","ig"),St=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{ot.apply(tt=it.call(We.childNodes),We.childNodes),tt[We.childNodes.length].nodeType}catch(Kw){ot={apply:tt.length?function(e,t){rt.apply(e,it.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}var Tt=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m;if((t?t.ownerDocument||t:We)!==Ee&&Ne(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(u=(t=t||Ee).nodeType)&&9!==u)return[];if(Te&&!r){if(o=xt.exec(e))if(a=o[1]){if(9===u){if(!(i=t.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(a))&&_e(t,i)&&i.id===a)return n.push(i),n}else{if(o[2])return ot.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&me.getElementsByClassName)return ot.apply(n,t.getElementsByClassName(a)),n}if(me.qsa&&(!ke||!ke.test(e))){if(f=l=$e,d=t,m=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){for(c=ve(e),(l=t.getAttribute("id"))?f=l.replace(Nt,"\\$&"):t.setAttribute("id",f),f="[id='"+f+"'] ",s=c.length;s--;)c[s]=f+Lt(c[s]);d=wt.test(e)&&Ot(t.parentNode)||t,m=c.join(",")}if(m)try{return ot.apply(n,d.querySelectorAll(m)),n}catch(g){}finally{l||t.removeAttribute("id")}}}return ye(e.replace(ft,"$1"),t,n,r)};function kt(){var r=[];return function e(t,n){return r.push(t+" ")>ge.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function At(e){return e[$e]=!0,e}function _t(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||1<<31)-(~e.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function Rt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function Dt(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function Bt(a){return At(function(i){return i=+i,At(function(e,t){for(var n,r=a([],e.length,i),o=r.length;o--;)e[n=r[o]]&&(e[n]=!(t[n]=e[n]))})})}function Ot(e){return e&&typeof e.getElementsByTagName!==Ze&&e}for(de in me=Tt.support={},he=Tt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},Ne=Tt.setDocument=function(e){var t,s=e?e.ownerDocument||e:We,n=s.defaultView;return s!==Ee&&9===s.nodeType&&s.documentElement?(Se=(Ee=s).documentElement,Te=!he(s),n&&n!==function(e){try{return e.top}catch(t){}return null}(n)&&(n.addEventListener?n.addEventListener("unload",function(){Ne()},!1):n.attachEvent&&n.attachEvent("onunload",function(){Ne()})),me.attributes=!0,me.getElementsByTagName=!0,me.getElementsByClassName=Ct.test(s.getElementsByClassName),me.getById=!0,ge.find.ID=function(e,t){if(typeof t.getElementById!==Ze&&Te){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},ge.filter.ID=function(e){var t=e.replace(Et,St);return function(e){return e.getAttribute("id")===t}},ge.find.TAG=me.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==Ze)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},ge.find.CLASS=me.getElementsByClassName&&function(e,t){if(Te)return t.getElementsByClassName(e)},Ae=[],ke=[],me.disconnectedMatch=!0,ke=ke.length&&new RegExp(ke.join("|")),Ae=Ae.length&&new RegExp(Ae.join("|")),t=Ct.test(Se.compareDocumentPosition),_e=t||Ct.test(Se.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},Qe=t?function(e,t){if(e===t)return we=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!me.sortDetached&&t.compareDocumentPosition(e)===n?e===s||e.ownerDocument===We&&_e(We,e)?-1:t===s||t.ownerDocument===We&&_e(We,t)?1:xe?at.call(xe,e)-at.call(xe,t):0:4&n?-1:1)}:function(e,t){if(e===t)return we=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,a=[e],u=[t];if(!o||!i)return e===s?-1:t===s?1:o?-1:i?1:xe?at.call(xe,e)-at.call(xe,t):0;if(o===i)return _t(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?_t(a[r],u[r]):a[r]===We?-1:u[r]===We?1:0},s):Ee},Tt.matches=function(e,t){return Tt(e,null,null,t)},Tt.matchesSelector=function(e,t){if((e.ownerDocument||e)!==Ee&&Ne(e),t=t.replace(gt,"='$1']"),me.matchesSelector&&Te&&(!Ae||!Ae.test(t))&&(!ke||!ke.test(t)))try{var n=(void 0).call(e,t);if(n||me.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(Kw){}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Et,St),e[3]=(e[3]||e[4]||e[5]||"").replace(Et,St),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||Tt.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&Tt.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return vt.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&pt.test(n)&&(t=ve(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Et,St).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=Ye[e+" "];return t||(t=new RegExp("(^|"+ut+")"+e+"("+ut+"|$)"))&&Ye(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Ze&&e.getAttribute("class")||"")})},ATTR:function(n,r,o){return function(e){var t=Tt.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===o:"!="===r?t!==o:"^="===r?o&&0===t.indexOf(o):"*="===r?o&&-1)[^>]*$|#([\w\-]*)$)/,en=je.Event,tn=Yt.makeMap("children,contents,next,prev"),nn=function(e){return void 0!==e},rn=function(e){return"string"==typeof e},on=function(e,t){var n,r,o;for(o=(t=t||Gt).createElement("div"),n=t.createDocumentFragment(),o.innerHTML=e;r=o.firstChild;)n.appendChild(r);return n},an=function(e,t,n,r){var o;if(rn(t))t=on(t,Cn(e[0]));else if(t.length&&!t.nodeType){if(t=pn.makeArray(t),r)for(o=t.length-1;0<=o;o--)an(e,t[o],n,r);else for(o=0;o"===e.charAt(e.length-1)&&3<=e.length?[null,e,null]:Zt.exec(e)))return pn(t).find(e);if(n[1])for(r=on(e,Cn(t)).firstChild;r;)Jt.call(o,r),r=r.nextSibling;else{if(!(r=Cn(t).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(e);o.length=1,o[0]=r}}else this.add(e,!1);return o},toArray:function(){return Yt.toArray(this)},add:function(e,t){var n,r,o=this;if(rn(e))return o.add(pn(e));if(!1!==t)for(n=pn.unique(o.toArray().concat(pn.makeArray(e))),o.length=n.length,r=0;r=a.length&&r(o)}))})})},eo=function(e){return Zr(e,Qr.nu)},to=function(n){return{is:function(e){return n===e},isValue:C,isError:y,getOr:H(n),getOrThunk:H(n),getOrDie:H(n),or:function(e){return to(n)},orThunk:function(e){return to(n)},fold:function(e,t){return t(n)},map:function(e){return to(e(n))},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOption:function(){return A.some(n)}}},no=function(n){return{is:y,isValue:y,isError:C,getOr:j,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(n),function(){throw new Error(e)}();var e},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return no(n)},each:v,bind:function(e){return no(n)},exists:y,forall:C,toOption:A.none}},ro={value:to,error:no};function oo(e,u){var t=e,n=function(e,t,n,r){var o,i;if(e){if(!r&&e[t])return e[t];if(e!==u){if(o=e[n])return o;for(i=e.parentNode;i&&i!==u;i=i.parentNode)if(o=i[n])return o}}};this.current=function(){return t},this.next=function(e){return t=n(t,"firstChild","nextSibling",e)},this.prev=function(e){return t=n(t,"lastChild","previousSibling",e)},this.prev2=function(e){return t=function(e,t,n,r){var o,i,a;if(e){if(o=e[n],u&&o===u)return;if(o){if(!r)for(a=o[t];a;a=a[t])if(!a[t])return a;return o}if((i=e.parentNode)&&i!==u)return i}}(t,"lastChild","previousSibling",e)}}var io,ao,uo,so=function(t){var n;return function(e){return(n=n||function(e,t){for(var n={},r=0,o=e.length;r\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Mo=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Fo=/[<>&\"\']/g,Uo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,zo={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};ao={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},uo={"<":"<",">":">","&":"&",""":'"',"'":"'"};var Vo=function(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n>10),56320+(1023&t))):zo[t]||String.fromCharCode(t):uo[e]||io[e]||(n=e,(r=er.fromTag("div").dom()).innerHTML=n,r.textContent||r.innerText||n);var n,r})}},Wo={},Ko={},Xo=Yt.makeMap,Yo=Yt.each,Go=Yt.extend,Jo=Yt.explode,Qo=Yt.inArray,Zo=function(e,t){return(e=Yt.trim(e))?e.split(t||" "):[]},ei=function(e){var u,t,n,r,o,i,s={},a=function(e,t,n){var r,o,i,a=function(e,t){var n,r,o={};for(n=0,r=e.length;n
').css(n).appendTo(a)[0];return c.set(A.some({caret:i,element:e,before:t})),c.get().each(function(e){t&&pn(e.caret).addClass("mce-visual-caret-before")}),f(),(r=e.ownerDocument.createRange()).setStart(s,0),r.setEnd(s,0),r},hide:l,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){c.get().each(function(e){var t=xc(a,e.element,e.before);pn(e.caret).css(t)})},destroy:function(){return Le.clearInterval(t)}}},Nc=function(e){return Cc(e)||Do.isTable(e)&&cc()},Ec=Do.isContentEditableFalse,Sc=Do.matchStyleValues("display","block table table-cell table-caption list-item"),Tc=Aa,kc=Ta,Ac=ya.curry,_c=Do.isElement,Rc=ja,Dc=function(e){return 0=o.data.length-1)return 1===e&&(r=s(o))?zc(r):n;if(Oa(o)&&i<=1)return-1===e&&(r=u(o))?Vc(r):n;if(i===o.data.length)return(r=s(o))?zc(r):n;if(0===i)return(r=u(o))?Vc(r):n}return n},Hc=function(e,t){var n=Mc(e,t);return Ec(n)&&!Do.isBogusAll(n)},jc=function(e,t){return Do.isTable(Mc(e,t))},$c=function(e,t){return A.from(Mc(e?0:-1,t)).filter(Ec)},Wc=function(e,t,n){var r=qc(e,t,n);return-1===e?wu.fromRangeStart(r):wu.fromRangeEnd(r)},Kc=Ac(Hc,0),Xc=Ac(Hc,-1),Yc=Ac(jc,0),Gc=Ac(jc,-1),Jc=function(e){return Su.isTextPosition(e)?0===e.offset():ja(e.getNode())},Qc=function(e){if(Su.isTextPosition(e)){var t=e.container();return e.offset()===t.data.length}return ja(e.getNode(!0))},Zc=function(e,t){return!Su.isTextPosition(e)&&!Su.isTextPosition(t)&&e.getNode()===t.getNode(!0)},el=function(e,t,n){return e?!Zc(t,n)&&(r=t,!(!Su.isTextPosition(r)&&Do.isBr(r.getNode())))&&Qc(t)&&Jc(n):!Zc(n,t)&&Jc(t)&&Qc(n);var r},tl=function(e,t,n){var r=Ns(t);return A.from(e?r.next(n):r.prev(n))},nl=function(e,t){var n,r,o,i,a,u=e?t.firstChild:t.lastChild;return Do.isText(u)?A.some(Su(u,e?0:u.data.length)):u?ja(u)?A.some(e?Su.before(u):(a=u,Do.isBr(a)?Su.before(a):Su.after(a))):(r=t,o=u,i=(n=e)?Su.before(o):Su.after(o),tl(n,r,i)):A.none()},rl={fromPosition:tl,nextPosition:b(tl,!0),prevPosition:b(tl,!1),navigate:function(t,n,r){return tl(t,n,r).bind(function(e){return Ic(r,e,n)&&el(t,r,e)?tl(t,n,e):A.some(e)})},positionIn:nl,firstPositionIn:b(nl,!0),lastPositionIn:b(nl,!1)},ol=function(e,t){return!e.isBlock(t)||t.innerHTML||Re.ie||(t.innerHTML='
'),t},il=function(e,t){return rl.lastPositionIn(e).fold(function(){return!1},function(e){return t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0})},al=function(e,t,n){return!(!1!==t.hasChildNodes()||!Xu(e,t)||(o=n,i=(r=t).ownerDocument.createTextNode(wa),r.appendChild(i),o.setStart(i,0),o.setEnd(i,0),0));var r,o,i},ul=function(e,t,n,r){var o,i,a,u,s=n[t?"start":"end"],c=e.getRoot();if(s){for(a=s[0],i=c,o=s.length-1;1<=o;o--){if(u=i.childNodes,al(c,i,r))return!0;if(s[o]>u.length-1)return!!al(c,i,r)||il(i,r);i=u[s[o]]}3===i.nodeType&&(a=Math.min(s[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(s[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a)}return!0},sl=function(e){return Do.isText(e)&&0=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===m&&0h.length-1?p=h.length-1:p<0&&(p=0),d=h[p]||g),l===d)return o(v([l]));for(n=e.findCommonAncestor(l,d),a=l;a;a=a.parentNode){if(a===d)return C(l,n,!0);if(a===n)break}for(a=d;a;a=a.parentNode){if(a===l)return C(d,n);if(a===n)break}r=y(l,n)||l,i=y(d,n)||d,C(l,r,!0),(s=b(r===l?r:r.nextSibling,"nextSibling",i===d?i.nextSibling:i)).length&&o(v(s)),C(d,i)}},Bl=(Es=sr.isText,Ss="text",Ts=function(e){return Es(e)?A.from(e.dom().nodeValue):A.none()},ks=Qn.detect().browser,{get:function(e){if(!Es(e))throw new Error("Can only get "+Ss+" value of a "+Ss+" node");return As(e).getOr("")},getOption:As=ks.isIE()&&10===ks.version.major?function(e){try{return Ts(e)}catch(Kw){return A.none()}}:Ts,set:function(e,t){if(!Es(e))throw new Error("Can only set raw "+Ss+" value of a "+Ss+" node");e.dom().nodeValue=t}}),Ol=function(e){return Bl.get(e)},Pl=function(r,o,i,a){return $r.parent(o).fold(function(){return"skipping"},function(e){return"br"===a||(n=o,sr.isText(n)&&"\ufeff"===Ol(n))?"skipping":(t=o,sr.isElement(t)&&Wi.has(t,oa())?"existing":Ku(o)?"caret":vl.isValid(r,i,a)&&vl.isValid(r,sr.name(e),i)?"valid":"invalid-child");var t,n})},Ll=undefined&&undefined.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o'))},Ql=function(n){$r.lastChild(n).each(function(t){$r.prevSibling(t).each(function(e){lo(n)&&mo(t)&&lo(e)&&Ri.remove(t)})})},Zl=Yt.makeMap;function ef(e){var u,s,c,l,f,d=[];return u=(e=e||{}).indent,s=Zl(e.indent_before||""),c=Zl(e.indent_after||""),l=$o.getEncodeFunc(e.entity_encoding||"raw",e.entities),f="html"===e.element_format,{start:function(e,t,n){var r,o,i,a;if(u&&s[e]&&0":" />",n&&u&&c[e]&&0"),u&&c[e]&&0")},comment:function(e){d.push("\x3c!--",e,"--\x3e")},pi:function(e,t){t?d.push(""):d.push(""),u&&d.push("\n")},doctype:function(e){d.push("",u?"\n":"")},reset:function(){d.length=0},getContent:function(){return d.join("").replace(/\n$/,"")}}}function tf(t,g){void 0===g&&(g=ni());var p=ef(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(e){var f,d;d=t.validate,f={3:function(e){p.text(e.value,e.raw)},8:function(e){p.comment(e.value)},7:function(e){p.pi(e.name,e.value)},10:function(e){p.doctype(e.value)},4:function(e){p.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;m(e),e=e.next;);}},p.reset();var m=function(e){var t,n,r,o,i,a,u,s,c,l=f[e.type];if(l)l(e);else{if(t=e.name,n=e.shortEnded,r=e.attributes,d&&r&&1|)$/," "):o("nextSibling")||(e=e.replace(/( | )(
|)$/," "))),e}(e)),n=o.parser,g=t.merge,r=tf({validate:o.settings.validate},o.schema),m='​',s={content:e,format:"html",selection:!0,paste:t.paste},(s=o.fire("BeforeSetContent",s)).isDefaultPrevented())o.fire("SetContent",{content:s.content,format:"html",selection:!0,paste:t.paste});else{-1===(e=s.content).indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,m);var b,y,C,x,w=(l=h.getRng()).startContainer||(l.parentElement?l.parentElement():null),N=o.getBody();w===N&&h.isCollapsed()&&v.isBlock(N.firstChild)&&(b=N.firstChild)&&!o.schema.getShortEndedElements()[b.nodeName]&&v.isEmpty(N.firstChild)&&((l=v.createRng()).setStart(N.firstChild,0),l.setEnd(N.firstChild,0),h.setRng(l)),h.isCollapsed()||(o.selection.setRng(rf(o.selection.getRng())),o.getDoc().execCommand("Delete",!1,null),C=(y=h.getRng()).startContainer,x=y.startOffset,3===C.nodeType&&y.collapsed&&("\xa0"===C.data[x]?(C.deleteData(x,1),/[\u00a0| ]$/.test(e)||(e+=" ")):"\xa0"===C.data[x-1]&&(C.deleteData(x-1,1),/[\u00a0| ]$/.test(e)||(e=" "+e))));var E,S,T,k={context:(i=h.getNode()).nodeName.toLowerCase(),data:t.data,insert:!0};if(u=n.parse(e,k),!0===t.paste&&$l(o.schema,u)&&Kl(v,i))return l=Wl(r,v,o.selection.getRng(),u),o.selection.setRng(l),void o.fire("SetContent",s);if(function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}(u),"mce_marker"===(f=u.lastChild).attr("id"))for(f=(c=f).prev;f;f=f.walk(!0))if(3===f.type||!v.isBlock(f.name)){o.schema.isValidChild(f.parent.name,"span")&&f.parent.insert(c,f,"br"===f.name);break}if(o._selectionOverrides.showBlockCaretContainer(i),k.invalid){for(h.setContent(m),i=h.getNode(),a=o.getBody(),9===i.nodeType?i=f=a:f=i;f!==a;)f=(i=f).parentNode;e=i===a?a.innerHTML:v.getOuterHTML(i),e=r.serialize(n.parse(e.replace(//i,function(){return r.serialize(u)}))),i===a?v.setHTML(a,e):v.setOuterHTML(i,e)}else e=r.serialize(u),function(e,t,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(e.dom.createFragment(t),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?e.dom.setHTML(n,t):e.selection.setContent(t)}}(o,e,i);!function(){if(g){var n=o.getBody(),r=new Yl(v);Yt.each(v.select("*[data-mce-fragment]"),function(e){for(var t=e.parentNode;t&&t!==n;t=t.parentNode)p[e.nodeName.toLowerCase()]&&r.compare(t,e)&&v.remove(e,!0)})}}(),function(e){var t,n,r;if(e){if(h.scrollIntoView(e),t=function(e){for(var t=o.getBody();e&&e!==t;e=e.parentNode)if("false"===o.dom.getContentEditable(e))return e;return null}(e))return v.remove(e),h.select(t);l=v.createRng(),(f=e.previousSibling)&&3===f.nodeType?(l.setStart(f,f.nodeValue.length),Re.ie||(d=e.nextSibling)&&3===d.nodeType&&(f.appendData(d.data),d.parentNode.removeChild(d))):(l.setStartBefore(e),l.setEndBefore(e)),n=v.getParent(e,v.isBlock),v.remove(e),n&&v.isEmpty(n)&&(o.$(n).empty(),l.setStart(n,0),l.setEnd(n,0),of(n)||n.getAttribute("data-mce-fragment")||!(r=function(e){var t=Su.fromRangeStart(e);if(t=Ns(o.getBody()).next(t))return t.toRange()}(l))?v.add(n,v.create("br",{"data-mce-bogus":"1"})):(l=r,v.remove(n))),h.setRng(l)}}(v.get("mce_marker")),E=o.getBody(),Yt.each(E.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),S=o.dom,T=o.selection.getStart(),A.from(S.getParent(T,"td,th")).map(er.fromDom).each(Ql),o.fire("SetContent",s),o.addVisual()}},uf=function(e,t){var n,r,o="string"!=typeof(n=t)?(r=Yt.extend({paste:n.paste,data:{paste:n.paste}},n),{content:n.content,details:r}):{content:n,details:{}};af(e,o.content,o.details)},sf=kr("sections","settings"),cf=Qn.detect().deviceType.isTouch(),lf=["lists","autolink","autosave"],ff={theme:"mobile"},df=function(e){var t=R(e)?e.join(" "):e,n=$(k(t)?t.split(" "):[],$n);return U(n,function(e){return 0Su.before(r).offset()?Su(t.container(),t.offset()-1):t;var n,r,o,i},id=function(e){return ja(e.previousSibling)?A.some((t=e.previousSibling,Do.isText(t)?Su(t,t.data.length):Su.after(t))):e.previousSibling?rl.lastPositionIn(e.previousSibling):A.none();var t},ad=function(e){return ja(e.nextSibling)?A.some((t=e.nextSibling,Do.isText(t)?Su(t,0):Su.before(t))):e.nextSibling?rl.firstPositionIn(e.nextSibling):A.none();var t},ud=function(r,o){return id(o).orThunk(function(){return ad(o)}).orThunk(function(){return e=r,t=o,n=Su.before(t.previousSibling?t.previousSibling:t.parentNode),rl.prevPosition(e,n).fold(function(){return rl.nextPosition(e,Su.after(t))},A.some);var e,t,n})},sd=function(n,r){return ad(r).orThunk(function(){return id(r)}).orThunk(function(){return e=n,t=r,rl.nextPosition(e,Su.after(t)).fold(function(){return rl.prevPosition(e,Su.before(t))},A.some);var e,t})},cd=function(e,t,n){return(r=e,o=t,i=n,r?sd(o,i):ud(o,i)).map(b(od,n));var r,o,i},ld=function(t,n,e){e.fold(function(){t.focus()},function(e){t.selection.setRng(e.toRange(),n)})},fd=function(e,t){return t&&e.schema.getBlockElements().hasOwnProperty(sr.name(t))},dd=function(e){if(Bf(e)){var t=er.fromHtml('
');return Ri.empty(e),Ti.append(e,t),A.some(Su.before(t.dom()))}return A.none()},md=function(t,n,e){var r,a,o,i=cd(n,t.getBody(),e.dom()),u=Zi.ancestor(e,b(fd,t),(r=t.getBody(),function(e){return e.dom()===r})),s=(a=e,o=i,ru([$r.prevSibling(a),$r.nextSibling(a),o],function(e,t,n){var r,o=e.dom(),i=t.dom();return Do.isText(o)&&Do.isText(i)?(r=o.data.length,o.appendData(i.data),Ri.remove(t),Ri.remove(a),n.container()===i?Su(o,r):n):(Ri.remove(a),n)}).orThunk(function(){return Ri.remove(a),o}));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(dd).fold(function(){ld(t,n,s)},function(e){ld(t,n,A.some(e))})},gd=function(a,u){var e,t,n,r,o;return(e=a.getBody(),t=u,n=a.selection.getRng(),r=qc(t?1:-1,e,n),o=Su.fromRangeStart(r),!1===t&&Xc(o)?A.some(ed.remove(o.getNode(!0))):t&&Kc(o)?A.some(ed.remove(o.getNode())):rd(e,t,o)).map(function(e){return e.fold((o=a,i=u,function(e){return o._selectionOverrides.hideFakeCaret(),md(o,i,er.fromDom(e)),!0}),(n=a,r=u,function(e){var t=r?Su.before(e):Su.after(e);return n.selection.setRng(t.toRange()),!0}),(t=a,function(e){return t.selection.setRng(e.toRange()),!0}));var t,n,r,o,i}).getOr(!1)},pd=function(e,t){var n,r=e.selection.getNode();return!!Do.isContentEditableFalse(r)&&(n=er.fromDom(e.getBody()),F(Ki(n,".mce-offscreen-selection"),Ri.remove),md(e,t,er.fromDom(e.selection.getNode())),Ef(e),!0)},hd=function(e,t){return e.selection.isCollapsed()?gd(e,t):pd(e,t)},vd=function(e){var t,n=function(e,t){for(;t&&t!==e;){if(Do.isContentEditableTrue(t)||Do.isContentEditableFalse(t))return t;t=t.parentNode}return null}(e.getBody(),e.selection.getNode());return Do.isContentEditableTrue(n)&&e.dom.isBlock(n)&&e.dom.isEmpty(n)&&(t=e.dom.create("br",{"data-mce-bogus":"1"}),e.dom.setHTML(n,""),n.appendChild(t),e.selection.setRng(Su.before(t).toRange())),!0},bd=Do.isText,yd=function(e){return bd(e)&&e.data[0]===wa},Cd=function(e){return bd(e)&&e.data[e.data.length-1]===wa},xd=function(e){return e.ownerDocument.createTextNode(wa)},wd=function(e,t){return e?function(e){if(bd(e.previousSibling))return Cd(e.previousSibling)||e.previousSibling.appendData(wa),e.previousSibling;if(bd(e))return yd(e)||e.insertData(0,wa),e;var t=xd(e);return e.parentNode.insertBefore(t,e),t}(t):function(e){if(bd(e.nextSibling))return yd(e.nextSibling)||e.nextSibling.insertData(0,wa),e.nextSibling;if(bd(e))return Cd(e)||e.appendData(wa),e;var t=xd(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t}(t)},Nd=b(wd,!0),Ed=b(wd,!1),Sd=function(e,t){return Do.isText(e.container())?wd(t,e.container()):wd(t,e.getNode())},Td=function(e,t){var n=t.get();return n&&e.container()===n&&ka(n)},kd=function(n,e){return e.fold(function(e){os.remove(n.get());var t=Nd(e);return n.set(t),A.some(Su(t,t.length-1))},function(e){return rl.firstPositionIn(e).map(function(e){if(Td(e,n))return Su(n.get(),1);os.remove(n.get());var t=Sd(e,!0);return n.set(t),Su(t,1)})},function(e){return rl.lastPositionIn(e).map(function(e){if(Td(e,n))return Su(n.get(),n.get().length-1);os.remove(n.get());var t=Sd(e,!1);return n.set(t),Su(t,t.length-1)})},function(e){os.remove(n.get());var t=Ed(e);return n.set(t),A.some(Su(t,1))})},Ad=function(e,t){for(var n=0;no.childNodes.length-1&&(c=!1),Do.isDocument(o)&&(o=g,i=0),o===g){if(c&&(u=o.childNodes[0s.childNodes.length-1;s=s.childNodes[Math.min(u,s.childNodes.length-1)]||s,u=c&&3===s.nodeType?s.nodeValue.length:0}var l=i.getParent(s,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=t&&t.ctrlKey;"LI"!==d||m||(l=f),s&&3===s.nodeType&&u>=s.nodeValue.length&&(function(e,t,n){for(var r,o=new oo(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||0")},mceToggleVisualAid:function(){s.hasVisual=!s.hasVisual,s.addVisual()},mceReplaceContent:function(e,t,n){s.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,i.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=o.getParent(i.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||a.remove("link"),n.href&&a.apply("link",n,r)},selectAll:function(){var e=o.getParent(i.getStart(),Do.isContentEditableTrue);if(e){var t=o.createRng();t.selectNodeContents(e),i.setRng(t)}},"delete":function(){Hm(s)},forwardDelete:function(){jm(s)},mceNewDocument:function(){s.setContent("")},InsertLineBreak:function(e,t,n){return mg(s,n),!0}});var p=function(n){return function(){var e=i.isCollapsed()?[o.getParent(i.getNode(),o.isBlock)]:i.getSelectedBlocks(),t=Mg(e,function(e){return!!a.matchNode(e,n)});return-1!==Fg(t,!0)}};e({JustifyLeft:p("alignleft"),JustifyCenter:p("aligncenter"),JustifyRight:p("alignright"),JustifyFull:p("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return f(e)},mceBlockQuote:function(){return f("blockquote")},Outdent:function(){var e;if(n.inline_styles){if((e=o.getParent(i.getStart(),o.isBlock))&&0"),u))[o.length-1]=Yt.extend(o[o.length-1],{func:n,scope:r||i}),Yt.extend(o[0],{desc:i.translate(t),subpatterns:o.slice(1)})},o=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},c=function(e){return e.func?e.func.call(e.scope):null};i.on("keyup keypress keydown",function(t){var e,n;((n=t).altKey||n.ctrlKey||n.metaKey||"keydown"===(e=t).type&&112<=e.keyCode&&e.keyCode<=123)&&!t.isDefaultPrevented()&&(ap(a,function(e){if(o(t,e))return r=e.subpatterns.slice(0),"keydown"===t.type&&c(e),!0}),o(t,r[0])&&(1===r.length&&"keydown"===t.type&&c(r[0]),r.shift()))}),this.add=function(e,n,r,o){var t;return"string"==typeof(t=r)?r=function(){i.execCommand(t,!1,null)}:Yt.isArray(t)&&(r=function(){i.execCommand(t[0],t[1],t[2])}),ap(up(Yt.trim(e.toLowerCase())),function(e){var t=s(e,n,r,o);a[t.id]=t}),!0},this.remove=function(e){var t=s(e);return!!a[t.id]&&(delete a[t.id],!0)}}var fp=function(e){var t=e!==undefined?e.dom():document;return A.from(t.activeElement).map(er.fromDom)},dp=function(e){var t=$r.owner(e).dom();return e.dom()===t.activeElement},mp=function(t){return fp($r.owner(t)).filter(function(e){return t.dom().contains(e.dom())})},gp=function(t,e){return(n=e,n.collapsed?A.from(eu(n.startContainer,n.startOffset)).map(er.fromDom):A.none()).bind(function(e){return bo(e)?A.some(e):!1===Fr.contains(t,e)?A.some(t):A.none()});var n},pp=function(t,e){gp(er.fromDom(t.getBody()),e).bind(function(e){return rl.firstPositionIn(e.dom())}).fold(function(){t.selection.normalize()},function(e){return t.selection.setRng(e.toRange())})},hp=function(e){if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},vp=function(e){var t,n=e.getBody();return n&&(t=er.fromDom(n),dp(t)||mp(t).isSome())},bp=function(e){return e.inline?vp(e):(t=e).iframeElement&&dp(er.fromDom(t.iframeElement));var t},yp=function(e){return e.editorManager.setActive(e)},Cp=function(e,t){e.removed||(t?yp(e):function(t){var e=t.selection,n=t.settings.content_editable,r=t.getBody(),o=e.getRng();t.quirks.refreshContentEditable();var i,a,u=(i=t,a=e.getNode(),i.dom.getParent(a,function(e){return"true"===i.dom.getContentEditable(e)}));if(t.$.contains(r,u))return hp(u),pp(t,o),yp(t);t.bookmark!==undefined&&!1===bp(t)&&Og(t).each(function(e){t.selection.setRng(e),o=e}),n||(Re.opera||hp(r),t.getWin().focus()),(Re.gecko||n)&&(hp(r),pp(t,o)),yp(t)}(e))},xp=bp,wp=function(e,t){return t.dom()[e]},Np=function(e,t){return parseInt(Sr(t,e),10)},Ep=b(wp,"clientWidth"),Sp=b(wp,"clientHeight"),Tp=b(Np,"margin-top"),kp=b(Np,"margin-left"),Ap=function(e,t,n){var r,o,i,a,u,s,c,l,f,d,m=er.fromDom(e.getBody()),g=e.inline?m:$r.documentElement(m),p=(r=e.inline,i=t,a=n,u=(o=g).dom().getBoundingClientRect(),{x:i-(r?u.left+o.dom().clientLeft+kp(o):0),y:a-(r?u.top+o.dom().clientTop+Tp(o):0)});return c=p.x,l=p.y,f=Ep(s=g),d=Sp(s),0<=c&&0<=l&&c<=f&&l<=d},_p=function(e){var t,n=e.inline?e.getBody():e.getContentAreaContainer();return(t=n,A.from(t).map(er.fromDom)).map(function(e){return Fr.contains($r.owner(e),e)}).getOr(!1)};function Rp(n){var t,o=[],i=function(){var e,t=n.theme;return t&&t.getNotificationManagerImpl?t.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},a=function(){0i&&(u=n.pageX+r-i),n.pageY+o>a&&(s=n.pageY+o-a),t.style.width=r-u+"px",t.style.height=o-s+"px",v(e.clientX,e.clientY)}},o=Nh(c,e),u=c,i=function(){u.dragging&&s.fire("dragend"),Eh(u)},(s=e).on("mousedown",n),e.on("mousemove",r),e.on("mouseup",o),t.bind(a,"mousemove",r),t.bind(a,"mouseup",i),e.on("remove",function(){t.unbind(a,"mousemove",r),t.unbind(a,"mouseup",i)})},Th=function(e){var n;Sh(e),(n=e).on("drop",function(e){var t="undefined"!=typeof e.clientX?n.getDoc().elementFromPoint(e.clientX,e.clientY):null;(yh(t)||yh(n.dom.getContentEditableParent(t)))&&e.preventDefault()})},kh=function(e){return jt.reduce(e,function(e,t){return e.concat(function(t){var e=function(e){return jt.map(e,function(e){return(e=Xa(e)).node=t,e})};if(Do.isElement(t))return e(t.getClientRects());if(Do.isText(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}}(t))},[])};(hh=ph||(ph={}))[hh.Up=-1]="Up",hh[hh.Down=1]="Down";var Ah=function(o,i,a,e,u,t){var n,s,c=0,l=[],r=function(e){var t,n,r;for(r=kh([e]),-1===o&&(r=r.reverse()),t=0;tt;var t}},Bh=function(n){return function(e){return t=n,e.line===t;var t}},Oh=Do.isContentEditableFalse,Ph=Pc,Lh=function(e,t){return Math.abs(e.left-t)},Ih=function(e,t){return Math.abs(e.right-t)},Mh=function(e,t){return e>=t.left&&e<=t.right},Fh=function(e,o){return jt.reduce(e,function(e,t){var n,r;return n=Math.min(Lh(e,o),Ih(e,o)),r=Math.min(Lh(t,o),Ih(t,o)),Mh(o,t)?t:Mh(o,e)?e:r===n&&Oh(t.node)?t:r=e.top&&n<=e.bottom});return(r=Fh(d,t))&&(r=Fh((u=e,l=function(t,e){var n;return n=jt.filter(kh([e]),function(e){return!t(e,s)}),c=c.concat(n),0===n.length},(c=[]).push(s=r),Uh(ph.Up,u,b(l,Ja),s.node),Uh(ph.Down,u,b(l,Qa),s.node),c),t))&&Nc(r.node)?(a=t,{node:(i=r).node,before:Lh(i,a)=(n=t).left&&r<=n.right&&o>=n.top&&o<=n.bottom);var n,r,o},!1)},qh=function(t){var e=Di(function(){if(!t.removed&&t.selection.getRng().collapsed){var e=ls(t,t.selection.getRng(),!1);t.selection.setRng(e)}},0);t.on("focus",function(){e.throttle()}),t.on("blur",function(){e.cancel()})},Hh={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(e){return Re.mac?e.metaKey:e.ctrlKey&&!e.altKey}},jh=Do.isContentEditableTrue,$h=Do.isContentEditableFalse,Wh=Xc,Kh=Kc,Xh=function(e,t){for(var n=e.getBody();t&&t!==n;){if(jh(t)||$h(t))return t;t=t.parentNode}return null},Yh=function(g){var p,e,t,a=g.getBody(),o=wc(g.getBody(),function(e){return g.dom.isBlock(e)},function(){return xp(g)}),h="sel-"+g.dom.uniqueId(),u=function(e){e&&g.selection.setRng(e)},s=function(){return g.selection.getRng()},v=function(e,t,n,r){return void 0===r&&(r=!0),g.fire("ShowCaret",{target:t,direction:e,before:n}).isDefaultPrevented()?null:(r&&g.selection.scrollIntoView(t,-1===e),o.show(n,t))},b=function(e,t){return t=qc(e,a,t),-1===e?Su.fromRangeStart(t):Su.fromRangeEnd(t)},n=function(e){return Aa(e)||Oa(e)||Pa(e)},y=function(e){return n(e.startContainer)||n(e.endContainer)},c=function(e,t){var n,r,o,i,a,u,s,c,l,f,d=g.$,m=g.dom;if(!e)return null;if(e.collapsed){if(!y(e))if(!1===t){if(c=b(-1,e),Nc(c.getNode(!0)))return v(-1,c.getNode(!0),!1,!1);if(Nc(c.getNode()))return v(-1,c.getNode(),!c.isAtEnd(),!1)}else{if(c=b(1,e),Nc(c.getNode()))return v(1,c.getNode(),!c.isAtEnd(),!1);if(Nc(c.getNode(!0)))return v(1,c.getNode(!0),!1,!1)}return null}return i=e.startContainer,a=e.startOffset,u=e.endOffset,3===i.nodeType&&0===a&&$h(i.parentNode)&&(i=i.parentNode,a=m.nodeIndex(i),i=i.parentNode),1!==i.nodeType?null:(u===a+1&&(n=i.childNodes[a]),$h(n)?(l=f=n.cloneNode(!0),(s=g.fire("ObjectSelected",{target:n,targetClone:l})).isDefaultPrevented()?null:(r=na(er.fromDom(g.getBody()),"#"+h).fold(function(){return d([])},function(e){return d([e.dom()])}),l=s.targetClone,0===r.length&&(r=d('
').attr("id",h)).appendTo(g.getBody()),e=g.dom.createRng(),l===f&&Re.ie?(r.empty().append('

\xa0

').append(l),e.setStartAfter(r[0].firstChild.firstChild),e.setEndAfter(l)):(r.empty().append("\xa0").append(l).append("\xa0"),e.setStart(r[0].firstChild,1),e.setEnd(r[0].lastChild,0)),r.css({top:m.getPos(n,g.getBody()).y}),r[0].focus(),(o=g.selection.getSel()).removeAllRanges(),o.addRange(e),F(Ki(er.fromDom(g.getBody()),"*[data-mce-selected]"),function(e){hr.remove(e,"data-mce-selected")}),n.setAttribute("data-mce-selected","1"),p=n,C(),e)):null)},l=function(){p&&(p.removeAttribute("data-mce-selected"),na(er.fromDom(g.getBody()),"#"+h).each(Ri.remove),p=null),na(er.fromDom(g.getBody()),"#"+h).each(Ri.remove),p=null},C=function(){o.hide()};return Re.ceFalse&&(function(){g.on("mouseup",function(e){var t=s();t.collapsed&&Ap(g,e.clientX,e.clientY)&&u(cs(g,t,!1))}),g.on("click",function(e){var t;(t=Xh(g,e.target))&&($h(t)&&(e.preventDefault(),g.focus()),jh(t)&&g.dom.isChildOf(t,g.selection.getNode())&&l())}),g.on("blur NewBlock",function(){l()}),g.on("ResizeWindow FullscreenStateChanged",function(){return o.reposition()});var n,r,i=function(e,t){var n,r,o=g.dom.getParent(e,g.dom.isBlock),i=g.dom.getParent(t,g.dom.isBlock);return!(!o||!g.dom.isChildOf(o,i)||!1!==$h(Xh(g,o)))||o&&(n=o,r=i,!(g.dom.getParent(n,g.dom.isBlock)===g.dom.getParent(r,g.dom.isBlock)))&&function(e){var t=Ns(e);if(!e.firstChild)return!1;var n=Su.before(e.firstChild),r=t.next(n);return r&&!Kh(r)&&!Wh(r)}(o)};r=!1,(n=g).on("touchstart",function(){r=!1}),n.on("touchmove",function(){r=!0}),n.on("touchend",function(e){var t=Xh(n,e.target);$h(t)&&(r||(e.preventDefault(),c(ss(n,t))))}),g.on("mousedown",function(e){var t,n=e.target;if((n===a||"HTML"===n.nodeName||g.dom.isChildOf(n,a))&&!1!==Ap(g,e.clientX,e.clientY))if(t=Xh(g,n))$h(t)?(e.preventDefault(),c(ss(g,t))):(l(),jh(t)&&e.shiftKey||Vh(e.clientX,e.clientY,g.selection.getRng())||(C(),g.selection.placeCaretAt(e.clientX,e.clientY)));else if(!1===Nc(n)){l(),C();var r=zh(a,e.clientX,e.clientY);if(r&&!i(e.target,r.node)){e.preventDefault();var o=v(1,r.node,r.before,!1);g.getBody().focus(),u(o)}}}),g.on("keypress",function(e){Hh.modifierPressed(e)||(e.keyCode,$h(g.selection.getNode())&&e.preventDefault())}),g.on("getSelectionRange",function(e){var t=e.range;if(p){if(!p.parentNode)return void(p=null);(t=t.cloneRange()).selectNode(p),e.range=t}}),g.on("setSelectionRange",function(e){var t;(t=c(e.range,e.forward))&&(e.range=t)}),g.on("AfterSetSelectionRange",function(e){var t,n=e.range;y(n)||"mcepastebin"===n.startContainer.parentNode.id||C(),t=n.startContainer.parentNode,g.dom.hasClass(t,"mce-offscreen-selection")||l()}),g.on("copy",function(e){var t,n=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!Re.ie){var r=(t=g.dom.get(h))?t.getElementsByTagName("*")[0]:t;r&&(e.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),Th(g),qh(g)}(),e=g.contentStyles,t=".mce-content-body",e.push(o.getCss()),e.push(t+" .mce-offscreen-selection {position: absolute;left: -9999999999px;max-width: 1000000px;}"+t+" *[contentEditable=false] {cursor: default;}"+t+" *[contentEditable=true] {cursor: text;}")),{showCaret:v,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(La(e),u(s()),g.selection.scrollIntoView(e[0]))},hideFakeCaret:C,destroy:function(){o.destroy(),p=null}}},Gh=function(e,t,n){var r,o,i,a,u=1;for(a=e.getShortEndedElements(),(i=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g).lastIndex=r=n;o=i.exec(t);){if(r=i.lastIndex,"/"===o[1])u--;else if(!o[1]){if(o[2]in a)continue;u++}if(0===u)break}return r};function Jh(F,U){void 0===U&&(U=ni());var e=function(){};!1!==(F=F||{}).fix_self_closing&&(F.fix_self_closing=!0);var z=F.comment?F.comment:e,V=F.cdata?F.cdata:e,q=F.text?F.text:e,H=F.start?F.start:e,j=F.end?F.end:e,$=F.pi?F.pi:e,W=F.doctype?F.doctype:e;return{parse:function(e){var t,n,r,d,o,i,a,m,u,s,g,c,p,l,f,h,v,b,y,C,x,w,N,E,S,T,k,A,_,R=0,D=[],B=0,O=$o.decode,P=Yt.makeMap("src,href,data,background,formaction,poster,xlink:href"),L=/((java|vb)script|mhtml):/i,I=function(e){var t,n;for(t=D.length;t--&&D[t].name!==e;);if(0<=t){for(n=D.length-1;t<=n;n--)(e=D[n]).valid&&j(e.name);D.length=t}},M=function(e,t,n,r,o){var i,a,u,s,c;if(n=(t=t.toLowerCase())in g?t:O(n||r||o||""),p&&!m&&0==(0===(u=t).indexOf("data-")||0===u.indexOf("aria-"))){if(!(i=b[t])&&y){for(a=y.length;a--&&!(i=y[a]).pattern.test(t););-1===a&&(i=null)}if(!i)return;if(i.validValues&&!(n in i.validValues))return}if(P[t]&&!F.allow_script_urls){var l=n.replace(/[\s\u0000-\u001F]+/g,"");try{l=decodeURIComponent(l)}catch(f){l=unescape(l)}if(L.test(l))return;if(c=l,!(s=F).allow_html_data_urls&&(/^data:image\//i.test(c)?!1===s.allow_svg_data_urls&&/^data:image\/svg\+xml/i.test(c):/^data:/i.test(c)))return}m&&(t in P||0===t.indexOf("on"))||(d.map[t]=n,d.push({name:t,value:n}))};for(S=new RegExp("<(?:(?:!--([\\w\\W]*?)--\x3e)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),T=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,s=U.getShortEndedElements(),E=F.self_closing_elements||U.getSelfClosingElements(),g=U.getBoolAttrs(),p=F.validate,u=F.remove_internals,_=F.fix_self_closing,k=U.getSpecialElements(),N=e+">";t=S.exec(N);){if(Re.length){q(O(e.substr(t.index))),R=t.index+t[0].length;continue}if(":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),c=n in s,_&&E[n]&&0"===n.charAt(0)&&(n=" "+n),F.allow_conditional_comments||"[if"!==n.substr(0,3).toLowerCase()||(n=" "+n),z(n)):(n=t[2])?V(n.replace(//g,"")):(n=t[3])?W(n):(n=t[4])&&$(n,t[5]);R=t.index+t[0].length}for(R]*data-mce-bogus="all"[^>]*>/g,d=e.schema;for(u=e.getTempAttrs(),s=l,c=new RegExp(["\\s?("+u.join("|")+')="[^"]+"'].join("|"),"gi"),l=s.replace(c,""),a=d.getShortEndedElements();i=f.exec(l);)r=f.lastIndex,o=i[0].length,n=a[i[1]]?r:Qh.findEndTag(d,l,r),l=l.substring(0,r-o)+l.substring(n),f.lastIndex=r-o;return Na(l)},ev={trimExternal:Zh,trimInternal:Zh},tv=0,nv=2,rv=1,ov=function(g,p){var e=g.length+p.length+2,h=new Array(e),v=new Array(e),c=function(e,t,n,r,o){var i=l(e,t,n,r);if(null===i||i.start===t&&i.diag===t-r||i.end===e&&i.diag===e-n)for(var a=e,u=n;a")?gv(r):pv(t)},yv=function(e,t,n){"fragmented"===t.type?sv(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(n?t.beforeBookmark:t.bookmark)},Cv=function(e,t){return!(!e||!t)&&(r=t,hv(e)===hv(r)||(n=t,vv(e)===vv(n)));var n,r};function xv(u){var s,r,o=this,c=0,l=[],t=0,f=function(){return 0===t},i=function(e){f()&&(o.typing=e)},d=function(e){u.setDirty(e)},a=function(e){i(!1),o.add({},e)},n=function(){o.typing&&(i(!1),o.add())};return u.on("init",function(){o.add()}),u.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&(n(),o.beforeChange())}),u.on("ExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&a(e)}),u.on("ObjectResizeStart Cut",function(){o.beforeChange()}),u.on("SaveContent ObjectResized blur",a),u.on("DragEnd",a),u.on("KeyUp",function(e){var t=e.keyCode;e.isDefaultPrevented()||((33<=t&&t<=36||37<=t&&t<=40||45===t||e.ctrlKey)&&(a(),u.nodeChanged()),46!==t&&8!==t||u.nodeChanged(),r&&o.typing&&!1===Cv(bv(u),l[0])&&(!1===u.isDirty()&&(d(!0),u.fire("change",{level:l[0],lastLevel:null})),u.fire("TypingUndo"),r=!1,u.nodeChanged()))}),u.on("KeyDown",function(e){var t=e.keyCode;if(!e.isDefaultPrevented())if(33<=t&&t<=36||37<=t&&t<=40||45===t)o.typing&&a(e);else{var n=e.ctrlKey&&!e.altKey||e.metaKey;!(t<16||20i.custom_undo_redo_levels){for(n=0;n
").append(n.childNodes)}))},$v[wv="pre"]||($v[wv]=[]),$v[wv].push(Nv);var Xv=function(e,t){Kv($v[e],function(e){e(t)})},Yv=/^(src|href|style)$/,Gv=Yt.each,Jv=vl.isEq,Qv=function(e){return/^(TH|TD)$/.test(e.nodeName)},Zv=function(e,t,n){var r,o,i;return r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],Do.isElement(r)&&(i=r.childNodes.length-1,!n&&o&&o--,r=r.childNodes[i=r.nodeValue.length&&(r=new oo(r,e.getBody()).next()||r),Do.isText(r)&&!n&&0===o&&(r=new oo(r,e.getBody()).prev()||r),r},eb=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},tb=function(e,t,n,r){return!(t=vl.getNonWhiteSpaceSibling(t,n,r))||"BR"===t.nodeName||e.isBlock(t)},nb=function(e,n,r,o,i){var t,a,u,s,c,l,f,d,m,g,p,h,v,b,y=e.dom;if(c=y,!(Jv(l=o,(f=n).inline)||Jv(l,f.block)||(f.selector?Do.isElement(l)&&c.is(l,f.selector):void 0)||(s=o,n.links&&"A"===s.tagName)))return!1;if("all"!==n.remove)for(Gv(n.styles,function(e,t){e=vl.normalizeStyleValue(y,vl.replaceVars(e,r),t),"number"==typeof t&&(t=e,i=0),(n.remove_similar||!i||Jv(vl.getStyle(y,i,t),e))&&y.setStyle(o,t,""),u=1}),u&&""===y.getAttrib(o,"style")&&(o.removeAttribute("style"),o.removeAttribute("data-mce-style")),Gv(n.attributes,function(e,t){var n;if(e=vl.replaceVars(e,r),"number"==typeof t&&(t=e,i=0),!i||Jv(y.getAttrib(i,t),e)){if("class"===t&&(e=y.getAttrib(o,t))&&(n="",Gv(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(n+=(n?" ":"")+e)}),n))return void y.setAttrib(o,t,n);"class"===t&&o.removeAttribute("className"),Yv.test(t)&&o.removeAttribute("data-mce-"+t),o.removeAttribute(t)}}),Gv(n.classes,function(e){e=vl.replaceVars(e,r),i&&!y.hasClass(i,e)||y.removeClass(o,e)}),a=y.getAttribs(o),t=0;t)\s*/g,"$1"),Yt.map(e.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var t=Yt.map(e.split(/(?:~\+|~|\+)/),_b),n=t.pop();return t.length&&(n.siblings=t),n}).reverse()):[]},Db=function(n,e){var t,r,o,i,a,u,s="";if(!1===(u=n.settings.preview_styles))return"";"string"!=typeof u&&(u="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");var c=function(e){return e.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=n.formatter.get(e)))return;e=e[0]}return"preview"in e&&!1===(u=e.preview)?"":(t=e.block||e.inline||"span",(i=Rb(e.selector)).length?(i[0].name||(i[0].name=t),t=e.selector,r=Ab(i,n)):r=Ab([t],n),o=kb.select(t,r)[0]||r.firstChild,Tb(e.styles,function(e,t){(e=c(e))&&kb.setStyle(o,t,e)}),Tb(e.attributes,function(e,t){(e=c(e))&&kb.setAttrib(o,t,e)}),Tb(e.classes,function(e){e=c(e),kb.hasClass(o,e)||kb.addClass(o,e)}),n.fire("PreviewFormats"),kb.setStyles(r,{position:"absolute",left:-65535}),n.getBody().appendChild(r),a=kb.getStyle(n.getBody(),"fontSize",!0),a=/px$/.test(a)?parseInt(a,10):0,Tb(u.split(" "),function(e){var t=kb.getStyle(o,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=kb.getStyle(n.getBody(),e,!0),"#ffffff"===kb.toHex(t).toLowerCase())||"color"===e&&"#000000"===kb.toHex(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===a)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*a+"px"}"border"===e&&t&&(s+="padding:0 2px;"),s+=e+":"+t+";"}}),n.fire("AfterPreviewFormats"),kb.remove(r),s)},Bb=function(e,t,n,r,o){var i=t.get(n);!Rv.match(e,n,r,o)||"toggle"in i[0]&&!i[0].toggle?wb.applyFormat(e,n,r,o):ob(e,n,r,o)},Ob=function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])};function Pb(e){var t,n,r,o=(t=e,n={},(r=function(e,t){e&&("string"!=typeof e?Yt.each(e,function(e,t){r(t,e)}):(t=t.length?t:[t],Yt.each(t,function(e){"undefined"==typeof e.deep&&(e.deep=!e.selector),"undefined"==typeof e.split&&(e.split=!e.selector||e.inline),"undefined"==typeof e.remove&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),n[e]=t))})(Sb.get(t.dom)),r(t.settings.formats),{get:function(e){return e?n[e]:n},register:r,unregister:function(e){return e&&n[e]&&delete n[e],n}}),i=Bi(null);return Ob(e),Hv(e),{get:o.get,register:o.register,unregister:o.unregister,apply:b(wb.applyFormat,e),remove:b(ob,e),toggle:b(Bb,e,o),match:b(Rv.match,e),matchAll:b(Rv.matchAll,e),matchNode:b(Rv.matchNode,e),canApply:b(Rv.canApply,e),formatChanged:b(Eb,e,i),getCssText:b(Db,e)}}var Lb,Ib=Object.prototype.hasOwnProperty,Mb=(Lb=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")};i--;)r=(n=e[i]).firstChild?n.firstChild.value:"","script"===t?((o=n.attr("type"))&&n.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===s.element_format&&0")):"xhtml"===s.element_format&&0k(n)?(C=A(y*b),y=A(C/b)):(y=A(C/b),C=A(y*b))),N.setStyles(D(s),{width:y,height:C}),r=0<(r=f.startPos.x+t)?r:0,o=0<(o=f.startPos.y+n)?o:0,N.setStyles(c,{left:r,top:o,display:"block"}),c.innerHTML=y+" × "+C,f[2]<0&&s.clientWidth<=y&&N.setStyle(s,"left",g+(h-y)),f[3]<0&&s.clientHeight<=C&&N.setStyle(s,"top",p+(v-C)),(t=_.scrollWidth-x)+(n=_.scrollHeight-w)!=0&&N.setStyles(c,{left:r-t,top:o-n}),i||(Yg(a,u,h,v),i=!0)},P=function(){i=!1;var e=function(e,t){t&&(u.style[e]||!a.schema.isValid(u.nodeName.toLowerCase(),e)?N.setStyle(D(u),e,t):N.setAttrib(D(u),e,t))};e("width",y),e("height",C),N.unbind(S,"mousemove",O),N.unbind(S,"mouseup",P),T!==S&&(N.unbind(T,"mousemove",O),N.unbind(T,"mouseup",P)),N.remove(s),N.remove(c),o(u),Gg(a,u,y,C),N.setAttrib(u,"style",N.getAttrib(u,"style")),a.nodeChanged()},o=function(e){var t,r,o,n,i;L(),F(),t=N.getPos(e,_),g=t.x,p=t.y,i=e.getBoundingClientRect(),r=i.width||i.right-i.left,o=i.height||i.bottom-i.top,u!==e&&(u=e,y=C=0),n=a.fire("ObjectSelected",{target:e}),B(e)&&!n.isDefaultPrevented()?E(l,function(n,e){var t;(t=N.get("mceResizeHandle"+e))&&N.remove(t),t=N.add(_,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===Re.ie&&(t.contentEditable=!1),N.bind(t,"mousedown",function(e){var t;e.stopImmediatePropagation(),e.preventDefault(),d=(t=e).screenX,m=t.screenY,h=D(u).clientWidth,v=D(u).clientHeight,b=v/h,(f=n).startPos={x:r*n[0]+g,y:o*n[1]+p},x=_.scrollWidth,w=_.scrollHeight,s=u.cloneNode(!0),N.addClass(s,"mce-clonedresizable"),N.setAttrib(s,"data-mce-bogus","all"),s.contentEditable=!1,s.unSelectabe=!0,N.setStyles(s,{left:g,top:p,margin:0}),s.removeAttribute("data-mce-selected"),_.appendChild(s),N.bind(S,"mousemove",O),N.bind(S,"mouseup",P),T!==S&&(N.bind(T,"mousemove",O),N.bind(T,"mouseup",P)),c=N.add(_,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},h+" × "+v)}),n.elm=t,N.setStyles(t,{left:r*n[0]+g-t.offsetWidth/2,top:o*n[1]+p-t.offsetHeight/2})}):L(),u.setAttribute("data-mce-selected","1")},L=function(){var e,t;for(e in F(),u&&u.removeAttribute("data-mce-selected"),l)(t=N.get("mceResizeHandle"+e))&&(N.unbind(t),N.remove(t))},I=function(e){var t,n=function(e,t){if(e)do{if(e===t)return!0}while(e=e.parentNode)};i||a.removed||(E(N.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),t="mousedown"===e.type?e.target:r.getNode(),n(t=N.$(t).closest("table,img,figure.image,hr")[0],_)&&(U(),n(r.getStart(!0),t)&&n(r.getEnd(!0),t))?o(t):L())},M=function(e){return fy(function(e,t){for(;t&&t!==e;){if(dy(t)||fy(t))return t;t=t.parentNode}return null}(a.getBody(),e))},F=function(){for(var e in l){var t=l[e];t.elm&&(N.unbind(t.elm),delete t.elm)}},U=function(){try{a.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}};return a.on("init",function(){U(),Re.ie&&11<=Re.ie&&(a.on("mousedown click",function(e){var t=e.target,n=t.nodeName;i||!/^(TABLE|IMG|HR)$/.test(n)||M(t)||(2!==e.button&&a.selection.select(t,"TABLE"===n),"mousedown"===e.type&&a.nodeChanged())}),a.dom.bind(_,"mscontrolselect",function(e){var t=function(e){Le.setEditorTimeout(a,function(){a.selection.select(e)})};if(M(e.target))return e.preventDefault(),void t(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&t(e.target))}));var t=Le.throttle(function(e){a.composing||I(e)});a.on("nodechange ResizeEditor ResizeWindow drop FullscreenStateChanged",t),a.on("keyup compositionend",function(e){u&&"TABLE"===u.nodeName&&t(e)}),a.on("hide blur",L),a.on("contextmenu",n)}),a.on("remove",F),{isResizable:B,showResizeRect:o,hideResizeRect:L,updateResizeRect:I,destroy:function(){u=s=null}}},gy=function(e){return Do.isContentEditableTrue(e)||Do.isContentEditableFalse(e)},py=function(e,t,n){var r,o,i,a,u,s=n;if(s.caretPositionFromPoint)(o=s.caretPositionFromPoint(e,t))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(s.body.createTextRange){r=s.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(c){r=function(e,n,t){var r,o,i;if(r=t.elementFromPoint(e,n),o=t.body.createTextRange(),r&&"HTML"!==r.tagName||(r=t.body),o.moveToElementText(r),0<(i=(i=Yt.toArray(o.getClientRects())).sort(function(e,t){return(e=Math.abs(Math.max(e.top-n,e.bottom-n)))-(t=Math.abs(Math.max(t.top-n,t.bottom-n)))})).length){n=(i[0].bottom+i[0].top)/2;try{return o.moveToPoint(e,n),o.collapse(!0),o}catch(a){}}return null}(e,t,n)}return i=r,a=n.body,u=i&&i.parentElement?i.parentElement():null,Do.isContentEditableFalse(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(u,a,gy))?null:i}return r},hy=function(n,e){return $(e,function(e){var t=n.fire("GetSelectionRange",{range:e});return t.range!==e?t.range:e})},vy=function(e,t){var n=(t||document).createDocumentFragment();return F(e,function(e){n.appendChild(e.dom())}),er.fromDom(n)},by=kr("element","width","rows"),yy=kr("element","cells"),Cy=kr("x","y"),xy=function(e,t){var n=parseInt(hr.get(e,t),10);return isNaN(n)?1:n},wy=function(e){return z(e,function(e,t){return t.cells().length>e?t.cells().length:e},0)},Ny=function(e,t){for(var n=e.rows(),r=0;r"+(r.item?r.item(0).outerHTML:r.htmlText),o.removeChild(o.firstChild)):o.innerHTML=r.toString(),t.getInner=!0;var u=e.selection.serializer.serialize(o,t);return"tree"===t.format?u:(t.content=e.selection.isCollapsed()?"":u,e.fire("GetContent",t),t.content)},Ly=function(e,t,n){var r,o,i,a=e.selection.getRng(),u=e.getDoc();if((n=n||{format:"html"}).set=!0,n.selection=!0,n.content=t,n.no_events||!(n=e.fire("BeforeSetContent",n)).isDefaultPrevented()){if(t=n.content,a.insertNode){t+='_',a.startContainer===u&&a.endContainer===u?u.body.innerHTML=t:(a.deleteContents(),0===u.body.childNodes.length?u.body.innerHTML=t:a.createContextualFragment?a.insertNode(a.createContextualFragment(t)):(o=u.createDocumentFragment(),i=u.createElement("div"),o.appendChild(i),i.outerHTML=t,a.insertNode(o))),r=e.dom.get("__caret"),(a=u.createRange()).setStartBefore(r),a.setEndBefore(r),e.selection.setRng(a),e.dom.remove("__caret");try{e.selection.setRng(a)}catch(s){}}else a.item&&(u.execCommand("Delete",!1,null),a=e.getRng()),/^\s+/.test(t)?(a.pasteHTML('_'+t),e.dom.remove("__mce_tmp")):a.pasteHTML(t);n.no_events||e.fire("SetContent",n)}else e.fire("SetContent",n)},Iy=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return A.from(i).map(er.fromDom).map(function(e){return r&&t.collapsed?e:$r.child(e,o(e,a)).getOr(e)}).bind(function(e){return sr.isElement(e)?A.some(e):$r.parent(e)}).map(function(e){return e.dom()}).getOr(e)},My=function(e,t,n){return Iy(e,t,!0,n,function(e,t){return Math.min($r.childNodesCount(e),t)})},Fy=function(e,t,n){return Iy(e,t,!1,n,function(e,t){return 0t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){return js(c,e,t)},placeCaretAt:function(e,t){return i(py(e,t,c.getDoc()))},getBoundingClientRect:function(){var e=m();return e.collapsed?Su.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){s=l=f=null,t.destroy()}};return n=ly(p),t=my(p,c),p.bookmarkManager=n,p.controlSelection=t,p},jy=Do.isContentEditableFalse,$y=Za,Wy=Xc,Ky=Kc,Xy=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},Yy=function(e,t,n,r){var o,i,a,u,s,c,l=e===Nu.Forwards,f=l?Ky:Wy;return!r.collapsed&&(o=$y(r),jy(o))?us(e,t,o,e===Nu.Backwards,!0):(u=Ta(r.startContainer),f(i=Wc(e,t.getBody(),r))?ss(t,i.getNode(!l)):(i=n(i))?f(i)?us(e,t,i.getNode(!l),l,!0):f(a=n(i))&&(!(c=Ic(s=i,a))&&Do.isBr(s.getNode())||c)?us(e,t,a.getNode(!l),l,!0):u?ls(t,i.toRange(),!0):null:u?r:null)},Gy=function(e,t,n,r){var o,i,a,u,s,c,l,f,d;if(d=$y(r),o=Wc(e,t.getBody(),r),i=n(t.getBody(),Dh(1),o),a=jt.filter(i,Bh(1)),s=jt.last(o.getClientRects()),(Ky(o)||Yc(o))&&(d=o.getNode()),(Wy(o)||Gc(o))&&(d=o.getNode(!0)),!s)return null;if(c=s.left,(u=Fh(a,c))&&jy(u.node))return l=Math.abs(c-u.left),f=Math.abs(c-u.right),us(e,t,u.node,l'),o=a,1===t?e.$(r).after(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse())}},Qy=function(l,f){return function(){var e,t,n,r,o,i,a,u,s,c=(t=f,r=Ns((e=l).getBody()),o=ya.curry(Xy,r.next),i=ya.curry(Xy,r.prev),a=t?Nu.Forwards:Nu.Backwards,u=t?o:i,s=e.selection.getRng(),(n=Yy(a,e,u,s))?n:(n=Jy(e,a,s))||null);return!!c&&(l.selection.setRng(c),!0)}},Zy=function(u,s){return function(){var e,t,n,r,o,i,a=(r=(t=s)?1:-1,o=t?Rh:_h,i=(e=u).selection.getRng(),(n=Gy(r,e,o,i))?n:(n=Jy(e,r,i))||null);return!!a&&(u.selection.setRng(a),!0)}},eC=function(e,r){return G($(e,function(e){return Mb({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:v},e)}),function(e){return t=e,(n=r).keyCode===t.keyCode&&n.shiftKey===t.shiftKey&&n.altKey===t.altKey&&n.ctrlKey===t.ctrlKey&&n.metaKey===t.metaKey?[e]:[];var t,n})},tC=function(e){for(var t=[],n=1;n'},xC=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},wC=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},NC=function(e,t,n){return!1===Do.isText(t)?n:e?1===n&&t.data.charAt(n-1)===wa?0:n:n===t.data.length-1&&t.data.charAt(n)===wa?t.data.length:n},EC=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},SC=function(e,t){var n=ec(e);n&&n.toLowerCase()===t.tagName.toLowerCase()&&e.dom.setAttribs(t,tc(e))},TC=function(a,e){var t,u,s,i,c,n,r,o,l,f,d,m,g,p,h,v,b,y,C=a.dom,x=a.schema,w=x.getNonEmptyElements(),N=a.selection.getRng(),E=function(e){var t,n,r,o=s,i=x.getTextInlineElements();if(e||"TABLE"===f||"HR"===f?(t=C.create(e||m),SC(a,t)):t=c.cloneNode(!1),r=t,!1===oc(a))C.setAttrib(t,"style",null),C.setAttrib(t,"class",null);else do{if(i[o.nodeName]){if(Ku(o))continue;n=o.cloneNode(!1),C.setAttrib(n,"id",""),t.hasChildNodes()?n.appendChild(t.firstChild):r=n,t.appendChild(n)}}while((o=o.parentNode)&&o!==u);return CC(r),t},S=function(e){var t,n,r,o;if(o=NC(e,s,i),Do.isText(s)&&(e?0s.childNodes.length-1,s=s.childNodes[Math.min(i,s.childNodes.length-1)]||s,i=g&&Do.isText(s)?s.nodeValue.length:0),(u=EC(C,s))&&((m&&!n||!m&&n)&&(s=function(e,t,n,r,o){var i,a,u,s,c,l,f,d=t||"P",m=e.dom,g=EC(m,r);if(!(a=m.getParent(r,m.isBlock))||!wC(m,a)){if(l=(a=a||g)===e.getBody()||(f=a)&&/^(TD|TH|CAPTION)$/.test(f.nodeName)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=m.create(d),SC(e,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(s=r;s.parentNode!==a;)s=s.parentNode;for(;s&&!m.isBlock(s);)s=(u=s).previousSibling;if(u&&e.schema.isValidChild(l,d.toLowerCase())){for(i=m.create(d),SC(e,i),u.parentNode.insertBefore(i,u),s=u;s&&!m.isBlock(s);)c=s.nextSibling,i.appendChild(s),s=c;n.setStart(r,o),n.setEnd(r,o)}}return r}(a,m,N,s,i)),c=C.getParent(s,C.isBlock),l=c?C.getParent(c.parentNode,C.isBlock):null,f=c?c.nodeName.toUpperCase():"","LI"!==(d=l?l.nodeName.toUpperCase():"")||e.ctrlKey||(l=(c=l).parentNode,f=d),/^(LI|DT|DD)$/.test(f)&&C.isEmpty(c)?yC(a,E,l,c,m):m&&c===a.getBody()||(m=m||"P",Ta(c)?(r=La(c),C.isEmpty(c)&&CC(c),lC(a,r)):S()?T():S(!0)?(r=c.parentNode.insertBefore(E(),c),lC(a,xC(c,"HR")?r:c)):((t=(b=N,y=b.cloneRange(),y.setStart(b.startContainer,NC(!0,b.startContainer,b.startOffset)),y.setEnd(b.endContainer,NC(!1,b.endContainer,b.endOffset)),y).cloneRange()).setEndAfter(c),function(e){for(;Do.isText(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;);}(o=t.extractContents()),r=o.firstChild,C.insertAfter(o,c),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;Do.isElement(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?e.remove(o):(a=o)&&"A"===a.nodeName&&0===Yt.trim(Na(a.innerText||a.textContent)).length&&e.remove(o);var a}}(C,w,r),p=C,(h=c).normalize(),(v=h.lastChild)&&!/^(left|right)$/gi.test(p.getStyle(v,"float",!0))||p.add(h,"br"),C.isEmpty(c)&&CC(c),r.normalize(),C.isEmpty(r)?(C.remove(r),T()):lC(a,r)),C.setAttrib(r,"id",""),a.fire("NewBlock",{newBlock:r})))},kC=function(e,t){return dC(e).filter(function(e){return 0",Ys(f)!==f.documentBaseUrl&&(g+=''),g+='',d=Gs(f),m=Js(f),Qs(f)&&(g+=''),g+='
'),ix.add(t.iframeContainer,l),p},ux=function(e,t){var n=ax(e,t);t.editorContainer&&(ix.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=ix.isHidden(t.editorContainer)),e.getElement().style.display="none",ix.setAttrib(e.id,"aria-hidden","true"),n||ox(e)},sx=pi.DOM,cx=function(t,n,e){var r,o,i=zp.get(e);if(r=zp.urls[e]||t.documentBaseUrl.replace(/\/$/,""),e=Yt.trim(e),i&&-1===Yt.inArray(n,e)){if(Yt.each(zp.dependencies(e),function(e){cx(t,n,e)}),t.plugins[e])return;o=new i(t,r,t.$),(t.plugins[e]=o).init&&(o.init(t,r),n.push(e))}},lx=function(e){return e.replace(/^\-/,"")},fx=function(e){return{editorContainer:e,iframeContainer:e}},dx=function(e){var t,n,r=e.getElement();return e.inline?fx(null):(t=r,n=sx.create("div"),sx.insertAfter(n,t),fx(n))},mx=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=e.settings,m=e.getElement();return e.orgDisplay=m.style.display,k(d.theme)?(l=(o=e).settings,f=o.getElement(),i=l.width||sx.getStyle(f,"width")||"100%",a=l.height||sx.getStyle(f,"height")||f.offsetHeight,u=l.min_height||100,(s=/^[0-9\.]+(|px)$/i).test(""+i)&&(i=Math.max(parseInt(i,10),100)),s.test(""+a)&&(a=Math.max(parseInt(a,10),u)),c=o.theme.renderUI({targetNode:f,width:i,height:a,deltaWidth:l.delta_width,deltaHeight:l.delta_height}),l.content_editable||(a=(c.iframeHeight||a)+("number"==typeof a?c.deltaHeight||0:""))=n.length)for(r=0,o=e.length;r=n.length||e[r]!==n[r]){i=r+1;break}if(e.length=e.length||e[r]!==n[r]){i=r+1;break}if(1===i)return t;for(r=0,o=e.length-(i-1);r]*>( | |\\s|\xa0|
|)<\\/"+a+">[\r\n]*|
[\r\n]*)$"),r=i.replace(u,"")}return"text"===t.format||Co(er.fromDom(n))?t.content=r:t.content=Yt.trim(r),t.no_events||e.fire("GetContent",t),t.content},Tx=function(e,t){t(e),e.firstChild&&Tx(e.firstChild,t),e.next&&Tx(e.next,t)},kx=function(e,t,n){var r=function(e,n,t){var r={},o={},i=[];for(var a in t.firstChild&&Tx(t.firstChild,function(t){F(e,function(e){e.name===t.name&&(r[e.name]?r[e.name].nodes.push(t):r[e.name]={filter:e,nodes:[t]})}),F(n,function(e){"string"==typeof t.attr(e.name)&&(o[e.name]?o[e.name].nodes.push(t):o[e.name]={filter:e,nodes:[t]})})}),r)r.hasOwnProperty(a)&&i.push(r[a]);for(var a in o)o.hasOwnProperty(a)&&i.push(o[a]);return i}(e,t,n);F(r,function(t){F(t.filter.callbacks,function(e){e(t.nodes,t.filter.name,{})})})},Ax=function(e){return e instanceof Wb},_x=function(e,t){var r;e.dom.setHTML(e.getBody(),t),xp(r=e)&&rl.firstPositionIn(r.getBody()).each(function(e){var t=e.getNode(),n=Do.isTable(t)?rl.firstPositionIn(t).getOr(e):e;r.selection.setRng(n.toRange())})},Rx=function(u,s,c){return void 0===c&&(c={}),c.format=c.format?c.format:"html",c.set=!0,c.content=Ax(s)?"":s,Ax(s)||c.no_events||(u.fire("BeforeSetContent",c),s=c.content),A.from(u.getBody()).fold(H(s),function(e){return Ax(s)?function(e,t,n,r){kx(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);var o=tf({validate:e.validate},e.schema).serialize(n);return r.content=Co(er.fromDom(t))?o:Yt.trim(o),_x(e,r.content),r.no_events||e.fire("SetContent",r),n}(u,e,s,c):(t=u,n=e,o=c,0===(r=s).length||/^\s+$/.test(r)?(a='
',"TABLE"===n.nodeName?r=""+a+"":/^(UL|OL)$/.test(n.nodeName)&&(r="
  • "+a+"
  • "),(i=ec(t))&&t.schema.isValidChild(n.nodeName.toLowerCase(),i.toLowerCase())?(r=a,r=t.dom.createHTML(i,t.settings.forced_root_block_attrs,r)):r||(r='
    '),_x(t,r),t.fire("SetContent",o)):("raw"!==o.format&&(r=tf({validate:t.validate},t.schema).serialize(t.parser.parse(r,{isRootContent:!0,insert:!0}))),o.content=Co(er.fromDom(n))?r:Yt.trim(r),_x(t,o.content),o.no_events||t.fire("SetContent",o)),o.content);var t,n,r,o,i,a})},Dx=pi.DOM,Bx=function(e){return A.from(e).each(function(e){return e.destroy()})},Ox=function(e){if(!e.removed){var t=e._selectionOverrides,n=e.editorUpload,r=e.getBody(),o=e.getElement();r&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&o&&Dx.remove(o.nextSibling),!e.inline&&r&&(i=e,Dx.setStyle(i.id,"display",i.orgDisplay)),Kg(e),e.editorManager.remove(e),Dx.remove(e.getContainer()),Bx(t),Bx(n),e.destroy()}var i},Px=function(e,t){var n,r,o,i=e.selection,a=e.dom;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),Bx(i),Bx(a)),(r=(n=e).formElement)&&(r._mceOldSubmit&&(r.submit=r._mceOldSubmit,r._mceOldSubmit=null),Dx.unbind(r,"submit reset",n.formEventDelegate)),(o=e).contentAreaContainer=o.formElement=o.container=o.editorContainer=null,o.bodyElement=o.contentDocument=o.contentWindow=null,o.iframeElement=o.targetElm=null,o.selection&&(o.selection=o.selection.win=o.selection.dom=o.selection.dom.doc=null),e.destroyed=!0):e.remove())},Lx=pi.DOM,Ix=Yt.extend,Mx=Yt.each,Fx=Yt.resolve,Ux=Re.ie,zx=function(e,t,n){var r,o,i,a,u,s,c,l=this,f=l.documentBaseUrl=n.documentBaseURL,d=n.baseURI;r=l,o=e,i=f,a=n.defaultSettings,u=t,c={id:o,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:i,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:(s=r).convertURL,url_converter_scope:s,ie7_compat:!0},t=hf(cf,c,a,u),l.settings=t,Ni.language=t.language||"en",Ni.languageLoad=t.language_load,Ni.baseURL=n.baseURL,l.id=e,l.setDirty(!1),l.plugins={},l.documentBaseURI=new Ex(t.document_base_url,{base_uri:d}),l.baseURI=d,l.contentCSS=[],l.contentStyles=[],l.shortcuts=new lp(l),l.loadedCSS={},l.editorCommands=new Ug(l),l.suffix=n.suffix,l.editorManager=n,l.inline=t.inline,l.buttons={},l.menuItems={},t.cache_suffix&&(Re.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),!1===t.override_viewport&&(Re.overrideViewPort=!1),n.fire("SetupEditor",{editor:l}),l.execCallback("setup",l),l.$=pn.overrideDefaults(function(){return{context:l.inline?l.getBody():l.getDoc(),element:l.getBody()}})};Ix(zx.prototype={render:function(){bx(this)},focus:function(e){Cp(this,e)},hasFocus:function(){return xp(this)},execCallback:function(e){for(var t=[],n=1;n=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(e,t){var n,r,o,i;return n=Cw(e.x,t.x),r=Cw(e.y,t.y),o=yw(e.x+e.w,t.x+t.w),i=yw(e.y+e.h,t.y+t.h),o-n<0||i-r<0?null:Nw(n,r,o-n,i-r)},clamp:function(e,t,n){var r,o,i,a,u,s,c,l,f,d;return u=e.x,s=e.y,c=e.x+e.w,l=e.y+e.h,f=t.x+t.w,d=t.y+t.h,r=Cw(0,t.x-u),o=Cw(0,t.y-s),i=Cw(0,c-f),a=Cw(0,l-d),u+=r,s+=o,n&&(c+=r,l+=o,u-=i,s-=a),Nw(u,s,(c-=i)-u,(l-=a)-s)},create:Nw,fromClientRect:function(e){return Nw(e.left,e.top,e.width,e.height)}},Sw={},Tw={add:function(e,t){Sw[e.toLowerCase()]=t},has:function(e){return!!Sw[e.toLowerCase()]},get:function(e){var t=e.toLowerCase(),n=Sw.hasOwnProperty(t)?Sw[t]:null;if(null===n)throw new Error("Could not find module for type: "+e);return n},create:function(e,t){var n;if("string"==typeof e?(t=t||{}).type=e:e=(t=e).type,e=e.toLowerCase(),!(n=Sw[e]))throw new Error("Could not find control by type: "+e);return(n=new n(t)).type=e,n}},kw=Yt.each,Aw=Yt.extend,_w=function(){};_w.extend=hw=function(n){var e,t,r,o=this.prototype,i=function(){var e,t,n;if(!vw&&(this.init&&this.init.apply(this,arguments),t=this.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(this,arguments)},a=function(){return this},u=function(n,r){return function(){var e,t=this._super;return this._super=o[n],e=r.apply(this,arguments),this._super=t,e}};for(t in vw=!0,e=new this,vw=!1,n.Mixins&&(kw(n.Mixins,function(e){for(var t in e)"init"!==t&&(n[t]=e[t])}),o.Mixins&&(n.Mixins=o.Mixins.concat(n.Mixins))),n.Methods&&kw(n.Methods.split(","),function(e){n[e]=a}),n.Properties&&kw(n.Properties.split(","),function(e){var t="_"+e;n[e]=function(e){return e!==undefined?(this[t]=e,this):this[t]}}),n.Statics&&kw(n.Statics,function(e,t){i[t]=e}),n.Defaults&&o.Defaults&&(n.Defaults=Aw({},o.Defaults,n.Defaults)),n)"function"==typeof(r=n[t])&&o[t]?e[t]=u(t,r):e[t]=r;return i.prototype=e,(i.constructor=i).extend=hw,i};var Rw=Math.min,Dw=Math.max,Bw=Math.round,Ow=function(e,n){var r,o,t,i;if(n=n||'"',null===e)return"null";if("string"==(t=typeof e))return o="\bb\tt\nn\ff\rr\"\"''\\\\",n+e.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=o.indexOf(t))+1?"\\"+o.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e)})+n;if("object"===t){if(e.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(e)){for(r=0,o="[";r