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]);