(function($, undefined){
jQuery(document).ready(function(){
// JavaScript Document
(function() {
$(window).on('load', function(){
$('#content_ifr').contents().on('click','.extended_featured .edit_X', function () {
var my_click = $(this).parent().parent()
tinyMCE.activeEditor.windowManager.open( {
title: 'Set the parameters of the Extended Box',
width: 550,
height: 500,
//autoScroll: true,
style: 'overflow: auto; padding-bottom:100px; box-sizing: border-box;',
body: [
{
type : 'container',
name : 'backgriond_color',
label : 'All Background Color:',
html : ''
},
{
type : 'container',
name : 'backgriond_color_hover',
label : 'All Background Hover:',
html : ''
},
{
type : 'container',
name : 'name_box',
label : 'Name Box',
html : ''
},
{
type : 'container',
name : 'name_color',
label : 'Name Color:',
html : ''
},
{
type : 'container',
name : 'text_color_hover',
label : 'All Hover Text Color:',
html : ''
},
{
type : 'container',
name : 'description',
label : 'Description:',
html : ''+my_click.find('.content_block02z div p:eq(0)').text()+''
},
{
type : 'container',
name : 'description_color',
label : 'Description Color:',
html : ''
},
{
type : 'container',
name : 'read_more',
label : 'Read More:',
html : ''
},
{
type : 'container',
name : 'link_more',
label : 'Link:',
html : ''
},
{
type : 'container',
name : 'readmore_color',
label : 'Read More Color:',
html : ''
},
{
type : 'container',
name : 'readmore_background',
label : 'Read More Backgroung:',
html : ''
},
{
type : 'container',
name : 'readmore_background_hover',
label : 'Read More Backgroung Hover:',
html : ''
},
{
type : 'container',
name : 'border_bottom_width',
label : 'Border Bottom Width (px)',
html : ''
},
{
type : 'container',
name : 'border_color',
label : 'Border Color:',
html : ''
},
{
type : 'container',
name : 'border_color_hover',
label : 'Border Hover:',
html : ''
},
{
type: 'container', // тип listbox = выпадающий список select
name: 'icon',
label: 'Select Icon',
html : '
---- Web Application Icons ----
---- Hand Icons ----
---- Transporatation Icons ----
---- Gender Icons ----
---- File Type Icons ----
---- Spinner Icons ----
---- Form Control Icons ----
---- Payment Icons ----
---- Chart Icons ----
---- Currency Icons ----
---- Text Editor Icons ----
---- Directional Icons ----
---- Video Player Icons ----
---- Brand Icons ----
---- Medical Icons ----
',
},
{
type : 'container',
name : 'icon_color',
label : 'Icon Color:',
html : ''
},
{
type : 'container',
name : 'icon_color_hover',
label : 'Icon Color Hover:',
html : ''
},
{
type : 'container',
name : 'icon_back_color',
label : 'Icon Background:',
html : ''
},
{
type : 'container',
name : 'icon_back_color_hover',
label : 'Icon Background Hover:',
html : ''
},
{
type : 'container',
name : 'insert_animation',
label : 'Animation:',
html : ''
},
{
type : 'container',
name : 'insert_delay',
label : 'Delay:',
html : ''
},
{
type : 'container',
name : 'empty1',
label : ' ',
html : '
'
},
{
type : 'container',
name : 'empty2',
label : ' ',
html : '
'
},
],
onsubmit: function( e ) { // это будет происходить после заполнения полей и нажатии кнопки отправки
var serialize_parametr = '';
$('.mce-container-body.mce-abs-layout input, .mce-container-body.mce-abs-layout select, .mce-container-body.mce-abs-layout textarea').each(function(index, element) {
serialize_parametr = serialize_parametr + $(this).attr('name') + '="'+$(this).val()+'" '
});
var iconner = $('#iconner .selected').removeClass('selected').attr('class')
serialize_parametr = serialize_parametr + 'insert_icon="' +iconner+ '" '
var id_this_td = 'unique_style_' + ( Math.floor(Math.random() * (999999 - 100000 + 1)) + 100000 )
var current_style = '';
var my_demo_template = '
');
my_click.remove()
}
});
$('#iconner').on('click','i', function () {
$('#iconner i').removeClass('selected')
$(this).addClass('selected')
});
$('.mce-container.mce-panel.mce-foot').css({'position' : 'fixed', 'left' : 'auto', 'top' : 'auto'})
$('#iconner '+'.'+my_click.find('.invisible_shortcode').html().split('"')[41].substring(3)).addClass('selected')
$('select#insert_animation [value="'+my_click.find('.invisible_shortcode').html().split('"')[37]+'"]').attr("selected", "");
$('select#insert_delay [value="'+my_click.find('.invisible_shortcode').html().split('"')[39]+'"]').attr("selected", "");
/*alert(my_click.find('.invisible_shortcode').html())
alert(my_click.find('.invisible_shortcode').html().split('"')[37])
alert(my_click.find('.invisible_shortcode').html().split('"')[39])
alert(my_click.find('.invisible_shortcode').html().split('"')[41])*/
});
})
tinymce.PluginManager.add('true_mce_button_extended_featured', function( editor, url ) { // id кнопки true_mce_button должен быть везде один и тот же
editor.addButton( 'true_mce_button_extended_featured', { // id кнопки true_mce_button
icon: ' fa fa fa-list-alt', // мой собственный CSS класс, благодаря которому я задам иконку кнопки
type: 'menubutton',
title: 'Add Extended Featured', // всплывающая подсказка при наведении
menu: [ // тут начинается первый выпадающий список
{ // первый элемент первого выпадающего списка
text: 'Add New Extended',
onclick: function() {
editor.windowManager.open( {
title: 'Set the parameters of the Extended Box',
width: 550,
height: 500,
//autoScroll: true,
style: 'overflow: auto; padding-bottom:100px; box-sizing: border-box;',
body: [
{
type : 'container',
name : 'backgriond_color',
label : 'All Background Color:',
html : ''
},
{
type : 'container',
name : 'backgriond_color_hover',
label : 'All Background Hover:',
html : ''
},
{
type : 'container',
name : 'name_box',
label : 'Name Box',
html : ''
},
{
type : 'container',
name : 'name_color',
label : 'Name Color:',
html : ''
},
{
type : 'container',
name : 'text_color_hover',
label : 'All Hover Text Color:',
html : ''
},
{
type : 'container',
name : 'description',
label : 'Description:',
html : ' Recommenden insert arround 100 symbols'
},
{
type : 'container',
name : 'description_color',
label : 'Description Color:',
html : ''
},
{
type : 'container',
name : 'read_more',
label : 'Read More:',
html : ''
},
{
type : 'container',
name : 'link_more',
label : 'Link:',
html : ''
},
{
type : 'container',
name : 'readmore_color',
label : 'Read More Color:',
html : ''
},
{
type : 'container',
name : 'readmore_background',
label : 'Read More Backgroung:',
html : ''
},
{
type : 'container',
name : 'readmore_background_hover',
label : 'Read More Backgroung Hover:',
html : ''
},
{
type : 'container',
name : 'border_bottom_width',
label : 'Border Bottom Width (px)',
html : ''
},
{
type : 'container',
name : 'border_color',
label : 'Border Color:',
html : ''
},
{
type : 'container',
name : 'border_color_hover',
label : 'Border Hover:',
html : ''
},
{
type: 'container', // тип listbox = выпадающий список select
name: 'icon',
label: 'Select Icon',
html : '
---- Web Application Icons ----
---- Hand Icons ----
---- Transporatation Icons ----
---- Gender Icons ----
---- File Type Icons ----
---- Spinner Icons ----
---- Form Control Icons ----
---- Payment Icons ----
---- Chart Icons ----
---- Currency Icons ----
---- Text Editor Icons ----
---- Directional Icons ----
---- Video Player Icons ----
---- Brand Icons ----
---- Medical Icons ----
',
},
{
type : 'container',
name : 'icon_color',
label : 'Icon Color:',
html : ''
},
{
type : 'container',
name : 'icon_color_hover',
label : 'Icon Color Hover:',
html : ''
},
{
type : 'container',
name : 'icon_back_color',
label : 'Icon Background:',
html : ''
},
{
type : 'container',
name : 'icon_back_color_hover',
label : 'Icon Background Hover:',
html : ''
},
{
type : 'container',
name : 'insert_animation',
label : 'Animation:',
html : ''
},
{
type : 'container',
name : 'insert_delay',
label : 'Delay:',
html : ''
},
{
type : 'container',
name : 'empty1',
label : ' ',
html : '
'
},
{
type : 'container',
name : 'empty2',
label : ' ',
html : '
'
},
],
onsubmit: function( e ) { // это будет происходить после заполнения полей и нажатии кнопки отправки
var serialize_parametr = '';
$('.mce-container-body.mce-abs-layout input, .mce-container-body.mce-abs-layout select, .mce-container-body.mce-abs-layout textarea').each(function(index, element) {
serialize_parametr = serialize_parametr + $(this).attr('name') + '="'+$(this).val()+'" '
});
var iconner = $('#iconner .selected').removeClass('selected').attr('class')
serialize_parametr = serialize_parametr + 'insert_icon="' +iconner+ '" '
var id_this_td = 'unique_style_' + ( Math.floor(Math.random() * (999999 - 100000 + 1)) + 100000 )
var current_style = '';
var my_demo_template = '