(function($, undefined){
jQuery(document).ready(function(){
// JavaScript Document
(function() {
$(window).on('load', function(){
$('#content_ifr').contents().on('click','.cg_featured_big .edit_X', function () {
var my_click = $(this).parent().parent()
tinyMCE.activeEditor.windowManager.open( {
width: 550,
height: 500,
//autoScroll: true,
style: 'overflow: auto; padding-bottom:100px; box-sizing: border-box;',
title: 'Set the parameters of the BIG Featured Box',
body: [
{
type : 'container',
name : 'name_box',
label : 'Name Hexagon Block',
html : ''
},
{
type : 'container',
name : 'name_box_color',
label : 'Name Color:',
html : ''
},
{
type : 'container',
name : 'name_box_color_hover',
label : 'Name Color Hover:',
html : ''
},
{
type : 'container',
name : 'description_tbox',
label : 'Description Block',
html : ''
},
{
type : 'container',
name : 'description_tbox_color',
label : 'Description Color:',
html : ''
},
{
type : 'container',
name : 'description_tbox_color_hover',
label : 'Description Color Hover:',
html : ''
},
{
type : 'container',
name : 'button_box',
label : 'Name Button',
html : ''
},
{
type : 'container',
name : 'mylink_box',
label : 'Link Block',
html : ''
},
{
type: 'container',
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 : 'backcolor',
label : 'Background Color:',
html : ''
},
{
type : 'container',
name : 'backcolor_hover',
label : 'Background Color Hover:',
html : ''
},
{
type : 'container',
name : 'activecolorel',
label : 'Button and Icon Color:',
html : ''
},
{
type : 'container',
name : 'activecolorel_hover',
label : 'Button and Icon Color hover:',
html : ''
},
{
type : 'container',
name : 'activecolorel_hoverback',
label : 'Button and Icon Back hover:',
html : ''
},
{
type : 'container',
name : 'insert_animation',
label : 'Animation:',
html : ''
},
{
type : 'container',
name : 'insert_delay',
label : 'Delay:',
html : ''
},
{
type : 'container',
name : 'empty1',
label : ' ',
html : '
'
},
],
onsubmit: function( e ) { // это будет происходить после заполнения полей и нажатии кнопки отправки
var iconner = $('#iconner .selected').removeClass('selected').attr('class')
var insert_name = $('input#name_box').val()
var insert_description = $('textarea#description_tbox').val()
var insert_button = $('input#button_box').val()
var insert_mylink = $('input#mylink_box').val()
var backcolor = $('input#backcolor').val()
var backcolor_hover = $('input#backcolor_hover').val()
var activecolorel = $('input#activecolorel').val()
var activecolorel_hover = $('input#activecolorel_hover').val()
var name_box_color = $('input#name_box_color').val()
var name_box_color_hover = $('input#name_box_color_hover').val()
var description_tbox_color = $('input#description_tbox_color').val()
var description_tbox_color_hover = $('input#description_tbox_color_hover').val()
var activecolorel_hoverback = $('input#activecolorel_hoverback').val()
var insert_animation = $('select#insert_animation').val()
var insert_delay = $('select#insert_delay').val()
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('"')[3].substring(3)).addClass('selected')
$('select#insert_animation [value="'+my_click.find('.invisible_shortcode').html().split('"')[11]+'"]').attr("selected", "");
$('select#insert_delay [value="'+my_click.find('.invisible_shortcode').html().split('"')[13]+'"]').attr("selected", "");
/*alert(my_click.find('.invisible_shortcode').html())
alert(my_click.find('.invisible_shortcode').html().split('"')[3])
alert(my_click.find('.invisible_shortcode').html().split('"')[11])
alert(my_click.find('.invisible_shortcode').html().split('"')[13])*/
});
})
tinymce.PluginManager.add('true_mce_button_featured_big', function( editor, url ) { // id кнопки true_mce_button должен быть везде один и тот же
editor.addButton( 'true_mce_button_featured_big', { // id кнопки true_mce_button
icon: ' fa fa-cube', // мой собственный CSS класс, благодаря которому я задам иконку кнопки
type: 'menubutton',
title: 'Add Big Featured Box', // всплывающая подсказка при наведении
menu: [ // тут начинается первый выпадающий список
{ // первый элемент первого выпадающего списка
text: 'Add Big Featured Box',
onclick: function() {
editor.windowManager.open( {
width: 550,
height: 500,
//autoScroll: true,
style: 'overflow: auto; padding-bottom:100px; box-sizing: border-box;',
title: 'Set the parameters of the BIG Featured Box',
body: [
{
type : 'container',
name : 'name_box',
label : 'Name Hexagon Block',
html : ''
},
{
type : 'container',
name : 'name_box_color',
label : 'Name Color:',
html : ''
},
{
type : 'container',
name : 'name_box_color_hover',
label : 'Name Color Hover:',
html : ''
},
{
type : 'container',
name : 'description_tbox',
label : 'Description Block',
html : ''
},
{
type : 'container',
name : 'description_tbox_color',
label : 'Description Color:',
html : ''
},
{
type : 'container',
name : 'description_tbox_color_hover',
label : 'Description Color Hover:',
html : ''
},
{
type : 'container',
name : 'button_box',
label : 'Name Button',
html : ''
},
{
type : 'container',
name : 'mylink_box',
label : 'Link Block',
html : ''
},
{
type: 'container',
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 : 'backcolor',
label : 'Background Color:',
html : ''
},
{
type : 'container',
name : 'backcolor_hover',
label : 'Background Color Hover:',
html : ''
},
{
type : 'container',
name : 'activecolorel',
label : 'Button and Icon Color:',
html : ''
},
{
type : 'container',
name : 'activecolorel_hover',
label : 'Button and Icon Color hover:',
html : ''
},
{
type : 'container',
name : 'activecolorel_hoverback',
label : 'Button and Icon Back hover:',
html : ''
},
{
type : 'container',
name : 'insert_animation',
label : 'Animation:',
html : ''
},
{
type : 'container',
name : 'insert_delay',
label : 'Delay:',
html : ''
},
{
type : 'container',
name : 'empty1',
label : ' ',
html : '
'
},
],
onsubmit: function( e ) { // это будет происходить после заполнения полей и нажатии кнопки отправки
var iconner = $('#iconner .selected').removeClass('selected').attr('class')
var insert_name = $('input#name_box').val()
var insert_description = $('textarea#description_tbox').val()
var insert_button = $('input#button_box').val()
var insert_mylink = $('input#mylink_box').val()
var backcolor = $('input#backcolor').val()
var backcolor_hover = $('input#backcolor_hover').val()
var activecolorel = $('input#activecolorel').val()
var activecolorel_hover = $('input#activecolorel_hover').val()
var name_box_color = $('input#name_box_color').val()
var name_box_color_hover = $('input#name_box_color_hover').val()
var description_tbox_color = $('input#description_tbox_color').val()
var description_tbox_color_hover = $('input#description_tbox_color_hover').val()
var activecolorel_hoverback = $('input#activecolorel_hoverback').val()
var insert_animation = $('select#insert_animation').val()
var insert_delay = $('select#insert_delay').val()
var id_this_td = 'unique_style_' + ( Math.floor(Math.random() * (999999 - 100000 + 1)) + 100000 )
var current_style = '';
var my_demo_template = '