/* var globalSettings = {};
var globalSettingsLoader = document.createElement('div');
$(globalSettingsLoader).load('/hidden-pages/global-settings #settings-container', function(result) {
$(result).find('.global-settings-value').each(function() {
globalSettings[$(this).attr('id')] = $(this).text();
});
});*/
setTimeout(function() {
$('.vac-item').each(function(){
$(this).children().attr('id', $(this).children('.vac-id').children('aside').attr('class'));
});
var hash = window.location.hash;
if (hash.includes("vacancy-")) {
var vacidhash = hash.substring(9);
var vacidhashquery = ".vac-button#vac-" + vacidhash;
$(vacidhashquery).click();
setTimeout(function() {
$([document.documentElement, document.body]).animate({
scrollTop: $(vacidhashquery).offset().top
}, 100);
}, 200);
}
}, 10);
$(document).on('click', '.vac-button', function() {
var vacid = $(this).attr('id');
var button = this;
var vacidtohash = vacid.substring(4);
if(!$(button).hasClass('open')) {
window.location.hash = "vacancy-" + vacidtohash;
} else {
history.pushState("", document.title, window.location.pathname + window.location.search);
}
$('.vac-description:not(#' + vacid + ')').stop().slideUp(200);
$('.vac-button:not(#' + vacid + ')').removeClass('open');
$(button).next('.vac-description#' + vacid).stop().slideToggle(200);
$(button).toggleClass('open');
setTimeout(function() {
$([document.documentElement, document.body]).animate({
scrollTop: $(button).offset().top
}, 100);
}, 200);
});
/* setInterval(function() {
$('.w-editor .w-content-editor-toolbar-wrapper [data-icon=LinkEmail').parents('.w-reset:not(.w-editor-bem-RTToolbar-LinkToolbar_ChangeButton) > .w-editor-bem-BarButton').remove()
}, 500);
$('html').on('click', 'a[href="/hidden-pages/email-spam-button"]', function(){
window.open('mailto:' + globalSettings['email-prefix'] + '@' + globalSettings['email-suffix'], '_blank');
return false;
});*/
var scriptsExt = [];
var scriptsInt = [];
$('.script-external:not(.converted), .script-block:not(.converted), .script-ajax:not(.converted)').each(function(i) {
if($(this).hasClass('script-external')) {
$(this).addClass('converted');
var scriptTitle = $(this).data('script-name');
var scriptDesc = $(this).data('script-description');
var scriptSrc = $(this).data('script-source');
scriptsExt[i] = document.createElement('script');
if($(this).data('script-callback-event')) {
$(scriptsExt[i]).attr({
'type': 'text/javascript',
'src': scriptSrc,
'onload': "$(document).trigger('scriptExtLoaded:"+$(this).data('script-callback-event').toString()+"')"
}).appendTo('.scripts-converted');
} else {
$(scriptsExt[i]).attr({
'type': 'text/javascript',
'src': scriptSrc
}).appendTo('.scripts-converted');
}
console.log('%cExternal script '+i+' loaded in!', "color:grey;font-size:small;font-style:oblique;line-height:4em;");
console.log('%cExternal Script: '+scriptTitle, "color:orange;font-size:x-large;font-weight:800;");
console.log('%c'+scriptDesc, "color:grey;");
$(document).trigger('scriptExtConverted', [scriptsExt[i], scriptTitle, scriptDesc]);
} else if($(this).hasClass('script-block')) {
$(this).addClass('converted');
var scriptTitle = $(this).data('script-name');
var scriptDesc = $(this).data('script-description');
scriptsInt[i] = document.createElement('script');
$(scriptsInt[i]).html($(this).text())
.appendTo('.scripts-converted');
console.log('%cInternal script '+i+' loaded in!', "color:grey;font-size:small;font-style:oblique;line-height:4em;");
console.log('%cCustom Script: '+scriptTitle, "color:purple;font-size:x-large;font-weight:800;");
console.log('%c'+scriptDesc, "color:grey;");
$(document).trigger('scriptIntConverted', [scriptsInt[i], scriptTitle, scriptDesc]);
} else if($(this).hasClass('script-ajax')) {
$(this).addClass('converted');
var scriptTitle = $(this).data('script-name');
var scriptDesc = $(this).data('script-description');
var scriptSrc = $(this).data('script-source');
var scriptCallback = $(this).data('script-callback-event');
$.getScript(scriptSrc, function( data, textStatus, jqxhr) {
console.log( data ); // Data returned
console.log( textStatus ); // Success
console.log( jqxhr.status ); // 200
console.log( "Load was performed." );
switch(textStatus){
case 'success':
console.log('%cAjax script '+i+' loaded in!', "color:grey;font-size:small;font-style:oblique;line-height:4em;");
console.log('%cCustom Script: '+scriptTitle, "color:green;font-size:x-large;font-weight:800;");
console.log('%c'+scriptDesc, "color:grey;");
break;
}
}).done(function(){
$(document).trigger('scriptAjaxLoaded:' + scriptCallback);
});
$(document).trigger('scriptAjaxConverted', [scriptTitle, scriptDesc]);
}
});
$(document).trigger('scriptsAllCompleted', [scriptsExt, scriptsInt]);
