Version Description
- Fixed posts block background editing
- Composer js improvements
- Fixed a couple of debug notices
- CSS fix
Download this release
Release Info
Developer | satollo |
Plugin | Newsletter |
Version | 4.8.4 |
Comparing to | |
See all releases |
Code changes from version 4.8.3 to 4.8.4
- emails/composer.php +4 -6
- emails/cpreview.php +10 -3
- emails/emails.php +206 -2
- emails/index.php +2 -1
- emails/tnp-composer/_css/newsletter-builder.css +569 -544
- emails/tnp-composer/_scripts/newsletter-builder.js +80 -13
- emails/tnp-composer/blocks/content-06-posts.block.php +4 -1
- emails/tnp-composer/blocks/content-07-twocols.block.php +4 -1
- emails/tnp-composer/edit.php +11 -0
- emails/tnp-composer/index.php +75 -40
- includes/controls.php +39 -7
- includes/helper.php +2 -1
- includes/module.php +17 -3
- plugin.php +15 -35
- readme.txt +8 -1
- subscription/subscription.php +3 -1
- users/index.php +1 -1
emails/composer.php
CHANGED
@@ -10,8 +10,9 @@ wp_enqueue_style('wp-color-picker');
|
|
10 |
wp_enqueue_script('wp-color-picker');
|
11 |
|
12 |
// TNP Composer style
|
13 |
-
wp_enqueue_style('tnpc-style', plugins_url('/tnp-composer/_css/newsletter-builder.css', __FILE__));
|
14 |
-
wp_enqueue_style('tnpc-newsletter-style', plugins_url('/tnp-composer/css/newsletter.css', __FILE__));
|
|
|
15 |
|
16 |
if (($controls->is_action('save') || $controls->is_action('preview')) && !$_GET['id']) {
|
17 |
|
@@ -101,12 +102,9 @@ if (isset($email)) {
|
|
101 |
</form>
|
102 |
</div>
|
103 |
|
104 |
-
<div id="tnp-body" class="tnp-body-lite">
|
105 |
|
106 |
-
<?php include NEWSLETTER_DIR . '/emails/tnp-composer/index.php'; ?>
|
107 |
|
108 |
-
|
109 |
|
110 |
-
<?php //include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
|
111 |
|
112 |
</div>
|
10 |
wp_enqueue_script('wp-color-picker');
|
11 |
|
12 |
// TNP Composer style
|
13 |
+
wp_enqueue_style('tnpc-style', plugins_url('/tnp-composer/_css/newsletter-builder.css', __FILE__), array(), time());
|
14 |
+
//wp_enqueue_style('tnpc-newsletter-style', plugins_url('/tnp-composer/css/newsletter.css', __FILE__));
|
15 |
+
wp_enqueue_style('tnpc-newsletter-style', home_url('/') . '?na=emails-composer-css');
|
16 |
|
17 |
if (($controls->is_action('save') || $controls->is_action('preview')) && !$_GET['id']) {
|
18 |
|
102 |
</form>
|
103 |
</div>
|
104 |
|
|
|
105 |
|
|
|
106 |
|
107 |
+
<?php include NEWSLETTER_DIR . '/emails/tnp-composer/index.php'; ?>
|
108 |
|
|
|
109 |
|
110 |
</div>
|
emails/cpreview.php
CHANGED
@@ -230,7 +230,14 @@ if ($controls->is_action('test')) {
|
|
230 |
//}
|
231 |
|
232 |
?>
|
233 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
234 |
<div class="wrap" id="tnp-wrap">
|
235 |
|
236 |
<?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
|
@@ -265,6 +272,8 @@ if ($controls->is_action('test')) {
|
|
265 |
<?php if ($email['status'] != 'sending' && $email['status'] != 'sent') $controls->button_confirm('editor', 'Save and switch to ' . ($email['editor'] == 0 ? 'HTML source editor' : 'Preview'), 'Sure?'); ?>
|
266 |
</p>
|
267 |
|
|
|
|
|
268 |
<div id="tabs">
|
269 |
<ul>
|
270 |
<li><a href="#tabs-a"><?php _e('Message', 'newsletter') ?></a></li>
|
@@ -277,8 +286,6 @@ if ($controls->is_action('test')) {
|
|
277 |
|
278 |
<div id="tabs-a" class="tnpc-subject">
|
279 |
|
280 |
-
<?php $controls->text('subject', 100, 'Subject'); ?>
|
281 |
-
|
282 |
<a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-tags" target="_blank"><?php _e('Available tags', 'newsletter') ?></a>
|
283 |
|
284 |
<br><br>
|
230 |
//}
|
231 |
|
232 |
?>
|
233 |
+
<style>
|
234 |
+
#options-subject {
|
235 |
+
font-size: 20px;
|
236 |
+
display: inline-block;
|
237 |
+
margin-bottom: 10px;
|
238 |
+
width: 100%;
|
239 |
+
}
|
240 |
+
</style>
|
241 |
<div class="wrap" id="tnp-wrap">
|
242 |
|
243 |
<?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
|
272 |
<?php if ($email['status'] != 'sending' && $email['status'] != 'sent') $controls->button_confirm('editor', 'Save and switch to ' . ($email['editor'] == 0 ? 'HTML source editor' : 'Preview'), 'Sure?'); ?>
|
273 |
</p>
|
274 |
|
275 |
+
<?php $controls->text('subject', 70, 'Subject'); ?>
|
276 |
+
|
277 |
<div id="tabs">
|
278 |
<ul>
|
279 |
<li><a href="#tabs-a"><?php _e('Message', 'newsletter') ?></a></li>
|
286 |
|
287 |
<div id="tabs-a" class="tnpc-subject">
|
288 |
|
|
|
|
|
289 |
<a href="http://www.thenewsletterplugin.com/plugins/newsletter/newsletter-tags" target="_blank"><?php _e('Available tags', 'newsletter') ?></a>
|
290 |
|
291 |
<br><br>
|
emails/emails.php
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
|
|
3 |
|
4 |
require_once NEWSLETTER_INCLUDES_DIR . '/themes.php';
|
5 |
require_once NEWSLETTER_INCLUDES_DIR . '/module.php';
|
@@ -22,6 +24,114 @@ class NewsletterEmails extends NewsletterModule {
|
|
22 |
$this->themes = new NewsletterThemes('emails');
|
23 |
parent::__construct('emails', '1.1.5');
|
24 |
add_action('wp_loaded', array($this, 'hook_wp_loaded'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
}
|
26 |
|
27 |
function hook_wp_loaded() {
|
@@ -45,7 +155,7 @@ class NewsletterEmails extends NewsletterModule {
|
|
45 |
header('Content-Type: text/html;charset=UTF-8');
|
46 |
header('X-Robots-Tag: noindex,nofollow,noarchive');
|
47 |
header('Cache-Control: no-cache,no-store,private');
|
48 |
-
|
49 |
// TODO: To be removed
|
50 |
if (is_file(WP_CONTENT_DIR . '/extensions/newsletter/view.php')) {
|
51 |
include WP_CONTENT_DIR . '/extensions/newsletter/view.php';
|
@@ -76,6 +186,26 @@ class NewsletterEmails extends NewsletterModule {
|
|
76 |
die();
|
77 |
break;
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
case 'emails-preview':
|
80 |
if (!current_user_can('manage_categories')) {
|
81 |
die('Not enough privileges');
|
@@ -272,6 +402,80 @@ class NewsletterEmails extends NewsletterModule {
|
|
272 |
}
|
273 |
}
|
274 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
275 |
}
|
276 |
|
277 |
NewsletterEmails::instance();
|
1 |
<?php
|
2 |
+
|
3 |
+
if (!defined('ABSPATH'))
|
4 |
+
exit;
|
5 |
|
6 |
require_once NEWSLETTER_INCLUDES_DIR . '/themes.php';
|
7 |
require_once NEWSLETTER_INCLUDES_DIR . '/module.php';
|
24 |
$this->themes = new NewsletterThemes('emails');
|
25 |
parent::__construct('emails', '1.1.5');
|
26 |
add_action('wp_loaded', array($this, 'hook_wp_loaded'));
|
27 |
+
|
28 |
+
if (is_admin()) {
|
29 |
+
add_action('wp_ajax_tnpc_render', array($this, 'tnpc_render_callback'));
|
30 |
+
add_action('wp_ajax_tnpc_preview', array($this, 'tnpc_preview_callback'));
|
31 |
+
add_action('wp_ajax_tnpc_css', array($this, 'tnpc_css_callback'));
|
32 |
+
add_action('wp_ajax_tnpc_options', array($this, 'hook_wp_ajax_tnpc_options'));
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
function hook_wp_ajax_tnpc_options() {
|
37 |
+
global $wpdb;
|
38 |
+
|
39 |
+
$block = $this->get_block($_REQUEST['id']);
|
40 |
+
if (!$block) {
|
41 |
+
die('Block not found with id ' . esc_html($_REQUEST['id']));
|
42 |
+
}
|
43 |
+
|
44 |
+
if (!class_exists('NewsletterControls')) {
|
45 |
+
include NEWSLETTER_INCLUDES_DIR . '/controls.php';
|
46 |
+
}
|
47 |
+
$options = stripslashes_deep($_REQUEST['options']);
|
48 |
+
$controls = new NewsletterControls($options);
|
49 |
+
|
50 |
+
$controls->init();
|
51 |
+
echo '<input type="hidden" name="action" value="tnpc_render">';
|
52 |
+
echo '<input type="hidden" name="b" value="' . esc_attr($_REQUEST['id']) . '">';
|
53 |
+
|
54 |
+
ob_start();
|
55 |
+
include $block['dir'] . '/options.php';
|
56 |
+
$content = ob_get_clean();
|
57 |
+
echo $content;
|
58 |
+
wp_die();
|
59 |
+
}
|
60 |
+
|
61 |
+
function tnpc_render_callback() {
|
62 |
+
$block_options = get_option('newsletter_main');
|
63 |
+
$block = $this->get_block($_POST['b']);
|
64 |
+
if ($block) {
|
65 |
+
|
66 |
+
if (isset($_POST['options']) && is_array($_POST['options'])) {
|
67 |
+
$options = stripslashes_deep($_POST['options']);
|
68 |
+
} else {
|
69 |
+
$options = array();
|
70 |
+
}
|
71 |
+
|
72 |
+
ob_start();
|
73 |
+
include $block['dir'] . '/block.php';
|
74 |
+
$content = ob_get_clean();
|
75 |
+
$content = $this->inline_css($content);
|
76 |
+
|
77 |
+
$data = '';
|
78 |
+
foreach ($options as $key => $value) {
|
79 |
+
$data .= 'options[' . $key . ']=' . urlencode($value) . '&';
|
80 |
+
}
|
81 |
+
|
82 |
+
if (isset($_POST['full'])) {
|
83 |
+
echo '<table border="0" cellpadding="0" cellspacing="0" width="100%" class="tnpc-row tnpc-row-block" data-id="', esc_attr($_POST['b']), '">';
|
84 |
+
echo '<tr>';
|
85 |
+
echo '<td data-options="', esc_attr($data), '" bgcolor="#ffffff" align="center" style="padding: 20px 15px 20px 15px; font-family: Helvetica, Arial, sans-serif;" class="section-padding edit-block">';
|
86 |
+
}
|
87 |
+
echo $content;
|
88 |
+
if (isset($_POST['full'])) {
|
89 |
+
echo '</td></tr></table>';
|
90 |
+
}
|
91 |
+
wp_die();
|
92 |
+
}
|
93 |
+
include NEWSLETTER_DIR . '/emails/tnp-composer/blocks/' . sanitize_file_name($_POST['b']) . '.php';
|
94 |
+
wp_die(); // this is required to terminate immediately and return a proper response
|
95 |
+
}
|
96 |
+
|
97 |
+
function inline_css($content) {
|
98 |
+
// CSS
|
99 |
+
$matches = array();
|
100 |
+
// "s" skips line breaks
|
101 |
+
$styles = preg_match('|<style>(.*?)</style>|s', $content, $matches);
|
102 |
+
if ($matches[1]) {
|
103 |
+
$style = str_replace(array("\n", "\r"), '', $matches[1]);
|
104 |
+
$rules = array();
|
105 |
+
preg_match_all('|\s*\.(.*?)\{(.*?)\}\s*|s', $style, $rules);
|
106 |
+
//print_r($rules);
|
107 |
+
for ($i = 0; $i < count($rules[1]); $i++) {
|
108 |
+
$class = trim($rules[1][$i]);
|
109 |
+
$value = trim($rules[2][$i]);
|
110 |
+
$content = str_replace('class="' . $class . '"', 'class="' . $class . '" style="' . $value . '"', $content);
|
111 |
+
}
|
112 |
+
}
|
113 |
+
//return $content;
|
114 |
+
return trim(preg_replace('|<style>.*?</style>|s', '', $content));
|
115 |
+
}
|
116 |
+
|
117 |
+
function tnpc_preview_callback() {
|
118 |
+
|
119 |
+
$id = (int) ($_POST['id'] ? $_POST['id'] : $_GET['id']);
|
120 |
+
$email = Newsletter::instance()->get_email($id, ARRAY_A);
|
121 |
+
|
122 |
+
if (empty($email)) {
|
123 |
+
echo 'Wrong email identifier';
|
124 |
+
return;
|
125 |
+
}
|
126 |
+
|
127 |
+
echo $email['message'];
|
128 |
+
|
129 |
+
wp_die(); // this is required to terminate immediately and return a proper response
|
130 |
+
}
|
131 |
+
|
132 |
+
function tnpc_css_callback() {
|
133 |
+
include NEWSLETTER_DIR . '/emails/tnp-composer/css/newsletter.css';
|
134 |
+
wp_die(); // this is required to terminate immediately and return a proper response
|
135 |
}
|
136 |
|
137 |
function hook_wp_loaded() {
|
155 |
header('Content-Type: text/html;charset=UTF-8');
|
156 |
header('X-Robots-Tag: noindex,nofollow,noarchive');
|
157 |
header('Cache-Control: no-cache,no-store,private');
|
158 |
+
|
159 |
// TODO: To be removed
|
160 |
if (is_file(WP_CONTENT_DIR . '/extensions/newsletter/view.php')) {
|
161 |
include WP_CONTENT_DIR . '/extensions/newsletter/view.php';
|
186 |
die();
|
187 |
break;
|
188 |
|
189 |
+
case 'emails-composer-css':
|
190 |
+
header('Cache: no-cache');
|
191 |
+
header('Content-Type: text/css');
|
192 |
+
echo file_get_contents(__DIR__ . '/tnp-composer/css/newsletter.css');
|
193 |
+
$dirs = apply_filters('newsletter_blocks_dir', array());
|
194 |
+
foreach ($dirs as $dir) {
|
195 |
+
|
196 |
+
$list = NewsletterEmails::instance()->scan_blocks_dir($dir);
|
197 |
+
|
198 |
+
foreach ($list as $key => $data) {
|
199 |
+
if (!file_exists($data['dir'] . '/style.css')) continue;
|
200 |
+
echo "\n\n";
|
201 |
+
echo "/* ", $data['name'], " */\n";
|
202 |
+
echo file_get_contents($data['dir'] . '/style.css');
|
203 |
+
}
|
204 |
+
}
|
205 |
+
|
206 |
+
die();
|
207 |
+
break;
|
208 |
+
|
209 |
case 'emails-preview':
|
210 |
if (!current_user_can('manage_categories')) {
|
211 |
die('Not enough privileges');
|
402 |
}
|
403 |
}
|
404 |
|
405 |
+
function scan_blocks_dir($dir) {
|
406 |
+
|
407 |
+
if (!is_dir($dir)) {
|
408 |
+
return array();
|
409 |
+
}
|
410 |
+
|
411 |
+
$handle = opendir($dir);
|
412 |
+
$list = array();
|
413 |
+
$relative_dir = substr($dir, strlen(WP_CONTENT_DIR));
|
414 |
+
while ($file = readdir($handle)) {
|
415 |
+
|
416 |
+
// The block unique key, we should find out how to biuld it, maybe an hash of the (relative) dir?
|
417 |
+
$key = $relative_dir . '/' . $file;
|
418 |
+
|
419 |
+
$full_file = $dir . '/' . $file . '/block.php';
|
420 |
+
if (!is_file($full_file)) {
|
421 |
+
continue;
|
422 |
+
}
|
423 |
+
|
424 |
+
$data = get_file_data($full_file, array('name' => 'Name', 'section' => 'Section', 'description' => 'Description'));
|
425 |
+
|
426 |
+
if (empty($data['name'])) {
|
427 |
+
$data['name'] = $file;
|
428 |
+
}
|
429 |
+
if (empty($data['section'])) {
|
430 |
+
$data['section'] = 'content';
|
431 |
+
}
|
432 |
+
if (empty($data['description'])) {
|
433 |
+
$data['description'] = '';
|
434 |
+
}
|
435 |
+
// Absolute path of the block files
|
436 |
+
$data['dir'] = $dir . '/' . $file;
|
437 |
+
|
438 |
+
$data['icon'] = content_url($relative_dir . '/' . $file . '/icon.png');
|
439 |
+
$list[$key] = $data;
|
440 |
+
}
|
441 |
+
closedir($handle);
|
442 |
+
return $list;
|
443 |
+
}
|
444 |
+
|
445 |
+
function get_blocks() {
|
446 |
+
/* READ THE BLOCKS */
|
447 |
+
$blocks_dir = NEWSLETTER_DIR . '/emails/tnp-composer/blocks/';
|
448 |
+
$files = glob($blocks_dir . '*.block.php', GLOB_BRACE);
|
449 |
+
$blocks = array();
|
450 |
+
foreach ($files as $file) {
|
451 |
+
$path_parts = pathinfo($file);
|
452 |
+
$filename = $path_parts['filename'];
|
453 |
+
$section = substr($filename, 0, strpos($filename, '-'));
|
454 |
+
$index = substr($filename, strpos($filename, '-') + 1, 2);
|
455 |
+
$blocks[$index]['name'] = substr($filename, strrpos($filename, '-') + 1);
|
456 |
+
$blocks[$index]['filename'] = $filename;
|
457 |
+
$blocks[$index]['icon'] = plugins_url('newsletter') . '/emails/tnp-composer/blocks/' . $filename . '.png';
|
458 |
+
$blocks[$index]['section'] = $section;
|
459 |
+
$blocks[$index]['description'] = '';
|
460 |
+
}
|
461 |
+
|
462 |
+
$dirs = apply_filters('newsletter_blocks_dir', array());
|
463 |
+
|
464 |
+
foreach ($dirs as $dir) {
|
465 |
+
$list = $this->scan_blocks_dir($dir);
|
466 |
+
$blocks = array_merge($blocks, $list);
|
467 |
+
}
|
468 |
+
return $blocks;
|
469 |
+
}
|
470 |
+
|
471 |
+
function get_block($id) {
|
472 |
+
$blocks = $this->get_blocks();
|
473 |
+
if (!isset($blocks[$id])) {
|
474 |
+
return null;
|
475 |
+
}
|
476 |
+
return $blocks[$id];
|
477 |
+
}
|
478 |
+
|
479 |
}
|
480 |
|
481 |
NewsletterEmails::instance();
|
emails/index.php
CHANGED
@@ -105,6 +105,7 @@ $emails = Newsletter::instance()->get_emails('message');
|
|
105 |
<tbody>
|
106 |
<?php foreach ($emails as $email) {
|
107 |
$email_options = unserialize($email->options);
|
|
|
108 |
?>
|
109 |
<tr>
|
110 |
<td><input type="checkbox" name="ids[]" value="<?php echo $email->id; ?>"/></td>
|
@@ -133,7 +134,7 @@ $emails = Newsletter::instance()->get_emails('message');
|
|
133 |
<td><?php if ($email->status == 'sent' || $email->status == 'sending') echo $email->sent . ' ' . __('of', 'newsletter') . ' ' . $email->total; ?></td>
|
134 |
<td><?php if ($email->status == 'sent' || $email->status == 'sending') echo $module->format_date($email->send_on); ?></td>
|
135 |
<td><?php echo $email->track == 1 ? __('Yes', 'newsletter') : __('Yes', 'newsletter'); ?></td>
|
136 |
-
<td><a class="button-primary" href="<?php echo $module->get_admin_page_url(
|
137 |
<td>
|
138 |
<a class="button-primary" href="<?php echo NewsletterStatistics::instance()->get_statistics_url($email->id); ?>"><i class="fa fa-bar-chart"></i> <?php _e('Statistics', 'newsletter') ?></a>
|
139 |
</td>
|
105 |
<tbody>
|
106 |
<?php foreach ($emails as $email) {
|
107 |
$email_options = unserialize($email->options);
|
108 |
+
$composer = isset($email_options['composer']);
|
109 |
?>
|
110 |
<tr>
|
111 |
<td><input type="checkbox" name="ids[]" value="<?php echo $email->id; ?>"/></td>
|
134 |
<td><?php if ($email->status == 'sent' || $email->status == 'sending') echo $email->sent . ' ' . __('of', 'newsletter') . ' ' . $email->total; ?></td>
|
135 |
<td><?php if ($email->status == 'sent' || $email->status == 'sending') echo $module->format_date($email->send_on); ?></td>
|
136 |
<td><?php echo $email->track == 1 ? __('Yes', 'newsletter') : __('Yes', 'newsletter'); ?></td>
|
137 |
+
<td><a class="button-primary" href="<?php echo $module->get_admin_page_url($composer ? 'composer' : 'edit'); ?>&id=<?php echo $email->id; ?>"><i class="fa fa-<?php echo $composer?'th-large':'pencil'?>"></i> <?php _e('Edit', 'newsletter') ?></a></td>
|
138 |
<td>
|
139 |
<a class="button-primary" href="<?php echo NewsletterStatistics::instance()->get_statistics_url($email->id); ?>"><i class="fa fa-bar-chart"></i> <?php _e('Statistics', 'newsletter') ?></a>
|
140 |
</td>
|
emails/tnp-composer/_css/newsletter-builder.css
CHANGED
@@ -1,545 +1,570 @@
|
|
1 |
-
.tnp-composer-heading {
|
2 |
-
display: inline-block;
|
3 |
-
margin-bottom: -5px !important;
|
4 |
-
}
|
5 |
-
|
6 |
-
.tnp-composer-heading h2 {
|
7 |
-
display: inline-block;
|
8 |
-
margin-left: 30px !important;
|
9 |
-
text-transform: none !important;
|
10 |
-
font-weight: 400 !important;
|
11 |
-
}
|
12 |
-
|
13 |
-
.tnp-composer-heading a {
|
14 |
-
display: inline-block;
|
15 |
-
margin-left: 30px;
|
16 |
-
}
|
17 |
-
|
18 |
-
.tnp-composer-heading form {
|
19 |
-
display: inline-block;
|
20 |
-
margin-left: 30px;
|
21 |
-
}
|
22 |
-
|
23 |
-
.tnp-composer-heading img {
|
24 |
-
width: 50px;
|
25 |
-
vertical-align: middle;
|
26 |
-
}
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
#newsletter-builder {
|
33 |
-
position: relative;
|
34 |
-
overflow: hidden;
|
35 |
-
width: 100%;
|
36 |
-
background-color: #FFFFFF;
|
37 |
-
}
|
38 |
-
#newsletter-builder-sidebar {
|
39 |
-
float: left;
|
40 |
-
/*position: absolute;*/
|
41 |
-
left: 0px;
|
42 |
-
top: 0px;
|
43 |
-
overflow: auto;
|
44 |
-
height: 100%;
|
45 |
-
z-index: 1;
|
46 |
-
height: 80vh;
|
47 |
-
width:
|
48 |
-
}
|
49 |
-
|
50 |
-
#newsletter-builder-sidebar h4 {
|
51 |
-
margin: 5px;
|
52 |
-
text-align: center;
|
53 |
-
color: #fff;
|
54 |
-
margin-bottom: 20px;
|
55 |
-
font-family: "Montserrat";
|
56 |
-
}
|
57 |
-
|
58 |
-
#newsletter-builder-sidebar h4 span {
|
59 |
-
background-color: #27AE60;
|
60 |
-
padding: 2px 5px;
|
61 |
-
border-radius: 3px;
|
62 |
-
}
|
63 |
-
|
64 |
-
|
65 |
-
#newsletter-builder-sidebar .newsletter-sidebar-add-buttons img {
|
66 |
-
width:
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
.
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
/*
|
102 |
-
-
|
103 |
-
-
|
104 |
-
-
|
105 |
-
transition: all 0.5s;
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
-
|
167 |
-
transition:
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
}
|
172 |
-
.tnpc-row
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
}
|
210 |
-
.tnpc-row-edit-hover
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
margin-top: 10px;
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
color: #
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
-
|
313 |
-
|
314 |
-
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
}
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
}
|
324 |
-
|
325 |
-
|
326 |
-
height:
|
327 |
-
width: 380px;
|
328 |
-
border:
|
329 |
-
outline: none;
|
330 |
-
font-family: inherit;
|
331 |
-
|
332 |
-
-
|
333 |
-
-
|
334 |
-
-
|
335 |
-
transition: all 0.5s;
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
}
|
340 |
-
.tnpc-edit-box-content-field-
|
341 |
-
-webkit-box-shadow: inset 0px 0px 10px 0px rgba(0,0,0,0.2);
|
342 |
-
-moz-box-shadow: inset 0px 0px 10px 0px rgba(0,0,0,0.2);
|
343 |
-
box-shadow: inset 0px 0px 10px 0px rgba(0,0,0,0.2);
|
344 |
-
}
|
345 |
-
.tnpc-edit-box-content-
|
346 |
-
/*float: left;*/
|
347 |
-
height:
|
348 |
-
width:
|
349 |
-
border: 1px solid rgba(204,204,204,1);
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
-webkit-
|
363 |
-
-moz-
|
364 |
-
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
width:
|
380 |
-
margin-top:
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
font-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
-
|
393 |
-
-
|
394 |
-
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
width:
|
401 |
-
|
402 |
-
}
|
403 |
-
.tnpc-edit-box-buttons-save
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
-webkit-
|
414 |
-
-moz-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
/*
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
}
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
display: block;
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
background-color: #
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
545 |
}
|
1 |
+
.tnp-composer-heading {
|
2 |
+
display: inline-block;
|
3 |
+
margin-bottom: -5px !important;
|
4 |
+
}
|
5 |
+
|
6 |
+
.tnp-composer-heading h2 {
|
7 |
+
display: inline-block;
|
8 |
+
margin-left: 30px !important;
|
9 |
+
text-transform: none !important;
|
10 |
+
font-weight: 400 !important;
|
11 |
+
}
|
12 |
+
|
13 |
+
.tnp-composer-heading a {
|
14 |
+
display: inline-block;
|
15 |
+
margin-left: 30px;
|
16 |
+
}
|
17 |
+
|
18 |
+
.tnp-composer-heading form {
|
19 |
+
display: inline-block;
|
20 |
+
margin-left: 30px;
|
21 |
+
}
|
22 |
+
|
23 |
+
.tnp-composer-heading img {
|
24 |
+
width: 50px;
|
25 |
+
vertical-align: middle;
|
26 |
+
}
|
27 |
+
|
28 |
+
|
29 |
+
|
30 |
+
|
31 |
+
|
32 |
+
#newsletter-builder {
|
33 |
+
position: relative;
|
34 |
+
overflow: hidden;
|
35 |
+
width: 100%;
|
36 |
+
background-color: #FFFFFF;
|
37 |
+
}
|
38 |
+
#newsletter-builder-sidebar {
|
39 |
+
float: left;
|
40 |
+
/*position: absolute;*/
|
41 |
+
left: 0px;
|
42 |
+
top: 0px;
|
43 |
+
overflow: auto;
|
44 |
+
height: 100%;
|
45 |
+
z-index: 1;
|
46 |
+
height: 80vh;
|
47 |
+
width: 250px;
|
48 |
+
}
|
49 |
+
|
50 |
+
#newsletter-builder-sidebar h4 {
|
51 |
+
margin: 5px;
|
52 |
+
text-align: center;
|
53 |
+
color: #fff;
|
54 |
+
margin-bottom: 20px;
|
55 |
+
font-family: "Montserrat";
|
56 |
+
}
|
57 |
+
|
58 |
+
#newsletter-builder-sidebar h4 span {
|
59 |
+
background-color: #27AE60;
|
60 |
+
padding: 2px 5px;
|
61 |
+
border-radius: 3px;
|
62 |
+
}
|
63 |
+
|
64 |
+
|
65 |
+
#newsletter-builder-sidebar .newsletter-sidebar-add-buttons img {
|
66 |
+
width: 100px;
|
67 |
+
height: 75px;
|
68 |
+
}
|
69 |
+
|
70 |
+
.newsletter-sidebar-add-buttons {
|
71 |
+
border-radius: 4px;
|
72 |
+
padding: 5px;
|
73 |
+
margin: 5px;
|
74 |
+
}
|
75 |
+
|
76 |
+
.tnp-body-lite {
|
77 |
+
background-color: #FFFFFF !important;
|
78 |
+
}
|
79 |
+
|
80 |
+
.newsletter-sidebar-buttons-content-tab {
|
81 |
+
margin: 1px;
|
82 |
+
position: relative;
|
83 |
+
display: inline-block;
|
84 |
+
}
|
85 |
+
.newsletter-sidebar-buttons-content-tab:hover {
|
86 |
+
cursor: move;
|
87 |
+
}
|
88 |
+
.newsletter-sidebar-buttons-content-tab:hover img{
|
89 |
+
opacity: 0.8;
|
90 |
+
}
|
91 |
+
.newsletter-sidebar-buttons-content-tab:hover .newsletter-sidebar-buttons-content-tab-add{
|
92 |
+
opacity: 0.5;
|
93 |
+
}
|
94 |
+
.newsletter-sidebar-buttons-content-tab-add {
|
95 |
+
height: 100%;
|
96 |
+
width: 100%;
|
97 |
+
background-color: rgba(70,70,70,1);
|
98 |
+
position: absolute;
|
99 |
+
left: 0;
|
100 |
+
top: 0;
|
101 |
+
/*float: left;*/
|
102 |
+
/*margin-top: -15px;*/
|
103 |
+
/*margin-left: -50px;*/
|
104 |
+
-webkit-transition: all 0.5s;
|
105 |
+
-moz-transition: all 0.5s;
|
106 |
+
-o-transition: all 0.5s;
|
107 |
+
transition: all 0.5s;
|
108 |
+
z-index: 2;
|
109 |
+
opacity: 0;
|
110 |
+
text-align: center;
|
111 |
+
line-height: inherit;
|
112 |
+
color: white;
|
113 |
+
}
|
114 |
+
.newsletter-sidebar-buttons-content-tab-add:hover {
|
115 |
+
background-color: rgba(0,0,0,1);
|
116 |
+
/* cursor: pointer;*/
|
117 |
+
}
|
118 |
+
|
119 |
+
#newsletter-builder-area {
|
120 |
+
overflow: auto;
|
121 |
+
background-color: #EDF1F4;
|
122 |
+
height: 80vh;
|
123 |
+
float: left;
|
124 |
+
width: 860px;
|
125 |
+
margin-left: 30px;
|
126 |
+
box-sizing: border-box;
|
127 |
+
padding-left: 50px;
|
128 |
+
padding-right: 50px;
|
129 |
+
margin-top: 30px;
|
130 |
+
padding-top: 50px;
|
131 |
+
min-height: 500px;
|
132 |
+
}
|
133 |
+
|
134 |
+
|
135 |
+
#newsletter-builder-area-center-frame-content {
|
136 |
+
/*float: left;*/
|
137 |
+
width: 750px;
|
138 |
+
background-color: rgba(153,153,153,1);
|
139 |
+
min-height: 50px;
|
140 |
+
}
|
141 |
+
|
142 |
+
#newsletter-mobile-preview-area {
|
143 |
+
float: left;
|
144 |
+
margin-left: 50px;
|
145 |
+
box-sizing: border-box;
|
146 |
+
margin-top: 30px;
|
147 |
+
padding-top: 50px;
|
148 |
+
#background-color: #EDF1F4;
|
149 |
+
padding-left: 30px;
|
150 |
+
padding-right: 30px;
|
151 |
+
text-align: center;
|
152 |
+
}
|
153 |
+
#newsletter-mobile-preview-area input {
|
154 |
+
width: 100px;
|
155 |
+
}
|
156 |
+
|
157 |
+
#tnp-mobile-preview {
|
158 |
+
width: 320px;
|
159 |
+
height: 500px;
|
160 |
+
border: 1px solid #eee;
|
161 |
+
padding: 10px;
|
162 |
+
box-sizing: border-box;
|
163 |
+
border-radius: 10px;
|
164 |
+
}
|
165 |
+
.tnpc-row {
|
166 |
+
-webkit-transition: box-shadow 0.5s;
|
167 |
+
-moz-transition: box-shadow 0.5s;
|
168 |
+
-o-transition: box-shadow 0.5s;
|
169 |
+
transition: box-shadow 0.5s;
|
170 |
+
position: relative;
|
171 |
+
}
|
172 |
+
.tnpc-row:hover {
|
173 |
+
cursor: move;
|
174 |
+
-webkit-box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.2);
|
175 |
+
-moz-box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.2);
|
176 |
+
box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.2);
|
177 |
+
}
|
178 |
+
.tnpc-row-delete, .tnpc-row-edit-block {
|
179 |
+
height: 40px;
|
180 |
+
width: 40px;
|
181 |
+
background-color: rgba(255,255,255,0.5);
|
182 |
+
right: -40px;
|
183 |
+
position: absolute;
|
184 |
+
color: rgba(102,102,102,1);
|
185 |
+
-webkit-transition: all 0.5s;
|
186 |
+
-moz-transition: all 0.5s;
|
187 |
+
-o-transition: all 0.5s;
|
188 |
+
transition: all 0.5s;
|
189 |
+
opacity: 0;
|
190 |
+
text-align: center;
|
191 |
+
font-size: 20px;
|
192 |
+
}
|
193 |
+
.tnpc-row-delete i, .tnpc-row-edit-block i {
|
194 |
+
line-height: 40px;
|
195 |
+
}
|
196 |
+
.tnpc-row-delete:hover {
|
197 |
+
background-color: rgba(255,0,0,1);
|
198 |
+
cursor: pointer;
|
199 |
+
color: rgba(255,255,255,1);
|
200 |
+
}
|
201 |
+
.tnpc-row:hover .tnpc-row-delete, .tnpc-row:hover .tnpc-row-edit-block {
|
202 |
+
opacity: 1;
|
203 |
+
}
|
204 |
+
.tnpc-row-delete {
|
205 |
+
top: 40px;
|
206 |
+
}
|
207 |
+
.tnpc-row-edit-block {
|
208 |
+
top: 0px;
|
209 |
+
}
|
210 |
+
.tnpc-row-edit-block:hover {
|
211 |
+
background-color: rgba(255,255,0,1);
|
212 |
+
cursor: pointer;
|
213 |
+
color: rgba(0,0,0,1);
|
214 |
+
}
|
215 |
+
.tnpc-row-edit {
|
216 |
+
position: relative;
|
217 |
+
}
|
218 |
+
.tnpc-row-edit-hover {
|
219 |
+
height: 100%;
|
220 |
+
width: 100%;
|
221 |
+
background-color: rgba(63,141,191,0.8);
|
222 |
+
position: absolute;
|
223 |
+
left: 0px;
|
224 |
+
top: 0px;
|
225 |
+
cursor: default;
|
226 |
+
-webkit-transition: all 0.5s;
|
227 |
+
-moz-transition: all 0.5s;
|
228 |
+
-o-transition: all 0.5s;
|
229 |
+
transition: all 0.5s;
|
230 |
+
}
|
231 |
+
.tnpc-row-edit-hover i {
|
232 |
+
position: absolute;
|
233 |
+
height: 30px;
|
234 |
+
width: 30px;
|
235 |
+
line-height: 30px;
|
236 |
+
left: 50%;
|
237 |
+
top: 50%;
|
238 |
+
text-align: center;
|
239 |
+
margin-top: -15px;
|
240 |
+
margin-left: -15px;
|
241 |
+
color: rgba(255,255,255,1);
|
242 |
+
-webkit-transition: all 0.5s;
|
243 |
+
-moz-transition: all 0.5s;
|
244 |
+
-o-transition: all 0.5s;
|
245 |
+
transition: all 0.5s;
|
246 |
+
-webkit-border-radius: 50%;
|
247 |
+
-moz-border-radius: 50%;
|
248 |
+
border-radius: 50%;
|
249 |
+
font-size: 16px;
|
250 |
+
}
|
251 |
+
.tnpc-row-edit-hover i:hover {
|
252 |
+
background-color: rgba(0,0,0,0.5);
|
253 |
+
cursor: pointer;
|
254 |
+
}
|
255 |
+
|
256 |
+
.tnpc-drop-here {
|
257 |
+
padding:10px;
|
258 |
+
text-align: center;
|
259 |
+
}
|
260 |
+
|
261 |
+
.tnpc-edit {
|
262 |
+
height: 100vh;
|
263 |
+
width: 100vw;
|
264 |
+
/*position: fixed;*/
|
265 |
+
z-index: 2;
|
266 |
+
display: none;
|
267 |
+
background-image: url(../_assets/background.png);
|
268 |
+
background-repeat: repeat;
|
269 |
+
position: absolute;
|
270 |
+
top: 0;
|
271 |
+
left: -20px;
|
272 |
+
}
|
273 |
+
.tnpc-edit-box {
|
274 |
+
width: 800px;
|
275 |
+
background-color: rgba(255,255,255,1);
|
276 |
+
margin-right: auto;
|
277 |
+
margin-left: auto;
|
278 |
+
margin-top: 10px;
|
279 |
+
-webkit-box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.5);
|
280 |
+
-moz-box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.5);
|
281 |
+
box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.5);
|
282 |
+
padding: 25px;
|
283 |
+
display: none;
|
284 |
+
background-color: #EDF1F4;
|
285 |
+
border-radius: 10px;
|
286 |
+
}
|
287 |
+
.tnpc-edit-box-title {
|
288 |
+
/*float: left;*/
|
289 |
+
width: 100%;
|
290 |
+
font-size: 29px;
|
291 |
+
color: #666666;
|
292 |
+
font-weight: 300;
|
293 |
+
margin-bottom: 40px;
|
294 |
+
}
|
295 |
+
|
296 |
+
.tnpc-edit-box-content {
|
297 |
+
/*float: left;*/
|
298 |
+
width: 100%;
|
299 |
+
margin-top: 10px;
|
300 |
+
}
|
301 |
+
.tnpc-edit-box-content-text {
|
302 |
+
/*float: left;*/
|
303 |
+
width: 100%;
|
304 |
+
font-size: 15px;
|
305 |
+
color: #666666;
|
306 |
+
font-weight: 600;
|
307 |
+
margin: 15px 0px 10px;
|
308 |
+
text-transform: uppercase;
|
309 |
+
}
|
310 |
+
|
311 |
+
.tnpc-edit-box-content-text span {
|
312 |
+
font-size: 11px;
|
313 |
+
color: #95A5A6;
|
314 |
+
background-color: #D3EADC;
|
315 |
+
padding: 2px 5px;
|
316 |
+
text-transform: none;
|
317 |
+
border-radius: 5px;
|
318 |
+
}
|
319 |
+
|
320 |
+
.tnpc-edit-box-content-field {
|
321 |
+
/*float: left;*/
|
322 |
+
width: 100%;
|
323 |
+
}
|
324 |
+
|
325 |
+
.tnpc-edit-box-content-field-input {
|
326 |
+
height: 33px;
|
327 |
+
width: 380px;
|
328 |
+
border: none !important;
|
329 |
+
outline: none;
|
330 |
+
font-family: inherit;
|
331 |
+
padding-right: 10px;
|
332 |
+
font-size: 15px;
|
333 |
+
-webkit-transition: all 0.5s;
|
334 |
+
-moz-transition: all 0.5s;
|
335 |
+
-o-transition: all 0.5s;
|
336 |
+
transition: all 0.5s;
|
337 |
+
color: rgba(102,102,102,1);
|
338 |
+
margin-bottom: 10px;
|
339 |
+
}
|
340 |
+
.tnpc-edit-box-content-field-input:focus {
|
341 |
+
-webkit-box-shadow: inset 0px 0px 10px 0px rgba(0,0,0,0.2);
|
342 |
+
-moz-box-shadow: inset 0px 0px 10px 0px rgba(0,0,0,0.2);
|
343 |
+
box-shadow: inset 0px 0px 10px 0px rgba(0,0,0,0.2);
|
344 |
+
}
|
345 |
+
.tnpc-edit-box-content-field-textarea {
|
346 |
+
/*float: left;*/
|
347 |
+
height: 180px;
|
348 |
+
width: 380px;
|
349 |
+
border: 1px solid rgba(204,204,204,1);
|
350 |
+
outline: none;
|
351 |
+
font-family: inherit;
|
352 |
+
font-size: 15px;
|
353 |
+
-webkit-transition: all 0.5s;
|
354 |
+
-moz-transition: all 0.5s;
|
355 |
+
-o-transition: all 0.5s;
|
356 |
+
transition: all 0.5s;
|
357 |
+
color: rgba(102,102,102,1);
|
358 |
+
resize: none;
|
359 |
+
padding: 10px;
|
360 |
+
}
|
361 |
+
.tnpc-edit-box-content-field-textarea:focus {
|
362 |
+
-webkit-box-shadow: inset 0px 0px 10px 0px rgba(0,0,0,0.2);
|
363 |
+
-moz-box-shadow: inset 0px 0px 10px 0px rgba(0,0,0,0.2);
|
364 |
+
box-shadow: inset 0px 0px 10px 0px rgba(0,0,0,0.2);
|
365 |
+
}
|
366 |
+
.tnpc-edit-box-content-icons {
|
367 |
+
/*float: left;*/
|
368 |
+
height: 388px;
|
369 |
+
width: 388px;
|
370 |
+
border: 1px solid rgba(204,204,204,1);
|
371 |
+
margin-top: 15px;
|
372 |
+
overflow-y: scroll;
|
373 |
+
}
|
374 |
+
.tnpc-edit-box-content-icons i {
|
375 |
+
line-height: 50px;
|
376 |
+
background-color: rgba(225,225,225,1);
|
377 |
+
/*float: left;*/
|
378 |
+
height: 50px;
|
379 |
+
width: 50px;
|
380 |
+
margin-top: 10px;
|
381 |
+
margin-left: 10px;
|
382 |
+
text-align: center;
|
383 |
+
-webkit-transition: all 0.5s;
|
384 |
+
-moz-transition: all 0.5s;
|
385 |
+
-o-transition: all 0.5s;
|
386 |
+
transition: all 0.5s;
|
387 |
+
font-size: 28px;
|
388 |
+
color: rgba(51,51,51,1);
|
389 |
+
}
|
390 |
+
.tnpc-edit-box-content-icons i:hover {
|
391 |
+
cursor: pointer;
|
392 |
+
background-color: rgba(153,153,153,1);
|
393 |
+
-webkit-border-radius: 50%;
|
394 |
+
-moz-border-radius: 50%;
|
395 |
+
border-radius: 50%;
|
396 |
+
color: rgba(0,0,0,1);
|
397 |
+
}
|
398 |
+
.tnpc-edit-box-buttons{
|
399 |
+
/*float: left;*/
|
400 |
+
width: 100%;
|
401 |
+
margin-top: 25px;
|
402 |
+
}
|
403 |
+
.tnpc-edit-box-buttons-save{
|
404 |
+
height: 35px;
|
405 |
+
text-align: right;
|
406 |
+
line-height: 35px;
|
407 |
+
color: #27AE60;
|
408 |
+
font-weight: 600;
|
409 |
+
font-size: 15px;
|
410 |
+
-webkit-border-radius: 3px;
|
411 |
+
-moz-border-radius: 3px;
|
412 |
+
border-radius: 3px;
|
413 |
+
-webkit-transition: background 0.5s;
|
414 |
+
-moz-transition: background 0.5s;
|
415 |
+
-o-transition: background 0.5s;
|
416 |
+
transition: background 0.5s;
|
417 |
+
cursor: pointer;
|
418 |
+
/*float: left;*/
|
419 |
+
/*padding-right: 25px;
|
420 |
+
padding-left: 25px;
|
421 |
+
width: 33%;*/
|
422 |
+
display: inline-block;
|
423 |
+
}
|
424 |
+
.tnpc-edit-box-buttons-save:hover {
|
425 |
+
color: #2ECC71;
|
426 |
+
}
|
427 |
+
.tnpc-edit-box-buttons-cancel{
|
428 |
+
height: 35px;
|
429 |
+
text-align: right;
|
430 |
+
line-height: 35px;
|
431 |
+
color: #C0392B;
|
432 |
+
font-weight: 600;
|
433 |
+
font-size: 15px;
|
434 |
+
-webkit-border-radius: 3px;
|
435 |
+
-moz-border-radius: 3px;
|
436 |
+
border-radius: 3px;
|
437 |
+
-webkit-transition: background 0.5s;
|
438 |
+
-moz-transition: background 0.5s;
|
439 |
+
-o-transition: background 0.5s;
|
440 |
+
transition: background 0.5s;
|
441 |
+
cursor: pointer;
|
442 |
+
/*float: left;*/
|
443 |
+
/*padding-right: 25px;
|
444 |
+
padding-left: 25px;
|
445 |
+
width: 33%;*/
|
446 |
+
display: inline-block;
|
447 |
+
margin-left: 10px;
|
448 |
+
}
|
449 |
+
.tnpc-edit-box-buttons-cancel:hover {
|
450 |
+
color: #E74C3C;
|
451 |
+
}
|
452 |
+
|
453 |
+
.tnpc-edit-box-content-field .iris-square {
|
454 |
+
margin-right: 10px;
|
455 |
+
}
|
456 |
+
|
457 |
+
.tnpc-edit-box-content-field .iris-picker .iris-slider {
|
458 |
+
height: 100% !important;
|
459 |
+
}
|
460 |
+
|
461 |
+
|
462 |
+
|
463 |
+
/* Tnp Composer Preview */
|
464 |
+
|
465 |
+
.tnpc-subject input {
|
466 |
+
padding: 12px 15px;
|
467 |
+
margin-left: 20px;
|
468 |
+
width: 70%;
|
469 |
+
}
|
470 |
+
|
471 |
+
.tnpc-subject a {
|
472 |
+
font-family: Source Sans Pro;
|
473 |
+
font-weight: 700;
|
474 |
+
text-transform: uppercase;
|
475 |
+
text-decoration: none;
|
476 |
+
background-color: #3498DB;
|
477 |
+
color: white;
|
478 |
+
padding: 2px 10px;
|
479 |
+
border-radius: 10px;
|
480 |
+
font-size: 13px;
|
481 |
+
letter-spacing: 0.1em;
|
482 |
+
}
|
483 |
+
|
484 |
+
|
485 |
+
.tnpc-preview {
|
486 |
+
margin-top: 10px;
|
487 |
+
}
|
488 |
+
|
489 |
+
|
490 |
+
.fake-browser-ui {
|
491 |
+
padding: 40px 0 0;
|
492 |
+
border-radius: 3px;
|
493 |
+
border-bottom: 10px solid #ccc;
|
494 |
+
background: #ddd;
|
495 |
+
display: inline-block;
|
496 |
+
position: relative;
|
497 |
+
line-height: 0;
|
498 |
+
vertical-align: top;
|
499 |
+
margin-left: 20px;
|
500 |
+
}
|
501 |
+
|
502 |
+
.fake-mobile-browser-ui {
|
503 |
+
padding: 30px 10px 37px;
|
504 |
+
border-radius: 10px;
|
505 |
+
border-bottom: 10px solid #ccc;
|
506 |
+
background: #ddd;
|
507 |
+
display: inline-block;
|
508 |
+
position: relative;
|
509 |
+
line-height: 0;
|
510 |
+
margin-left: 30px;
|
511 |
+
}
|
512 |
+
|
513 |
+
.fake-browser-ui .frame {
|
514 |
+
display: block;
|
515 |
+
height: 25px;
|
516 |
+
position: absolute;
|
517 |
+
top: 12px;
|
518 |
+
left: 8px;
|
519 |
+
}
|
520 |
+
|
521 |
+
.fake-mobile-browser-ui .frame {
|
522 |
+
display: block;
|
523 |
+
height: 25px;
|
524 |
+
margin-top: 10px;
|
525 |
+
}
|
526 |
+
|
527 |
+
.fake-browser-ui span {
|
528 |
+
height: 12px;
|
529 |
+
width: 12px;
|
530 |
+
border-radius: 8px;
|
531 |
+
background-color: #eee;
|
532 |
+
border: 1px solid #dadada;
|
533 |
+
float: left;
|
534 |
+
margin: 0 0 0 4px;
|
535 |
+
}
|
536 |
+
|
537 |
+
.fake-mobile-browser-ui span {
|
538 |
+
height: 50px;
|
539 |
+
width: 50px;
|
540 |
+
border-radius: 60px;
|
541 |
+
background-color: #eee;
|
542 |
+
border: 2px solid #ccc;
|
543 |
+
display: block;
|
544 |
+
margin: auto;
|
545 |
+
}
|
546 |
+
|
547 |
+
.fake-browser-ui .bt-1 {
|
548 |
+
background-color: #ED594A;
|
549 |
+
}
|
550 |
+
|
551 |
+
.fake-browser-ui .bt-2 {
|
552 |
+
background-color: #FDD800;
|
553 |
+
}
|
554 |
+
|
555 |
+
.fake-browser-ui .bt-3 {
|
556 |
+
background-color: #5AC05A;
|
557 |
+
}
|
558 |
+
|
559 |
+
|
560 |
+
/* Tnp Html Editor */
|
561 |
+
|
562 |
+
#tnpc-html-editor {
|
563 |
+
height: 600px;
|
564 |
+
border-top: 20px solid #323232;
|
565 |
+
border-radius: 8px;
|
566 |
+
}
|
567 |
+
|
568 |
+
#tnpc-block-options-form {
|
569 |
+
font-color: #444;
|
570 |
}
|
emails/tnp-composer/_scripts/newsletter-builder.js
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
jQuery.fn.hover_edit = function () {
|
2 |
|
3 |
this.hover(
|
@@ -25,6 +26,7 @@ jQuery.fn.hover_edit = function () {
|
|
25 |
target.find('img').attr("src", jQuery("#tnpc-edit-image .image").val());
|
26 |
target.find('img').attr("alt", jQuery("#tnpc-edit-image .alt").val());
|
27 |
target.find('a').attr("href", jQuery("#tnpc-edit-image .url").val());
|
|
|
28 |
});
|
29 |
}
|
30 |
|
@@ -40,6 +42,7 @@ jQuery.fn.hover_edit = function () {
|
|
40 |
jQuery(this).parent().parent().slideUp(500)
|
41 |
target.text(jQuery("#tnpc-edit-link .title").val());
|
42 |
target.attr("href", jQuery("#tnpc-edit-link .url").val());
|
|
|
43 |
});
|
44 |
}
|
45 |
|
@@ -64,6 +67,7 @@ jQuery.fn.hover_edit = function () {
|
|
64 |
target.css("color", jQuery("#tnpc-edit-button .fgcolor").val());
|
65 |
target.css("background-color", jQuery("#tnpc-edit-button .bgcolor").val());
|
66 |
target.css("border-color", jQuery("#tnpc-edit-button .bgcolor").val());
|
|
|
67 |
});
|
68 |
}
|
69 |
|
@@ -84,6 +88,7 @@ jQuery.fn.hover_edit = function () {
|
|
84 |
jQuery(this).parent().parent().slideUp(500)
|
85 |
target.text(jQuery("#tnpc-edit-title .title").val());
|
86 |
target.css("color", jQuery("#tnpc-edit-title .color").val());
|
|
|
87 |
});
|
88 |
}
|
89 |
|
@@ -147,6 +152,7 @@ jQuery.fn.hover_edit = function () {
|
|
147 |
jQuery(this).parent().parent().parent().fadeOut(500)
|
148 |
jQuery(this).parent().parent().slideUp(500)
|
149 |
target.html(tinymce.activeEditor.getContent());
|
|
|
150 |
});
|
151 |
}
|
152 |
|
@@ -176,7 +182,9 @@ jQuery.fn.add_delete = function () {
|
|
176 |
jQuery.fn.perform_delete = function () {
|
177 |
this.click(function () {
|
178 |
jQuery(this).parent().remove();
|
|
|
179 |
});
|
|
|
180 |
}
|
181 |
|
182 |
jQuery.fn.add_block_edit = function () {
|
@@ -189,6 +197,8 @@ jQuery.fn.perform_block_edit = function () {
|
|
189 |
jQuery(".tnpc-row-edit-block").click(function (e) {
|
190 |
e.preventDefault()
|
191 |
});
|
|
|
|
|
192 |
|
193 |
this.click(function (e) {
|
194 |
|
@@ -206,12 +216,20 @@ jQuery.fn.perform_block_edit = function () {
|
|
206 |
});
|
207 |
jQuery('.bgcolor').wpColorPicker().iris('color', target.css("background-color"));
|
208 |
|
209 |
-
//
|
|
|
210 |
if (jQuery(this).parent().parent().hasClass('tnpc-row-posts')) {
|
211 |
|
212 |
jQuery("#tnpc-edit-posts").fadeIn(500);
|
213 |
jQuery("#tnpc-edit-posts .tnpc-edit-box").slideDown(500);
|
214 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
} else {
|
216 |
|
217 |
jQuery("#tnpc-edit-block").fadeIn(500);
|
@@ -227,6 +245,8 @@ jQuery.fn.perform_block_edit = function () {
|
|
227 |
target.css("font-family", jQuery("#tnpc-edit-block .font").val());
|
228 |
|
229 |
});
|
|
|
|
|
230 |
|
231 |
jQuery("#tnpc-edit-posts .tnpc-edit-box-buttons-save").click(function () {
|
232 |
|
@@ -242,13 +262,15 @@ jQuery.fn.perform_block_edit = function () {
|
|
242 |
'b': target.parent().parent().parent().data('block') + ".block",
|
243 |
'num': jQuery("#tnpc-edit-posts .number").val(),
|
244 |
'tags': jQuery("#tnpc-edit-posts .tags").val(),
|
245 |
-
'categories': categories
|
|
|
246 |
};
|
247 |
jQuery.post(ajaxurl, data, function (response) {
|
248 |
new_row = jQuery(response);
|
249 |
target.parent().before(new_row).remove();
|
250 |
new_row.add_delete();
|
251 |
new_row.add_block_edit();
|
|
|
252 |
new_row.find(".tnpc-row-edit").hover_edit();
|
253 |
});
|
254 |
});
|
@@ -265,14 +287,20 @@ jQuery(function () {
|
|
265 |
//Drag & Drop
|
266 |
jQuery("#newsletter-builder-area-center-frame-content").sortable({
|
267 |
revert: false,
|
268 |
-
|
|
|
|
|
|
|
|
|
|
|
269 |
if (ui.item.hasClass("newsletter-sidebar-buttons-content-tab")) {
|
270 |
loading_row = jQuery('<div style="text-align: center; padding: 20px; background-color: #d4d5d6; color: #52BE7F;"><i class="fa fa-cog fa-2x fa-spin" /></div>');
|
271 |
ui.item.before(loading_row);
|
272 |
ui.item.remove();
|
273 |
var data = {
|
274 |
'action': 'tnpc_render',
|
275 |
-
'b': ui.item.data("file")
|
|
|
276 |
};
|
277 |
jQuery.post(ajaxurl, data, function (response) {
|
278 |
new_row = jQuery(response);
|
@@ -283,30 +311,35 @@ jQuery(function () {
|
|
283 |
new_row.add_delete();
|
284 |
new_row.add_block_edit();
|
285 |
new_row.find(".tnpc-row-edit").hover_edit();
|
|
|
286 |
});
|
287 |
}
|
288 |
}
|
289 |
});
|
290 |
|
291 |
-
jQuery(".tnpc-row").draggable({
|
292 |
-
connectToSortable: "#newsletter-builder-area-center-frame-content",
|
293 |
-
//helper: "clone",
|
294 |
-
revert: false,
|
295 |
-
handle: ".tnpc-row-move"
|
296 |
-
});
|
297 |
|
298 |
jQuery(".newsletter-sidebar-buttons-content-tab").draggable({
|
299 |
connectToSortable: "#newsletter-builder-area-center-frame-content",
|
300 |
helper: "clone",
|
301 |
revert: false,
|
302 |
start: function () {
|
303 |
-
if (jQuery('.tnpc-row').length)
|
304 |
jQuery('.tnpc-row').append('<div class="tnpc-drop-here">Drag&Drop blocks here!</div>');
|
305 |
-
|
306 |
jQuery('#newsletter-builder-area-center-frame-content').append('<div class="tnpc-drop-here">Drag&Drop blocks here!</div>');
|
|
|
307 |
},
|
308 |
-
stop: function () {
|
|
|
309 |
jQuery('.tnpc-drop-here').remove();
|
|
|
|
|
310 |
}
|
311 |
});
|
312 |
|
@@ -315,6 +348,28 @@ jQuery(function () {
|
|
315 |
jQuery(this).parent().parent().parent().fadeOut(500)
|
316 |
jQuery(this).parent().parent().slideUp(500)
|
317 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
318 |
|
319 |
// initialize controls
|
320 |
jQuery(".tnpc-row").add_delete();
|
@@ -323,6 +378,18 @@ jQuery(function () {
|
|
323 |
|
324 |
});
|
325 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
326 |
function create() {
|
327 |
|
328 |
jQuery("#newsletter-preloaded-export").html(jQuery("#newsletter-builder-area-center-frame-content").html());
|
1 |
+
|
2 |
jQuery.fn.hover_edit = function () {
|
3 |
|
4 |
this.hover(
|
26 |
target.find('img').attr("src", jQuery("#tnpc-edit-image .image").val());
|
27 |
target.find('img').attr("alt", jQuery("#tnpc-edit-image .alt").val());
|
28 |
target.find('a').attr("href", jQuery("#tnpc-edit-image .url").val());
|
29 |
+
tnp_mobile_preview();
|
30 |
});
|
31 |
}
|
32 |
|
42 |
jQuery(this).parent().parent().slideUp(500)
|
43 |
target.text(jQuery("#tnpc-edit-link .title").val());
|
44 |
target.attr("href", jQuery("#tnpc-edit-link .url").val());
|
45 |
+
tnp_mobile_preview();
|
46 |
});
|
47 |
}
|
48 |
|
67 |
target.css("color", jQuery("#tnpc-edit-button .fgcolor").val());
|
68 |
target.css("background-color", jQuery("#tnpc-edit-button .bgcolor").val());
|
69 |
target.css("border-color", jQuery("#tnpc-edit-button .bgcolor").val());
|
70 |
+
tnp_mobile_preview();
|
71 |
});
|
72 |
}
|
73 |
|
88 |
jQuery(this).parent().parent().slideUp(500)
|
89 |
target.text(jQuery("#tnpc-edit-title .title").val());
|
90 |
target.css("color", jQuery("#tnpc-edit-title .color").val());
|
91 |
+
tnp_mobile_preview();
|
92 |
});
|
93 |
}
|
94 |
|
152 |
jQuery(this).parent().parent().parent().fadeOut(500)
|
153 |
jQuery(this).parent().parent().slideUp(500)
|
154 |
target.html(tinymce.activeEditor.getContent());
|
155 |
+
tnp_mobile_preview();
|
156 |
});
|
157 |
}
|
158 |
|
182 |
jQuery.fn.perform_delete = function () {
|
183 |
this.click(function () {
|
184 |
jQuery(this).parent().remove();
|
185 |
+
tnp_mobile_preview();
|
186 |
});
|
187 |
+
|
188 |
}
|
189 |
|
190 |
jQuery.fn.add_block_edit = function () {
|
197 |
jQuery(".tnpc-row-edit-block").click(function (e) {
|
198 |
e.preventDefault()
|
199 |
});
|
200 |
+
|
201 |
+
|
202 |
|
203 |
this.click(function (e) {
|
204 |
|
216 |
});
|
217 |
jQuery('.bgcolor').wpColorPicker().iris('color', target.css("background-color"));
|
218 |
|
219 |
+
// The row container which is a global variable and used later after the options save
|
220 |
+
$container = jQuery(this).closest("table");
|
221 |
if (jQuery(this).parent().parent().hasClass('tnpc-row-posts')) {
|
222 |
|
223 |
jQuery("#tnpc-edit-posts").fadeIn(500);
|
224 |
jQuery("#tnpc-edit-posts .tnpc-edit-box").slideDown(500);
|
225 |
|
226 |
+
} else if ($container.hasClass('tnpc-row-block')) {
|
227 |
+
jQuery("#tnpc-block-options").fadeIn(500);
|
228 |
+
jQuery("#tnpc-block-options .tnpc-edit-box").slideDown(500);
|
229 |
+
// Qua bisogna mandare anche le opzioni
|
230 |
+
jQuery("#tnpc-block-options-form").load(ajaxurl, "action=tnpc_options&id=" + $container.data("id") + "&" + target.attr("data-options"), function (data) {
|
231 |
+
|
232 |
+
});
|
233 |
} else {
|
234 |
|
235 |
jQuery("#tnpc-edit-block").fadeIn(500);
|
245 |
target.css("font-family", jQuery("#tnpc-edit-block .font").val());
|
246 |
|
247 |
});
|
248 |
+
|
249 |
+
|
250 |
|
251 |
jQuery("#tnpc-edit-posts .tnpc-edit-box-buttons-save").click(function () {
|
252 |
|
262 |
'b': target.parent().parent().parent().data('block') + ".block",
|
263 |
'num': jQuery("#tnpc-edit-posts .number").val(),
|
264 |
'tags': jQuery("#tnpc-edit-posts .tags").val(),
|
265 |
+
'categories': categories,
|
266 |
+
'bgcolor': jQuery("#tnpc-edit-posts .bgcolor").val()
|
267 |
};
|
268 |
jQuery.post(ajaxurl, data, function (response) {
|
269 |
new_row = jQuery(response);
|
270 |
target.parent().before(new_row).remove();
|
271 |
new_row.add_delete();
|
272 |
new_row.add_block_edit();
|
273 |
+
|
274 |
new_row.find(".tnpc-row-edit").hover_edit();
|
275 |
});
|
276 |
});
|
287 |
//Drag & Drop
|
288 |
jQuery("#newsletter-builder-area-center-frame-content").sortable({
|
289 |
revert: false,
|
290 |
+
//placeholder: "placeholder",
|
291 |
+
forcePlaceholderSize: true,
|
292 |
+
opacity: 0.6,
|
293 |
+
tolerance: "pointer",
|
294 |
+
update: function (event, ui) {
|
295 |
+
//debugger;
|
296 |
if (ui.item.hasClass("newsletter-sidebar-buttons-content-tab")) {
|
297 |
loading_row = jQuery('<div style="text-align: center; padding: 20px; background-color: #d4d5d6; color: #52BE7F;"><i class="fa fa-cog fa-2x fa-spin" /></div>');
|
298 |
ui.item.before(loading_row);
|
299 |
ui.item.remove();
|
300 |
var data = {
|
301 |
'action': 'tnpc_render',
|
302 |
+
'b': ui.item.data("file"),
|
303 |
+
'full': 1
|
304 |
};
|
305 |
jQuery.post(ajaxurl, data, function (response) {
|
306 |
new_row = jQuery(response);
|
311 |
new_row.add_delete();
|
312 |
new_row.add_block_edit();
|
313 |
new_row.find(".tnpc-row-edit").hover_edit();
|
314 |
+
tnp_mobile_preview();
|
315 |
});
|
316 |
}
|
317 |
}
|
318 |
});
|
319 |
|
320 |
+
// jQuery(".tnpc-row").draggable({
|
321 |
+
// connectToSortable: "#newsletter-builder-area-center-frame-content",
|
322 |
+
// //helper: "clone",
|
323 |
+
// revert: false,
|
324 |
+
// handle: ".tnpc-row-move"
|
325 |
+
// });
|
326 |
|
327 |
jQuery(".newsletter-sidebar-buttons-content-tab").draggable({
|
328 |
connectToSortable: "#newsletter-builder-area-center-frame-content",
|
329 |
helper: "clone",
|
330 |
revert: false,
|
331 |
start: function () {
|
332 |
+
if (jQuery('.tnpc-row').length) {
|
333 |
jQuery('.tnpc-row').append('<div class="tnpc-drop-here">Drag&Drop blocks here!</div>');
|
334 |
+
} else {
|
335 |
jQuery('#newsletter-builder-area-center-frame-content').append('<div class="tnpc-drop-here">Drag&Drop blocks here!</div>');
|
336 |
+
}
|
337 |
},
|
338 |
+
stop: function (event, ui) {
|
339 |
+
//debugger;
|
340 |
jQuery('.tnpc-drop-here').remove();
|
341 |
+
|
342 |
+
|
343 |
}
|
344 |
});
|
345 |
|
348 |
jQuery(this).parent().parent().parent().fadeOut(500)
|
349 |
jQuery(this).parent().parent().slideUp(500)
|
350 |
});
|
351 |
+
|
352 |
+
jQuery("#tnpc-block-options .tnpc-edit-box-buttons-save").click(function () {
|
353 |
+
//alert(target.data('options'));
|
354 |
+
jQuery(this).parent().parent().parent().fadeOut(500)
|
355 |
+
jQuery(this).parent().parent().slideUp(500)
|
356 |
+
|
357 |
+
var data = jQuery("#tnpc-block-options-form").serialize();
|
358 |
+
var dataArray = jQuery("#tnpc-block-options-form").serializeArray()
|
359 |
+
var options = "";
|
360 |
+
for (var i = 0; i < dataArray.length; i++) {
|
361 |
+
//alert(dataArray[i]);
|
362 |
+
if (dataArray[i].name.startsWith("options"))
|
363 |
+
options += dataArray[i].name + "=" + encodeURIComponent(dataArray[i].value) + "&";
|
364 |
+
}
|
365 |
+
jQuery.post(ajaxurl, data, function (response) {
|
366 |
+
target.html(response);
|
367 |
+
target.attr("data-options", options);
|
368 |
+
target.find(".tnpc-row-edit").hover_edit();
|
369 |
+
tnp_mobile_preview();
|
370 |
+
//alert(data);
|
371 |
+
});
|
372 |
+
});
|
373 |
|
374 |
// initialize controls
|
375 |
jQuery(".tnpc-row").add_delete();
|
378 |
|
379 |
});
|
380 |
|
381 |
+
function tnp_mobile_preview() {
|
382 |
+
var d = document.getElementById("tnp-mobile-preview").contentWindow.document;
|
383 |
+
d.open();
|
384 |
+
|
385 |
+
d.write("<!DOCTYPE html><html><head>");
|
386 |
+
d.write("<link rel='stylesheet' href='" + TNP_HOME_URL + "?na=emails-composer-css&ver=" + Math.random() + "' type='text/css'");
|
387 |
+
d.write("</head><body style='margin: 0; padding: 0;'>");
|
388 |
+
d.write(jQuery("#newsletter-builder-area-center-frame-content").html());
|
389 |
+
d.write("</body></html>");
|
390 |
+
d.close();
|
391 |
+
}
|
392 |
+
|
393 |
function create() {
|
394 |
|
395 |
jQuery("#newsletter-preloaded-export").html(jQuery("#newsletter-builder-area-center-frame-content").html());
|
emails/tnp-composer/blocks/content-06-posts.block.php
CHANGED
@@ -10,12 +10,15 @@ if (!empty($_POST['tags'])) {
|
|
10 |
$filters['tag'] = $_POST['tags'];
|
11 |
}
|
12 |
$posts = get_posts($filters);
|
|
|
|
|
|
|
13 |
?>
|
14 |
|
15 |
<!-- COMPACT ARTICLE SECTION -->
|
16 |
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="tnpc-row tnpc-row-posts" data-id="content-06" data-block="content-06-posts">
|
17 |
<tr>
|
18 |
-
<td bgcolor="
|
19 |
<table border="0" cellpadding="0" cellspacing="0" width="500" style="padding:0 0 20px 0;" class="responsive-table">
|
20 |
<!-- TITLE -->
|
21 |
<tr>
|
10 |
$filters['tag'] = $_POST['tags'];
|
11 |
}
|
12 |
$posts = get_posts($filters);
|
13 |
+
|
14 |
+
$bgcolor = isset($_POST['bgcolor']) ? $_POST['bgcolor'] : '#E6E9ED';
|
15 |
+
|
16 |
?>
|
17 |
|
18 |
<!-- COMPACT ARTICLE SECTION -->
|
19 |
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="tnpc-row tnpc-row-posts" data-id="content-06" data-block="content-06-posts">
|
20 |
<tr>
|
21 |
+
<td bgcolor="<?php echo $bgcolor ?>" align="center" style="padding: 70px 15px 70px 15px;" class="section-padding edit-block">
|
22 |
<table border="0" cellpadding="0" cellspacing="0" width="500" style="padding:0 0 20px 0;" class="responsive-table">
|
23 |
<!-- TITLE -->
|
24 |
<tr>
|
emails/tnp-composer/blocks/content-07-twocols.block.php
CHANGED
@@ -10,12 +10,15 @@ if (!empty($_POST['tags'])) {
|
|
10 |
$filters['tag'] = $_POST['tags'];
|
11 |
}
|
12 |
$posts = get_posts($filters);
|
|
|
|
|
|
|
13 |
?>
|
14 |
|
15 |
<!-- TWO COLUMN SECTION -->
|
16 |
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="tnpc-row tnpc-row-posts" data-id="content-07" data-block="content-07-twocols">
|
17 |
<tr>
|
18 |
-
<td bgcolor="
|
19 |
<table border="0" cellpadding="0" cellspacing="0" width="500" class="responsive-table">
|
20 |
<tr>
|
21 |
<td>
|
10 |
$filters['tag'] = $_POST['tags'];
|
11 |
}
|
12 |
$posts = get_posts($filters);
|
13 |
+
|
14 |
+
$bgcolor = isset($_POST['bgcolor']) ? $_POST['bgcolor'] : '#E6E9ED';
|
15 |
+
|
16 |
?>
|
17 |
|
18 |
<!-- TWO COLUMN SECTION -->
|
19 |
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="tnpc-row tnpc-row-posts" data-id="content-07" data-block="content-07-twocols">
|
20 |
<tr>
|
21 |
+
<td bgcolor="<?php echo $bgcolor ?>" align="center" style="padding: 70px 15px 70px 15px;" class="section-padding edit-block">
|
22 |
<table border="0" cellpadding="0" cellspacing="0" width="500" class="responsive-table">
|
23 |
<tr>
|
24 |
<td>
|
emails/tnp-composer/edit.php
CHANGED
@@ -1471,4 +1471,15 @@ if (!defined('ABSPATH')) exit;
|
|
1471 |
<div class="tnpc-edit-box-buttons-cancel"><?php _e("Cancel", "newsletter") ?></div>
|
1472 |
</div>
|
1473 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1474 |
</div>
|
1471 |
<div class="tnpc-edit-box-buttons-cancel"><?php _e("Cancel", "newsletter") ?></div>
|
1472 |
</div>
|
1473 |
</div>
|
1474 |
+
</div>
|
1475 |
+
|
1476 |
+
<div class="tnpc-edit" id="tnpc-block-options">
|
1477 |
+
<div class="tnpc-edit-box">
|
1478 |
+
<form id="tnpc-block-options-form">
|
1479 |
+
</form>
|
1480 |
+
<div class="tnpc-edit-box-buttons">
|
1481 |
+
<div class="tnpc-edit-box-buttons-save"><?php _e("Save", "newsletter") ?></div>
|
1482 |
+
<div class="tnpc-edit-box-buttons-cancel"><?php _e("Cancel", "newsletter") ?></div>
|
1483 |
+
</div>
|
1484 |
+
</div>
|
1485 |
</div>
|
emails/tnp-composer/index.php
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
<?php
|
2 |
-
if (!defined('ABSPATH'))
|
|
|
3 |
|
4 |
/* READ THE BLOCKS */
|
5 |
$blocks_dir = NEWSLETTER_DIR . '/emails/tnp-composer/blocks/';
|
@@ -12,33 +13,60 @@ foreach ($files as $file) {
|
|
12 |
$blocks[$section][$index]['name'] = substr($filename, strrpos($filename, '-') + 1);
|
13 |
$blocks[$section][$index]['filename'] = $filename;
|
14 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
// order the sections
|
16 |
$blocks = array_merge(array_flip(array('header', 'content', 'footer')), $blocks);
|
17 |
|
18 |
// prepare the options for the default blocks
|
19 |
$block_options = get_option('newsletter_main');
|
20 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
<div id="newsletter-preloaded-export" style="display: none;"></div>
|
23 |
|
24 |
-
<?php include NEWSLETTER_DIR . '/emails/tnp-composer/edit.php'; ?>
|
25 |
-
|
26 |
<div id="newsletter-builder">
|
27 |
|
28 |
-
<?php /* SIDEBAR */ ?>
|
29 |
<div id="newsletter-builder-sidebar">
|
30 |
|
31 |
-
<?php
|
32 |
-
foreach ($blocks as $k => $section) {
|
33 |
-
?>
|
34 |
<div class="newsletter-sidebar-add-buttons" id="sidebar-add-<?php echo $k ?>">
|
35 |
<h4><span><?php echo ucfirst($k) ?></span></h4>
|
36 |
<?php foreach ($section AS $key => $block) { ?>
|
37 |
<div class="newsletter-sidebar-buttons-content-tab" data-id="<?php echo $k . '-' . $key ?>" data-file="<?php echo $block['filename'] ?>">
|
38 |
-
<?php if (
|
39 |
-
<img src="<?php echo
|
|
|
|
|
40 |
<?php } else { ?>
|
41 |
-
<img src="http://placehold.it/200x100?text=<?php echo $block['name'] ?>" title="Drag&Drop"
|
42 |
<?php } ?>
|
43 |
</div>
|
44 |
<?php } ?>
|
@@ -49,40 +77,47 @@ $block_options = get_option('newsletter_main');
|
|
49 |
|
50 |
<div id="newsletter-builder-area">
|
51 |
|
52 |
-
<div id="newsletter-builder-area-center">
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
} else {
|
66 |
-
echo $body;
|
67 |
-
}
|
68 |
-
} else {
|
69 |
-
include $blocks_dir . 'header-01-header.block.php';
|
70 |
-
include $blocks_dir . 'content-01-hero.block.php';
|
71 |
-
include $blocks_dir . 'footer-01-footer.block.php';
|
72 |
-
include $blocks_dir . 'footer-02-canspam.block.php';
|
73 |
-
}
|
74 |
-
?>
|
75 |
-
|
76 |
-
</div>
|
77 |
-
</div>
|
78 |
</div>
|
79 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
</div>
|
81 |
|
82 |
<script type="text/javascript">
|
83 |
TNP_PLUGIN_URL = "<?php echo NEWSLETTER_URL ?>";
|
|
|
84 |
</script>
|
85 |
-
|
86 |
-
|
87 |
-
<script type="text/javascript" src="
|
88 |
-
<script
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
+
if (!defined('ABSPATH'))
|
3 |
+
exit;
|
4 |
|
5 |
/* READ THE BLOCKS */
|
6 |
$blocks_dir = NEWSLETTER_DIR . '/emails/tnp-composer/blocks/';
|
13 |
$blocks[$section][$index]['name'] = substr($filename, strrpos($filename, '-') + 1);
|
14 |
$blocks[$section][$index]['filename'] = $filename;
|
15 |
}
|
16 |
+
|
17 |
+
$dirs = apply_filters('newsletter_blocks_dir', array());
|
18 |
+
|
19 |
+
foreach ($dirs as $dir) {
|
20 |
+
|
21 |
+
$list = NewsletterEmails::instance()->scan_blocks_dir($dir);
|
22 |
+
|
23 |
+
foreach ($list as $key => $data) {
|
24 |
+
$blocks[$data['section']][$key]['name'] = $data['name'];
|
25 |
+
$blocks[$data['section']][$key]['filename'] = $key;
|
26 |
+
$blocks[$data['section']][$key]['icon'] = $data['icon'];
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
// order the sections
|
31 |
$blocks = array_merge(array_flip(array('header', 'content', 'footer')), $blocks);
|
32 |
|
33 |
// prepare the options for the default blocks
|
34 |
$block_options = get_option('newsletter_main');
|
35 |
?>
|
36 |
+
<style>
|
37 |
+
.placeholder {
|
38 |
+
border: 1px dotted #bbb!important;
|
39 |
+
border-style: dotted!important;
|
40 |
+
border-color: #bbb!important;
|
41 |
+
border-width: 1px!important;
|
42 |
+
background-color: #fff!important;
|
43 |
+
height: 50px;
|
44 |
+
margin: 15px 0;
|
45 |
+
width: 100%;
|
46 |
+
box-sizing: border-box!important;
|
47 |
+
}
|
48 |
+
#newsletter-builder-area-center-frame-content {
|
49 |
+
min-height: 300px!important;
|
50 |
+
}
|
51 |
+
</style>
|
52 |
|
53 |
<div id="newsletter-preloaded-export" style="display: none;"></div>
|
54 |
|
|
|
|
|
55 |
<div id="newsletter-builder">
|
56 |
|
|
|
57 |
<div id="newsletter-builder-sidebar">
|
58 |
|
59 |
+
<?php foreach ($blocks as $k => $section) { ?>
|
|
|
|
|
60 |
<div class="newsletter-sidebar-add-buttons" id="sidebar-add-<?php echo $k ?>">
|
61 |
<h4><span><?php echo ucfirst($k) ?></span></h4>
|
62 |
<?php foreach ($section AS $key => $block) { ?>
|
63 |
<div class="newsletter-sidebar-buttons-content-tab" data-id="<?php echo $k . '-' . $key ?>" data-file="<?php echo $block['filename'] ?>">
|
64 |
+
<?php if (isset($block['icon'])) { ?>
|
65 |
+
<img src="<?php echo $block['icon'] ?>" title="<?php echo esc_attr($block['name']) ?>" style="width: 100px; height: 75px;">
|
66 |
+
<?php } else if (file_exists(NEWSLETTER_DIR . '/emails/tnp-composer/blocks/' . $block['filename'] . '.png')) { ?>
|
67 |
+
<img src="<?php echo plugins_url('newsletter'); ?>/emails/tnp-composer/blocks/<?php echo $block['filename'] ?>.png" title="Drag&Drop" style="width: 100px; height: 75px;">
|
68 |
<?php } else { ?>
|
69 |
+
<img src="http://placehold.it/200x100?text=<?php echo $block['name'] ?>" title="Drag&Drop" style="width: 100px; height: 75px;">
|
70 |
<?php } ?>
|
71 |
</div>
|
72 |
<?php } ?>
|
77 |
|
78 |
<div id="newsletter-builder-area">
|
79 |
|
80 |
+
<div id="newsletter-builder-area-center-frame-content">
|
81 |
+
|
82 |
+
<?php
|
83 |
+
if (isset($email)) {
|
84 |
+
echo NewsletterModule::extract_body($body);
|
85 |
+
} else {
|
86 |
+
include $blocks_dir . 'header-01-header.block.php';
|
87 |
+
include $blocks_dir . 'content-01-hero.block.php';
|
88 |
+
include $blocks_dir . 'footer-01-footer.block.php';
|
89 |
+
include $blocks_dir . 'footer-02-canspam.block.php';
|
90 |
+
}
|
91 |
+
?>
|
92 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
</div>
|
94 |
</div>
|
95 |
+
|
96 |
+
<div id="newsletter-mobile-preview-area">
|
97 |
+
<iframe id="tnp-mobile-preview"></iframe>
|
98 |
+
<br>
|
99 |
+
<input type="button" onclick="tnp_mobile_preview()" value="↻">
|
100 |
+
</div>
|
101 |
+
|
102 |
+
</div>
|
103 |
+
|
104 |
+
<div id="tnp-body">
|
105 |
+
<?php include NEWSLETTER_DIR . '/emails/tnp-composer/edit.php'; ?>
|
106 |
</div>
|
107 |
|
108 |
<script type="text/javascript">
|
109 |
TNP_PLUGIN_URL = "<?php echo NEWSLETTER_URL ?>";
|
110 |
+
TNP_HOME_URL = "<?php echo home_url('/') ?>";
|
111 |
</script>
|
112 |
+
<script type="text/javascript" src="<?php echo plugins_url('newsletter'); ?>/emails/tnp-composer/_scripts/newsletter-builder.js?ver=<?php echo time()?>"></script>
|
113 |
+
<script type="text/javascript" src="<?php echo plugins_url('newsletter'); ?>/tinymce4/tinymce.min.js"></script>
|
114 |
+
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.nicescroll/3.6.8-fix/jquery.nicescroll.min.js"></script>
|
115 |
+
<script>
|
116 |
+
jQuery(function() {
|
117 |
+
|
118 |
+
//jQuery("#tnp-mobile-preview").niceScroll();
|
119 |
+
tnp_mobile_preview();
|
120 |
+
}
|
121 |
+
|
122 |
+
);
|
123 |
+
</script>
|
includes/controls.php
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
|
|
3 |
|
4 |
class NewsletterControls {
|
5 |
|
@@ -118,7 +120,7 @@ class NewsletterControls {
|
|
118 |
}
|
119 |
$this->messages .= __('Saved.', 'newsletter');
|
120 |
}
|
121 |
-
|
122 |
function add_message_done() {
|
123 |
if (!empty($this->messages)) {
|
124 |
$this->messages .= '<br><br>';
|
@@ -229,8 +231,39 @@ class NewsletterControls {
|
|
229 |
|
230 |
$this->checkboxes_group($name, $list);
|
231 |
}
|
232 |
-
|
233 |
-
function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
234 |
$pages = get_pages();
|
235 |
$options = array();
|
236 |
foreach ($pages as $page) {
|
@@ -438,7 +471,7 @@ class NewsletterControls {
|
|
438 |
} else {
|
439 |
echo '<input class="button-primary" type="button" value="' . esc_attr($label) . '" onclick="this.form.act.value=\'' . esc_attr($action) . '\';this.form.submit()"/>';
|
440 |
}
|
441 |
-
}
|
442 |
|
443 |
function button_confirm($action, $label, $message = '', $data = '') {
|
444 |
if (empty($message)) {
|
@@ -686,7 +719,7 @@ class NewsletterControls {
|
|
686 |
echo '</div>';
|
687 |
}
|
688 |
|
689 |
-
/**
|
690 |
* Creates a single select with the active preferences.
|
691 |
*/
|
692 |
function preferences_select($name = 'preference') {
|
@@ -997,5 +1030,4 @@ class NewsletterControls {
|
|
997 |
}
|
998 |
|
999 |
}
|
1000 |
-
|
1001 |
?>
|
1 |
<?php
|
2 |
+
|
3 |
+
if (!defined('ABSPATH'))
|
4 |
+
exit;
|
5 |
|
6 |
class NewsletterControls {
|
7 |
|
120 |
}
|
121 |
$this->messages .= __('Saved.', 'newsletter');
|
122 |
}
|
123 |
+
|
124 |
function add_message_done() {
|
125 |
if (!empty($this->messages)) {
|
126 |
$this->messages .= '<br><br>';
|
231 |
|
232 |
$this->checkboxes_group($name, $list);
|
233 |
}
|
234 |
+
|
235 |
+
function posts_select($name, $max = 20, $args = array()) {
|
236 |
+
$args = array_merge(array(
|
237 |
+
'posts_per_page' => 5,
|
238 |
+
'offset' => 0,
|
239 |
+
'category' => '',
|
240 |
+
'category_name' => '',
|
241 |
+
'orderby' => 'date',
|
242 |
+
'order' => 'DESC',
|
243 |
+
'include' => '',
|
244 |
+
'exclude' => '',
|
245 |
+
'meta_key' => '',
|
246 |
+
'meta_value' => '',
|
247 |
+
'post_type' => 'post',
|
248 |
+
'post_mime_type' => '',
|
249 |
+
'post_parent' => '',
|
250 |
+
'author' => '',
|
251 |
+
'author_name' => '',
|
252 |
+
'post_status' => 'publish',
|
253 |
+
'suppress_filters' => true
|
254 |
+
), $args);
|
255 |
+
$args['posts_per_page'] = $max;
|
256 |
+
|
257 |
+
$posts = get_posts($args);
|
258 |
+
$options = array();
|
259 |
+
foreach ($posts as $post) {
|
260 |
+
$options['' . $post->ID] = $post->post_title;
|
261 |
+
}
|
262 |
+
|
263 |
+
$this->select($name, $options);
|
264 |
+
}
|
265 |
+
|
266 |
+
function page($name = 'page', $first = null) {
|
267 |
$pages = get_pages();
|
268 |
$options = array();
|
269 |
foreach ($pages as $page) {
|
471 |
} else {
|
472 |
echo '<input class="button-primary" type="button" value="' . esc_attr($label) . '" onclick="this.form.act.value=\'' . esc_attr($action) . '\';this.form.submit()"/>';
|
473 |
}
|
474 |
+
}
|
475 |
|
476 |
function button_confirm($action, $label, $message = '', $data = '') {
|
477 |
if (empty($message)) {
|
719 |
echo '</div>';
|
720 |
}
|
721 |
|
722 |
+
/**
|
723 |
* Creates a single select with the active preferences.
|
724 |
*/
|
725 |
function preferences_select($name = 'preference') {
|
1030 |
}
|
1031 |
|
1032 |
}
|
|
|
1033 |
?>
|
includes/helper.php
CHANGED
@@ -2,7 +2,8 @@
|
|
2 |
if (!defined('ABSPATH')) exit;
|
3 |
|
4 |
function tnp_post_thumbnail_src($post, $size = 'thumbnail') {
|
5 |
-
$
|
|
|
6 |
if (strpos($media[0], 'http') !== 0) $media[0] = 'http:' . $media[0];
|
7 |
return $media[0];
|
8 |
}
|
2 |
if (!defined('ABSPATH')) exit;
|
3 |
|
4 |
function tnp_post_thumbnail_src($post, $size = 'thumbnail') {
|
5 |
+
if (is_object($post)) $post = $post->ID;
|
6 |
+
$media = wp_get_attachment_image_src(get_post_thumbnail_id($post), $size);
|
7 |
if (strpos($media[0], 'http') !== 0) $media[0] = 'http:' . $media[0];
|
8 |
return $media[0];
|
9 |
}
|
includes/module.php
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
|
|
3 |
|
4 |
class NewsletterModule {
|
5 |
|
@@ -62,7 +64,7 @@ class NewsletterModule {
|
|
62 |
|
63 |
if ($this->old_version == '0.0.0') {
|
64 |
$this->first_install();
|
65 |
-
update_option($this->prefix."_first_install_time", time(), FALSE);
|
66 |
}
|
67 |
|
68 |
if (strcmp($this->old_version, $this->version) != 0) {
|
@@ -751,7 +753,8 @@ class NewsletterModule {
|
|
751 |
echo '<html><head></head><body>';
|
752 |
echo '<form method="post" action="' . home_url('/') . '" id="form">';
|
753 |
foreach ($_REQUEST as $name => $value) {
|
754 |
-
if ($name == 'submit')
|
|
|
755 |
if (is_array($value)) {
|
756 |
foreach ($value as $element) {
|
757 |
echo '<input type="hidden" name="';
|
@@ -781,6 +784,17 @@ class NewsletterModule {
|
|
781 |
die();
|
782 |
}
|
783 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
784 |
}
|
785 |
|
786 |
/**
|
1 |
<?php
|
2 |
+
|
3 |
+
if (!defined('ABSPATH'))
|
4 |
+
exit;
|
5 |
|
6 |
class NewsletterModule {
|
7 |
|
64 |
|
65 |
if ($this->old_version == '0.0.0') {
|
66 |
$this->first_install();
|
67 |
+
update_option($this->prefix . "_first_install_time", time(), FALSE);
|
68 |
}
|
69 |
|
70 |
if (strcmp($this->old_version, $this->version) != 0) {
|
753 |
echo '<html><head></head><body>';
|
754 |
echo '<form method="post" action="' . home_url('/') . '" id="form">';
|
755 |
foreach ($_REQUEST as $name => $value) {
|
756 |
+
if ($name == 'submit')
|
757 |
+
continue;
|
758 |
if (is_array($value)) {
|
759 |
foreach ($value as $element) {
|
760 |
echo '<input type="hidden" name="';
|
784 |
die();
|
785 |
}
|
786 |
|
787 |
+
static function extract_body($html) {
|
788 |
+
$x = stripos($html, '<body');
|
789 |
+
if ($x !== false) {
|
790 |
+
$x = strpos($html, '>', $x);
|
791 |
+
$y = strpos($html, '</body>');
|
792 |
+
return substr($html, $x + 1, $y - $x - 1);
|
793 |
+
} else {
|
794 |
+
return $html;
|
795 |
+
}
|
796 |
+
}
|
797 |
+
|
798 |
}
|
799 |
|
800 |
/**
|
plugin.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: Newsletter
|
5 |
Plugin URI: http://www.thenewsletterplugin.com/plugins/newsletter
|
6 |
Description: Newsletter is a cool plugin to create your own subscriber list, to send newsletters, to build your business. <strong>Before update give a look to <a href="http://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong>
|
7 |
-
Version: 4.8.
|
8 |
Author: Stefano Lissa & The Newsletter Team
|
9 |
Author URI: http://www.thenewsletterplugin.com
|
10 |
Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
|
@@ -14,7 +14,7 @@
|
|
14 |
*/
|
15 |
|
16 |
// Used as dummy parameter on css and js links
|
17 |
-
define('NEWSLETTER_VERSION', '4.8.
|
18 |
|
19 |
global $wpdb, $newsletter;
|
20 |
|
@@ -202,9 +202,7 @@ class Newsletter extends NewsletterModule {
|
|
202 |
wp_schedule_event(time() + 30, 'newsletter', 'newsletter');
|
203 |
}
|
204 |
|
205 |
-
|
206 |
-
add_action('wp_ajax_tnpc_preview', 'tnpc_preview_callback');
|
207 |
-
add_action('wp_ajax_tnpc_css', 'tnpc_css_callback');
|
208 |
|
209 |
add_action('admin_menu', array($this, 'add_extensions_menu'), 90);
|
210 |
}
|
@@ -435,8 +433,9 @@ class Newsletter extends NewsletterModule {
|
|
435 |
}
|
436 |
|
437 |
$action = isset($_REQUEST['na']) ? $_REQUEST['na'] : '';
|
438 |
-
if (empty($action) || is_admin())
|
439 |
return;
|
|
|
440 |
|
441 |
// TODO: Remove!
|
442 |
$cache_stop = true;
|
@@ -449,8 +448,9 @@ class Newsletter extends NewsletterModule {
|
|
449 |
|
450 |
if ($action == 'fu') {
|
451 |
$user = $this->check_user();
|
452 |
-
if ($user == null)
|
453 |
die('No user');
|
|
|
454 |
$wpdb->query("update " . NEWSLETTER_USERS_TABLE . " set followup=2 where id=" . $user->id);
|
455 |
$options_followup = get_option('newsletter_followup');
|
456 |
$this->message = $options_followup['unsubscribed_text'];
|
@@ -476,6 +476,10 @@ class Newsletter extends NewsletterModule {
|
|
476 |
}
|
477 |
|
478 |
function hook_admin_head() {
|
|
|
|
|
|
|
|
|
479 |
if ($this->is_admin_page()) {
|
480 |
echo '<link type="text/css" rel="stylesheet" href="' . plugins_url('newsletter') . '/admin.css?' . time() . '"/>';
|
481 |
echo '<script src="' . plugins_url('newsletter') . '/admin.js?' . NEWSLETTER_VERSION . '"></script>';
|
@@ -1435,7 +1439,9 @@ require_once NEWSLETTER_DIR . '/subscription/subscription.php';
|
|
1435 |
require_once NEWSLETTER_DIR . '/emails/emails.php';
|
1436 |
require_once NEWSLETTER_DIR . '/users/users.php';
|
1437 |
require_once NEWSLETTER_DIR . '/statistics/statistics.php';
|
1438 |
-
|
|
|
|
|
1439 |
require_once NEWSLETTER_DIR . '/wp/wp.php';
|
1440 |
|
1441 |
if (!is_dir(WP_PLUGIN_DIR . '/newsletter-feed')) {
|
@@ -1499,7 +1505,7 @@ function newsletter_activate() {
|
|
1499 |
NewsletterEmails::instance()->upgrade();
|
1500 |
NewsletterSubscription::instance()->upgrade();
|
1501 |
NewsletterStatistics::instance()->upgrade();
|
1502 |
-
NewsletterLock::instance()->upgrade();
|
1503 |
NewsletterWp::instance()->upgrade();
|
1504 |
}
|
1505 |
|
@@ -1508,29 +1514,3 @@ register_activation_hook(__FILE__, 'newsletter_deactivate');
|
|
1508 |
function newsletter_deactivate() {
|
1509 |
|
1510 |
}
|
1511 |
-
|
1512 |
-
function tnpc_render_callback() {
|
1513 |
-
$block_options = get_option('newsletter_main');
|
1514 |
-
include NEWSLETTER_DIR . '/emails/tnp-composer/blocks/' . sanitize_file_name($_POST['b']) . '.php';
|
1515 |
-
wp_die(); // this is required to terminate immediately and return a proper response
|
1516 |
-
}
|
1517 |
-
|
1518 |
-
function tnpc_preview_callback() {
|
1519 |
-
|
1520 |
-
$id = (int) ($_POST['id'] ? $_POST['id'] : $_GET['id']);
|
1521 |
-
$email = Newsletter::instance()->get_email($id, ARRAY_A);
|
1522 |
-
|
1523 |
-
if (empty($email)) {
|
1524 |
-
echo 'Wrong email identifier';
|
1525 |
-
return;
|
1526 |
-
}
|
1527 |
-
|
1528 |
-
echo $email['message'];
|
1529 |
-
|
1530 |
-
wp_die(); // this is required to terminate immediately and return a proper response
|
1531 |
-
}
|
1532 |
-
|
1533 |
-
function tnpc_css_callback() {
|
1534 |
-
include NEWSLETTER_DIR . '/emails/tnp-composer/css/newsletter.css';
|
1535 |
-
wp_die(); // this is required to terminate immediately and return a proper response
|
1536 |
-
}
|
4 |
Plugin Name: Newsletter
|
5 |
Plugin URI: http://www.thenewsletterplugin.com/plugins/newsletter
|
6 |
Description: Newsletter is a cool plugin to create your own subscriber list, to send newsletters, to build your business. <strong>Before update give a look to <a href="http://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong>
|
7 |
+
Version: 4.8.4
|
8 |
Author: Stefano Lissa & The Newsletter Team
|
9 |
Author URI: http://www.thenewsletterplugin.com
|
10 |
Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
|
14 |
*/
|
15 |
|
16 |
// Used as dummy parameter on css and js links
|
17 |
+
define('NEWSLETTER_VERSION', '4.8.4');
|
18 |
|
19 |
global $wpdb, $newsletter;
|
20 |
|
202 |
wp_schedule_event(time() + 30, 'newsletter', 'newsletter');
|
203 |
}
|
204 |
|
205 |
+
|
|
|
|
|
206 |
|
207 |
add_action('admin_menu', array($this, 'add_extensions_menu'), 90);
|
208 |
}
|
433 |
}
|
434 |
|
435 |
$action = isset($_REQUEST['na']) ? $_REQUEST['na'] : '';
|
436 |
+
if (empty($action) || is_admin()) {
|
437 |
return;
|
438 |
+
}
|
439 |
|
440 |
// TODO: Remove!
|
441 |
$cache_stop = true;
|
448 |
|
449 |
if ($action == 'fu') {
|
450 |
$user = $this->check_user();
|
451 |
+
if ($user == null) {
|
452 |
die('No user');
|
453 |
+
}
|
454 |
$wpdb->query("update " . NEWSLETTER_USERS_TABLE . " set followup=2 where id=" . $user->id);
|
455 |
$options_followup = get_option('newsletter_followup');
|
456 |
$this->message = $options_followup['unsubscribed_text'];
|
476 |
}
|
477 |
|
478 |
function hook_admin_head() {
|
479 |
+
// Small global rule for sidebar menu entries
|
480 |
+
echo '<style>';
|
481 |
+
echo '.tnp-side-menu { color: #E67E22!important; }';
|
482 |
+
echo '</style>';
|
483 |
if ($this->is_admin_page()) {
|
484 |
echo '<link type="text/css" rel="stylesheet" href="' . plugins_url('newsletter') . '/admin.css?' . time() . '"/>';
|
485 |
echo '<script src="' . plugins_url('newsletter') . '/admin.js?' . NEWSLETTER_VERSION . '"></script>';
|
1439 |
require_once NEWSLETTER_DIR . '/emails/emails.php';
|
1440 |
require_once NEWSLETTER_DIR . '/users/users.php';
|
1441 |
require_once NEWSLETTER_DIR . '/statistics/statistics.php';
|
1442 |
+
if (!file_exists(WP_PLUGIN_DIR . '/newsletter-lock')) {
|
1443 |
+
require_once NEWSLETTER_DIR . '/lock/lock.php';
|
1444 |
+
}
|
1445 |
require_once NEWSLETTER_DIR . '/wp/wp.php';
|
1446 |
|
1447 |
if (!is_dir(WP_PLUGIN_DIR . '/newsletter-feed')) {
|
1505 |
NewsletterEmails::instance()->upgrade();
|
1506 |
NewsletterSubscription::instance()->upgrade();
|
1507 |
NewsletterStatistics::instance()->upgrade();
|
1508 |
+
//NewsletterLock::instance()->upgrade();
|
1509 |
NewsletterWp::instance()->upgrade();
|
1510 |
}
|
1511 |
|
1514 |
function newsletter_deactivate() {
|
1515 |
|
1516 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
Tags: newsletter,email,subscription,mass mail,list build,email marketing,direct mailing,automation,automated
|
3 |
Requires at least: 3.4.0
|
4 |
Tested up to: 4.7.2
|
5 |
-
Stable tag: 4.8.
|
6 |
Contributors: satollo,webagile,michael-travan
|
7 |
|
8 |
Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
|
@@ -77,6 +77,13 @@ Thank you, The Newsletter Team
|
|
77 |
|
78 |
== Changelog ==
|
79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
= 4.8.3 =
|
81 |
|
82 |
* Fixed debug notices on widgets
|
2 |
Tags: newsletter,email,subscription,mass mail,list build,email marketing,direct mailing,automation,automated
|
3 |
Requires at least: 3.4.0
|
4 |
Tested up to: 4.7.2
|
5 |
+
Stable tag: 4.8.4
|
6 |
Contributors: satollo,webagile,michael-travan
|
7 |
|
8 |
Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
|
77 |
|
78 |
== Changelog ==
|
79 |
|
80 |
+
= 4.8.4 =
|
81 |
+
|
82 |
+
* Fixed posts block background editing
|
83 |
+
* Composer js improvements
|
84 |
+
* Fixed a couple of debug notices
|
85 |
+
* CSS fix
|
86 |
+
|
87 |
= 4.8.3 =
|
88 |
|
89 |
* Fixed debug notices on widgets
|
subscription/subscription.php
CHANGED
@@ -118,7 +118,9 @@ class NewsletterSubscription extends NewsletterModule {
|
|
118 |
$key = 'confirmation';
|
119 |
$module = NewsletterSubscription::instance();
|
120 |
$message = $newsletter->replace($module->options[$key . '_text'], $user);
|
121 |
-
|
|
|
|
|
122 |
echo $message;
|
123 |
die();
|
124 |
|
118 |
$key = 'confirmation';
|
119 |
$module = NewsletterSubscription::instance();
|
120 |
$message = $newsletter->replace($module->options[$key . '_text'], $user);
|
121 |
+
if (isset($module->options[$key . '_tracking'])) {
|
122 |
+
$message .= $module->options[$key . '_tracking'];
|
123 |
+
}
|
124 |
echo $message;
|
125 |
die();
|
126 |
|
users/index.php
CHANGED
@@ -226,7 +226,7 @@ $controls->data['search_page']++;
|
|
226 |
<?php
|
227 |
for ($i=1; $i<=NEWSLETTER_LIST_MAX; $i++) {
|
228 |
$l = 'list_' . $i;
|
229 |
-
if ($s->$l == 1) echo $lists['' . $i] . '<br />';
|
230 |
}
|
231 |
?>
|
232 |
</small>
|
226 |
<?php
|
227 |
for ($i=1; $i<=NEWSLETTER_LIST_MAX; $i++) {
|
228 |
$l = 'list_' . $i;
|
229 |
+
if ($s->$l == 1) echo esc_html($lists['' . $i]) . '<br />';
|
230 |
}
|
231 |
?>
|
232 |
</small>
|