| 1 |
<?php |
| 2 |
wp_enqueue_script('jquery-ui-core'); |
| 3 |
wp_enqueue_script('jquery-ui-widget'); |
| 4 |
wp_enqueue_script('jquery-ui-position'); |
| 5 |
wp_enqueue_script('jquery'); |
| 6 |
global $wp_scripts; |
| 7 |
?> |
| 8 |
<!DOCTYPE html> |
| 9 |
<head> |
| 10 |
<title><?php _e("Insert Divider", 'kadencetoolkit'); ?></title> |
| 11 |
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" /> |
| 12 |
<script language="javascript" type="text/javascript" src="<?php echo get_option('siteurl') ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script> |
| 13 |
<script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script> |
| 14 |
<base target="_self" /> |
| 15 |
<?php wp_print_scripts(); ?> |
| 16 |
<script type="text/javascript"> |
| 17 |
|
| 18 |
var ButtonDialog = { |
| 19 |
local_ed : 'ed', |
| 20 |
init : function(ed) { |
| 21 |
ButtonDialog.local_ed = ed; |
| 22 |
tinyMCEPopup.resizeToInnerSize(); |
| 23 |
}, |
| 24 |
insert : function insertButton(ed) { |
| 25 |
|
| 26 |
// Try and remove existing style / blockquote |
| 27 |
tinyMCEPopup.execCommand('mceRemoveNode', false, null); |
| 28 |
|
| 29 |
// set up variables to contain our input values |
| 30 |
var divider = jQuery('#icon-dialog select#divider').val(); |
| 31 |
|
| 32 |
var output = ''; |
| 33 |
|
| 34 |
// setup the output of our shortcode |
| 35 |
switch(divider) { |
| 36 |
case 'hr': |
| 37 |
output += '[hr]'; |
| 38 |
break; |
| 39 |
case 'space_20': |
| 40 |
output += '[space_20]'; |
| 41 |
break; |
| 42 |
case 'space_40': |
| 43 |
output += '[space_40]'; |
| 44 |
break; |
| 45 |
case 'space_80': |
| 46 |
output += '[space_80]'; |
| 47 |
break; |
| 48 |
default: |
| 49 |
output += '[clear]'; |
| 50 |
} |
| 51 |
|
| 52 |
tinyMCEPopup.execCommand('mceInsertContent', false, output); |
| 53 |
|
| 54 |
// Return |
| 55 |
tinyMCEPopup.close(); |
| 56 |
} |
| 57 |
}; |
| 58 |
tinyMCEPopup.onInit.add(ButtonDialog.init, ButtonDialog); |
| 59 |
|
| 60 |
</script> |
| 61 |
<style type="text/css" media="screen">.kad-popup {padding: 0 8px; font-size: 0;} #icon-dialog {font-size: 12px;} #icon-dialog label {font-size:14px; display:block; padding:4px;} #icon-dialog select {display:block; height:28px; width:200px; font-size:12px;} #icon-dialog a#insert {margin-top:10px;} |
| 62 |
|
| 63 |
</style> |
| 64 |
|
| 65 |
</head> |
| 66 |
<body class="kad-popup"> |
| 67 |
<div id="icon-dialog"> |
| 68 |
<form action="/" method="get" accept-charset="utf-8"> |
| 69 |
<div> |
| 70 |
<label for="dividers"><?php _e("Choose a Divider", 'kadencetoolkit'); ?></label> |
| 71 |
<select name="divider" id="divider"> |
| 72 |
<option value="hr"><?php _e("Line", 'kadencetoolkit'); ?></option> |
| 73 |
<option value="space_20"><?php _e("Padding Small", 'kadencetoolkit'); ?></option> |
| 74 |
<option value="space_40"><?php _e("Padding Medium", 'kadencetoolkit'); ?></option> |
| 75 |
<option value="space_80"><?php _e("Padding Large", 'kadencetoolkit'); ?></option> |
| 76 |
<option value="clear"><?php _e("Clear", 'kadencetoolkit'); ?></option> |
| 77 |
</select> |
| 78 |
</div> |
| 79 |
<div> |
| 80 |
<a href="javascript:ButtonDialog.insert(ButtonDialog.local_ed)" id="insert" style="display: block; line-height: 24px; text-align:center"><?php _e("Insert", 'kadencetoolkit'); ?></a> |
| 81 |
</div> |
| 82 |
</form> |
| 83 |
</div> |
| 84 |
</body> |
| 85 |
</html> |