ADDED Code of Version 2.0.0 of the Advanced Composer Blocks for Newsletter Plugin
This commit is contained in:
commit
028d595144
28 changed files with 2187 additions and 0 deletions
26
js/mbtnp-blocks-live-preview.js
Normal file
26
js/mbtnp-blocks-live-preview.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
jQuery(function ($) {
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// Extract the ID from the URL
|
||||
var urlParams = new URLSearchParams(window.location.search);
|
||||
var id = urlParams.get('id');
|
||||
|
||||
// Only proceed if the ID is present
|
||||
if (id) {
|
||||
// Get the root domain
|
||||
var domain = window.location.protocol + '//' + window.location.hostname;
|
||||
|
||||
// Create the new button
|
||||
var livePreviewButton = $('<a/>', {
|
||||
class: 'button-primary',
|
||||
href: domain + '/?na=view&id=' + id,
|
||||
target: '_blank',
|
||||
html: '<i class="fas fa-eye"></i>'
|
||||
});
|
||||
|
||||
// Append the button to the menu
|
||||
$('.tnpb-actions').append(livePreviewButton);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue