(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i { var margs_ajax = { action_reinit: null, // -- function on reinit action_reinit_all_loaded: null, // -- function on reinit all loaded action_after_menu_update: null, // -- function after menu update action_check_if_we_can_load_new_page: null, // -- make another check before definately telling if we can remove the loading class action_check_if_we_can_remove_loading: null, // -- @deprecated / make another check before definately telling if we can remove the loading class main_settings: { enable_ajax: 'on' } }; if (pargs) { margs_ajax = Object.assign(margs_ajax, pargs); } // -- ajax functionality const $ = jQuery; // -- config HARD CODE PER THEME var scripts_execute_after_ajax_call = 'off', content_selector = '.royale--content', cache_pages = 'off', _body = $('body'), _theActualNavSelector = '.royale--nav', theme_ajax_transition = 'none' // -- fade or scaledown , theme_extra_items_to_be_replaced = '' // -- fade or scaledown ; // -- consts const MENU_CONTENT_SELECTORS = '.current-menu-item,.current-page-ancestor,.current-menu-ancestor,.current_page_ancestor,.current_page_parent,.current-page-parent,.current-menu-parent,.current_page_item'; // -- ajax vars var new_content_selector_html = ''; var newclass_body = ''; var currclass_body = ''; var scripts_loaded_arr = []; var scripts_tobeloaded = []; var stylesheets_tobeloaded = []; var stylesheets_tobeadded = []; var scripts_tobeexecuted = []; var pages_caches = []; var _theActualNav = null, _content = null // -- the content selector .. will get replaced , _contentTransitioning = null, _contentContainer = null, _dzsajx_styles_con = null, _dzsajx_scripts_tbe_con = null, _dzsajx_caches_con = null, _preloader = null, old_href = '', old_class_body = '', window_location_without_hash = ''; var isBusyMainTransition = false // -- if we are busy with the ajax , new_page_not_loaded_yet = false // -- we use this to force load a page even if all scripts are not loaded , page_change_ind = 0, content_wrapper_transitioned_out = false, refresh_menu = false // -- we will need to refresh menu object if it is included in the content element ; var ___response = null; var sw_found_content = false; var windowhref = '', ajax_site_url = '', curr_html = window.location.href, newtitle = '', newbodyclass = '', curr_html_with_clear_cache = false, history_first_pushed_state = false // -- check if the first history state has been pushed so we can back to a outer page before the first one , has_custom_outside_content_1 = false; // -- import custom content var nr_scripts_tobeloaded = 0; var state_curr_menu_items_links = []; var extra_items = []; var extra_items_tobeadded = []; // -- aux imports var $_tempContentToBeAdded = null // -- we will only use it for reinit , _html_for_classes = $('html').eq(0); try { window_location_without_hash = String(window.location.href).split('#')[0]; } catch (err) {} _body.append('
'); _dzsajx_scripts_tbe_con = _body.children('.dzsajx-scripts-con'); _theActualNav = $(_theActualNavSelector).eq(0); _content = $(content_selector).eq(0); if (_content == null) { _content = $('body'); } _content.addClass('dzsajx-content'); if (margs_ajax.main_settings.transition) { _html_for_classes.addClass('dzsajx-transition-' + margs_ajax.main_settings.transition); _html_for_classes.addClass('dzsajx-preloader-' + margs_ajax.main_settings.preloader); } if (margs_ajax.main_settings) { if (margs_ajax.main_settings.preloader == 'bar' || margs_ajax.main_settings.preloader == 'bars' || margs_ajax.main_settings.preloader == 'custom') { var aux = '
'; if (margs_ajax.main_settings.preloader == 'bar') { aux += '
'; } if (margs_ajax.main_settings.preloader == 'bars') { aux += '
'; } if (margs_ajax.main_settings.preloader == 'custom') { aux += '
' + margs_ajax.main_settings.custom_preloader_html + '
'; } aux += '
'; if (_content.prev().hasClass('dzsajx-preloader') == false) { _content.before(aux); } _preloader = $('.dzsajx-preloader').eq(0); } } _body.append('
'); _dzsajx_styles_con = _body.children('.dzsajx-styles-con'); scripts_execute_after_ajax_call = 'on'; if (scripts_execute_after_ajax_call == 'on') { _body.append('
'); _dzsajx_scripts_tbe_con = _body.children('.dzsajx-scripts-con'); } if (cache_pages == 'on') { _body.append('
'); _dzsajx_caches_con = _body.children('.dzsajx-caches-con'); } var selecta_ajax = 'a:not(.no-ajaxer,.bp-secondary-action,.bp-primary-action'; // -- convert ajax settings.. if (window.dzsajx_settings && window.dzsajx_settings.classes_to_ignore) { selecta_ajax += ',' + dzsajx_settings.classes_to_ignore; } selecta_ajax += ')'; // -- marking scripts as loaded $('script').each(function () { var _t = $(this); if (_t.attr('src')) { scripts_loaded_arr.push(_t.attr('src')); } if (String(_t.attr('src')).indexOf('https://maps.googleapis.com/maps/api') == 0) { window.google_maps_loaded = true; } }); $('link').each(function () { var _t = $(this); if (_t.attr('rel') == 'stylesheet' && _t.attr('href')) { var aux_href = _t.attr('href'); if (aux_href.indexOf('./') == 0) { aux_href = aux_href.replace('./', ''); } scripts_loaded_arr.push(aux_href); } }); // -- marking scripts as loaded END window.dzsajx_click_menu_anchor = click_menu_anchor; $(document).on('click', selecta_ajax, click_menu_anchor); if (window.addEventListener) { window.addEventListener('popstate', handle_popstate); } function handle_popstate(e) { if (e.state && e.state.href) { var args = { 'force_href': e.state.href, force_no_ajax: 'on' }; if (window.dzsajx_settings && dzsajx_settings.use_ajax_on_back_button == 'on') { args.force_no_ajax = 'off'; } click_menu_anchor(null, args); if (Object.size && e.state.curr_menu_items && Object.size(e.state.curr_menu_items) > 0) { if (_theActualNav) { _theActualNav.find(MENU_CONTENT_SELECTORS).removeClass(MENU_CONTENT_SELECTORS.replace(/,/g, ' ')); for (var i2 = 0; i2 < Object.size(e.state.curr_menu_items); i2++) { _theActualNav.find('li').eq(e.state.curr_menu_items[i2]).addClass('current-menu-item current_page_item'); } } } return false; } } function loadScript(src, callback) { var s, r, t; r = false; s = document.createElement('script'); s.type = 'text/javascript'; s.src = src; s.async = true; s.onload = function () { if (!r && (!this.readyState || this.readyState == 'complete')) { r = true; callback(s); } }; if (_dzsajx_scripts_tbe_con) { _dzsajx_scripts_tbe_con.get(0).appendChild(s); } else { t = document.getElementsByTagName('script')[0]; t.parentNode.insertBefore(s, t); } } function click_menu_anchor(e, pargs) { var _t = $(this); var thehref = _t.attr('href'); var isSelectOption = false; let sw_found_content = false; // -- set true if found content selector var margs = { _t: null, force_href: '', force_no_ajax: 'off', from_zoombox: 'off', force_pushState: false, do_not_scroll: "off", do_not_change_menu: "off" }; if (pargs) { margs = $.extend(margs, pargs); } if (margs._t) { _t = margs._t; thehref = _t.attr('href'); } if (_html_for_classes.hasClass('page-playlistadd')) { var clickMenuAnchorArgs = { _t: _t, 'from_zoombox': 'on' }; if (parent && parent.click_menu_anchor) { parent.click_menu_anchor(e, clickMenuAnchorArgs); } return false; } // -- if we are on the same page item if (_t && _t.parent().hasClass('current-menu-item') && margs.force_no_ajax != 'on') { return false; } if (margs.from_zoombox == 'on') { window.api_close_zoombox(); } if (_t.hasClass && _t.hasClass('result-con')) { $('.bigsearch-con').removeClass('activated'); _html_for_classes.removeClass('big-search-activated'); } if (_t && _t.get(0) && _t.get(0).nodeName == 'SELECT') { isSelectOption = true; thehref = _t.val(); } if (_t && _t.get(0) && _t.get(0).nodeName == 'OPTION') { isSelectOption = true; thehref = _t.val(); } if (thehref === curr_html && margs.force_no_ajax != 'on') { return false; } if (window.dzsajx_settings && window.dzsajx_settings.disable_ajax_on_touch_devices && window.dzsajx_settings.disable_ajax_on_touch_devices == 'on' && is_touch_device()) { margs.force_no_ajax = 'on'; window.location.href = thehref; } if (margs.force_href) { thehref = margs.force_href; console.info(margs.force_no_ajax, thehref); if (margs.force_no_ajax == 'on') { window.location.href = thehref; } } if (isBusyMainTransition) { setTimeout(function () { var args = {}; if (_t) { args._t = _t; args.force_href = thehref; } ; click_menu_anchor(e, args); }, 1000); return false; } if (isSelectOption) {} // -- well test if it's an outer link, if its an outside link we dont need any ajax. if (margs_ajax.main_settings.enable_ajax == 'on' && window && margs.force_no_ajax != 'on' && String(thehref).split('#')[0] != window_location_without_hash) { let isLoadInAjax = false; if (thehref) { if (thehref.indexOf('#') == 0 || thehref.indexOf('javascript') == 0 || thehref.indexOf('.jpg') > thehref.length - 5) {} else { if (window.location.href.indexOf('file://') == 0 || (thehref.indexOf('http://') > -1 || thehref.indexOf('https://') > -1) && thehref.indexOf(ajax_site_url) != 0 || thehref.indexOf('admin.php') > -1 || thehref.indexOf('wp-admin') > -1) {} else { //if indeed we are going to history api it isLoadInAjax = true; } } } if (isLoadInAjax) { // -- history API here $('body').removeClass('loaded'); $('.toexecute-from-dzsajx').remove(); if (can_history_api()) { scripts_tobeloaded = []; stylesheets_tobeloaded = []; nr_scripts_tobeloaded = 0; content_wrapper_transitioned_out = false; if (_t.hasClass('ajax-link-user')) {// -- if it's user.. } else { _html_for_classes.addClass('dzsajx-ajax-transitioning-out '); _html_for_classes.addClass('dzsajx-ajax-loading '); if (margs.do_not_scroll != 'on') { $('html, body').animate({ scrollTop: 0 }, 100); } // -- convert ajax settings.. if (theme_ajax_transition == 'scaledown' || theme_ajax_transition == 'slide') { _content.wrap('
'); _contentContainer = _content.parent(); } else {} _content.addClass('last-content'); if (_preloader) { _preloader.addClass('active'); // -- convert ajax settings.. if (margs_ajax.main_settings && margs_ajax.main_settings.preloader == 'bar') { _preloader.find('.the-bar').css({ 'width': '0' }); _preloader.find('.the-bar').animate({ 'width': '60%' }, { queue: false, duration: 1000 }); } } } setTimeout(function () { content_wrapper_transitioned_out = true; }, 300); let isCached = false; // -- we had caching here , removed for now // -- load the new page if (isCached == false) { $.ajax({ url: thehref, context: document.body, success: function (response, textStatus, jqXHR) { onajaxcompleted(response, textStatus, jqXHR, _t, thehref, e); }, error: function (response, textStatus, xhr) { onajaxcompleted(response, textStatus, xhr, _t, thehref, e); } }); } if (_t.get(0) != window && margs.do_not_change_menu != 'on') { state_curr_menu_items_links = []; if (_theActualNav) { _theActualNav.find('.current-menu-item,.current_page_item').each(function () { var _t2 = $(this); state_curr_menu_items_links.push(_theActualNav.find('li').index(_t2)); }); } if (_theActualNav) { _theActualNav.find(MENU_CONTENT_SELECTORS).removeClass(MENU_CONTENT_SELECTORS.replace(/(,|\.)/g, ' ')); } if (_t.parent().get(0) && _t.parent().get(0).nodeName == "LI") { _t.parent().addClass('current-menu-item current_page_item'); } // -- add class to the ancestors ( up to 2 levels ) if (_t.parent().parent().parent().get(0) && _t.parent().parent().parent().get(0).nodeName == "LI") { _t.parent().parent().parent().addClass('current-menu-ancestor'); } if (_t.parent().parent().parent().parent().parent().get(0) && _t.parent().parent().parent().parent().parent().get(0).nodeName == "LI") { _t.parent().parent().parent().parent().parent().addClass('current-menu-ancestor'); } if (margs_ajax.action_after_menu_update) { margs_ajax.action_after_menu_update(); } } return false; } } } } function onajaxcompleted(response, textStatus, jqXHR, _t, thehref, e) { // -- the main ajax function if (_t) { if (_t.parent().parent().parent().hasClass('menu-toggler-target')) { _t.parent().parent().parent().removeClass('active'); } if (_t.parent().parent().parent().parent().parent().hasClass('menu-toggler-target')) { _t.parent().parent().parent().parent().parent().removeClass('active'); } } if (jqXHR == 'Not Found') { response = response.responseText; } var ___response_raw = $(response); response = String(response).replace(//gim, ''); // -- update class for body // -- convert ajax settings.. if (window.dzsajx_settings && dzsajx_settings.update_body_class == 'on') { var regex_links = / -1) { _t.get(0).parentNode.removeChild(_t.get(0)); } } }); for (var i24 in scripts_loaded_arr) { if (scripts_loaded_arr[i24].indexOf(aux_split[i233]) > -1) { scripts_loaded_arr.splice(i24, 1); } } } } var regex_scripts = //gim; var match; while (match = regex_scripts.exec(response)) { if (match[1]) { let isFoundScript = false; for (var j = 0; j < scripts_loaded_arr.length; j++) { var aux = match[1]; if (aux.indexOf('&') > -1) { aux = aux.split('&')[0]; } if (match[1] == '' || scripts_loaded_arr[j] == match[1] || ajax_site_url + scripts_loaded_arr[j] == match[1]) { isFoundScript = true; } } if (isFoundScript == false && match[1]) { scripts_tobeloaded.push(match[1]); } } } var regex_links = /(
([\s|\S]*?)<\/div>/igm; var match; while (match = regex_script_tag.exec(response_html)) { if (match[2]) { var obj = { attr: match[1], content: match[2] }; scripts_tobeexecuted.push(obj); } } response_html = String(response_html).replace(/
([\s|\S]*?)<\/div>/igm, ''); } ___response = $(response_html); $_tempContentToBeAdded = ___response; // -- convert ajax settings.. if (window.dzsajx_settings && dzsajx_settings.menu_selector) { if (dzsajx_settings.menu_move_on_top_of_content == 'on') { ___response.find(dzsajx_settings.menu_selector).eq(0).remove(); } } var regex_bodyclass = / 0) { sw_found_content = true; } else { // -- if we cannot find content we just load normally setTimeout(function () { args = {}; if (_t) { args._t = _t; args.force_href = thehref; args.force_no_ajax = "on"; } ; // -- if we cannot find menu selector ... click_menu_anchor(e, args); }, 50); } // -- convert ajax settings.. if (theme_extra_items_to_be_replaced) { ___response.find(theme_extra_items_to_be_replaced).each(function () { var _t23 = $(this); extra_items.push(_t23); }); } // -- convert ajax settings.. if (window.dzsajx_settings && dzsajx_settings.extra_items_to_be_added) { var aux_split = String(dzsajx_settings.extra_items_to_be_added).split(','); for (var i233 in aux_split) { ___response.find(aux_split[i233]).each(function () { var _t234 = $(this); var obj = { 'selector': aux_split[i233], 'html': _t234.html(), 'outer_html': _t234.get(0).outerHTML }; extra_items_tobeadded.push(obj); }); } } // -- check each for (var i = 0; i < ___response.length; i++) { var _t3 = ___response[i]; if (_t3.attr && _t3.attr('class') == 'mainoptions') {} var aux_href = ''; if (_t3.href) { aux_href = _t3.href; if (aux_href.indexOf('./') == 0) { aux_href = aux_href.replace('./', ''); } } if (has_custom_outside_content_1) { if (_t3.className == 'custom-outside-content-1') { $('.custom-outside-content-1').html(_t3.innerHTML); } } } setTimeout(function () { var i = 0; nr_scripts_tobeloaded = scripts_tobeloaded.length; function loadFunc(e) {} if (_contentContainer) {} else { // ----- // -- the actual content add // ----- _content.after(_content.clone()); _content.next().children().remove(); ; if ($_tempContentToBeAdded.find(content_selector).eq(0).get(0)) { _content.next().removeClass(); _content.next().addClass($_tempContentToBeAdded.find(content_selector).eq(0).attr('class')); } _content.next().append(new_content_selector_html); } if (nr_scripts_tobeloaded <= 0) { ajax_try_load_new_page({ 'call_from': 'no scripts to be loaded' }); return false; } else { new_page_not_loaded_yet = true; setTimeout(function () { if (new_page_not_loaded_yet) { ajax_try_load_new_page({ 'call_from': 'new_page_not_loaded_yet ' }); } }, 2000); } var i4 = 0; for (i4 = 0; i4 < scripts_tobeloaded.length; i4++) { var the_script = scripts_tobeloaded[i4]; // -- no caching if (the_script.indexOf('?') > -1) { the_script = the_script + '&zoomit=' + Math.random(); } // -- scripts to be loaded todo: here setTimeout(function (i5) { var the_script = scripts_tobeloaded[i5]; if (the_script.indexOf('?') > -1) { the_script = the_script + '&zoomit=' + Math.random(); } loadScript(the_script, load_script_cb); }, i4 * 10, i4); } // -- load new stylesheets for (i4 = 0; i4 < stylesheets_tobeloaded.length; i4++) { $('', { rel: 'stylesheet', type: 'text/css', href: stylesheets_tobeloaded[i4] }).appendTo('head'); scripts_loaded_arr.push(stylesheets_tobeloaded[i4]); } setTimeout(function () {}, 1000); }, 100); // -- change url value here if ((_t.get(0) != window || margs.force_pushState) && sw_found_content) { if (history_first_pushed_state == false) { if (window.location.href.indexOf('file://') === -1) { var aux = curr_html; if (aux == 'index.php') { aux = ''; } var stateObj = { href: curr_html }; history.pushState(stateObj, null, aux); } history_first_pushed_state = true; } var aux_arr = state_curr_menu_items_links.slice(0); var stateObj = { page_change_ind: page_change_ind, href: thehref, 'curr_menu_items': aux_arr }; page_change_ind++; old_href = window.location.href; old_class_body = _body.attr('class'); history.pushState(stateObj, newtitle, thehref); if (newtitle) { document.title = newtitle; } curr_html = thehref; } // -- END change url value here } function reinit() { window_location_without_hash = String(window.location.href).split('#')[0]; $("html, body").animate({ scrollTop: 0 }, "fast"); if (margs_ajax.action_reinit) { margs_ajax.action_reinit($_tempContentToBeAdded); } setTimeout(function () { reinit_all_loaded(); }, 700); } function reinit_all_loaded(pargs) { var margs = { check_tracks_list: true, animate_shortcode_user: true }; if (pargs) { margs = $.extend(margs, pargs); } _html_for_classes.addClass('reinited'); isBusyMainTransition = false; if (refresh_menu) { if (_theActualNav) { _theActualNav = $(dzsajx_settings.menu_selector); } } if (window.dzsapp_reinit) { window.dzsapp_reinit(); } if (margs_ajax.action_reinit_all_loaded) { margs_ajax.action_reinit_all_loaded(); } } function convert_to_html(arg, pargs) { // -- convert html, body scripts to html var margs = { 'convert_script_tags': "off" }; if (pargs) { margs = $.extend(margs, pargs); } var fout = ''; fout = String(arg).replace(/<\!DOCTYPE.*?>/gi, ''); fout = String(fout).replace(//gi, ''); fout = String(fout).replace(/<\/html.*?>/gi, ''); fout = String(fout).replace(/([\s|\S]*?)<\/head>/igm, ''); // let us delete this actually fout = String(fout).replace(/([\s|\S]*?)<\/body>/igm, '
$1
'); if (margs.convert_script_tags == 'on') { fout = String(fout).replace(/([\s|\S]*?)<\/script>/igm, '
$2
'); } fout = '
' + fout + '
'; return fout; } function ajax_try_load_new_page(pargs) { if (margs_ajax.action_check_if_we_can_load_new_page) { margs_ajax.action_check_if_we_can_load_new_page($_tempContentToBeAdded, ajax_load_new_page); } else { ajax_load_new_page(pargs); } } function ajax_load_new_page(pargs) { // -- here we load the new page var margs = { 'call_from': 'default' }; if (pargs) { margs = $.extend(margs, pargs); } // -- we will try again later.. if (content_wrapper_transitioned_out == false) { setTimeout(ajax_load_new_page, 300); return false; } // destroy listeners for all objects hier // -- tbc if (_dzsajx_caches_con) {} else { _content.find('.audioplayer').each(function () { var _t = $(this); if (_t.get(0) && _t.get(0).api_destroy_listeners) { _t.get(0).api_destroy_listeners(); } }); } if (newclass_body) { _body.attr('class', newclass_body); } var i23 = 0; // -- convert ajax settings.. // -- extra items to be replaced if (theme_extra_items_to_be_replaced) { $(theme_extra_items_to_be_replaced).each(function () { var _t23 = $(this); if (extra_items[i23]) { _t23.html(extra_items[i23].html()); _t23.attr('style', extra_items[i23].attr('style')); } i23++; }); extra_items = []; } i23 = 0; // -- convert ajax settings.. if (window.dzsajx_settings && dzsajx_settings.extra_items_to_be_added) { var aux_split = String(dzsajx_settings.extra_items_to_be_added).split(','); for (var i233 in aux_split) { var sw = false; // -- if we find var k_found = null; for (var i24 in extra_items_tobeadded) { if (extra_items_tobeadded[i24].selector == aux_split[i233]) { sw = true; k_found = i24; break; } } if (sw) { var _c = extra_items_tobeadded[k_found]; if ($(_c.selector).length > 0) { $(_c.selector).eq(0).html(_c.html); } else { // -- convert ajax settings.. if (window.dzsajx_settings && dzsajx_settings.extra_items_to_be_added_before_elements) { $(dzsajx_settings.extra_items_to_be_added_before_elements).before(_c.outer_html); } else { _body.append(_c.outer_html); } } } else { // -- if we do not find it in the new page we remove it from the current one if ($(aux_split[i233]).length > 0) { $(aux_split[i233]).eq(0).remove(); ; } } } extra_items_tobeadded = []; } if (_preloader) { _preloader.find('.the-bar').animate({ 'width': '100%' }, { queue: false, duration: 300 }); _preloader.removeClass('active'); } if (_dzsajx_styles_con) { _dzsajx_styles_con.children().remove(); } for (var i3 = 0; i3 < stylesheets_tobeadded.length; i3++) { _dzsajx_styles_con.append(stylesheets_tobeadded[i3]); } // -- here we add new page html if (_html_for_classes.hasClass('dzsajx-ajax-user-transitioning-out')) { _content.find('.user-query').eq(0).after(new_content_selector_html); _content.find('.user-query').eq(0).remove(); } else { if (_contentContainer) { // -- we transition here the content _contentContainer.append(_content.clone()); _contentContainer.children().last().removeClass('curr-content'); _contentContainer.children().last().addClass('transitioning-content'); _contentContainer.children().last().html(new_content_selector_html); _contentTransitioning = _contentContainer.children('.transitioning-content').eq(0); _contentTransitioning.css({ 'height': 'auto', 'position': 'relative' }); var auxh = _contentTransitioning.outerHeight(); _contentTransitioning.css({ 'height': '', 'position': '' }); _contentContainer.animate({ 'height': auxh }, { duration: 800, complete: function () {} }); } else { _content = _content.next(); _content.removeClass('last-content'); _content.addClass('curr-content'); // -- removing content if (_dzsajx_caches_con) { _content.parent().find('.dzsajx-content.last-content:not(".in-cache")').attr('the_href', old_href); _content.parent().find('.dzsajx-content.last-content:not(".in-cache")').attr('class_body', old_class_body); console.info("SAVED CLASS BODY", old_class_body); var sw = false; _dzsajx_caches_con.children().each(function () { var _t23 = $(this); ; }); if (sw == false) { console.info('last content - ', $('.dzsajx-content.last-content')); _dzsajx_caches_con.append($('.dzsajx-content.last-content')); _dzsajx_caches_con.children().addClass('in-cache'); _content.parent().find('.dzsajx-content.last-content:not(".in-cache")').remove(); } } else { _content.prev().remove(); } setTimeout(function () {}, 1000); execute_scripts_to_be_executed({ 'call_from': 'no content container..' }); } setTimeout(function () { _html_for_classes.addClass('dzsajx-ajax-transitioning-in'); }, 50); } reinit(_contentTransitioning); _html_for_classes.addClass('dzsajx-ajax-finished-loading '); // -- remove the loading class setTimeout(function () { loading_remove_class(); }, 100); setTimeout(function () { _html_for_classes.removeClass('dzsajx-ajax-transitioning-out'); }, 500); setTimeout(function () { _html_for_classes.removeClass('dzsajx-ajax-finished-loading '); }, 500); setTimeout(function () { // -- convert ajax settings.. if (window.dzsajx_settings && dzsajx_settings.script_call_on_reinit) { try { eval(dzsajx_settings.script_call_on_reinit); } catch (err) { console.warn(err); console.info('eval error - ', err, err.stack); } } _html_for_classes.removeClass('dzsajx-ajax-transitioning-in'); _html_for_classes.removeClass('dzsajx-ajax-user-transitioning-out'); if (_contentContainer) { _contentContainer.children().first().remove(); _contentContainer.children().last().removeClass('transitioning-content'); _content = _contentContainer.children().last(); _content.unwrap(); _contentContainer = null; execute_scripts_to_be_executed({ 'call_from': '_contentContainer' }); } }, 1000); isBusyMainTransition = true; new_page_not_loaded_yet = false; } function loading_remove_class() { _html_for_classes.removeClass('dzsajx-ajax-loading '); } function execute_scripts_to_be_executed(pargs) { var margs = { 'call_from': 'default' }; if (pargs) { margs = $.extend(margs, pargs); } if (scripts_tobeexecuted.length > 0) { for (var i in scripts_tobeexecuted) { var _t23 = scripts_tobeexecuted[i]; if (_t23) { try { var sn = document.createElement('script'); var aux = _t23.content; if (1 || dzsajx_settings.remove_document_ready && dzsajx_settings.remove_document_ready == 'on') { if (aux.indexOf('jQuery(document).ready') > -1) { aux = aux.replace(/jQuery\(document\).ready\(function.*?{/g, ''); var n = aux.lastIndexOf('})'); window.$ = jQuery; if (n >= 0 && n + '})'.length <= aux.length) { aux = aux.substring(0, n) + ""; } } } sn.appendChild(document.createTextNode(aux)); var regexS = /['|"](.*?)['|"]/gim; var regtest = regexS.exec(_t23.attr); if (regtest != null) { if (regtest[1]) { $(sn).attr('type', regtest[1]); } else {} } sn.async = true; try { if (sn) { _dzsajx_scripts_tbe_con.get(0).appendChild(sn); } } catch (err) { console.info('err', err); } } catch (err) {} } } scripts_tobeexecuted = []; } setTimeout(function () { $(window).trigger('resize'); }, 1000); } }; function can_history_api() { return !!(window.history && history.pushState); } exports.ajax_init = ajax_init; },{}],2:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.royale_viewSetupResponsive = void 0; const VIEW_MENU_HIDDEN_CLASS = 'menu-hidden'; const royale_viewSetupResponsive = () => { const responsive_trigger = 600; let $ = jQuery; let win = jQuery(window); let _body = jQuery('body'); let ww = 0; let th = 0; let wide = 0; let menuWid = 220; let inter_calculateDims = 0; let content = jQuery('.royale--content'); win.on('resize', window_resize); window_resize(); $(document).on('click', '.hidemenu,.showmenu,.responsive-menu--toggle', handle_mouse); function onhidemenu() { _body.addClass(VIEW_MENU_HIDDEN_CLASS); _body.removeClass('menu-open'); setTimeout(do_onhidemenu, 250); function do_onhidemenu() { $('.showmenu').css('left', 0); } } function onshowmenu() { $('.showmenu').css('left', -57); setTimeout(do_onshowmenu, 250); function do_onshowmenu() { _body.removeClass(VIEW_MENU_HIDDEN_CLASS); _body.addClass('menu-open'); } setTimeout(do_onshowmenu2, 450); function do_onshowmenu2() {} } function handle_mouse(e) { var _t = $(this); if (_t.hasClass('responsive-menu--toggle')) { if (_body.hasClass(VIEW_MENU_HIDDEN_CLASS)) { onshowmenu(); } else { onhidemenu(); } return false; } if (_t.hasClass('hidemenu')) { onhidemenu(); } if (_t.hasClass('showmenu')) { onshowmenu(); } } function calculateDims() {} function window_resize(event) { if (typeof event !== "undefined") event.stopPropagation(); ww = jQuery(window).width(); th = jQuery(window).height(); if (ww < responsive_trigger) { _body.addClass('responsive-mode'); } else { _body.removeClass('responsive-mode'); _body.removeClass(VIEW_MENU_HIDDEN_CLASS); } if (ww < 600) { onhidemenu(); } clearTimeout(inter_calculateDims); inter_calculateDims = setTimeout(calculateDims, 150); } }; exports.royale_viewSetupResponsive = royale_viewSetupResponsive; },{}],3:[function(require,module,exports){ "use strict"; var _viewResponsive = require("./jsinc/_viewResponsive"); window.cj_offsetX = -1; (function ($) { let menu_hoffset = 0; let menu_height = 0; $.royale = function () { let _body = $('body'); const _royaleBackgroundCon = $('.royale--background-con').eq(0); init(); // INIT FUNCTION function init() { setTimeout(function () { _body.addClass('royale-inited'); }, 100); var logo = $(".royale-logo"), nav = $(".menu-left nav").eq(0), topNav = logo.height() + parseInt(logo.css("margin-top"), 10) + parseInt(nav.css("margin-top"), 10); (0, _viewResponsive.royale_viewSetupResponsive)(); topNav = nav.offset().top; if (_body.hasClass('admin-bar')) { topNav -= 32; } menu_hoffset = $('nav > div').height() + parseInt($('nav > div').offset().top); menu_height = parseInt($('nav > div').height()); $('.searchform').each(function () { var _t = $(this); if (_t.find('.dashicons-search').length == 0) { _t.append(''); } }); $("nav ul li > ul").each(function () { var _t = $(this); $(this).children(":first").css("margin-top", topNav); var size_total_items_height = 0; _t.children().each(function () { var _t2 = $(this); size_total_items_height += _t2.outerHeight(); }); $(this).children().eq(0).css("margin-top", topNav); }); // SETTING UP THE FOOTER MOUSE OVER EVENTS $("footer a").mouseover(footerOver).mouseout(footerOut); $(".email a").mouseover(emailOver).mouseout(emailOut); // SETTING UP THE BLOG SEARCH BAR $("#search-submit").each(function () { $(this).mouseover(submitOver).mouseout(submitOut).click(function (event) { event.stopPropagation(); event.preventDefault(); }); }); $(".royale-form").each(function () { $(this).attr("action", ""); }); $("#search-bar").each(function () { var ths = $(this); $(this).find("#search-field").each(function () { if ($(this).attr("value")) { $(this).data("parent", ths).data("original", $(this).attr("value")).focus(inFocus).blur(outFocus); } }); }); if (window.royale_settings.enable_ajax == 'on') { var ajax = require('./jsinc/_ajax'); ajax.ajax_init({ main_settings: window.royale_settings, action_reinit: reinit, action_check_if_we_can_load_new_page: ajax_check_if_we_can_remove_loading, action_reinit_all_loaded: ajax_reinit_all_loaded }); } // -- END ajax_init() royale_check_is_ready(); } function ajax_reinit_all_loaded() { setTimeout(function () { if (window.dzscsc_init) { dzscsc_init('.contentscroller.auto-init', { init_each: true }); } setTimeout(function () { $('.contentscroller').each(function () { var _t3 = $(this); _t3.get(0).api_force_resize(); }); }, 100); }, 500); } function ajax_check_if_we_can_remove_loading($_tempContentToBeAdded, argfunc) { if ($_tempContentToBeAdded.find('.theme-background--actual').eq(0) && $_tempContentToBeAdded.find('.theme-background--actual').eq(0).css('background-image')) { var img_src = sanitize_css_background_image($_tempContentToBeAdded.find('.theme-background--actual').eq(0).css('background-image')); check_when_img_is_ready_then_call_func(img_src, argfunc); } else { argfunc(); } } function check_when_img_is_ready_promise(img_src) { return new Promise(resolve => { var img = new Image(); var inte = 0; var intt = 0; img.onload = function () { clearInterval(inte); clearTimeout(intt); resolve(img); }; img.src = img_src; inte = setInterval(() => { if (img.naturalWidth) { clearInterval(inte); clearTimeout(intt); royale_is_ready(); } }, 100); intt = setTimeout(() => { clearInterval(inte); clearTimeout(intt); resolve(); }, 3000); }); } async function check_when_img_is_ready_then_call_func(img_src) { await check_when_img_is_ready_promise(img_src); } function royale_check_is_ready() { if (_body.find('.theme-background--actual').length) { var img_src = sanitize_css_background_image(_body.find('.theme-background--actual').eq(0).css('background-image')); check_when_img_is_ready_then_call_func(img_src).then(() => { royale_is_ready(); }); var img = new Image(); img.onload = function () { royale_is_ready(); }; img.src = img_src; } else { royale_is_ready(); } } function royale_is_ready() { setTimeout(function () { _body.addClass('royale-ready'); }, 10); } function reinit($_tempContentToBeAdded) { if ($_tempContentToBeAdded && $_tempContentToBeAdded.find('.theme-background--actual').length) { _royaleBackgroundCon.append('
'); royale_fade_backgrounds(); } } function royale_fade_backgrounds() { setTimeout(() => { _royaleBackgroundCon.addClass('transitioning-next'); setTimeout(() => { _royaleBackgroundCon.find('.theme-background--actual').remove(); _royaleBackgroundCon.find('.theme-background--next').addClass('theme-background--actual').removeClass('theme-background--next'); _royaleBackgroundCon.removeClass('transitioning-next'); }, 500); }, 1000); } function sanitize_css_background_image(arg) { arg = String(arg).replace(/url\(/g, ''); arg = String(arg).replace(/\)/g, ''); arg = String(arg).replace(/\"/g, ''); return arg; } // FOOTER LINK OVER function footerOver() { $(this).parent().addClass("bullet-over"); } // FOOTER LINK OVER function footerOut() { $(this).parent().removeClass("bullet-over"); } // FOOTER EMAIL OVER function emailOver() { $(this).parent().addClass("email-over"); } // FOOTER EMAIL OVER function emailOut() { $(this).parent().removeClass("email-over"); } // BLOG LINK OVER function blogCommentOver(event) { event.stopPropagation(); $(this).data("text").addClass("blog-comment-over"); } // BLOG LINK OUT function blogCommentOut(event) { event.stopPropagation(); $(this).data("text").removeClass("blog-comment-over"); } // BLOG LINK CLICK function gotoBlogPage(event) { event.stopPropagation(); window.location = $(this).data("url"); } // COMMENTS LINK CLICK function jumpToComments(event) { event.stopPropagation(); window.location = "#replies"; } // SEARCH BAR FOCUS IN function inFocus() { var st = this.value; if (st === $(this).data("original")) this.value = ""; $(this).addClass("form-field-focus"); $(this).data("parent").addClass("search-field-focus"); } // SEARCH BAR FOCUS OUT function outFocus() { if (this.value === "") this.value = $(this).data("original"); $(this).removeClass("form-field-focus"); $(this).data("parent").removeClass("search-field-focus"); } // SEARCH BAR SUBMIT BUTTON OVER function submitOver(event) { event.stopPropagation(); $(this).css("opacity", 0.75); } // SEARCH BAR SUBMIT BUTTON OUT function submitOut(event) { event.stopPropagation(); $(this).css("opacity", 1); } }; })(jQuery); jQuery(document).ready(function ($) { $.royale(); }); },{"./jsinc/_ajax":1,"./jsinc/_viewResponsive":2}]},{},[3]) //# sourceMappingURL=royale.js.map