woocommerce-smart-coupons

This commit is contained in:
Tony Volpe
2024-06-17 16:29:48 -04:00
parent c52ceefa4b
commit 39e0717541
237 changed files with 79624 additions and 0 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,44 @@
/**
* WooCommerce Smart Coupons JavaScript
*
* @package WooCommerce Smart Coupons/Assets/JS
*/
jQuery(
function(){
tinymce.create(
'tinymce.plugins.smart_coupons_shortcode_plugin',
{
init : function(ed, url) {
var assetsUrl = url.substr( 0, url.lastIndexOf( "/js" ) );
// Register command for when button is clicked.
ed.addCommand(
'smart_coupons_insert_shortcode',
function() {
ed.windowManager.open(
{
id : 'sc_coupons_attributes',
width : "auto",
height : "auto",
wpDialog : true
},
{
plugin_url : url // Plugin absolute URL.
}
);
}
);
// Register buttons - trigger above command when clicked.
ed.addButton( 'sc_shortcode_button', {title : 'Insert Smart Coupons shortcode', cmd : 'smart_coupons_insert_shortcode', classes: 'smart-coupon-shortcode btn' } );
},
}
);
// Register our TinyMCE plugin.
// first parameter is the button ID1.
// second parameter must match the first parameter of the tinymce.create() function above.
tinymce.PluginManager.add( 'sc_shortcode_button', tinymce.plugins.smart_coupons_shortcode_plugin );
}
);