";
if(e_PAGE == 'mailout.php')
{
$insert .= " ".LAN_MAILOUT_16."<\/a>";
$insert .= "".LAN_MAILOUT_14."<\/a>";
$insert .= "".LAN_MAILOUT_17."<\/a>";
$insert .= "".LAN_MAILOUT_18."<\/a>";
}
$insert .= "');";
define("SWITCH_TO_BB",$insert);
}
else
{
define("SWITCH_TO_BB","");
}
// print_a($_POST);
//
e107::js('footer-inline',"
$(function() {
$('.e-wysiwyg').each(function() {
var id = $(this).attr('id'); // 'e-wysiwyg';
".SWITCH_TO_BB."
$('#bbcode-panel-'+id+'--preview').hide();
});
$('#media-manager-submit-buttons').show();
$('.tinyInsert').click(function() {
var val = $(this).attr('data-value');
top.tinymce.activeEditor.execCommand('mceInsertContent',0,val);
return false;
});
// When new tab is added - convert textarea to TinyMce.
$('.e-tabs-add').on('click',function(){
alert('New Page Added'); // added for delay - quick and dirty work-around. XXX fixme
var idt = $(this).attr('data-target'); // eg. news-body
var ct = parseInt($('#e-tab-count').val());
var id = idt + '-' + ct;
$('#bbcode-panel-'+id+'--preview').hide();
".SWITCH_TO_BB."
top.tinymce.activeEditor.execCommand('mceAddControl', false, id);
});
$(document).on('click','.e-dialog-save', function(){
// var html = $('#html_holder').val();
var s = $('#bbcode_holder').val();
// alert(s);
var p = $.ajax({
type: 'POST',
url: '".e_PLUGIN_ABS. "tinymce4/plugins/e107/parser.php', // parse bbcode value
data: { content: s, mode: 'tohtml' },
async : false,
dataType: 'html',
success: function(html) {
return html;
}
}).responseText;
html = p;
// alert(p);
if(html === undefined)
{
return;
}
// tinyMCE.execCommand('mceInsertContent',false,html);
top.tinymce.activeEditor.execCommand('mceInsertRawHTML',false,html);
top.tinymce.activeEditor.windowManager.close();
});
$('.e-dialog-cancel').click(function(){
top.tinymce.activeEditor.windowManager.close();
});
});
","jquery", 1);
}