<div id="thememakers_shortcode_template" class="thememakers_shortcode_template clearfix">

    <div class="fullwidth">

        <h4 class="label"><?php _e('Select Type', THEMEMAKERS_THEME_FOLDER_NAME); ?></h4>

        <select class="js_shortcode_template_changer data-select" data-shortcode-field="type">
            <option value="tabs1"><?php _e('Style', THEMEMAKERS_THEME_FOLDER_NAME); ?> 1</option>
            <option value="tabs2"><?php _e('Style', THEMEMAKERS_THEME_FOLDER_NAME); ?> 2</option>
            <option value="tabs3"><?php _e('Style', THEMEMAKERS_THEME_FOLDER_NAME); ?> 3</option>
        </select>	
        
        <a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" href="javascript:add_shortcode_tabs_list_item();void(0);"><?php _e('Add Tab', THEMEMAKERS_THEME_FOLDER_NAME); ?></a>

    </div><!--/ .fullwidth-->

</div><!--/ .thememakers_shortcode_template-->


<div id="thememakers_shortcode_tab_template" class="thememakers_shortcode_template">

    
    <ul id="shortcode_tabs_list">
        <li>
            <h4 class="label"><?php _e('Tab Title', THEMEMAKERS_THEME_FOLDER_NAME); ?></h4>
            <input type="text" value="<?php _e('Tab Title', THEMEMAKERS_THEME_FOLDER_NAME); ?>" class="js_shortcode_template_changer data-input" data-shortcode-field="title" />
            <h4 class="label"><?php _e('Content', THEMEMAKERS_THEME_FOLDER_NAME); ?></h4>
            <textarea class="js_shortcode_template_changer data-area" data-shortcode-field="content"></textarea>
        </li>
    </ul> 

</div><!--/ .thememakers_shortcode_tab_template-->


<!-- --------------------------  PROCESSOR  --------------------------- -->

<div class="fullwidth-frame">
	
	<h4 class="label"><?php _e('Preview', THEMEMAKERS_THEME_FOLDER_NAME); ?></h4>
	
	<?php $frame_uri = Thememakers_Application_Shortcodes::get_application_uri() . "/preview.php"; ?>

	<div class="shortcode_app_frame_block">
		<div class="thememakers_shortcode_info_popup" style="display: none"></div>
		<iframe src="<?php echo $frame_uri ?>" class="shortcode_app_frame" frameborder="1" id="thememakers_shortcode_template_preview"></iframe>
	</div>

	<script type="text/javascript">
		var thememakers_app_shortcodes_preview_url = "<?php echo $frame_uri ?>";
		var shortcode_tabs_list = null;
		var shortcode_tabs_list_template = null;
		var shortcode_name = "tabbed_content";

		jQuery(function() {
			thememakers_app_shortcodes.tab_changer(shortcode_name);
			jQuery(".js_shortcode_template_changer, #thememakers_shortcode_tab_template .js_shortcode_template_changer").on('keyup, change', function() {
				thememakers_app_shortcodes.tab_changer(shortcode_name);
			});

			//***
			shortcode_tabs_list = jQuery("#shortcode_tabs_list");
			shortcode_tabs_list_template = jQuery("#shortcode_tabs_list li:first-child").html();
		});

		//*****

		function add_shortcode_tabs_list_item() {
			jQuery(shortcode_tabs_list).append("<li>" + shortcode_tabs_list_template + "</li>");
			thememakers_app_shortcodes.tab_changer(shortcode_name);
			jQuery(".js_shortcode_template_changer").on('keyup, change', function() {
				thememakers_app_shortcodes.tab_changer(shortcode_name);
			});
		}

	</script>
	
</div><!--/ .fullwidth-frame-->



