Popup Builder – Responsive WordPress Pop up - Version 3.68.5

Version Description

Current Version of Popup Builder is 3.68.5

Download this release

Release Info

Developer Sygnoos
Plugin Icon 128x128 Popup Builder – Responsive WordPress Pop up
Version 3.68.5
Comparing to
See all releases

Code changes from version 3.68.4 to 3.68.5

com/classes/Actions.php CHANGED
@@ -691,7 +691,6 @@ class Actions
691
  update_option('SGPB_NEWSLETTER_'.$subscriptionFormId, ++$successCount);
692
  }
693
  }
694
-
695
  // Update the status of all the sent mails
696
  $updateStatusQuery = $wpdb->prepare('UPDATE '.$wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME.' SET status = 1 where id >= %d and subscriptionType = %d limit %d', $currentStateEmailId, $subscriptionFormId, $emailsInFlow);
697
  $wpdb->query($updateStatusQuery);
@@ -863,11 +862,11 @@ class Actions
863
  /**
864
  * Check Popup is satisfy for popup condition
865
  *
866
- * @since 1.0.0
867
- *
868
  * @param array $args
869
  *
870
- * @return bool
 
 
871
  *
872
  */
873
  public function conditionsSatisfy($args = array())
691
  update_option('SGPB_NEWSLETTER_'.$subscriptionFormId, ++$successCount);
692
  }
693
  }
 
694
  // Update the status of all the sent mails
695
  $updateStatusQuery = $wpdb->prepare('UPDATE '.$wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME.' SET status = 1 where id >= %d and subscriptionType = %d limit %d', $currentStateEmailId, $subscriptionFormId, $emailsInFlow);
696
  $wpdb->query($updateStatusQuery);
862
  /**
863
  * Check Popup is satisfy for popup condition
864
  *
 
 
865
  * @param array $args
866
  *
867
+ * @return array
868
+ *
869
+ *@since 1.0.0
870
  *
871
  */
872
  public function conditionsSatisfy($args = array())
com/classes/Feedback.php CHANGED
@@ -5,17 +5,19 @@ class SGPBFeedback
5
  {
6
  public function __construct()
7
  {
8
- add_action('current_screen', function () {
9
- if (!$this->isPluginsScreen()) {
10
- return;
11
- }
12
-
13
- add_filter('sgpbAdminJsFiles', array($this, 'adminJsFilter'), 1, 1);
14
- add_action('admin_footer', array($this, 'renderDeactivateFeedbackDialog'));
15
- } );
16
  add_action('wp_ajax_sgpb_deactivate_feedback', array($this, 'sgpbDeactivateFeedback'));
17
  }
18
 
 
 
 
 
 
 
 
 
 
19
  public function adminJsFilter($jsFiles)
20
  {
21
  $jsFiles[] = array(
5
  {
6
  public function __construct()
7
  {
8
+ add_action('current_screen', array($this, 'actionToCurrentScreen'));
 
 
 
 
 
 
 
9
  add_action('wp_ajax_sgpb_deactivate_feedback', array($this, 'sgpbDeactivateFeedback'));
10
  }
11
 
12
+ public function actionToCurrentScreen() {
13
+ if (!$this->isPluginsScreen()) {
14
+ return;
15
+ }
16
+
17
+ add_filter('sgpbAdminJsFiles', array($this, 'adminJsFilter'), 1, 1);
18
+ add_action('admin_footer', array($this, 'renderDeactivateFeedbackDialog'));
19
+ }
20
+
21
  public function adminJsFilter($jsFiles)
22
  {
23
  $jsFiles[] = array(
com/classes/Filters.php CHANGED
@@ -53,6 +53,50 @@ class Filters
53
  add_filter( 'rank_math/sitemap/exclude_post_type', array($this, 'excludeRankMath'), 10, 2 );
54
  add_filter('sgpbUserSelectionQuery', array($this, 'userSelectionQueryAddExtraAttributes'), 100, 1);
55
  add_filter('sgpbFilterOptionsBeforeSaving', array($this, 'filterOptionsBeforeSaving'), 100, 1);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  }
57
 
58
  public function filterOptionsBeforeSaving($unfilteredData = array())
@@ -404,6 +448,14 @@ class Filters
404
  'priority' => 'low'
405
  );
406
 
 
 
 
 
 
 
 
 
407
  return $metaboxes;
408
  }
409
 
@@ -640,11 +692,10 @@ class Filters
640
 
641
  $content = str_replace(' src="'.$urls[$key].'"', ' src="" data-attr-src="'.esc_attr($urls[$key]).'"', $content);
642
  }
643
-
644
  if (function_exists('do_blocks')) {
645
- $content = do_blocks($content);
646
- }
647
-
648
  return do_shortcode($content);
649
  }
650
 
53
  add_filter( 'rank_math/sitemap/exclude_post_type', array($this, 'excludeRankMath'), 10, 2 );
54
  add_filter('sgpbUserSelectionQuery', array($this, 'userSelectionQueryAddExtraAttributes'), 100, 1);
55
  add_filter('sgpbFilterOptionsBeforeSaving', array($this, 'filterOptionsBeforeSaving'), 100, 1);
56
+ add_filter('sgpbPopupExtraData', array($this, 'popupExtraDataRender'), 100, 2);
57
+ }
58
+
59
+ public function popupExtraDataRender($popupId = 0, $popupOptions = array())
60
+ {
61
+ $floatingButton = '';
62
+ if (empty($popupOptions['sgpb-enable-floating-button'])) {
63
+ return $floatingButton;
64
+ }
65
+ $buttonStyles = '';
66
+ $buttonClass = 'sgpb-'.$popupOptions['sgpb-floating-button-style'].'-'.$popupOptions['sgpb-floating-button-position'];
67
+
68
+ if (isset($popupOptions['sgpb-floating-button-style']) && $popupOptions['sgpb-floating-button-style'] == 'basic' && strstr($popupOptions['sgpb-floating-button-position'], 'center')) {
69
+ if (strstr($popupOptions['sgpb-floating-button-position'], 'top') || strstr($popupOptions['sgpb-floating-button-position'], 'bottom')) {
70
+ $buttonStyles .= 'right: '.$popupOptions['sgpb-floating-button-position-right'].'%;';
71
+ }
72
+ else if (strstr($popupOptions['sgpb-floating-button-position'], 'left') || strstr($popupOptions['sgpb-floating-button-position'], 'right')) {
73
+ $buttonStyles .= 'top: '.$popupOptions['sgpb-floating-button-position-top'].'%;';
74
+ }
75
+ }
76
+
77
+ if (isset($popupOptions['sgpb-floating-button-font-size'])) {
78
+ $buttonStyles .= 'font-size: '.$popupOptions['sgpb-floating-button-font-size'].'px;';
79
+ }
80
+ if (isset($popupOptions['sgpb-floating-button-border-size'])) {
81
+ $buttonStyles .= 'border-width: '.$popupOptions['sgpb-floating-button-border-size'].'px;';
82
+ $buttonStyles .= 'border-style: solid;';
83
+ }
84
+ if (isset($popupOptions['sgpb-floating-button-border-radius'])) {
85
+ $buttonStyles .= 'border-radius: '.$popupOptions['sgpb-floating-button-border-radius'].'px;';
86
+ }
87
+ if (isset($popupOptions['sgpb-floating-button-border-color'])) {
88
+ $buttonStyles .= 'border-color: '.$popupOptions['sgpb-floating-button-border-color'].';';
89
+ }
90
+ if (isset($popupOptions['sgpb-floating-button-bg-color'])) {
91
+ $buttonStyles .= 'background-color: '.$popupOptions['sgpb-floating-button-bg-color'].';';
92
+ }
93
+ if (isset($popupOptions['sgpb-floating-button-text-color'])) {
94
+ $buttonStyles .= 'color: '.$popupOptions['sgpb-floating-button-text-color'].';';
95
+ }
96
+
97
+ $floatingButton = '<button class="'.$buttonClass.' sgpb-floating-button sg-popup-id-'.$popupId.'" style="'.$buttonStyles.'">'.$popupOptions['sgpb-floating-button-text'].'</button>';
98
+
99
+ echo $floatingButton;
100
  }
101
 
102
  public function filterOptionsBeforeSaving($unfilteredData = array())
448
  'priority' => 'low'
449
  );
450
 
451
+ $metaboxes['floatingButton'] = array(
452
+ 'key' => 'floatingButton',
453
+ 'displayName' => 'Floating Button',
454
+ 'filePath' => SG_POPUP_VIEWS_PATH.'floatingButton.php',
455
+ 'context' => 'side',
456
+ 'priority' => 'high'
457
+ );
458
+
459
  return $metaboxes;
460
  }
461
 
692
 
693
  $content = str_replace(' src="'.$urls[$key].'"', ' src="" data-attr-src="'.esc_attr($urls[$key]).'"', $content);
694
  }
 
695
  if (function_exists('do_blocks')) {
696
+ $content = do_blocks($content);
697
+ }
698
+
699
  return do_shortcode($content);
700
  }
701
 
com/classes/NotificationCenter.php CHANGED
@@ -4,7 +4,6 @@ use sgpb\AdminHelper;
4
 
5
  class SGPBNotificationCenter
6
  {
7
- private $notificationsCount = 0;
8
  private $requestUrl = SG_POPUP_BUILDER_NOTIFICATIONS_URL;
9
  private $cronTimeout = 'daily';
10
 
4
 
5
  class SGPBNotificationCenter
6
  {
 
7
  private $requestUrl = SG_POPUP_BUILDER_NOTIFICATIONS_URL;
8
  private $cronTimeout = 'daily';
9
 
com/classes/ScriptsLoader.php CHANGED
@@ -108,17 +108,17 @@ class ScriptsLoader
108
  }
109
  self::$alreadyLoadedPopups[$popupId] = $events;
110
  $events = json_encode($events);
111
-
 
112
  $popupOptions = $this->getEncodedOptionsFromPopup($popup);
113
  $popupOptions = apply_filters('sgpbLoadToFooterOptions', $popupOptions);
114
-
115
  add_action('wp_footer', function() use ($popupId, $events, $popupOptions, $popupContent) {
116
  $footerPopupContent = '<div style="position:fixed;bottom: -999999999999999999999px;">
117
  <div class="sg-popup-builder-content" id="sg-popup-content-wrapper-'.$popupId.'" data-id="'.esc_attr($popupId).'" data-events="'.esc_attr($events).'" data-options="'.esc_attr($popupOptions).'">
118
  <div class="sgpb-popup-builder-content-'.esc_attr($popupId).' sgpb-popup-builder-content-html">'.$popupContent.'</div>
119
  </div>
120
  </div>';
121
-
122
  echo $footerPopupContent;
123
  });
124
  }
108
  }
109
  self::$alreadyLoadedPopups[$popupId] = $events;
110
  $events = json_encode($events);
111
+ $currentUseOptions = $popup->getOptions();
112
+ $extraContent = apply_filters('sgpbPopupExtraData', $popupId, $currentUseOptions);
113
  $popupOptions = $this->getEncodedOptionsFromPopup($popup);
114
  $popupOptions = apply_filters('sgpbLoadToFooterOptions', $popupOptions);
 
115
  add_action('wp_footer', function() use ($popupId, $events, $popupOptions, $popupContent) {
116
  $footerPopupContent = '<div style="position:fixed;bottom: -999999999999999999999px;">
117
  <div class="sg-popup-builder-content" id="sg-popup-content-wrapper-'.$popupId.'" data-id="'.esc_attr($popupId).'" data-events="'.esc_attr($events).'" data-options="'.esc_attr($popupOptions).'">
118
  <div class="sgpb-popup-builder-content-'.esc_attr($popupId).' sgpb-popup-builder-content-html">'.$popupContent.'</div>
119
  </div>
120
  </div>';
121
+ $footerPopupContent .= $extraContent;
122
  echo $footerPopupContent;
123
  });
124
  }
com/classes/extension/SgpbPopupExtension.php CHANGED
@@ -41,7 +41,7 @@ class SgpbPopupExtension implements SgpbIPopupExtension
41
  'reviewUrl' => SG_POPUP_RATE_US_URL
42
  )
43
  );
44
-
45
  $allowPages = array(
46
  'popupType',
47
  'editpage',
@@ -97,6 +97,7 @@ class SgpbPopupExtension implements SgpbIPopupExtension
97
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'bootstrap.min.js');
98
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'sgPopupRangeSlider.js');
99
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'Backend.js');
 
100
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'NotificationCenter.js');
101
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'Popup.js');
102
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'PopupConfig.js');
@@ -134,7 +135,7 @@ class SgpbPopupExtension implements SgpbIPopupExtension
134
  'handle' => 'Backend.js',
135
  'name' => 'SGPB_JS_LOCALIZATION',
136
  'data' => $translatedData
137
- );
138
 
139
  $localizeData[] = array(
140
  'handle' => 'Popup.js',
41
  'reviewUrl' => SG_POPUP_RATE_US_URL
42
  )
43
  );
44
+
45
  $allowPages = array(
46
  'popupType',
47
  'editpage',
97
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'bootstrap.min.js');
98
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'sgPopupRangeSlider.js');
99
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'Backend.js');
100
+ $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'FloatingButton.js', 'dep' => array('Backend.js'),);
101
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'NotificationCenter.js');
102
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'Popup.js');
103
  $jsFiles[] = array('folderUrl'=> SG_POPUP_JS_URL, 'filename' => 'PopupConfig.js');
135
  'handle' => 'Backend.js',
136
  'name' => 'SGPB_JS_LOCALIZATION',
137
  'data' => $translatedData
138
+ );
139
 
140
  $localizeData[] = array(
141
  'handle' => 'Popup.js',
com/classes/extension/SgpbPopupExtensionActivator.php CHANGED
@@ -71,7 +71,7 @@ class PopupExtensionActivator
71
 
72
  private function moveExtensionToPluginsSection($extensionsInfo)
73
  {
74
- foreach ($extensionsInfo as $extensionFolder => $extensionsInfo) {
75
  $passedExtension = WP_PLUGIN_DIR.DIRECTORY_SEPARATOR.$extensionFolder.DIRECTORY_SEPARATOR;
76
  $originalExtension = SG_POPUP_BUILDER_PATH.'extensions'.DIRECTORY_SEPARATOR.$extensionFolder.DIRECTORY_SEPARATOR;
77
  @rename($originalExtension,$passedExtension);
71
 
72
  private function moveExtensionToPluginsSection($extensionsInfo)
73
  {
74
+ foreach ($extensionsInfo as $extensionFolder => $extensionsDetail) {
75
  $passedExtension = WP_PLUGIN_DIR.DIRECTORY_SEPARATOR.$extensionFolder.DIRECTORY_SEPARATOR;
76
  $originalExtension = SG_POPUP_BUILDER_PATH.'extensions'.DIRECTORY_SEPARATOR.$extensionFolder.DIRECTORY_SEPARATOR;
77
  @rename($originalExtension,$passedExtension);
com/classes/popups/SGPopup.php CHANGED
@@ -157,6 +157,10 @@ abstract class SGPopup
157
  $events = array_merge($events, $optionEvents);
158
  }
159
 
 
 
 
 
160
  return apply_filters('sgpbPopupEvents', $events, $popupObj);
161
  }
162
 
@@ -375,9 +379,6 @@ abstract class SGPopup
375
  case 'email':
376
  $sanitizedValue = sanitize_email($value);
377
  break;
378
- case "checkbox":
379
- $sanitizedValue = sanitize_text_field($value);
380
- break;
381
  case 'sgpb':
382
  $sanitizedValue = $this->recursiveHtmlSpecialchars($value);
383
  break;
157
  $events = array_merge($events, $optionEvents);
158
  }
159
 
160
+ if (!empty($popupObj->getOptionValue('sgpb-enable-floating-button'))) {
161
+ $events[] = array('param' => 'setByCssClass', 'hiddenOption' => array());
162
+ }
163
+
164
  return apply_filters('sgpbPopupEvents', $events, $popupObj);
165
  }
166
 
379
  case 'email':
380
  $sanitizedValue = sanitize_email($value);
381
  break;
 
 
 
382
  case 'sgpb':
383
  $sanitizedValue = $this->recursiveHtmlSpecialchars($value);
384
  break;
com/config/configPackage.php CHANGED
@@ -3,6 +3,6 @@ if (!defined('ABSPATH')) {
3
  exit();
4
  }
5
 
6
- define('SG_POPUP_VERSION', '3.68.4');
7
  define('SGPB_POPUP_PKG', SGPB_POPUP_PKG_FREE);
8
  define('POPUP_BUILDER_BASENAME', 'popupbuilder-platinum/popup-builder.php');
3
  exit();
4
  }
5
 
6
+ define('SG_POPUP_VERSION', '3.68.5');
7
  define('SGPB_POPUP_PKG', SGPB_POPUP_PKG_FREE);
8
  define('POPUP_BUILDER_BASENAME', 'popupbuilder-platinum/popup-builder.php');
com/config/dataConfig.php CHANGED
@@ -914,6 +914,19 @@ class SgpbDataConfig
914
  $options[] = array('name' => 'sgpb-show-popup-same-user-expiry', 'type' => 'number', 'defaultValue' => 1);
915
  $options[] = array('name' => 'sgpb-show-popup-same-user-page-level', 'type' => 'checkbox', 'defaultValue' => '');
916
 
 
 
 
 
 
 
 
 
 
 
 
 
 
917
  $SGPB_OPTIONS = apply_filters('sgpbPopupDefaultOptions', $options);
918
  }
919
 
914
  $options[] = array('name' => 'sgpb-show-popup-same-user-expiry', 'type' => 'number', 'defaultValue' => 1);
915
  $options[] = array('name' => 'sgpb-show-popup-same-user-page-level', 'type' => 'checkbox', 'defaultValue' => '');
916
 
917
+ $options[] = array('name' => 'sgpb-enable-floating-button', 'type' => 'checkbox', 'defaultValue' => '');
918
+ $options[] = array('name' => 'sgpb-floating-button-style', 'type' => 'text', 'defaultValue' => 'corner');
919
+ $options[] = array('name' => 'sgpb-floating-button-position', 'type' => 'text', 'defaultValue' => 'bottom-right');
920
+ $options[] = array('name' => 'sgpb-floating-button-position-top', 'type' => 'text', 'defaultValue' => '40');
921
+ $options[] = array('name' => 'sgpb-floating-button-position-right', 'type' => 'text', 'defaultValue' => '50');
922
+ $options[] = array('name' => 'sgpb-floating-button-font-size', 'type' => 'number', 'defaultValue' => 16);
923
+ $options[] = array('name' => 'sgpb-floating-button-border-size', 'type' => 'number', 'defaultValue' => 5);
924
+ $options[] = array('name' => 'sgpb-floating-button-border-radius', 'type' => 'number', 'defaultValue' => 5);
925
+ $options[] = array('name' => 'sgpb-floating-button-border-color', 'type' => 'text', 'defaultValue' => '#5263eb');
926
+ $options[] = array('name' => 'sgpb-floating-button-bg-color', 'type' => 'text', 'defaultValue' => '#5263eb');
927
+ $options[] = array('name' => 'sgpb-floating-button-text-color', 'type' => 'text', 'defaultValue' => '#ffffff');
928
+ $options[] = array('name' => 'sgpb-floating-button-text', 'type' => 'text', 'defaultValue' => __('Click it!'));
929
+
930
  $SGPB_OPTIONS = apply_filters('sgpbPopupDefaultOptions', $options);
931
  }
932
 
com/helpers/AdminHelper.php CHANGED
@@ -100,30 +100,6 @@ class AdminHelper
100
  return $popupTypeClassName;
101
  }
102
 
103
- public static function getPopupTargetParam($param)
104
- {
105
- global $SGPB_DATA_CONFIG_ARRAY;
106
- $targetData = $SGPB_DATA_CONFIG_ARRAY['target'];
107
-
108
- if (empty($targetData[$param])) {
109
- return '';
110
- }
111
-
112
- return $targetData[$param];
113
- }
114
-
115
- public static function getPopupTargetParamType($param)
116
- {
117
- global $SGPB_DATA_CONFIG_ARRAY;
118
- $targetDataTypes = $SGPB_DATA_CONFIG_ARRAY['target']['types'];
119
-
120
- if (empty($targetDataTypes[$param])) {
121
- return '';
122
- }
123
-
124
- return $targetDataTypes[$param];
125
- }
126
-
127
  public static function createSelectBox($data, $selectedValue, $attrs)
128
  {
129
  $attrString = '';
@@ -381,18 +357,12 @@ class AdminHelper
381
  {
382
  if ($popupId) {
383
  if ($theme == 'sgpb-theme-1' || $theme == 'sgpb-theme-4' || $theme == 'sgpb-theme-5') {
384
- if (isset($buttonPosition)) {
385
- $buttonPosition = $buttonPosition;
386
- }
387
- else {
388
  $buttonPosition = 'bottomRight';
389
  }
390
  }
391
  else if ($theme == 'sgpb-theme-2' || $theme == 'sgpb-theme-3' || $theme == 'sgpb-theme-6') {
392
- if (isset($buttonPosition)) {
393
- $buttonPosition = $buttonPosition;
394
- }
395
- else {
396
  $buttonPosition = 'topRight';
397
  }
398
  }
@@ -987,33 +957,6 @@ class AdminHelper
987
  return $isActive;
988
  }
989
 
990
- public static function getMaxCountPopup()
991
- {
992
- $allPopups = SGPopup::getAllPopups();
993
- $dontShowPopup = get_option('sgpbDontShowAskReviewBanner');
994
- if ($dontShowPopup) {
995
- return false;
996
- }
997
- $result = array();
998
-
999
- if (empty($allPopups)) {
1000
- return false;
1001
- }
1002
- foreach ($allPopups as $popup) {
1003
- if (empty($popup)) {
1004
- continue;
1005
- }
1006
- $popupId = $popup->getId();
1007
- $count = SGPopup::getPopupOpeningCountById($popupId);
1008
-
1009
- $title = $popup->getTitle();
1010
- $result['title'] = $title;
1011
- $result['count'] = $count;
1012
- }
1013
-
1014
- return $result;
1015
- }
1016
-
1017
  public static function supportBannerNotification()
1018
  {
1019
  $content = '<div class="sgpb-support-notification-wrapper sgpb-wrapper"><h4 class="sgpb-support-notification-title">'.__('Need some help?', SG_POPUP_TEXT_DOMAIN).'</h4>';
@@ -1289,13 +1232,6 @@ class AdminHelper
1289
  return $data;
1290
  }
1291
 
1292
- public static function getBannerText()
1293
- {
1294
- $bannerText = get_option('sgpb-banner-remote-get');
1295
-
1296
- return $bannerText;
1297
- }
1298
-
1299
  public static function getRightMetaboxBannerText()
1300
  {
1301
  $bannerText = get_option('sgpb-metabox-banner-remote-get');
@@ -1377,47 +1313,13 @@ class AdminHelper
1377
  return get_post_meta($popupId, '_wpb_shortcodes_custom_css', true);
1378
  }
1379
 
1380
- // countdown popup
1381
- public static function renderCountdownStyles($popupId = 0, $countdownBgColor, $countdownTextColor)
1382
- {
1383
- return "<style type='text/css'>
1384
- .sgpb-counts-content.sgpb-flipclock-js-$popupId.flip-clock-wrapper ul li a div div.inn {
1385
- background-color: $countdownBgColor;
1386
- color: $countdownTextColor;
1387
- }
1388
- .sgpb-countdown-wrapper {
1389
- width: 446px;
1390
- height: 130px;
1391
- padding-top: 22px;
1392
- box-sizing: border-box;
1393
- margin: 0 auto;
1394
- }
1395
- .sgpb-counts-content {
1396
- display: inline-block;
1397
- }
1398
- .sgpb-counts-content > ul.flip {
1399
- width: 40px;
1400
- margin: 4px;
1401
- }
1402
- </style>";
1403
- }
1404
-
1405
- // countdown popup scripts and params
1406
- public static function renderCountdownScript($id, $seconds, $type, $language, $timezone, $autoclose)
1407
- {
1408
- $params = array(
1409
- 'id' => $id,
1410
- 'seconds' => $seconds,
1411
- 'type' => $type,
1412
- 'language' => $language,
1413
- 'timezone' => $timezone,
1414
- 'autoclose' => $autoclose
1415
- );
1416
-
1417
- return $params;
1418
- }
1419
-
1420
- // countdown popup, convert date to seconds
1421
  public static function dateToSeconds($dueDate, $timezone)
1422
  {
1423
  if (empty($timezone)) {
@@ -1453,42 +1355,6 @@ class AdminHelper
1453
  return $protocol;
1454
  }
1455
 
1456
- public static function getCurrentUrl()
1457
- {
1458
- $protocol = self::getSiteProtocol();
1459
- $currentUrl = $protocol."://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
1460
-
1461
- return $currentUrl;
1462
- }
1463
-
1464
- public static function isAppleMobileDevice()
1465
- {
1466
- $isIOS = false;
1467
-
1468
- $useragent = @$_SERVER['HTTP_USER_AGENT'];
1469
- preg_match('/iPhone|Android|iPad|iPod|webOS/', $useragent, $matches);
1470
-
1471
- $os = current($matches);
1472
- if ($os == 'iPad' || $os == 'iPhone' || $os == 'iPod') {
1473
- $isIOS = true;
1474
- }
1475
-
1476
- return $isIOS;
1477
- }
1478
-
1479
- public static function setPushToBottom($element = '')
1480
- {
1481
- $style = '<style type="text/css">';
1482
- $style .= "$element";
1483
- $style .= '{position: absolute !important;';
1484
- $style .= 'left: 0 !important;';
1485
- $style .= 'right: 0 !important;';
1486
- $style .= 'bottom: 2px !important;}';
1487
- $style .= '</style>';
1488
-
1489
- return $style;
1490
- }
1491
-
1492
  public static function findSubscribersByEmail($subscriberEmail = '', $list = 0)
1493
  {
1494
  global $wpdb;
@@ -1615,14 +1481,6 @@ class AdminHelper
1615
  return $hasInactiveExtensions;
1616
  }
1617
 
1618
- public static function getSubscriberDataById($id)
1619
- {
1620
- global $wpdb;
1621
- $result = $wpdb->get_row('SELECT * FROM '.$wpdb->prefix.SGPB_SUBSCRIBERS_TABLE_NAME.' WHERE id='.$id, ARRAY_A);
1622
-
1623
- return $result;
1624
- }
1625
-
1626
  public static function getSubscriptionColumnsById($id)
1627
  {
1628
  $popup = SGPopup::find($id);
@@ -2056,9 +1914,6 @@ class AdminHelper
2056
  // finally get the correct version number
2057
  $known = array('Version', $ub, 'other');
2058
  $pattern = '#(?<browser>'.join('|', $known).')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';
2059
- if (!preg_match_all($pattern, $uAgent, $matches)) {
2060
- // we have no matching number just continue
2061
- }
2062
  // see how many we have
2063
  $i = count($matches['browser']);
2064
  //we will have two since we are not using 'other' argument yet
100
  return $popupTypeClassName;
101
  }
102
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  public static function createSelectBox($data, $selectedValue, $attrs)
104
  {
105
  $attrString = '';
357
  {
358
  if ($popupId) {
359
  if ($theme == 'sgpb-theme-1' || $theme == 'sgpb-theme-4' || $theme == 'sgpb-theme-5') {
360
+ if (!isset($buttonPosition)) {
 
 
 
361
  $buttonPosition = 'bottomRight';
362
  }
363
  }
364
  else if ($theme == 'sgpb-theme-2' || $theme == 'sgpb-theme-3' || $theme == 'sgpb-theme-6') {
365
+ if (!isset($buttonPosition)) {
 
 
 
366
  $buttonPosition = 'topRight';
367
  }
368
  }
957
  return $isActive;
958
  }
959
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
960
  public static function supportBannerNotification()
961
  {
962
  $content = '<div class="sgpb-support-notification-wrapper sgpb-wrapper"><h4 class="sgpb-support-notification-title">'.__('Need some help?', SG_POPUP_TEXT_DOMAIN).'</h4>';
1232
  return $data;
1233
  }
1234
 
 
 
 
 
 
 
 
1235
  public static function getRightMetaboxBannerText()
1236
  {
1237
  $bannerText = get_option('sgpb-metabox-banner-remote-get');
1313
  return get_post_meta($popupId, '_wpb_shortcodes_custom_css', true);
1314
  }
1315
 
1316
+ /**
1317
+ * countdown popup, convert date to seconds
1318
+ *
1319
+ * @param $dueDate
1320
+ * @param $timezone
1321
+ * @return false|int|string
1322
+ */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1323
  public static function dateToSeconds($dueDate, $timezone)
1324
  {
1325
  if (empty($timezone)) {
1355
  return $protocol;
1356
  }
1357
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1358
  public static function findSubscribersByEmail($subscriberEmail = '', $list = 0)
1359
  {
1360
  global $wpdb;
1481
  return $hasInactiveExtensions;
1482
  }
1483
 
 
 
 
 
 
 
 
 
1484
  public static function getSubscriptionColumnsById($id)
1485
  {
1486
  $popup = SGPopup::find($id);
1914
  // finally get the correct version number
1915
  $known = array('Version', $ub, 'other');
1916
  $pattern = '#(?<browser>'.join('|', $known).')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';
 
 
 
1917
  // see how many we have
1918
  $i = count($matches['browser']);
1919
  //we will have two since we are not using 'other' argument yet
com/helpers/ConfigDataHelper.php CHANGED
@@ -869,6 +869,22 @@ class ConfigDataHelper
869
  'sgpb-fadeOut' => __('FadeOut', SG_POPUP_TEXT_DOMAIN)
870
  );
871
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
872
  $data['userRoles'] = self::getAllUserRoles();
873
 
874
  return $data;
869
  'sgpb-fadeOut' => __('FadeOut', SG_POPUP_TEXT_DOMAIN)
870
  );
871
 
872
+ $data['floatingButtonPositions'] = array(
873
+ 'top-left' => __('Top left', SG_POPUP_TEXT_DOMAIN),
874
+ 'top-right' => __('Top right', SG_POPUP_TEXT_DOMAIN),
875
+ 'bottom-left' => __('Bottom left', SG_POPUP_TEXT_DOMAIN),
876
+ 'bottom-right' => __('Bottom right', SG_POPUP_TEXT_DOMAIN),
877
+ 'top-center' => __('Top center', SG_POPUP_TEXT_DOMAIN),
878
+ 'bottom-center' => __('Bottom center', SG_POPUP_TEXT_DOMAIN),
879
+ 'right-center' => __('Right center', SG_POPUP_TEXT_DOMAIN),
880
+ 'left-center' => __('Left center', SG_POPUP_TEXT_DOMAIN)
881
+ );
882
+
883
+ $data['floatingButtonStyle'] = array(
884
+ 'corner' => __('Corner', SG_POPUP_TEXT_DOMAIN),
885
+ 'basic' => __('Basic', SG_POPUP_TEXT_DOMAIN)
886
+ );
887
+
888
  $data['userRoles'] = self::getAllUserRoles();
889
 
890
  return $data;
com/helpers/Functions.php CHANGED
@@ -186,44 +186,6 @@ class Functions
186
  return $engine;
187
  }
188
 
189
- public static function getPopupTypeToAllowToShowMetabox()
190
- {
191
- global $post;
192
-
193
- if ($post->post_type != SG_POPUP_POST_TYPE) {
194
- return false;
195
- }
196
- if (!empty($_GET['sgpb_type'])) {
197
- $type = $_GET['sgpb_type'];
198
- }
199
- else {
200
- $popupId = $post->ID;
201
- $popup = SGPopup::find($popupId);
202
- if (empty($popup) || !is_object($popup)) {
203
- return false;
204
- }
205
- $type = $popup->getType();
206
- }
207
-
208
- return $type;
209
- }
210
-
211
- public static function getExtensionDirectory($extensionFolderName = '', $popupMainFolderName = '')
212
- {
213
- $directoryExisits = is_dir(SGPB_POPUP_EXTENSIONS_PATH.$extensionFolderName);
214
- $dir = SGPB_POPUP_EXTENSIONS_PATH.$extensionFolderName;
215
-
216
- if (!$directoryExisits) {
217
- $directoryExisits = is_dir(WP_PLUGIN_DIR.'/'.$extensionFolderName);
218
- $dir = WP_PLUGIN_DIR.'/'.$extensionFolderName;
219
- if (!$directoryExisits) {
220
- $dir = false;
221
- }
222
- }
223
-
224
- return $dir;
225
- }
226
-
227
  public static function getIpAddress()
228
  {
229
  $ipAddress = 'UNKNOWN';
186
  return $engine;
187
  }
188
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
189
  public static function getIpAddress()
190
  {
191
  $ipAddress = 'UNKNOWN';
popup-builder.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Popup Builder
4
  * Plugin URI: https://popup-builder.com
5
  * Description: The most complete popup plugin. Html, image, iframe, shortcode, video and many other popup types. Manage popup dimensions, effects, themes and more.
6
- * Version: 3.68.4
7
  * Author: Sygnoos
8
  * Author URI: https://sygnoos.com
9
  * License: GPLv2
3
  * Plugin Name: Popup Builder
4
  * Plugin URI: https://popup-builder.com
5
  * Description: The most complete popup plugin. Html, image, iframe, shortcode, video and many other popup types. Manage popup dimensions, effects, themes and more.
6
+ * Version: 3.68.5
7
  * Author: Sygnoos
8
  * Author URI: https://sygnoos.com
9
  * License: GPLv2
public/css/popupAdminStyles.css CHANGED
@@ -13,7 +13,7 @@ solid #ccc}#fixed-position6{border-left:1px solid #ccc;border-right:1px solid #c
13
  a{text-decoration:none !important}.sgpb-color-picker-wrapper .iris-picker{z-index:99999}.sgpb-color-picker-wrapper .wp-picker-container
14
  a{height:24px}.popups-div{width:200px;height:200px;float:left;margin-right:10px;margin-bottom:10px;background-color:#DEDEDE;background-size:100%;transition:all .1s ease-in-out;position:relative}.popups-div:hover{background-color:#CDCDCD;transform:scale(1.02)}.sgpb-type-icon{height:115px;margin-top:20px;background-size:contain;background-repeat:no-repeat;background-position:42px}.sgpb-type-text-wrapper{text-align:center}.sgpb-type-text{font-size:23px;margin:14px
15
  0 0 0 !important;color:#000 !important}.sgpb-more-ideas{background-image:url("../img/moreIdeas.png")}.image-popup{background-image:url("../img/imageTypeIcon.png")}.pdf-popup,.pdf-popup-pro{background-image:url("../img/pdfTypeIcon.png")}.sgpb-image-div{background-color:#87e37f !important}.sgpb-image-div:hover{background-color:#b1fdab !important}.create-popup-link{text-decoration:none !important}.create-popup-link:focus,.create-popup-link:hover,.create-popup-link:active{outline:0;border:none;-moz-outline-style:none;box-shadow:none}.html-popup{background-image:url("../img/htmlTypeIcon.png")}.sgpb-html-div{background-color:#f7941d !important}.sgpb-html-div:hover{background-color:#ffac49 !important}.sgpb-pdf-div{background-color:#dc1d00 !important}.sgpb-pdf-div:hover{background-color:#ea7766 !important}.fblike-popup{background-image:url("../img/facebookTypeIcon.png")}.sgpb-fblike-div{background-color:#4267b2 !important}.sgpb-fblike-div:hover{background-color:#648bdb !important}.iframe-popup{background-image:url("../img/iframeTypeIcon.png")}.sgpb-iframe-div{background-color:#b084bc !important}.sgpb-iframe-div:hover{background-color:#d4a6e0 !important}.gamification-popup,.gamification-popup-pro{background-image:url("../img/gamificationIcon.png")}.sgpb-gamification-div{background-color:#b084bc !important}.sgpb-gamification-div:hover{background-color:#d4a6e0 !important}.pushNotification-popup,.pushNotification-popup-pro{background-image:url("../img/pushNotificationTypeIcon.png")}.sgpb-extensions-wrapper .sgpb-pushNotification-div,
16
- .sgpb-extensions-wrapper .sgpb-pushNotification-div:hover{background-color:rgba(212, 166, 224, 0.4) !important}.sgpb-pushNotification-div{background-color:#b084bc !important}.sgpb-pushNotification-div:hover{background-color:#d4a6e0 !important}.sgpb-extensions-wrapper .sgpb-iframe-div{background-color:rgba(212, 166, 224, 0.4) !important}.sgpb-free-extensions-wrapper .sgpb-pdf-div{background-color:#ea7766 !important}.sgpb-extensions-wrapper .sgpb-gamification-div{background-color:rgba(212, 166, 224, 0.4) !important}.video-popup{background-image:url("../img/videoTypeIcon.png")}.sgpb-video-div{background-color:#d22215 !important}.sgpb-video-div:hover{background-color:#f34133 !important}.sgpb-extensions-wrapper .sgpb-video-div{background-color:rgba(243, 65, 51, 0.4) !important}.ageRestriction-popup{background-image:url("../img/restrictionTyoeIcon.png")}.sgpb-ageRestriction-div{background-color:#f7cc44 !important}.sgpb-ageRestriction-div:hover{background-color:#ffdd73 !important}.ageVerification-popup,.ageVerification-popup-pro{background-image:url('../img/ageVerificationTypeIcon.png')}.sgpb-ageVerification-div{background-color:#d22215 !important}.sgpb-ageVerification-div:hover{background-color:#f34133 !important}.sgpb-extensions-wrapper .sgpb-ageRestriction-div{background-color:#ffdd73 !important}.countdown-popup{background-image:url("../img/CountdownTypeIcon.png")}.sgpb-countdown-div{background-color:#acd373 !important}.sgpb-countdown-div:hover{background-color:#cef398 !important}.sgpb-extensions-wrapper .sgpb-countdown-div{background-color:#cef398 !important}.social-popup{background-image:url("../img/socialTypeIcon.png")}.sgpb-social-div{background-color:#1da0f1 !important}.sgpb-social-div:hover{background-color:#38b3ff !important}.sgpb-extensions-wrapper .sgpb-social-div{background-color:rgba(29, 160, 241, 0.4) !important}.sg-exit-intent{background-image:url("../img/ExitIntent.png")}.subscription-popup{background-image:url("../img/subscriptionTypeIcon.png")}.subscriptionPlus-popup-pro{background-image:url("../img/subscriptionPlusTypeIcon.png")}.sgpb-subscription-div{background-color:#7eb540 !important}.sgpb-subscription-div:hover{background-color:#a1dd5e !important}.contactForm-popup{background-image:url("../img/contactFormTypeIcon.png")}.sgpb-contactForm-div{background-color:#f94563 !important}.sgpb-contactForm-div:hover{background-color:#ff5974 !important}.sgpb-mailchimp-div{background-color:#ffe01b !important}.sgpb-mailchimp-div:hover{background-color:#ffe74e !important}.sgpb-aweber-div{background-color:#0079c1 !important}.sgpb-aweber-div:hover{background-color:#42b1f3 !important}.sgpbAWeber-popup-pro,.aweber-popup{background-image:url("../img/aweberTypeIcon.png") !important}.scheduling-popup-pro{background-image:url("../img/schedulingTypeIcon.png") !important}.edd-popup-pro{background-image:url("../img/eddTypeIcon.png") !important}.sgpb-edd-div{background-color:#7dbfe9 !important}.geo-targeting-popup-pro{background-image:url("../img/geoTypeIcon.png") !important}.sgpb-geo-targeting-div{background-color:rgba(73, 185, 173, 0.4) !important}.sgpb-subscriptionPlus-div{background-color:rgba(23, 165, 143, 0.4) !important}.sgpb-sgpbAWeber-div{background-color:rgba(0,121,193,0.4)}.sgpb-sgpbAWeber-div:hover{background-color:rgba(0,121,193,0.4)}.sgpb-login-div{background-color:#396af7 !important}.sgpb-login-div:hover{background-color:#4d7afc !important}.sgpb-extensions-wrapper .sgpb-login-div{background-color:rgba(77, 122, 252, 0.4) !important}.sgpb-registration-div{background-color:#fe415b !important}.sgpb-registration-div:hover{background-color:#fe5a70 !important}.sgpb-extensions-wrapper .sgpb-registration-div{background-color:rgb(254, 65, 91, 0.4) !important}.login-popup-pro,.login-popup{background-image:url("../img/loginTypeIcon.png") !important}.registration-popup-pro,.registration-popup{background-image:url("../img/registrationTypeIcon.png") !important}.sgpbMailchimp-popup-pro,.mailchimp-popup{background-image:url("../img/mailchimpTypeIcon.png") !important}.sgpb-scheduling-div{background-color:#1976d3}.sgpb-scheduling-div:hover{background-color:#308ee8}.sgpb-extensions-wrapper .sgpb-scheduling-div{background-color:rgba(48, 142, 232, 0.4) !important}.sgpb-sgpbMailchimp-div{background-color:rgba(255, 224, 27, 0.4) !important}.sgpbAdBlock-popup-pro{background-image:url("../img/adBlockTypeIcon.png") !important}.sgpb-sgpbAdBlock-div{background-color:rgba(249,61,62,0.4)}.sgpb-sgpbAdBlock-div{background-color:rgba(249,61,62,0.4)}.sgpb-sgpbAdBlock-div:hover{background-color:rgba(249,61,62,0.4)}.sgpbScroll-popup-pro{background-image:url("../img/scroll.png") !important}.sgpb-sgpbScroll-div{background-color:rgba(73,185,173,0.4)}.sgpb-sgpbScroll-div:hover{background-color:rgba(73,185,173,0.4)}.sgpbInactivity-popup-pro{background-image:url("../img/inactivity.png") !important}.sgpb-sgpbInactivity-div{background-color:rgba(197,212,61,0.4)}.sgpb-sgpbInactivity-div:hover{background-color:rgba(197,212,61,0.4)}.sgpbRandom-popup-pro{background-image:url("../img/random.png") !important}.sgpb-sgpbRandom-div{background-color:rgba(225,240,85,0.4)}.sgpb-sgpbRandom-div:hover{background-color:rgba(225,240,85,0.4)}.advancedClosing-popup-pro{background-image:url("../img/advancesClosing.png") !important}.sgpb-advancedClosing-div{background-color:rgba(241,139,64,0.4)}.sgpb-advancedClosing-div:hover{background-color:rgba(241,139,64,0.4)}.sgpbAdvancedTargeting-popup-pro{background-image:url("../img/advancedTargeting.png") !important}.sgpb-sgpbAdvancedTargeting-div{background-color:rgba(245,110,107,0.4)}.sgpb-sgpbAdvancedTargeting-div:hover{background-color:rgba(245,110,107,0.4)}.sgpbAnalitics-popup-pro{background-image:url("../img/analyticsTypeIcon.png") !important}.sgpbRecentSales-popup-pro{background-image:url("../img/recentSales.png") !important}.sgpb-sgpbAnalitics-div{background-color:rgba(250,166,40,0.4)}.sgpb-sgpbAnalitics-div:hover{background-color:rgba(250,166,40,0.4)}.sgpbExitIntent-popup-pro{background-image:url("../img/exitIntentTypeIcon.png") !important}.recentSales-popup{background-image:url("../img/recentSales.png") !important}.sgpb-recentSales-div{background-color:#ff5723 !important}.sgpb-recentSales-div:hover{background-color:#ff6e41 !important}.sgpb-sgpbRecentSales-div{background-color:rgba(255, 87, 35, 0.4) !important}.sgpb-sgpbExitIntent-div{background-color:rgba(140,115,211,0.4)}.sgpb-sgpbExitIntent-div:hover{background-color:rgba(140,115,211,0.4)}.iframe-popup-pro{background-image:url("../img/iframeTypeIcon.png")}.iframe-popup-pro-wrapper{background-color:rgba(176,132,188,0.4)}.iframe-popup-pro-wrapper:hover{background-color:rgba(176,132,188,0.4)}.video-popup-pro{background-image:url("../img/videoTypeIcon.png")}.video-popup-pro-wrapper{background-color:rgba(210,34,21,0.26)}.video-popup-pro-wrapper:hover{background-color:rgba(210,34,21,0.26)}.ageRestriction-popup-pro{background-image:url("../img/restrictionTyoeIcon.png")}.ageRestriction-popup-pro-wrapper{background-color:rgba(247,204,68,0.4)}.ageRestriction-popup-pro-wrapper:hover{background-color:rgba(247,204,68,0.4)}.countdown-popup-pro{background-image:url("../img/CountdownTypeIcon.png")}.countdown-popup-pro-wrapper{background-color:rgba(172, 211, 115, 0.4) !important}.countdown-popup-pro-wrapper:hover{background-color:rgba(172, 211, 115, 0.4) !important}.social-popup-pro{background-image:url("../img/socialTypeIcon.png")}.social-popup-pro-wrapper{background-color:rgba(2,116,179,0.4)}.social-popup-pro-wrapper:hover{background-color:rgba(2,116,179,0.4)}.contactForm-popup-pro{background-image:url("../img/contactFormTypeIcon.png")}.contactForm-popup-pro-wrapper{background-color:rgba(251,175,93,0.4)}.contactForm-popup-pro-wrapper:hover{background-color:rgba(251,175,93,0.4)}.Woo-popup,.sgpbWOO-popup-pro{background-image:url("../img/wooTypeIcon.png")}.sgpb-Woo-div,.sgpb-sgpbWOO-div{background-color:#a46497 !important}.sgpb-Woo-div:hover,.sgpb-sgpbWOO-div:hover{background-color:#cb7fbb !important}.sgpb-extensions-wrapper .sgpb-sgpbWOO-div{background-color:#cb7fbb !important}.sgpb-popup-type-pro-ribbon{background-image:url(../img/probadge.png);position:absolute;top:-5px;right:-5px;width:71px;height:40px;background-size:cover}.sgpb-popup-type-free-pro-ribbon{background-image:url(../img/freeProbadge.png);position:absolute;top:-5px;right:-5px;width:71px;height:40px;background-size:cover}.sg-rules-or{border-top:2px dashed #ddd;line-height:1;text-align:center;margin:15px
17
  0 5px}.sgpb-wrapper.sgpb-settings input[type="checkbox"]{margin-top:2px !important}.sgpb-wrapper.sgpb-settings .sgpb-info-icon-align{margin-top:6px !important}.sgpb-wrapper.sgpb-settings .hndle.ui-sortable-handle.js-special-title{font-weight:600}.sgpb-wrapper.sgpb-settings
18
  h2{margin-bottom:20px}.sgpb-wrapper input[type="radio"]:checked:before{margin:3px
19
  3px 0 !important}.sgpb-wrapper input[type="checkbox"]:focus{outline:0
@@ -112,4 +112,4 @@ h3{border-bottom:1px solid #ccc;padding-bottom:15px;padding-left:20px}.sgpb-noti
112
  a{font-size:12px !important}.sgpb-review-description .sgrb-review-h2{margin-top:0 !important}.sgpb-hide-notification-at-all{float:right}.sgpb-hide-notification-at-all:hover{cursor:pointer;background-color:#cccccca3}#sgpb-feedback-popup{display:none;position:fixed;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,0.6);z-index:9999;opacity:0;pointer-events:none}#sgpb-feedback-popup:target{opacity:1;pointer-events:auto}.sgpb-feedback-popup-wrapper{width:35%;min-width:310px;background-color:white;padding:0
113
  15px 15px 15px;box-sizing:border-box;border-radius:4px;overflow:auto;position:fixed;left:50%;top:30%;margin-top:-37.5px;margin-left:-201px}.sgpb-show-feedback-popup,.sgpb-show-feedback-popup:target{opacity:1 !important;pointer-events:auto !important;display:block !important}.sgpb-deactivate-feedback-dialog-input{margin:0
114
  !important}.sgpb-feedback-popup-wrapper .sgpb-add-subscriber-popup-close-btn{margin-top:9px}.sgpb-feedback-popup-wrapper .sgpb-feedback-popup-header{border-bottom:1px solid #ccc}.sgpb-feedback-descritpion{margin:10px
115
- 0 15px 0 !important}.sgpb-feedback-each-reason-row{margin-bottom:10px}.sgpb-deactivate-feedback-dialog-label{margin-top:2px}.sgpb-feedback-text-input{width:100%}.sgpb-feedback-submit{background-color:#2873EB !important;border-color:#2873EB !important}.sgpb-feedback-submit:hover{background-color:#2873ebcc !important;border-color:#2873ebcc !important}.sgpb-feedback-submit-skip{float:right}.sgpb-feedback-error-message{font-size:13px;color:#f00}.sgpb-feedback-btns-wrapper{margin-top:30px}.btn-light.js-send-newsletter{color:#000 !important}.sgpb-js-newsletter-spinner{margin-left:10px}
13
  a{text-decoration:none !important}.sgpb-color-picker-wrapper .iris-picker{z-index:99999}.sgpb-color-picker-wrapper .wp-picker-container
14
  a{height:24px}.popups-div{width:200px;height:200px;float:left;margin-right:10px;margin-bottom:10px;background-color:#DEDEDE;background-size:100%;transition:all .1s ease-in-out;position:relative}.popups-div:hover{background-color:#CDCDCD;transform:scale(1.02)}.sgpb-type-icon{height:115px;margin-top:20px;background-size:contain;background-repeat:no-repeat;background-position:42px}.sgpb-type-text-wrapper{text-align:center}.sgpb-type-text{font-size:23px;margin:14px
15
  0 0 0 !important;color:#000 !important}.sgpb-more-ideas{background-image:url("../img/moreIdeas.png")}.image-popup{background-image:url("../img/imageTypeIcon.png")}.pdf-popup,.pdf-popup-pro{background-image:url("../img/pdfTypeIcon.png")}.sgpb-image-div{background-color:#87e37f !important}.sgpb-image-div:hover{background-color:#b1fdab !important}.create-popup-link{text-decoration:none !important}.create-popup-link:focus,.create-popup-link:hover,.create-popup-link:active{outline:0;border:none;-moz-outline-style:none;box-shadow:none}.html-popup{background-image:url("../img/htmlTypeIcon.png")}.sgpb-html-div{background-color:#f7941d !important}.sgpb-html-div:hover{background-color:#ffac49 !important}.sgpb-pdf-div{background-color:#dc1d00 !important}.sgpb-pdf-div:hover{background-color:#ea7766 !important}.fblike-popup{background-image:url("../img/facebookTypeIcon.png")}.sgpb-fblike-div{background-color:#4267b2 !important}.sgpb-fblike-div:hover{background-color:#648bdb !important}.iframe-popup{background-image:url("../img/iframeTypeIcon.png")}.sgpb-iframe-div{background-color:#b084bc !important}.sgpb-iframe-div:hover{background-color:#d4a6e0 !important}.gamification-popup,.gamification-popup-pro{background-image:url("../img/gamificationIcon.png")}.sgpb-gamification-div{background-color:#b084bc !important}.sgpb-gamification-div:hover{background-color:#d4a6e0 !important}.pushNotification-popup,.pushNotification-popup-pro{background-image:url("../img/pushNotificationTypeIcon.png")}.sgpb-extensions-wrapper .sgpb-pushNotification-div,
16
+ .sgpb-extensions-wrapper .sgpb-pushNotification-div:hover{background-color:rgba(212, 166, 224, 0.4) !important}.sgpb-pushNotification-div{background-color:#b084bc !important}.sgpb-pushNotification-div:hover{background-color:#d4a6e0 !important}.sgpb-extensions-wrapper .sgpb-iframe-div{background-color:rgba(212, 166, 224, 0.4) !important}.sgpb-free-extensions-wrapper .sgpb-pdf-div{background-color:#ea7766 !important}.sgpb-extensions-wrapper .sgpb-gamification-div{background-color:rgba(212, 166, 224, 0.4) !important}.video-popup{background-image:url("../img/videoTypeIcon.png")}.sgpb-video-div{background-color:#d22215 !important}.sgpb-video-div:hover{background-color:#f34133 !important}.sgpb-extensions-wrapper .sgpb-video-div{background-color:rgba(243, 65, 51, 0.4) !important}.ageRestriction-popup{background-image:url("../img/restrictionTyoeIcon.png")}.sgpb-ageRestriction-div{background-color:#f7cc44 !important}.sgpb-ageRestriction-div:hover{background-color:#ffdd73 !important}.ageVerification-popup,.ageVerification-popup-pro{background-image:url('../img/ageVerificationTypeIcon.png')}.sgpb-ageVerification-div{background-color:#d22215 !important}.sgpb-ageVerification-div:hover{background-color:#f34133 !important}.sgpb-extensions-wrapper .sgpb-ageRestriction-div{background-color:#ffdd73 !important}.countdown-popup{background-image:url("../img/CountdownTypeIcon.png")}.sgpb-countdown-div{background-color:#acd373 !important}.sgpb-countdown-div:hover{background-color:#cef398 !important}.sgpb-extensions-wrapper .sgpb-countdown-div{background-color:#cef398 !important}.social-popup{background-image:url("../img/socialTypeIcon.png")}.sgpb-social-div{background-color:#1da0f1 !important}.sgpb-social-div:hover{background-color:#38b3ff !important}.sgpb-extensions-wrapper .sgpb-social-div{background-color:rgba(29, 160, 241, 0.4) !important}.sg-exit-intent{background-image:url("../img/ExitIntent.png")}.subscription-popup{background-image:url("../img/subscriptionTypeIcon.png")}.subscriptionPlus-popup-pro{background-image:url("../img/subscriptionPlusTypeIcon.png")}.sgpb-subscription-div{background-color:#7eb540 !important}.sgpb-subscription-div:hover{background-color:#a1dd5e !important}.contactForm-popup{background-image:url("../img/contactFormTypeIcon.png")}.sgpb-contactForm-div{background-color:#f94563 !important}.sgpb-contactForm-div:hover{background-color:#ff5974 !important}.sgpb-mailchimp-div{background-color:#ffe01b !important}.sgpb-mailchimp-div:hover{background-color:#ffe74e !important}.sgpb-aweber-div{background-color:#0079c1 !important}.sgpb-aweber-div:hover{background-color:#42b1f3 !important}.sgpbAWeber-popup-pro,.aweber-popup{background-image:url("../img/aweberTypeIcon.png") !important}.scheduling-popup-pro{background-image:url("../img/schedulingTypeIcon.png") !important}.edd-popup-pro{background-image:url("../img/eddTypeIcon.png") !important}.sgpb-edd-div{background-color:#7dbfe9 !important}.geo-targeting-popup-pro{background-image:url("../img/geoTypeIcon.png") !important}.sgpb-geo-targeting-div{background-color:rgba(73, 185, 173, 0.4) !important}.sgpb-subscriptionPlus-div{background-color:rgba(23, 165, 143, 0.4) !important}.sgpb-sgpbAWeber-div{background-color:rgba(0,121,193,0.4)}.sgpb-sgpbAWeber-div:hover{background-color:rgba(0,121,193,0.4)}.sgpb-login-div{background-color:#396af7 !important}.sgpb-login-div:hover{background-color:#4d7afc !important}.sgpb-extensions-wrapper .sgpb-login-div{background-color:rgba(77, 122, 252, 0.4) !important}.sgpb-registration-div{background-color:#fe415b !important}.sgpb-registration-div:hover{background-color:#fe5a70 !important}.sgpb-extensions-wrapper .sgpb-registration-div{background-color:rgba(254, 65, 91, 0.4) !important}.login-popup-pro,.login-popup{background-image:url("../img/loginTypeIcon.png") !important}.registration-popup-pro,.registration-popup{background-image:url("../img/registrationTypeIcon.png") !important}.sgpbMailchimp-popup-pro,.mailchimp-popup{background-image:url("../img/mailchimpTypeIcon.png") !important}.sgpb-scheduling-div{background-color:#1976d3}.sgpb-scheduling-div:hover{background-color:#308ee8}.sgpb-extensions-wrapper .sgpb-scheduling-div{background-color:rgba(48, 142, 232, 0.4) !important}.sgpb-sgpbMailchimp-div{background-color:rgba(255, 224, 27, 0.4) !important}.sgpbAdBlock-popup-pro{background-image:url("../img/adBlockTypeIcon.png") !important}.sgpb-sgpbAdBlock-div{background-color:rgba(249,61,62,0.4)}.sgpb-sgpbAdBlock-div{background-color:rgba(249,61,62,0.4)}.sgpb-sgpbAdBlock-div:hover{background-color:rgba(249,61,62,0.4)}.sgpbScroll-popup-pro{background-image:url("../img/scroll.png") !important}.sgpb-sgpbScroll-div{background-color:rgba(73,185,173,0.4)}.sgpb-sgpbScroll-div:hover{background-color:rgba(73,185,173,0.4)}.sgpbInactivity-popup-pro{background-image:url("../img/inactivity.png") !important}.sgpb-sgpbInactivity-div{background-color:rgba(197,212,61,0.4)}.sgpb-sgpbInactivity-div:hover{background-color:rgba(197,212,61,0.4)}.sgpbRandom-popup-pro{background-image:url("../img/random.png") !important}.sgpb-sgpbRandom-div{background-color:rgba(225,240,85,0.4)}.sgpb-sgpbRandom-div:hover{background-color:rgba(225,240,85,0.4)}.advancedClosing-popup-pro{background-image:url("../img/advancesClosing.png") !important}.sgpb-advancedClosing-div{background-color:rgba(241,139,64,0.4)}.sgpb-advancedClosing-div:hover{background-color:rgba(241,139,64,0.4)}.sgpbAdvancedTargeting-popup-pro{background-image:url("../img/advancedTargeting.png") !important}.sgpb-sgpbAdvancedTargeting-div{background-color:rgba(245,110,107,0.4)}.sgpb-sgpbAdvancedTargeting-div:hover{background-color:rgba(245,110,107,0.4)}.sgpbAnalitics-popup-pro{background-image:url("../img/analyticsTypeIcon.png") !important}.sgpbRecentSales-popup-pro{background-image:url("../img/recentSales.png") !important}.sgpb-sgpbAnalitics-div{background-color:rgba(250,166,40,0.4)}.sgpb-sgpbAnalitics-div:hover{background-color:rgba(250,166,40,0.4)}.sgpbExitIntent-popup-pro{background-image:url("../img/exitIntentTypeIcon.png") !important}.recentSales-popup{background-image:url("../img/recentSales.png") !important}.sgpb-recentSales-div{background-color:#ff5723 !important}.sgpb-recentSales-div:hover{background-color:#ff6e41 !important}.sgpb-sgpbRecentSales-div{background-color:rgba(255, 87, 35, 0.4) !important}.sgpb-sgpbExitIntent-div{background-color:rgba(140,115,211,0.4)}.sgpb-sgpbExitIntent-div:hover{background-color:rgba(140,115,211,0.4)}.iframe-popup-pro{background-image:url("../img/iframeTypeIcon.png")}.iframe-popup-pro-wrapper{background-color:rgba(176,132,188,0.4)}.iframe-popup-pro-wrapper:hover{background-color:rgba(176,132,188,0.4)}.video-popup-pro{background-image:url("../img/videoTypeIcon.png")}.video-popup-pro-wrapper{background-color:rgba(210,34,21,0.26)}.video-popup-pro-wrapper:hover{background-color:rgba(210,34,21,0.26)}.ageRestriction-popup-pro{background-image:url("../img/restrictionTyoeIcon.png")}.ageRestriction-popup-pro-wrapper{background-color:rgba(247,204,68,0.4)}.ageRestriction-popup-pro-wrapper:hover{background-color:rgba(247,204,68,0.4)}.countdown-popup-pro{background-image:url("../img/CountdownTypeIcon.png")}.countdown-popup-pro-wrapper{background-color:rgba(172, 211, 115, 0.4) !important}.countdown-popup-pro-wrapper:hover{background-color:rgba(172, 211, 115, 0.4) !important}.social-popup-pro{background-image:url("../img/socialTypeIcon.png")}.social-popup-pro-wrapper{background-color:rgba(2,116,179,0.4)}.social-popup-pro-wrapper:hover{background-color:rgba(2,116,179,0.4)}.contactForm-popup-pro{background-image:url("../img/contactFormTypeIcon.png")}.contactForm-popup-pro-wrapper{background-color:rgba(251,175,93,0.4)}.contactForm-popup-pro-wrapper:hover{background-color:rgba(251,175,93,0.4)}.Woo-popup,.sgpbWOO-popup-pro{background-image:url("../img/wooTypeIcon.png")}.sgpb-Woo-div,.sgpb-sgpbWOO-div{background-color:#a46497 !important}.sgpb-Woo-div:hover,.sgpb-sgpbWOO-div:hover{background-color:#cb7fbb !important}.sgpb-extensions-wrapper .sgpb-sgpbWOO-div{background-color:#cb7fbb !important}.sgpb-popup-type-pro-ribbon{background-image:url(../img/probadge.png);position:absolute;top:-5px;right:-5px;width:71px;height:40px;background-size:cover}.sgpb-popup-type-free-pro-ribbon{background-image:url(../img/freeProbadge.png);position:absolute;top:-5px;right:-5px;width:71px;height:40px;background-size:cover}.sg-rules-or{border-top:2px dashed #ddd;line-height:1;text-align:center;margin:15px
17
  0 5px}.sgpb-wrapper.sgpb-settings input[type="checkbox"]{margin-top:2px !important}.sgpb-wrapper.sgpb-settings .sgpb-info-icon-align{margin-top:6px !important}.sgpb-wrapper.sgpb-settings .hndle.ui-sortable-handle.js-special-title{font-weight:600}.sgpb-wrapper.sgpb-settings
18
  h2{margin-bottom:20px}.sgpb-wrapper input[type="radio"]:checked:before{margin:3px
19
  3px 0 !important}.sgpb-wrapper input[type="checkbox"]:focus{outline:0
112
  a{font-size:12px !important}.sgpb-review-description .sgrb-review-h2{margin-top:0 !important}.sgpb-hide-notification-at-all{float:right}.sgpb-hide-notification-at-all:hover{cursor:pointer;background-color:#cccccca3}#sgpb-feedback-popup{display:none;position:fixed;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,0.6);z-index:9999;opacity:0;pointer-events:none}#sgpb-feedback-popup:target{opacity:1;pointer-events:auto}.sgpb-feedback-popup-wrapper{width:35%;min-width:310px;background-color:white;padding:0
113
  15px 15px 15px;box-sizing:border-box;border-radius:4px;overflow:auto;position:fixed;left:50%;top:30%;margin-top:-37.5px;margin-left:-201px}.sgpb-show-feedback-popup,.sgpb-show-feedback-popup:target{opacity:1 !important;pointer-events:auto !important;display:block !important}.sgpb-deactivate-feedback-dialog-input{margin:0
114
  !important}.sgpb-feedback-popup-wrapper .sgpb-add-subscriber-popup-close-btn{margin-top:9px}.sgpb-feedback-popup-wrapper .sgpb-feedback-popup-header{border-bottom:1px solid #ccc}.sgpb-feedback-descritpion{margin:10px
115
+ 0 15px 0 !important}.sgpb-feedback-each-reason-row{margin-bottom:10px}.sgpb-deactivate-feedback-dialog-label{margin-top:2px}.sgpb-feedback-text-input{width:100%}.sgpb-feedback-submit{background-color:#2873EB !important;border-color:#2873EB !important}.sgpb-feedback-submit:hover{background-color:#2873ebcc !important;border-color:#2873ebcc !important}.sgpb-feedback-submit-skip{float:right}.sgpb-feedback-error-message{font-size:13px;color:#f00}.sgpb-feedback-btns-wrapper{margin-top:30px}.btn-light.js-send-newsletter{color:#000 !important}.sgpb-js-newsletter-spinner{margin-left:10px}.sgpb-floating-btn-wrapper .col-md-5.sgpb-static-padding-top{padding-right:0 !important}#sgpb-floating-button{position:fixed;text-align:center;border-style:solid}.sgpb-corner-bottom-right{transition:all .2s ease,transform 1ms!important}.sgpb-corner-top-right{transition:all .2s ease,transform 1ms!important}.sgpb-corner-bottom-left,.sgpb-corner-bottom-right,.sgpb-corner-top-left,.sgpb-corner-top-right{border:none !important}
public/css/theme.css CHANGED
@@ -1,4 +1,4 @@
1
- .sg-popup-builder-content{height:100%}.sgpb-theme-1-overlay{background:url(data:image/image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAAAAAAeW/F+AAAAOklEQVR4Ae3QIQrAUADD0Lj2AIV//5uO+RE59asKz4U177rz9VAdqkU1qAbVoBpUg2pR3V/VbrVb7QHULigVcx3ZmQAAAABJRU5ErkJggg==)}.sgpb-theme-6-overlay{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDpCMEM4NDgzQjlDRTNFMTExODE4NUVDOTdFQ0I0RDgxRSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpGREU5OEVCQzAzMjYxMUUyOTg5OURDMDlDRTJDMTc0RSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpGREU5OEVCQjAzMjYxMUUyOTg5OURDMDlDRTJDMTc0RSIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M2IChXaW5kb3dzKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkIxQzg0ODNCOUNFM0UxMTE4MTg1RUM5N0VDQjREODFFIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkIwQzg0ODNCOUNFM0UxMTE4MTg1RUM5N0VDQjREODFFIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+s3YRAQAAABtJREFUeNpiFODh2cBABGBiIBKMKqSOQoAAAwBokQDs5F/8FAAAAABJRU5ErkJggg==)}#sgpb-popup-dialog-main-div-wrapper #sgpb-close-button{padding:0
2
  !important;color:#444 !important;border:0
3
  !important;margin:0
4
  !important;overflow:visible !important;width:auto !important;background:none !important;text-shadow:0px 0px 2px #fff !important}#sgpb-popup-dialog-main-div-wrapper #sgpb-close-button:active{outline:0
@@ -16,7 +16,7 @@ solid #8A8A8A;background-color:#707070}.sgpb-theme-5-content{border-radius:3px !
16
  img{height:auto;max-width:100%}.sgpb-overflow-hidden{width:100%;height:100%;overflow:hidden !important}.sgpb-overflow-hidden-body{width:100%;overflow:hidden !important}.sgpb-popup-content-direction-right{direction:rtl !important}.sgpb-popup-content-direction-right input[type="url"],
17
  .sgpb-popup-content-direction-right input[type="email"],
18
  .sgpb-popup-content-direction-right .sg-fb-buttons-wrapper,
19
- .sgpb-popup-content-direction-right .sgpb-alert{text-align:right !important}/**/@charset "UTF-8";.sg-animated{-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-fill-mode:none;animation-fill-mode:none}.sg-animated.infinite{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.sg-animated.hinge{-webkit-animation-duration:2s;animation-duration:2s}.sg-animated.bounceIn,.sg-animated.bounceOut,.sg-animated.flipOutX,.sg-animated.flipOutY{-webkit-animation-duration: .75s;animation-duration: .75s}@-webkit-keyframes
20
  bounce{20%,53%,80%,from,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1);-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}40%,43%{-webkit-animation-timing-function:cubic-bezier(.755,.050,.855,.060);animation-timing-function:cubic-bezier(.755,.050,.855,.060);-webkit-transform:translate3d(0,-30px,0);transform:translate3d(0,-30px,0)}70%{-webkit-animation-timing-function:cubic-bezier(.755,.050,.855,.060);animation-timing-function:cubic-bezier(.755,.050,.855,.060);-webkit-transform:translate3d(0,-15px,0);transform:translate3d(0,-15px,0)}90%{-webkit-transform:translate3d(0, -4px, 0);transform:translate3d(0, -4px, 0)}}@keyframes
21
  bounce{20%,53%,80%,from,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1);-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}40%,43%{-webkit-animation-timing-function:cubic-bezier(.755,.050,.855,.060);animation-timing-function:cubic-bezier(.755,.050,.855,.060);-webkit-transform:translate3d(0,-30px,0);transform:translate3d(0,-30px,0)}70%{-webkit-animation-timing-function:cubic-bezier(.755,.050,.855,.060);animation-timing-function:cubic-bezier(.755,.050,.855,.060);-webkit-transform:translate3d(0,-15px,0);transform:translate3d(0,-15px,0)}90%{-webkit-transform:translate3d(0,-4px,0);transform:translate3d(0,-4px,0)}}.sgpb-bounce{-webkit-animation-name:bounce;animation-name:bounce;-webkit-transform-origin:center bottom;transform-origin:center bottom}@-webkit-keyframes
22
  flash{50%,from,to{opacity:1}25%,75%{opacity:0}}@keyframes
@@ -168,4 +168,4 @@ slideOutRight{from{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,
168
  slideOutUp{from{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}to{visibility:hidden;-webkit-transform:translate3d(0, -100%, 0);transform:translate3d(0, -100%, 0)}}@keyframes
169
  slideOutUp{from{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}to{visibility:hidden;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}}.sgpb-slideOutUp{-webkit-animation-name:slideOutUp;animation-name:slideOutUp}.sgpb-iframe-spiner{background:url('data:image/gif;base64,R0lGODlh8ABAAaIHALa2tmNjY8XFxdbW1oyMjO/v7+bm5v///yH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjY0QTk5QUJDNTA1RDExRTA4NTIwQzAwMjQyRkFEMkEyIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjY0QTk5QUJENTA1RDExRTA4NTIwQzAwMjQyRkFEMkEyIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NjRBOTlBQkE1MDVEMTFFMDg1MjBDMDAyNDJGQUQyQTIiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NjRBOTlBQkI1MDVEMTFFMDg1MjBDMDAyNDJGQUQyQTIiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4B//79/Pv6+fj39vX08/Lx8O/u7ezr6uno5+bl5OPi4eDf3t3c29rZ2NfW1dTT0tHQz87N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') center center no-repeat}.sgpb-alert{padding:15px;border:1px
170
  solid transparent;border-radius:4px;text-align:center}.sgpb-alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.sgpb-alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.sgpb-alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.sgpb-alert
171
- p{margin-bottom:0px}[id*="__lpform_sgpb-"]{position:fixed !important}
1
+ @charset "UTF-8";.sg-popup-builder-content{height:100%}.sgpb-theme-1-overlay{background:url(data:image/image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAAAAAAeW/F+AAAAOklEQVR4Ae3QIQrAUADD0Lj2AIV//5uO+RE59asKz4U177rz9VAdqkU1qAbVoBpUg2pR3V/VbrVb7QHULigVcx3ZmQAAAABJRU5ErkJggg==)}.sgpb-theme-6-overlay{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDpCMEM4NDgzQjlDRTNFMTExODE4NUVDOTdFQ0I0RDgxRSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpGREU5OEVCQzAzMjYxMUUyOTg5OURDMDlDRTJDMTc0RSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpGREU5OEVCQjAzMjYxMUUyOTg5OURDMDlDRTJDMTc0RSIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M2IChXaW5kb3dzKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkIxQzg0ODNCOUNFM0UxMTE4MTg1RUM5N0VDQjREODFFIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkIwQzg0ODNCOUNFM0UxMTE4MTg1RUM5N0VDQjREODFFIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+s3YRAQAAABtJREFUeNpiFODh2cBABGBiIBKMKqSOQoAAAwBokQDs5F/8FAAAAABJRU5ErkJggg==)}#sgpb-popup-dialog-main-div-wrapper #sgpb-close-button{padding:0
2
  !important;color:#444 !important;border:0
3
  !important;margin:0
4
  !important;overflow:visible !important;width:auto !important;background:none !important;text-shadow:0px 0px 2px #fff !important}#sgpb-popup-dialog-main-div-wrapper #sgpb-close-button:active{outline:0
16
  img{height:auto;max-width:100%}.sgpb-overflow-hidden{width:100%;height:100%;overflow:hidden !important}.sgpb-overflow-hidden-body{width:100%;overflow:hidden !important}.sgpb-popup-content-direction-right{direction:rtl !important}.sgpb-popup-content-direction-right input[type="url"],
17
  .sgpb-popup-content-direction-right input[type="email"],
18
  .sgpb-popup-content-direction-right .sg-fb-buttons-wrapper,
19
+ .sgpb-popup-content-direction-right .sgpb-alert{text-align:right !important}/**/ .sg-animated{-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-fill-mode:none;animation-fill-mode:none}.sg-animated.infinite{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.sg-animated.hinge{-webkit-animation-duration:2s;animation-duration:2s}.sg-animated.bounceIn,.sg-animated.bounceOut,.sg-animated.flipOutX,.sg-animated.flipOutY{-webkit-animation-duration: .75s;animation-duration: .75s}@-webkit-keyframes
20
  bounce{20%,53%,80%,from,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1);-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}40%,43%{-webkit-animation-timing-function:cubic-bezier(.755,.050,.855,.060);animation-timing-function:cubic-bezier(.755,.050,.855,.060);-webkit-transform:translate3d(0,-30px,0);transform:translate3d(0,-30px,0)}70%{-webkit-animation-timing-function:cubic-bezier(.755,.050,.855,.060);animation-timing-function:cubic-bezier(.755,.050,.855,.060);-webkit-transform:translate3d(0,-15px,0);transform:translate3d(0,-15px,0)}90%{-webkit-transform:translate3d(0, -4px, 0);transform:translate3d(0, -4px, 0)}}@keyframes
21
  bounce{20%,53%,80%,from,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1);-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}40%,43%{-webkit-animation-timing-function:cubic-bezier(.755,.050,.855,.060);animation-timing-function:cubic-bezier(.755,.050,.855,.060);-webkit-transform:translate3d(0,-30px,0);transform:translate3d(0,-30px,0)}70%{-webkit-animation-timing-function:cubic-bezier(.755,.050,.855,.060);animation-timing-function:cubic-bezier(.755,.050,.855,.060);-webkit-transform:translate3d(0,-15px,0);transform:translate3d(0,-15px,0)}90%{-webkit-transform:translate3d(0,-4px,0);transform:translate3d(0,-4px,0)}}.sgpb-bounce{-webkit-animation-name:bounce;animation-name:bounce;-webkit-transform-origin:center bottom;transform-origin:center bottom}@-webkit-keyframes
22
  flash{50%,from,to{opacity:1}25%,75%{opacity:0}}@keyframes
168
  slideOutUp{from{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}to{visibility:hidden;-webkit-transform:translate3d(0, -100%, 0);transform:translate3d(0, -100%, 0)}}@keyframes
169
  slideOutUp{from{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}to{visibility:hidden;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}}.sgpb-slideOutUp{-webkit-animation-name:slideOutUp;animation-name:slideOutUp}.sgpb-iframe-spiner{background:url('data:image/gif;base64,R0lGODlh8ABAAaIHALa2tmNjY8XFxdbW1oyMjO/v7+bm5v///yH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjY0QTk5QUJDNTA1RDExRTA4NTIwQzAwMjQyRkFEMkEyIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjY0QTk5QUJENTA1RDExRTA4NTIwQzAwMjQyRkFEMkEyIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NjRBOTlBQkE1MDVEMTFFMDg1MjBDMDAyNDJGQUQyQTIiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NjRBOTlBQkI1MDVEMTFFMDg1MjBDMDAyNDJGQUQyQTIiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4B//79/Pv6+fj39vX08/Lx8O/u7ezr6uno5+bl5OPi4eDf3t3c29rZ2NfW1dTT0tHQz87N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') center center no-repeat}.sgpb-alert{padding:15px;border:1px
170
  solid transparent;border-radius:4px;text-align:center}.sgpb-alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.sgpb-alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.sgpb-alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.sgpb-alert
171
+ p{margin-bottom:0px}[id*="__lpform_sgpb-"]{position:fixed !important}.sgpb-floating-button{display:inline-block;text-decoration:none;z-index:99999999;position:fixed;text-align:center;padding:10px;font-family:sans-serif;font-weight:600;box-shadow:none;-webkit-box-shadow:none;-moz-box-shadow:none;cursor:pointer !important;letter-spacing:0.05em !important}#sgpb-floating-button{display:inline-block;text-decoration:none;font-family:sans-serif;font-weight:600;box-shadow:none;-webkit-box-shadow:none;-moz-box-shadow:none;cursor:pointer !important;letter-spacing:0.05em !important}.sgpb-basic-left-center{transform:rotate(90deg) !important;transform-origin:left bottom 0px !important}.sgpb-basic-right-center{transform:rotate(-90deg);transform-origin:right bottom 0px}.sgpb-basic-bottom-right{right:0px;bottom:0px}.sgpb-basic-bottom-left{bottom:0px;left:0px}.sgpb-basic-top-right{right:0px;top:0px}.sgpb-basic-top-left{left:0px;top:0px}.sgpb-corner-bottom-right{right:-58px;bottom:-27px;transform:rotate(-45deg);transform-origin:right center 0px;width:160px;height:160px;display:inline-grid}.sgpb-corner-bottom-right:hover{right:-56px !important;bottom:-25px !important}.sgpb-corner-bottom-left{bottom:-139px;left:-106px;transform:rotate(45deg);transform-origin:right center 0px;width:160px;height:160px;display:inline-grid}.sgpb-corner-bottom-left:hover{bottom:-136px !important;left:-103px !important}.sgpb-corner-top-right{right:-58px;top:-27px;transform:rotate(45deg);transform-origin:right center 0px;line-height:260px;width:160px;height:160px;display:inline-grid}.sgpb-corner-top-right:hover{right:-56px !important;top:-25px !important}.sgpb-corner-top-left{left:-106px;top:-139px;transform:rotate(-45deg);transform-origin:right center 0px;line-height:260px;width:155px;height:155px;display:inline-grid}.sgpb-corner-top-left:hover{left:-103px !important;top:-136px !important}
public/js/Backend.js CHANGED
@@ -4,36 +4,34 @@ SGPBBackend.sgAddEvent=function(element,eventName,fn)
4
  else if(element.attachEvent){element.attachEvent('on'+eventName,fn);}};SGPBBackend.prototype.sgInit=function()
5
  {this.makePopupTitleRequired();this.targetCondition();this.popupSelect2();this.sgTabs();this.accordion();this.initRadioAccordions();this.fixedPositionSelection();this.popupThemesPreview();this.setCloseButtonDefaultPositionValues();this.colorPicker();this.rangeSlider();this.backgroundRangeSliderInit();this.overlayRangeSliderInit();this.imageUpload();this.buttonImageUpload();this.buttonImageRemove();this.backgroundImageUpload();this.backgroundImageRemove();this.multipleChoiceButton();this.switchPopupActive();this.previewInit();this.soundUpload();this.resetSound();this.soundPreview();this.showInfo();this.openAnimationPreview();this.closeAnimationPreview();this.resetToDefaultValue();this.editPopupSettingsForFullscreenMode();this.autosave();this.popupBuilderButton();this.downloadSystemInfoFile();};SGPBBackend.prototype.changeTab=function(tab)
6
  {jQuery('#sgpb-editor-options-tab-content-wrapper-'+tab).css('display','none');var i,tabContent,tabLinks;tabContent=jQuery('.sgpb-editor-options-tab-content-wrapper');tabContent.each(function(){jQuery(this).css('display','none');});tabLinks=jQuery('.sgpb-editor-tab-links');tabLinks.each(function(){jQuery(this).removeClass('sgpb-active-tab');});jQuery('#sgpb-editor-options-tab-content-wrapper-'+tab).css('display','block');jQuery('.sgpb-editor-tab-'+tab).addClass('sgpb-active-tab');this.rangeSlider();};SGPBBackend.prototype.downloadSystemInfoFile=function(){if(!jQuery('.sgpb-download-system-info').length){return false;}
7
- jQuery('.sgpb-download-system-info').bind('click',function(){window.location.href=SGPB_JS_PARAMS.postUrl+'?action=sgpb_system_info';});}
8
- SGPBBackend.prototype.resetCssEditorContent=function(){jQuery('.editor-content-css').val('');}
9
- SGPBBackend.prototype.popupBuilderButton=function()
10
- {var that=this;jQuery(document).on('tinymce-editor-setup',function(event,editor){if(editor.settings.toolbar1.indexOf('popupBuilderHtmlButton')!=-1){return;}
11
  editor.settings.toolbar1+=', popupBuilderHtmlButton';editor.addButton('popupBuilderHtmlButton',{text:'Popup Builder Button',tooltip:'Popup Builder Custom HTML Button',icon:'wp-menu-image dashicons-before dashicons-menu-icon-sgpb-button',onclick:function(){that.mediaButtonPopup('sgpb-custom-button-wrapper');}});});};SGPBBackend.popups=[];SGPBBackend.prototype.mediaButtonPopup=function(hiddenDivId)
12
  {var select2Init=1;var that=this;var popupConfigObj=new PopupConfig();popupConfigObj.magicCall('setContentPadding',14);popupConfigObj.magicCall('setContentBorderRadius',4);popupConfigObj.magicCall('setContentBorderRadiusType','px');popupConfigObj.magicCall('setScrollingEnabled',true);popupConfigObj.magicCall('setContentBorderWidth',5);popupConfigObj.magicCall('setContentBorderColor','#506274');popupConfigObj.magicCall('setShadowSpread',1);popupConfigObj.magicCall('setContentShadowBlur',4);popupConfigObj.magicCall('setContentShadowColor','#cccccc');popupConfigObj.magicCall('setMinWidth',400);popupConfigObj.magicCall('contents',document.getElementById(hiddenDivId));popupConfigObj.magicCall('setOverlayColor','black');popupConfigObj.magicCall('setOverlayOpacity',40);var config=popupConfigObj.combineConfigObj();var popup=new SGPopup(config);if(!SGPBBackend.popups.length){SGPBBackend.popups.push(popup);}
13
- SGPBBackend.popups[0].open();jQuery(window).bind('sgpbDidOpen',function(){jQuery('.sgpb-insert-popup').addClass('js-sg-select2');if(select2Init==1){that.popupSelect2();}
14
- select2Init++;jQuery('.select2-container--below').remove();that.popupSelect2();that.customButtonColorPicker();if(mediaButtonParams.currentPostType!=mediaButtonParams.popupBuilderPostType){that.customButtonColorPicker();jQuery('.sgpb-custom-button-popup').addClass('js-sg-select2');if(select2Init==1){that.popupSelect2();}
15
  select2Init++;jQuery('.select2-container--below').remove();that.popupSelect2();}
16
  else{that.multipleChoiceButton();that.customButtonColorPicker();}
17
  that.insertHTMLButtonToEditor();that.closeMediaButtonPopup(popup);});that.accordion();jQuery(window).on('sgpbMultichoiceChanged',function(){that.accordion();});};SGPBBackend.prototype.customButtonColorPicker=function()
18
  {var that=this;var colorPicker=jQuery('.sgpb-custom-button-color-picker');if(!colorPicker.length){return false;}
19
  colorPicker.wpColorPicker({change:function(){var colorPickerElement=jQuery(this);that.changeColor(colorPickerElement);}});jQuery('.wp-picker-holder').bind('click',function(){var selectedInput=jQuery(this).prev().find('.sgpb-color-picker');that.changeColor(selectedInput);});};SGPBBackend.prototype.insertHTMLButtonToEditor=function()
20
  {jQuery('.sgpb-insert-custom-button-to-editor').unbind('click').bind('click',function(){var buttonTitle=jQuery('#sgpb-custom-btn-title').val();var style='';jQuery('.sgpb-custom-button-settings').each(function(){var styleType=jQuery(this).data('style-type');var val=jQuery(this).val();style+=styleType+': '+val+';';});var defaultStyles={padding:0,'font-size':'22px','font-weight':900};for(var styleType in defaultStyles){style+=styleType+': '+defaultStyles[styleType]+';';}
21
- var serizlizedOption=jQuery('#sgpb-custom-button-wrapper').find('select,textarea, input');var allOptionsObj={};serizlizedOption.each(function(){var name=jQuery(this).attr('name');if(jQuery(this).attr('type')=='checkbox'){if(jQuery(this).is(':checked')){var value=jQuery(this).val();allOptionsObj[name]=value;}
22
  return true;}
23
- if(jQuery(this).attr('type')=='radio'){if(jQuery(this).is(':checked')){var value=jQuery(this).val();allOptionsObj[name]=value;}}
24
- else{var value=jQuery(this).val();allOptionsObj[name]=value;}});var bgColor=allOptionsObj['sgpb-custom-btn-bg-color'];var hoverBgColor=allOptionsObj['sgpb-custom-btn-bg-color'];var allOptionsJson=encodeURI(JSON.stringify(allOptionsObj));var id=Math.floor(Math.random()*Math.floor(100000));var button='<button style="'+style+'" class="sgpb-html-custom-button sgpb-html-custom-button-'+id+'" data-options='+allOptionsJson+' onMouseOver="this.style.backgroundColor="'+hoverBgColor+'" onMouseOut="this.style.backgroundColor="'+bgColor+'" ">'+buttonTitle+'</button>';button+='<style>.sgpb-html-custom-button-'+id+':hover {background-color: '+hoverBgColor+' !important;}</style>';if(allOptionsObj['sgpb-custom-button']=='openPopup'){var currentPopupId=allOptionsObj['sgpb-custom-button-popup'];button='[sg_popup id="'+currentPopupId+'" insidePopup="on"] <br>'+button+'<br>[/sg_popup]';}
25
  window.send_to_editor(button);});};SGPBBackend.prototype.closeMediaButtonPopup=function(popup)
26
  {jQuery('.sgpb-close-media-popup-js').on('click',function(){popup.close();});};SGPBBackend.prototype.resetToDefaultValue=function()
27
  {var htmlTarget=jQuery('.js-sgpb-reset-default-value');if(!htmlTarget.length){return false;}
28
  htmlTarget.each(function(){jQuery(this).bind('change',function(){var currentValue=jQuery(this).val();var defaultValue=jQuery(this).data('default');if(!defaultValue||currentValue){return false;}
29
- jQuery(this).val(defaultValue)});})};SGPBBackend.prototype.showInfo=function()
30
  {jQuery('.sgpb-info-icon').hover(function(){jQuery(this).nextAll('.sgpb-info-text').first().css({'display':'inline-block'});},function(){jQuery(this).nextAll('.sgpb-info-text').first().css({'display':'none'});});};SGPBBackend.prototype.soundPreview=function()
31
- {var songValue=1;var lastSong=undefined;jQuery('.js-preview-sound').bind('click',function(){var uploadFile=jQuery('#js-sound-open-url').val();if(typeof lastSong=='undefined'){lastSong=new Audio(uploadFile);}
32
- if(songValue==1){lastSong.play();songValue=2;}
33
- else if(songValue==2){lastSong.pause();songValue=1;}
34
  lastSong.onended=function()
35
- {lastSong=undefined;songValue=1;}});jQuery('#js-sound-open-url').change(function(){if(typeof lastSong!='undefined'){lastSong.pause();lastSong=undefined;}
36
- songValue=1;});jQuery('#js-reset-to-default-song').click(function(e){e.preventDefault();if(typeof lastSong!='undefined'){lastSong.pause();lastSong=undefined;}
37
  songValue=1;var defaultSong=jQuery(this).data('default-song');jQuery('#js-sound-open-url').val(defaultSong).change();});};SGPBBackend.prototype.resetSound=function()
38
  {var resetButton=jQuery('#js-reset-to-default-song');if(!resetButton.length){return false;}
39
  resetButton.bind('click',function(){var defaultSoundUrl=jQuery(this).data('default-song');jQuery('#js-sound-open-url').val(defaultSoundUrl).change();});};SGPBBackend.prototype.soundUpload=function()
@@ -49,11 +47,11 @@ var closeAnimation=jQuery('.sgpb-preview-close-animation');var closeAnimationDiv
49
  var speedSeconds=speedVal*1000;setTimeout(function(){closeAnimationDiv.hide();},speedSeconds);closeAnimationDiv.removeClass();closeAnimationDiv.show();closeAnimationDiv.css({'animationDuration':speedSeconds+'ms'});closeAnimationDiv.addClass('sg-animated '+jQuery('.sgpb-close-animation-effects option:selected').val());};jQuery('.sgpb-close-animation-effects').bind('change',closeAnimationAction);closeAnimationPreview.bind('click',closeAnimationAction);};SGPBBackend.prototype.multipleChoiceButton=function()
50
  {if(!jQuery('.sgpb-choice-wrapper input').length){return false;}
51
  var that=this;jQuery('.sgpb-choice-option-wrapper input').each(function(){if(jQuery(this).is(':checked')){that.buildChoiceShowOption(jQuery(this));}
52
- jQuery(this).on("click",function(){that.hideAllChoiceWrapper(jQuery('.sgpb-choice-option-wrapper'));that.buildChoiceShowOption(jQuery(this));jQuery(window).trigger('sgpbMultichoiceChanged');});})};SGPBBackend.prototype.hideAllChoiceWrapper=function(choiceOptionsWrapper)
53
  {choiceOptionsWrapper.each(function(){var choiceInput=jQuery(this).find('input');if(!choiceInput.length){return;}
54
- var choiceInputWrapperId=choiceInput.attr('data-attr-href');jQuery('#'+choiceInputWrapperId).addClass('sg-hide');})};SGPBBackend.prototype.buildChoiceShowOption=function(currentRadioButton)
55
  {var choiceOptions=currentRadioButton.attr('data-attr-href');var currentOptionWrapper=currentRadioButton.parents('.sgpb-choice-wrapper').first();var choiceOptionWrapper=jQuery('#'+choiceOptions).removeClass('sg-hide');currentOptionWrapper.after(choiceOptionWrapper);};SGPBBackend.prototype.initRadioAccordions=function()
56
- {var radioButtonsList=[jQuery("[name='sgpb-content-click-behavior']"),jQuery("[name='sgpb-popup-dimension-mode']")];for(var radioButtonIndex in radioButtonsList){var radioButton=radioButtonsList[radioButtonIndex];if(typeof radioButton!='object'){continue;}
57
  var that=this;radioButton.each(function(){that.buildRadioAccordionActions(jQuery(this));});radioButton.on("change",function(){that.buildRadioAccordionActions(jQuery(this),'change');});}};SGPBBackend.prototype.buildRadioAccordionActions=function(currentRadioButton,event)
58
  {if(event=='change'){currentRadioButton.parents('.sg-radio-option-behavior').first().find('.js-radio-accordion').addClass('sg-hide');}
59
  var value=currentRadioButton.val();var toggleContent=jQuery('.js-accordion-'+value);toggleContent.addClass('sg-hide');var addAfter=currentRadioButton;if(currentRadioButton.is(':checked')){if(currentRadioButton.parents('.row').first().length){addAfter=currentRadioButton.parents('.row').first();}
@@ -188,4 +186,4 @@ responsiveModeSelector.change(function(){var selectedMode=jQuery(this).val();if(
188
  {var c;if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)){c=hex.substring(1).split('');if(c.length==3){c=[c[0],c[0],c[1],c[1],c[2],c[2]];}
189
  c='0x'+c.join('');return'rgba('+[(c>>16)&255,(c>>8)&255,c&255].join(',')+','+opacity+')';}
190
  throw new Error('Bad Hex');};SGPBBackend.resetCount=function(popupId)
191
- {if(confirm(SGPB_JS_LOCALIZATION.areYouSure)){var data={nonce:SGPB_JS_PARAMS.nonce,action:'sgpb_reset_popup_opening_count',popupId:popupId};jQuery.post(ajaxurl,data,function(response){location.reload();});}};jQuery(document).ready(function(){sgpbBackendObj=new SGPBBackend();sgpbBackendObj.sgInit();});jQuery(window).load(function(){sgpbBackendObj.rangeSlider();});
4
  else if(element.attachEvent){element.attachEvent('on'+eventName,fn);}};SGPBBackend.prototype.sgInit=function()
5
  {this.makePopupTitleRequired();this.targetCondition();this.popupSelect2();this.sgTabs();this.accordion();this.initRadioAccordions();this.fixedPositionSelection();this.popupThemesPreview();this.setCloseButtonDefaultPositionValues();this.colorPicker();this.rangeSlider();this.backgroundRangeSliderInit();this.overlayRangeSliderInit();this.imageUpload();this.buttonImageUpload();this.buttonImageRemove();this.backgroundImageUpload();this.backgroundImageRemove();this.multipleChoiceButton();this.switchPopupActive();this.previewInit();this.soundUpload();this.resetSound();this.soundPreview();this.showInfo();this.openAnimationPreview();this.closeAnimationPreview();this.resetToDefaultValue();this.editPopupSettingsForFullscreenMode();this.autosave();this.popupBuilderButton();this.downloadSystemInfoFile();};SGPBBackend.prototype.changeTab=function(tab)
6
  {jQuery('#sgpb-editor-options-tab-content-wrapper-'+tab).css('display','none');var i,tabContent,tabLinks;tabContent=jQuery('.sgpb-editor-options-tab-content-wrapper');tabContent.each(function(){jQuery(this).css('display','none');});tabLinks=jQuery('.sgpb-editor-tab-links');tabLinks.each(function(){jQuery(this).removeClass('sgpb-active-tab');});jQuery('#sgpb-editor-options-tab-content-wrapper-'+tab).css('display','block');jQuery('.sgpb-editor-tab-'+tab).addClass('sgpb-active-tab');this.rangeSlider();};SGPBBackend.prototype.downloadSystemInfoFile=function(){if(!jQuery('.sgpb-download-system-info').length){return false;}
7
+ jQuery('.sgpb-download-system-info').bind('click',function(){window.location.href=SGPB_JS_PARAMS.postUrl+'?action=sgpb_system_info';});};SGPBBackend.prototype.resetCssEditorContent=function(){jQuery('.editor-content-css').val('');};SGPBBackend.prototype.popupBuilderButton=function()
8
+ {var that=this;jQuery(document).on('tinymce-editor-setup',function(event,editor){if(editor.settings.toolbar1.indexOf('popupBuilderHtmlButton')!==-1){return;}
 
 
9
  editor.settings.toolbar1+=', popupBuilderHtmlButton';editor.addButton('popupBuilderHtmlButton',{text:'Popup Builder Button',tooltip:'Popup Builder Custom HTML Button',icon:'wp-menu-image dashicons-before dashicons-menu-icon-sgpb-button',onclick:function(){that.mediaButtonPopup('sgpb-custom-button-wrapper');}});});};SGPBBackend.popups=[];SGPBBackend.prototype.mediaButtonPopup=function(hiddenDivId)
10
  {var select2Init=1;var that=this;var popupConfigObj=new PopupConfig();popupConfigObj.magicCall('setContentPadding',14);popupConfigObj.magicCall('setContentBorderRadius',4);popupConfigObj.magicCall('setContentBorderRadiusType','px');popupConfigObj.magicCall('setScrollingEnabled',true);popupConfigObj.magicCall('setContentBorderWidth',5);popupConfigObj.magicCall('setContentBorderColor','#506274');popupConfigObj.magicCall('setShadowSpread',1);popupConfigObj.magicCall('setContentShadowBlur',4);popupConfigObj.magicCall('setContentShadowColor','#cccccc');popupConfigObj.magicCall('setMinWidth',400);popupConfigObj.magicCall('contents',document.getElementById(hiddenDivId));popupConfigObj.magicCall('setOverlayColor','black');popupConfigObj.magicCall('setOverlayOpacity',40);var config=popupConfigObj.combineConfigObj();var popup=new SGPopup(config);if(!SGPBBackend.popups.length){SGPBBackend.popups.push(popup);}
11
+ SGPBBackend.popups[0].open();jQuery(window).bind('sgpbDidOpen',function(){jQuery('.sgpb-insert-popup').addClass('js-sg-select2');if(select2Init===1){that.popupSelect2();}
12
+ select2Init++;jQuery('.select2-container--below').remove();that.popupSelect2();that.customButtonColorPicker();if(mediaButtonParams.currentPostType!==mediaButtonParams.popupBuilderPostType){that.customButtonColorPicker();jQuery('.sgpb-custom-button-popup').addClass('js-sg-select2');if(select2Init===1){that.popupSelect2();}
13
  select2Init++;jQuery('.select2-container--below').remove();that.popupSelect2();}
14
  else{that.multipleChoiceButton();that.customButtonColorPicker();}
15
  that.insertHTMLButtonToEditor();that.closeMediaButtonPopup(popup);});that.accordion();jQuery(window).on('sgpbMultichoiceChanged',function(){that.accordion();});};SGPBBackend.prototype.customButtonColorPicker=function()
16
  {var that=this;var colorPicker=jQuery('.sgpb-custom-button-color-picker');if(!colorPicker.length){return false;}
17
  colorPicker.wpColorPicker({change:function(){var colorPickerElement=jQuery(this);that.changeColor(colorPickerElement);}});jQuery('.wp-picker-holder').bind('click',function(){var selectedInput=jQuery(this).prev().find('.sgpb-color-picker');that.changeColor(selectedInput);});};SGPBBackend.prototype.insertHTMLButtonToEditor=function()
18
  {jQuery('.sgpb-insert-custom-button-to-editor').unbind('click').bind('click',function(){var buttonTitle=jQuery('#sgpb-custom-btn-title').val();var style='';jQuery('.sgpb-custom-button-settings').each(function(){var styleType=jQuery(this).data('style-type');var val=jQuery(this).val();style+=styleType+': '+val+';';});var defaultStyles={padding:0,'font-size':'22px','font-weight':900};for(var styleType in defaultStyles){style+=styleType+': '+defaultStyles[styleType]+';';}
19
+ var serizlizedOption=jQuery('#sgpb-custom-button-wrapper').find('select,textarea, input');var allOptionsObj={};serizlizedOption.each(function(){var name=jQuery(this).attr('name');if(jQuery(this).attr('type')==='checkbox'){if(jQuery(this).is(':checked')){var value=jQuery(this).val();allOptionsObj[name]=value;}
20
  return true;}
21
+ if(jQuery(this).attr('type')==='radio'){if(jQuery(this).is(':checked')){var value=jQuery(this).val();allOptionsObj[name]=value;}}
22
+ else{var value=jQuery(this).val();allOptionsObj[name]=value;}});var bgColor=allOptionsObj['sgpb-custom-btn-bg-color'];var hoverBgColor=allOptionsObj['sgpb-custom-btn-bg-color'];var allOptionsJson=encodeURI(JSON.stringify(allOptionsObj));var id=Math.floor(Math.random()*Math.floor(100000));var button='<button style="'+style+'" class="sgpb-html-custom-button sgpb-html-custom-button-'+id+'" data-options='+allOptionsJson+' onMouseOver="this.style.backgroundColor="'+hoverBgColor+'" onMouseOut="this.style.backgroundColor="'+bgColor+'" ">'+buttonTitle+'</button>';button+='<style>.sgpb-html-custom-button-'+id+':hover {background-color: '+hoverBgColor+' !important;}</style>';if(allOptionsObj['sgpb-custom-button']==='openPopup'){var currentPopupId=allOptionsObj['sgpb-custom-button-popup'];button='[sg_popup id="'+currentPopupId+'" insidePopup="on"] <br>'+button+'<br>[/sg_popup]';}
23
  window.send_to_editor(button);});};SGPBBackend.prototype.closeMediaButtonPopup=function(popup)
24
  {jQuery('.sgpb-close-media-popup-js').on('click',function(){popup.close();});};SGPBBackend.prototype.resetToDefaultValue=function()
25
  {var htmlTarget=jQuery('.js-sgpb-reset-default-value');if(!htmlTarget.length){return false;}
26
  htmlTarget.each(function(){jQuery(this).bind('change',function(){var currentValue=jQuery(this).val();var defaultValue=jQuery(this).data('default');if(!defaultValue||currentValue){return false;}
27
+ jQuery(this).val(defaultValue);});});};SGPBBackend.prototype.showInfo=function()
28
  {jQuery('.sgpb-info-icon').hover(function(){jQuery(this).nextAll('.sgpb-info-text').first().css({'display':'inline-block'});},function(){jQuery(this).nextAll('.sgpb-info-text').first().css({'display':'none'});});};SGPBBackend.prototype.soundPreview=function()
29
+ {var songValue=1;var lastSong=undefined;jQuery('.js-preview-sound').bind('click',function(){var uploadFile=jQuery('#js-sound-open-url').val();if(typeof lastSong==='undefined'){lastSong=new Audio(uploadFile);}
30
+ if(songValue===1){lastSong.play();songValue=2;}
31
+ else if(songValue===2){lastSong.pause();songValue=1;}
32
  lastSong.onended=function()
33
+ {lastSong=undefined;songValue=1;};});jQuery('#js-sound-open-url').change(function(){if(typeof lastSong!=='undefined'){lastSong.pause();lastSong=undefined;}
34
+ songValue=1;});jQuery('#js-reset-to-default-song').click(function(e){e.preventDefault();if(typeof lastSong!=='undefined'){lastSong.pause();lastSong=undefined;}
35
  songValue=1;var defaultSong=jQuery(this).data('default-song');jQuery('#js-sound-open-url').val(defaultSong).change();});};SGPBBackend.prototype.resetSound=function()
36
  {var resetButton=jQuery('#js-reset-to-default-song');if(!resetButton.length){return false;}
37
  resetButton.bind('click',function(){var defaultSoundUrl=jQuery(this).data('default-song');jQuery('#js-sound-open-url').val(defaultSoundUrl).change();});};SGPBBackend.prototype.soundUpload=function()
47
  var speedSeconds=speedVal*1000;setTimeout(function(){closeAnimationDiv.hide();},speedSeconds);closeAnimationDiv.removeClass();closeAnimationDiv.show();closeAnimationDiv.css({'animationDuration':speedSeconds+'ms'});closeAnimationDiv.addClass('sg-animated '+jQuery('.sgpb-close-animation-effects option:selected').val());};jQuery('.sgpb-close-animation-effects').bind('change',closeAnimationAction);closeAnimationPreview.bind('click',closeAnimationAction);};SGPBBackend.prototype.multipleChoiceButton=function()
48
  {if(!jQuery('.sgpb-choice-wrapper input').length){return false;}
49
  var that=this;jQuery('.sgpb-choice-option-wrapper input').each(function(){if(jQuery(this).is(':checked')){that.buildChoiceShowOption(jQuery(this));}
50
+ jQuery(this).on("click",function(){that.hideAllChoiceWrapper(jQuery('.sgpb-choice-option-wrapper'));that.buildChoiceShowOption(jQuery(this));jQuery(window).trigger('sgpbMultichoiceChanged');});});};SGPBBackend.prototype.hideAllChoiceWrapper=function(choiceOptionsWrapper)
51
  {choiceOptionsWrapper.each(function(){var choiceInput=jQuery(this).find('input');if(!choiceInput.length){return;}
52
+ var choiceInputWrapperId=choiceInput.attr('data-attr-href');jQuery('#'+choiceInputWrapperId).addClass('sg-hide');});};SGPBBackend.prototype.buildChoiceShowOption=function(currentRadioButton)
53
  {var choiceOptions=currentRadioButton.attr('data-attr-href');var currentOptionWrapper=currentRadioButton.parents('.sgpb-choice-wrapper').first();var choiceOptionWrapper=jQuery('#'+choiceOptions).removeClass('sg-hide');currentOptionWrapper.after(choiceOptionWrapper);};SGPBBackend.prototype.initRadioAccordions=function()
54
+ {var radioButtonsList=[jQuery("[name='sgpb-content-click-behavior']"),jQuery("[name='sgpb-popup-dimension-mode']")];for(var radioButtonIndex in radioButtonsList){var radioButton=radioButtonsList[radioButtonIndex];if(typeof radioButton!=='object'){continue;}
55
  var that=this;radioButton.each(function(){that.buildRadioAccordionActions(jQuery(this));});radioButton.on("change",function(){that.buildRadioAccordionActions(jQuery(this),'change');});}};SGPBBackend.prototype.buildRadioAccordionActions=function(currentRadioButton,event)
56
  {if(event=='change'){currentRadioButton.parents('.sg-radio-option-behavior').first().find('.js-radio-accordion').addClass('sg-hide');}
57
  var value=currentRadioButton.val();var toggleContent=jQuery('.js-accordion-'+value);toggleContent.addClass('sg-hide');var addAfter=currentRadioButton;if(currentRadioButton.is(':checked')){if(currentRadioButton.parents('.row').first().length){addAfter=currentRadioButton.parents('.row').first();}
186
  {var c;if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)){c=hex.substring(1).split('');if(c.length==3){c=[c[0],c[0],c[1],c[1],c[2],c[2]];}
187
  c='0x'+c.join('');return'rgba('+[(c>>16)&255,(c>>8)&255,c&255].join(',')+','+opacity+')';}
188
  throw new Error('Bad Hex');};SGPBBackend.resetCount=function(popupId)
189
+ {if(confirm(SGPB_JS_LOCALIZATION.areYouSure)){var data={nonce:SGPB_JS_PARAMS.nonce,action:'sgpb_reset_popup_opening_count',popupId:popupId};jQuery.post(ajaxurl,data,function(response){location.reload();});}};jQuery(document).ready(function(){sgpbBackendObj=new SGPBBackend();sgpbBackendObj.sgInit();});jQuery(window).on('load',function(){sgpbBackendObj.rangeSlider();});
public/js/Banner.js CHANGED
@@ -2,11 +2,10 @@ function SGPBBanner(){}
2
  SGPBBanner.prototype.init=function(){this.callFeedbackPopup();this.closeFeedbackPopup();this.close();this.closeLicenseNotice();};SGPBBanner.prototype.closeFeedbackPopup=function()
3
  {if(!jQuery('#sgpb-feedback-popup').length){return;}
4
  var hideFeedbackPopup=function(){jQuery('#sgpb-feedback-popup .js-sgpb-add-spinner').addClass('sg-hide-element');jQuery('#sgpb-feedback-popup').removeClass('sgpb-show-feedback-popup');}
5
- jQuery('#sgpb-feedback-popup .sgpb-subscriber-data-popup-close-btn-js').bind('click',function(){hideFeedbackPopup();});document.onkeydown=function(e){e=e||window.event;if(e.keyCode==27){hideFeedbackPopup();}};}
6
- SGPBBanner.prototype.callFeedbackPopup=function()
7
  {if(!jQuery('#sgpb-feedback-popup').length){return;}
8
  jQuery('.sgpb-feedback-error-message').addClass('sg-hide-element');var deactivateLink=jQuery('#the-list').find('[data-slug="popup-builder"] span.deactivate a'),dialog=jQuery('#sgpb-feedback-popup'),dialogForm=jQuery('#sgpb-deactivate-feedback-dialog-form');deactivateLink.bind('click',function(e){var deactivationLink=jQuery(this).attr('href');e.preventDefault();dialog.addClass('sgpb-show-feedback-popup');jQuery('.sgpb-deactivate-feedback-dialog-input').bind('click',function(){jQuery('.sgpb-feedback-text-input').hide();jQuery(this).parent().next().find('.sgpb-feedback-text-input').show();});jQuery('.sgpb-feedback-submit-skip').click(function(){window.location.href=deactivationLink;return;});jQuery('.sgpb-feedback-submit').click(function(){if(!jQuery('.sgpb-deactivate-feedback-dialog-input').is(':checked')){jQuery('.sgpb-feedback-error-message').removeClass('sg-hide-element');return;}
9
- var formData=dialogForm.serialize();var ajaxData={action:'sgpb_deactivate_feedback',nonce:SGPB_JS_PARAMS.nonce,beforeSend:function(){jQuery(this).attr('disabled','disabled');jQuery('.sgpb-feedback-error-message').addClass('sg-hide-element');jQuery('.js-sgpb-add-spinner').removeClass('sg-hide-element');},formData:formData};jQuery.post(SGPB_JS_PARAMS.url,ajaxData,function(res){window.location.href=deactivationLink;})});});};SGPBBanner.prototype.close=function()
10
  {if(!jQuery('.sgpb-banner-wrapper').length){return;}
11
  jQuery('.sgpb-info-close').click(function(){jQuery('.sgpb-banner-wrapper').remove();});};SGPBBanner.prototype.closeLicenseNotice=function()
12
  {if(!jQuery('.sgpb-extensions-notices').length){return;}
2
  SGPBBanner.prototype.init=function(){this.callFeedbackPopup();this.closeFeedbackPopup();this.close();this.closeLicenseNotice();};SGPBBanner.prototype.closeFeedbackPopup=function()
3
  {if(!jQuery('#sgpb-feedback-popup').length){return;}
4
  var hideFeedbackPopup=function(){jQuery('#sgpb-feedback-popup .js-sgpb-add-spinner').addClass('sg-hide-element');jQuery('#sgpb-feedback-popup').removeClass('sgpb-show-feedback-popup');}
5
+ jQuery('#sgpb-feedback-popup .sgpb-subscriber-data-popup-close-btn-js').bind('click',function(){hideFeedbackPopup();});document.onkeydown=function(e){e=e||window.event;if(e.keyCode===27){hideFeedbackPopup();}};};SGPBBanner.prototype.callFeedbackPopup=function()
 
6
  {if(!jQuery('#sgpb-feedback-popup').length){return;}
7
  jQuery('.sgpb-feedback-error-message').addClass('sg-hide-element');var deactivateLink=jQuery('#the-list').find('[data-slug="popup-builder"] span.deactivate a'),dialog=jQuery('#sgpb-feedback-popup'),dialogForm=jQuery('#sgpb-deactivate-feedback-dialog-form');deactivateLink.bind('click',function(e){var deactivationLink=jQuery(this).attr('href');e.preventDefault();dialog.addClass('sgpb-show-feedback-popup');jQuery('.sgpb-deactivate-feedback-dialog-input').bind('click',function(){jQuery('.sgpb-feedback-text-input').hide();jQuery(this).parent().next().find('.sgpb-feedback-text-input').show();});jQuery('.sgpb-feedback-submit-skip').click(function(){window.location.href=deactivationLink;return;});jQuery('.sgpb-feedback-submit').click(function(){if(!jQuery('.sgpb-deactivate-feedback-dialog-input').is(':checked')){jQuery('.sgpb-feedback-error-message').removeClass('sg-hide-element');return;}
8
+ var formData=dialogForm.serialize();var ajaxData={action:'sgpb_deactivate_feedback',nonce:SGPB_JS_PARAMS.nonce,beforeSend:function(){jQuery(this).attr('disabled','disabled');jQuery('.sgpb-feedback-error-message').addClass('sg-hide-element');jQuery('.js-sgpb-add-spinner').removeClass('sg-hide-element');},formData:formData};jQuery.post(SGPB_JS_PARAMS.url,ajaxData,function(res){window.location.href=deactivationLink;});});});};SGPBBanner.prototype.close=function()
9
  {if(!jQuery('.sgpb-banner-wrapper').length){return;}
10
  jQuery('.sgpb-info-close').click(function(){jQuery('.sgpb-banner-wrapper').remove();});};SGPBBanner.prototype.closeLicenseNotice=function()
11
  {if(!jQuery('.sgpb-extensions-notices').length){return;}
public/js/ExtensionsNotification.js CHANGED
@@ -2,8 +2,7 @@ function SGPBExtensionsNotification()
2
  {this.init();}
3
  SGPBExtensionsNotification.prototype.init=function()
4
  {this.closeExtensionNotificationPanel();this.dontShowAgain();this.closeProblemAlert();this.dontShowAgainProblemAlert();this.addToPopupMenuLinkColor();};SGPBExtensionsNotification.prototype.addToPopupMenuLinkColor=function()
5
- {jQuery('a[href="edit.php?post_type='+SGPB_JS_EXTENSIONS_PARAMS.popupPostType+'&page='+SGPB_JS_EXTENSIONS_PARAMS.extendPage+'"]').css({color:"#55efc4"})
6
- jQuery('a[href="edit.php?post_type='+SGPB_JS_EXTENSIONS_PARAMS.popupPostType+'&page='+SGPB_JS_EXTENSIONS_PARAMS.extendPage+'"]').attr('href',SGPB_JS_EXTENSIONS_PARAMS.allExtensionsUrl);jQuery('a[href="edit.php?post_type='+SGPB_JS_EXTENSIONS_PARAMS.popupPostType+'&page='+SGPB_JS_EXTENSIONS_PARAMS.supportPage+'"]').attr('href',SGPB_JS_EXTENSIONS_PARAMS.supportUrl);};SGPBExtensionsNotification.prototype.closeProblemAlert=function()
7
  {var closeButton=jQuery('.sgpb-problem-notice-close');if(!closeButton.length){return false;}
8
  closeButton.bind('click',function(){jQuery('.sgpb-alert-problem').remove();});};SGPBExtensionsNotification.prototype.dontShowAgainProblemAlert=function()
9
  {var dontShow=jQuery('.sgpb-problem-notice-dont-show');if(!dontShow.length){return false;}
2
  {this.init();}
3
  SGPBExtensionsNotification.prototype.init=function()
4
  {this.closeExtensionNotificationPanel();this.dontShowAgain();this.closeProblemAlert();this.dontShowAgainProblemAlert();this.addToPopupMenuLinkColor();};SGPBExtensionsNotification.prototype.addToPopupMenuLinkColor=function()
5
+ {jQuery('a[href="edit.php?post_type='+SGPB_JS_EXTENSIONS_PARAMS.popupPostType+'&page='+SGPB_JS_EXTENSIONS_PARAMS.extendPage+'"]').css({color:"#55efc4"});jQuery('a[href="edit.php?post_type='+SGPB_JS_EXTENSIONS_PARAMS.popupPostType+'&page='+SGPB_JS_EXTENSIONS_PARAMS.extendPage+'"]').attr('href',SGPB_JS_EXTENSIONS_PARAMS.allExtensionsUrl);jQuery('a[href="edit.php?post_type='+SGPB_JS_EXTENSIONS_PARAMS.popupPostType+'&page='+SGPB_JS_EXTENSIONS_PARAMS.supportPage+'"]').attr('href',SGPB_JS_EXTENSIONS_PARAMS.supportUrl);};SGPBExtensionsNotification.prototype.closeProblemAlert=function()
 
6
  {var closeButton=jQuery('.sgpb-problem-notice-close');if(!closeButton.length){return false;}
7
  closeButton.bind('click',function(){jQuery('.sgpb-alert-problem').remove();});};SGPBExtensionsNotification.prototype.dontShowAgainProblemAlert=function()
8
  {var dontShow=jQuery('.sgpb-problem-notice-dont-show');if(!dontShow.length){return false;}
public/js/FloatingButton.js ADDED
@@ -0,0 +1,231 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function SGPBFloatingButton() {
2
+
3
+ }
4
+
5
+ SGPBFloatingButton.prototype.adminInit = function()
6
+ {
7
+ var that = this;
8
+ var buttonStyle = jQuery('#sgpb-floating-button-style');
9
+ if (buttonStyle.length) {
10
+ that.reorderOtherOptions(buttonStyle.val());
11
+ that.reorderPositions(buttonStyle.val());
12
+ }
13
+ document.getElementById('sgpb-floating-btn-wrapper').addEventListener('change', function(){
14
+ that.livePreview();
15
+ });
16
+ jQuery('#sgpb-floating-button-text').on('keyup keypress', function() {
17
+ setTimeout(function(){
18
+
19
+ that.livePreview();
20
+ }, 100);
21
+ });
22
+
23
+ jQuery('#sgpb-enable-floating-button').on('click', function() {
24
+ if (!jQuery(this).is(':checked')) {
25
+ that.removeButton();
26
+ }
27
+ var buttonStyle = jQuery('#sgpb-floating-button-style').val();
28
+ that.reorderPositions(buttonStyle);
29
+ that.reorderOtherOptions(buttonStyle);
30
+ });
31
+ jQuery('#sgpb-floating-button-position').on('select2:close', function() {
32
+ setTimeout(function(){
33
+
34
+ that.livePreview();
35
+ }, 100);
36
+ });
37
+
38
+ jQuery('#sgpb-floating-button-style').on('select2:select', function(e) {
39
+ var data = e.params.data;
40
+ var buttonStyle = data.id;
41
+ setTimeout(function(){
42
+
43
+ that.livePreview();
44
+ that.reorderPositions(buttonStyle);
45
+ that.reorderOtherOptions(buttonStyle);
46
+ }, 100);
47
+ });
48
+
49
+ jQuery('#sgpb-floating-btn-wrapper .sgpb-color-picker').each(function() {
50
+ var currentColorPicker = jQuery(this);
51
+ currentColorPicker.wpColorPicker({
52
+ change: function() {
53
+ setTimeout(function(){
54
+
55
+ that.livePreview();
56
+ }, 100);
57
+ }
58
+ });
59
+ });
60
+ };
61
+
62
+ SGPBFloatingButton.prototype.livePreview = function()
63
+ {
64
+ var buttonIsEnabled = document.getElementById('sgpb-enable-floating-button').checked;
65
+ if (buttonIsEnabled) {
66
+ this.createButton();
67
+ }
68
+
69
+ return true;
70
+ };
71
+
72
+ SGPBFloatingButton.prototype.createButton = function()
73
+ {
74
+ /* we remove already existed button and create new */
75
+ this.removeButton();
76
+ var buttonStyle = document.getElementById('sgpb-floating-button-style').value;
77
+ var buttonPosition = document.getElementById('sgpb-floating-button-position').value;
78
+
79
+ this.hideShowUnrelatedOptions(buttonStyle);
80
+
81
+ var positionTop = document.getElementById('sgpb-floating-button-position-top').value;
82
+ var positionRight = document.getElementById('sgpb-floating-button-position-right').value;
83
+ var textColor = document.getElementById('sgpb-floating-button-text-color').value;
84
+ var bgColor = document.getElementById('sgpb-floating-button-bg-color').value;
85
+ var borderColor = document.getElementById('sgpb-floating-button-border-color').value;
86
+ var borderRadius = document.getElementById('sgpb-floating-button-border-radius').value;
87
+ var borderSize = document.getElementById('sgpb-floating-button-border-size').value;
88
+ var fontSize = document.getElementById('sgpb-floating-button-font-size').value;
89
+ var text = document.getElementById('sgpb-floating-button-text').value;
90
+ var button = document.createElement('button');
91
+ button.innerHTML = text;
92
+ button.id = 'sgpb-floating-button';
93
+ button.style.fontSize = fontSize+'px';
94
+ button.style.borderWidth = borderSize+'px';
95
+ button.style.borderRadius = borderRadius+'px';
96
+ button.style.borderColor = borderColor;
97
+ button.style.backgroundColor = bgColor;
98
+ button.style.color = textColor;
99
+ button.style.zIndex = '99999999';
100
+ button.style.position = 'fixed';
101
+ button.style.textAlign = 'center';
102
+ button.style.padding = '10px';
103
+ if (buttonPosition.includes('right')) {
104
+ button.style.right = '0';
105
+ if (buttonPosition.includes('center')) {
106
+ button.style.top = positionTop+'%';
107
+ button.style.transform = 'rotate(-90deg)';
108
+ button.style.transformOrigin = 'bottom right';
109
+ }
110
+ }
111
+ if (buttonPosition.includes('bottom')) {
112
+ button.style.bottom = '0';
113
+ if (buttonPosition.includes('center')) {
114
+ button.style.right = positionRight+'%';
115
+ }
116
+ }
117
+ if (buttonPosition.includes('left')) {
118
+ button.style.left = '0';
119
+ if (buttonPosition.includes('center')) {
120
+ button.style.top = positionTop+'%';
121
+ button.style.transform = 'rotate(90deg)';
122
+ button.style.transformOrigin = 'left bottom';
123
+ }
124
+ }
125
+ if (buttonPosition.includes('top')) {
126
+ button.style.top = '0';
127
+ if (buttonPosition.includes('center')) {
128
+ button.style.right = positionRight+'%';
129
+ }
130
+ }
131
+ if (buttonStyle === 'corner') {
132
+ if (buttonPosition === 'top-left') {
133
+ button.style.left = '-106px';
134
+ button.style.top = '-139px';
135
+ button.style.transform = 'rotate(-45deg)';
136
+ button.style.transformOrigin = 'right center';
137
+ }
138
+ if (buttonPosition === 'bottom-left') {
139
+ button.style.left = '-106px';
140
+ button.style.bottom = '-139px';
141
+ button.style.transform = 'rotate(45deg)';
142
+ button.style.transformOrigin = 'right center';
143
+ }
144
+ if (buttonPosition === 'top-right') {
145
+ button.style.right = '-58px';
146
+ button.style.top = '-27px';
147
+ button.style.transform = 'rotate(45deg)';
148
+ button.style.transformOrigin = 'right center';
149
+ }
150
+ if (buttonPosition === 'bottom-right') {
151
+ button.style.right = '-58px';
152
+ button.style.bottom = '-27px';
153
+ button.style.transform = 'rotate(-45deg)';
154
+ button.style.transformOrigin = 'right';
155
+ }
156
+ button.style.width = '160px';
157
+ button.style.height = '160px';
158
+ button.style.display = 'inline-grid';
159
+ }
160
+ button.className = 'sgpb-'+buttonStyle+'-'+buttonPosition;
161
+ document.getElementsByTagName('body')[0].appendChild(button);
162
+ };
163
+
164
+ SGPBFloatingButton.prototype.removeButton = function()
165
+ {
166
+ var button = document.getElementById('sgpb-floating-button');
167
+ if (button !== null) {
168
+ button.parentNode.removeChild(button);
169
+ }
170
+ };
171
+
172
+ SGPBFloatingButton.prototype.hideShowUnrelatedOptions = function(buttonStyle)
173
+ {
174
+ var that = this;
175
+ jQuery('#sgpb-floating-button-style').on('select2:select', function (e) {
176
+ var data = e.params.data;
177
+ /* data.id = 'corner/basic' */
178
+ that.reorderPositions(data.id);
179
+ that.reorderOtherOptions(data.id);
180
+ });
181
+ };
182
+
183
+ SGPBFloatingButton.prototype.reorderPositions = function(buttonStyle)
184
+ {
185
+ var positionDropdown = jQuery('#sgpb-floating-button-position');
186
+ if (!positionDropdown.length) {
187
+ return false;
188
+ }
189
+ /* these positions will be removed or appended */
190
+ var dynamicPositions = [
191
+ {'id': 'top-center', 'text': 'Top center'},
192
+ {'id': 'bottom-center', 'text': 'Bottom center'},
193
+ {'id': 'right-center', 'text': 'Right center'},
194
+ {'id': 'left-center', 'text': 'Left center'}
195
+ ];
196
+ /* we need the loop and checking button style in it, to know if we should add or remove the related options */
197
+ for (var i in dynamicPositions) {
198
+ if (buttonStyle === 'corner') {
199
+ positionDropdown.find("option[value='" + dynamicPositions[i].id + "']").remove();
200
+ }
201
+ if (buttonStyle === 'basic') {
202
+ /* check if we've already had this option (select2 documentation method) */
203
+ if (positionDropdown.find("option[value='" + dynamicPositions[i].id + "']").length) {
204
+ positionDropdown.val(dynamicPositions[i].id).trigger('change');
205
+ }
206
+ else {
207
+ var newOption = new Option(dynamicPositions[i].text, dynamicPositions[i].id, false, false);
208
+ positionDropdown.append(newOption).trigger('change');
209
+ }
210
+ }
211
+ }
212
+
213
+ return false;
214
+ };
215
+
216
+ SGPBFloatingButton.prototype.reorderOtherOptions = function(buttonStyle)
217
+ {
218
+ jQuery('.sgpb-basic-button-style-options-wrapper-js').removeClass('sgpb-hide');
219
+ if (buttonStyle === 'corner') {
220
+ jQuery('.sgpb-basic-button-style-options-wrapper-js').addClass('sgpb-hide');
221
+ }
222
+ };
223
+
224
+ jQuery(document).ready(function() {
225
+ if (document.getElementById('sgpb-enable-floating-button') === null) {
226
+ return false;
227
+ }
228
+ var sgpbFloatingBtn = new SGPBFloatingButton();
229
+ sgpbFloatingBtn.livePreview();
230
+ sgpbFloatingBtn.adminInit();
231
+ });
public/js/MediaButton.js CHANGED
@@ -1,27 +1,27 @@
1
  function SGPBMediaButton(){}
2
  SGPBMediaButton.prototype.init=function()
3
  {this.tinymceButton();this.openMediaButtonPopup();};SGPBMediaButton.prototype.tinymceButton=function()
4
- {var that=this;jQuery(document).on('tinymce-editor-setup',function(event,editor){if(editor.settings.toolbar1.indexOf('popupBuilderEditorButton')!=-1){return;}
5
  editor.settings.toolbar1+=', popupBuilderEditorButton';editor.addButton('popupBuilderEditorButton',{icon:'wp-menu-image dashicons-before dashicons-menu-icon-sgpb sgpb-tinymce-button',onclick:function(){that.mediaButtonPopup();}});});};SGPBMediaButton.prototype.openMediaButtonPopup=function()
6
  {var that=this;jQuery('.sgpb-tinymce-button, .sgpb-insert-media-button-js, .sgpb-insert-js-variable').unbind('click').bind('click',function(e){e.preventDefault();that.mediaButtonPopup(jQuery(this));});};SGPBMediaButton.prototype.mediaButtonPopup=function(currentTag)
7
- {var select2Init=1;var that=this;var hiddenDivId=jQuery(currentTag).attr('data-id')||'sgpb-hidden-media-popup';var popupConfigObj=new PopupConfig();popupConfigObj.magicCall('setContentPadding',14);popupConfigObj.magicCall('setContentBorderRadius',4);popupConfigObj.magicCall('setContentBorderRadiusType','px');popupConfigObj.magicCall('setContentBorderWidth',5);popupConfigObj.magicCall('setContentBorderColor','#506274');popupConfigObj.magicCall('setShadowSpread',1);popupConfigObj.magicCall('setContentShadowBlur',4);popupConfigObj.magicCall('setContentShadowColor','#cccccc');popupConfigObj.magicCall('setMinWidth',400);popupConfigObj.magicCall('setSrcElement',hiddenDivId);popupConfigObj.magicCall('setOverlayColor','black');popupConfigObj.magicCall('setOverlayOpacity',40);var config=popupConfigObj.combineConfigObj();var popup=new SGPopup(config);popup.open();jQuery(window).bind('sgpbDidOpen',function(){jQuery('.sgpb-insert-popup').addClass('js-sg-select2');if(mediaButtonParams.currentPostType!=mediaButtonParams.popupBuilderPostType){jQuery('.sgpb-insert-popup-event').addClass('js-sg-select2');if(select2Init==1){that.popupSelect2();}
8
  select2Init++;jQuery('.select2-container--below').remove();that.popupSelect2();}
9
  else{that.popupSelect2();jQuery('.select2-container--below').remove();}
10
  that.closeMediaButtonPopup(popup);});that.insertPopup(popup);};SGPBMediaButton.prototype.closeMediaButtonPopup=function(popup)
11
  {jQuery('.sgpb-close-media-popup-js').on('click',function(){popup.close();});};SGPBMediaButton.prototype.insertPopup=function(popup)
12
- {var insidePopup=false;if(mediaButtonParams.currentPostType==mediaButtonParams.popupBuilderPostType){insidePopup=true;}
13
- jQuery('.sgpb-insert-popup-js').unbind('click').bind('click',function(){var selectedContent='';var selectedPopup=jQuery('.sgpb-insert-popup').val();var selectedPopupEvent=jQuery('.sgpb-insert-popup-event').val();if(typeof selectedPopupEvent!='undefined'){selectedPopupEvent=' event="'+selectedPopupEvent+'"';}
14
  else{selectedPopupEvent='';if(insidePopup){selectedPopupEvent=' insidePopup="on"';}}
15
- if(selectedPopup==''||selectedPopup==null){popup.close();return;}
16
- if(selectedPopupEvent=='onLoad'&&!insidePopup){window.send_to_editor('[sg_popup id="'+selectedPopup+'"'+selectedPopupEvent+'][/sg_popup]');popup.close();return;}
17
- if(typeof tinyMCE.editors.content!='undefined'&&(document.getElementById('content').offsetParent===null)){selectedContent=(tinyMCE.activeEditor.selection.getContent())?tinyMCE.activeEditor.selection.getContent():'';}
18
- else{var content=document.getElementById('content');var selectedContent;if(typeof document.selection!='undefined'){content.focus();var sel=document.selection.createRange();selectedContent=sel.text;}
19
- else if(typeof content!='undefined'&&content!=null){if(typeof content.selectionStart!='undefined'){var startPos=content.selectionStart;var endPos=content.selectionEnd;selectedContent=content.value.substring(startPos,endPos);}}}
20
- window.send_to_editor('[sg_popup id="'+selectedPopup+'"'+selectedPopupEvent+']'+selectedContent+'[/sg_popup]');popup.close();});jQuery('.sgpb-insert-js-variable-to-editor').unbind('click').bind('click',function(){var jsVariableSelector=jQuery('.sgpb-popup-dialog-main-div-wrapper .sgpb-js-variable-selector').val();var jsVariableAttribute=jQuery('.sgpb-popup-dialog-main-div-wrapper .sgpb-js-variable-attribute').val();jQuery('.sgpb-js-variable-errors').addClass('sg-hide-element');var valid=true;if(jsVariableSelector==''){valid=false;jQuery('.sgpb-js-variable-selector-error').removeClass('sg-hide-element');}
21
- if(jsVariableAttribute==''){valid=false;jQuery('.sgpb-js-variable-attribute-error').removeClass('sg-hide-element');}
22
  if(!valid){return false;}
23
  jQuery('.sgpb-js-variable-errors').addClass('sg-hide-element');window.send_to_editor('[pbvariable selector="'+jsVariableSelector+'" attribute="'+jsVariableAttribute+'"]');popup.close();});};SGPBMediaButton.prototype.popupSelect2=function()
24
  {if(!jQuery('.js-sg-select2').length){return;}
25
- jQuery('select.js-sg-select2').each(function(){var type=jQuery(this).attr('data-select-type');var className=jQuery(this).attr('data-select-class');var options={width:'100%'};if(type=='ajax'){if(typeof SGPB_JS_PARAMS=='undefined'){return;}
26
- options=jQuery.extend(options,{minimumInputLength:1,ajax:{url:SGPB_JS_PARAMS.url,dataType:'json',delay:250,type:'POST',data:function(params){var searchKey=jQuery(this).attr('data-value-param');return{action:'select2_search_data',nonce_ajax:SGPB_JS_PARAMS.nonce,searchTerm:params.term,searchKey:searchKey};},processResults:function(data){return{results:jQuery.map(data.items,function(item){return{text:item.text,id:item.id}})};}}});}
27
  jQuery(this).sgpbselect2(options);});};jQuery(document).ready(function(){var mediaButton=new SGPBMediaButton();jQuery(document).on('tinymce-editor-init',function(event,editor){mediaButton.init();});});
1
  function SGPBMediaButton(){}
2
  SGPBMediaButton.prototype.init=function()
3
  {this.tinymceButton();this.openMediaButtonPopup();};SGPBMediaButton.prototype.tinymceButton=function()
4
+ {var that=this;jQuery(document).on('tinymce-editor-setup',function(event,editor){if(editor.settings.toolbar1.indexOf('popupBuilderEditorButton')!==-1){return;}
5
  editor.settings.toolbar1+=', popupBuilderEditorButton';editor.addButton('popupBuilderEditorButton',{icon:'wp-menu-image dashicons-before dashicons-menu-icon-sgpb sgpb-tinymce-button',onclick:function(){that.mediaButtonPopup();}});});};SGPBMediaButton.prototype.openMediaButtonPopup=function()
6
  {var that=this;jQuery('.sgpb-tinymce-button, .sgpb-insert-media-button-js, .sgpb-insert-js-variable').unbind('click').bind('click',function(e){e.preventDefault();that.mediaButtonPopup(jQuery(this));});};SGPBMediaButton.prototype.mediaButtonPopup=function(currentTag)
7
+ {var select2Init=1;var that=this;var hiddenDivId=jQuery(currentTag).attr('data-id')||'sgpb-hidden-media-popup';var popupConfigObj=new PopupConfig();popupConfigObj.magicCall('setContentPadding',14);popupConfigObj.magicCall('setContentBorderRadius',4);popupConfigObj.magicCall('setContentBorderRadiusType','px');popupConfigObj.magicCall('setContentBorderWidth',5);popupConfigObj.magicCall('setContentBorderColor','#506274');popupConfigObj.magicCall('setShadowSpread',1);popupConfigObj.magicCall('setContentShadowBlur',4);popupConfigObj.magicCall('setContentShadowColor','#cccccc');popupConfigObj.magicCall('setMinWidth',400);popupConfigObj.magicCall('setSrcElement',hiddenDivId);popupConfigObj.magicCall('setOverlayColor','black');popupConfigObj.magicCall('setOverlayOpacity',40);var config=popupConfigObj.combineConfigObj();var popup=new SGPopup(config);popup.open();jQuery(window).bind('sgpbDidOpen',function(){jQuery('.sgpb-insert-popup').addClass('js-sg-select2');if(mediaButtonParams.currentPostType!==mediaButtonParams.popupBuilderPostType){jQuery('.sgpb-insert-popup-event').addClass('js-sg-select2');if(select2Init===1){that.popupSelect2();}
8
  select2Init++;jQuery('.select2-container--below').remove();that.popupSelect2();}
9
  else{that.popupSelect2();jQuery('.select2-container--below').remove();}
10
  that.closeMediaButtonPopup(popup);});that.insertPopup(popup);};SGPBMediaButton.prototype.closeMediaButtonPopup=function(popup)
11
  {jQuery('.sgpb-close-media-popup-js').on('click',function(){popup.close();});};SGPBMediaButton.prototype.insertPopup=function(popup)
12
+ {var insidePopup=false;if(mediaButtonParams.currentPostType===mediaButtonParams.popupBuilderPostType){insidePopup=true;}
13
+ jQuery('.sgpb-insert-popup-js').unbind('click').bind('click',function(){var selectedContent='';var selectedPopup=jQuery('.sgpb-insert-popup').val();var selectedPopupEvent=jQuery('.sgpb-insert-popup-event').val();if(typeof selectedPopupEvent!=='undefined'){selectedPopupEvent=' event="'+selectedPopupEvent+'"';}
14
  else{selectedPopupEvent='';if(insidePopup){selectedPopupEvent=' insidePopup="on"';}}
15
+ if(selectedPopup===''||selectedPopup===null){popup.close();return;}
16
+ if(selectedPopupEvent==='onLoad'&&!insidePopup){window.send_to_editor('[sg_popup id="'+selectedPopup+'"'+selectedPopupEvent+'][/sg_popup]');popup.close();return;}
17
+ if(typeof tinyMCE.editors.content!=='undefined'&&(document.getElementById('content').offsetParent===null)){selectedContent=(tinyMCE.activeEditor.selection.getContent())?tinyMCE.activeEditor.selection.getContent():'';}
18
+ else{var content=document.getElementById('content');if(typeof document.selection!=='undefined'){content.focus();var sel=document.selection.createRange();selectedContent=sel.text;}
19
+ else if(typeof content!=='undefined'&&content!==null){if(typeof content.selectionStart!=='undefined'){var startPos=content.selectionStart;var endPos=content.selectionEnd;selectedContent=content.value.substring(startPos,endPos);}}}
20
+ window.send_to_editor('[sg_popup id="'+selectedPopup+'"'+selectedPopupEvent+']'+selectedContent+'[/sg_popup]');popup.close();});jQuery('.sgpb-insert-js-variable-to-editor').unbind('click').bind('click',function(){var jsVariableSelector=jQuery('.sgpb-popup-dialog-main-div-wrapper .sgpb-js-variable-selector').val();var jsVariableAttribute=jQuery('.sgpb-popup-dialog-main-div-wrapper .sgpb-js-variable-attribute').val();jQuery('.sgpb-js-variable-errors').addClass('sg-hide-element');var valid=true;if(jsVariableSelector===''){valid=false;jQuery('.sgpb-js-variable-selector-error').removeClass('sg-hide-element');}
21
+ if(jsVariableAttribute===''){valid=false;jQuery('.sgpb-js-variable-attribute-error').removeClass('sg-hide-element');}
22
  if(!valid){return false;}
23
  jQuery('.sgpb-js-variable-errors').addClass('sg-hide-element');window.send_to_editor('[pbvariable selector="'+jsVariableSelector+'" attribute="'+jsVariableAttribute+'"]');popup.close();});};SGPBMediaButton.prototype.popupSelect2=function()
24
  {if(!jQuery('.js-sg-select2').length){return;}
25
+ jQuery('select.js-sg-select2').each(function(){var type=jQuery(this).attr('data-select-type');var className=jQuery(this).attr('data-select-class');var options={width:'100%'};if(type==='ajax'){if(typeof SGPB_JS_PARAMS==='undefined'){return;}
26
+ options=jQuery.extend(options,{minimumInputLength:1,ajax:{url:SGPB_JS_PARAMS.url,dataType:'json',delay:250,type:'POST',data:function(params){var searchKey=jQuery(this).attr('data-value-param');return{action:'select2_search_data',nonce_ajax:SGPB_JS_PARAMS.nonce,searchTerm:params.term,searchKey:searchKey};},processResults:function(data){return{results:jQuery.map(data.items,function(item){return{text:item.text,id:item.id}});};}}});}
27
  jQuery(this).sgpbselect2(options);});};jQuery(document).ready(function(){var mediaButton=new SGPBMediaButton();jQuery(document).on('tinymce-editor-init',function(event,editor){mediaButton.init();});});
public/js/Newsletter.js CHANGED
@@ -5,8 +5,8 @@ SGPBNewsletter.prototype.getTinymceContent=function()
5
  return jQuery('#sgpb-newsletter-text').val();};SGPBNewsletter.prototype.init=function()
6
  {var sendButton=jQuery('.js-send-newsletter');if(!sendButton.length){return false;}
7
  var that=this;sendButton.bind('click',function(e){e.preventDefault();var currentBtn=jQuery(this);var validationStatus=true;var testSendingStatus=currentBtn.data('send-type');var testSendingEmails=jQuery('.sgpb-newlsetter-test-emails').val();var fromEmail=jQuery('.sgpb-newsletter-from-email').val();var subscriptionFormId=jQuery('.js-sg-newsletter-forms option:selected').val();subscriptionFormId=parseInt(subscriptionFormId);var validateEmail=fromEmail.search(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,10})+$/);if(isNaN(subscriptionFormId)){jQuery('.sgpb-newsletter-popup-error').removeClass('sg-hide-element');validationStatus=false;}
8
- if(validateEmail==-1){validationStatus=false;jQuery('.sgpb-newsletter-from-email-error').removeClass('sg-hide-element');return false;}
9
  if(!validationStatus){return false;}
10
- jQuery('.sgpb-newsletter-validation').addClass('sg-hide-element');var emailsInFlow=jQuery('.sgpb-emails-in-flow').val();emailsInFlow=parseInt(emailsInFlow);var newsletterSubject=jQuery('.sgpb-newsletter-subject').val();var messageBody=that.getTinymceContent();var data={nonce:SGPB_JS_PARAMS.nonce,action:'sgpb_send_newsletter',newsletterData:{subscriptionFormId:subscriptionFormId,beforeSend:function(){currentBtn.next('.sgpb-js-newsletter-spinner').removeClass('sgpb-hide');jQuery('.sgpb-newsletter-notice').addClass('sgpb-hide');jQuery('.sgpb-newsletter-success-message').addClass('sgpb-hide');jQuery('.sgpb-newsletter-test-success-message').addClass('sgpb-hide');},fromEmail:fromEmail,emailsInFlow:emailsInFlow,newsletterSubject:newsletterSubject,messageBody:messageBody,testSendingStatus:testSendingStatus,testSendingEmails:testSendingEmails}};jQuery.post(ajaxurl,data,function(response){if(response=='test'){jQuery('.sgpb-newsletter-test-success-message').removeClass('sgpb-hide');}
11
  else{jQuery('.sgpb-newsletter-success-message').removeClass('sgpb-hide');}
12
  jQuery('.sgpb-newsletter-notice').removeClass('sgpb-hide');jQuery('.sgpb-js-newsletter-spinner').addClass('sgpb-hide');});});};jQuery(document).ready(function(){new SGPBNewsletter();});
5
  return jQuery('#sgpb-newsletter-text').val();};SGPBNewsletter.prototype.init=function()
6
  {var sendButton=jQuery('.js-send-newsletter');if(!sendButton.length){return false;}
7
  var that=this;sendButton.bind('click',function(e){e.preventDefault();var currentBtn=jQuery(this);var validationStatus=true;var testSendingStatus=currentBtn.data('send-type');var testSendingEmails=jQuery('.sgpb-newlsetter-test-emails').val();var fromEmail=jQuery('.sgpb-newsletter-from-email').val();var subscriptionFormId=jQuery('.js-sg-newsletter-forms option:selected').val();subscriptionFormId=parseInt(subscriptionFormId);var validateEmail=fromEmail.search(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,10})+$/);if(isNaN(subscriptionFormId)){jQuery('.sgpb-newsletter-popup-error').removeClass('sg-hide-element');validationStatus=false;}
8
+ if(validateEmail===-1){validationStatus=false;jQuery('.sgpb-newsletter-from-email-error').removeClass('sg-hide-element');return false;}
9
  if(!validationStatus){return false;}
10
+ jQuery('.sgpb-newsletter-validation').addClass('sg-hide-element');var emailsInFlow=jQuery('.sgpb-emails-in-flow').val();emailsInFlow=parseInt(emailsInFlow);var newsletterSubject=jQuery('.sgpb-newsletter-subject').val();var messageBody=that.getTinymceContent();var data={nonce:SGPB_JS_PARAMS.nonce,action:'sgpb_send_newsletter',newsletterData:{subscriptionFormId:subscriptionFormId,beforeSend:function(){currentBtn.next('.sgpb-js-newsletter-spinner').removeClass('sgpb-hide');jQuery('.sgpb-newsletter-notice').addClass('sgpb-hide');jQuery('.sgpb-newsletter-success-message').addClass('sgpb-hide');jQuery('.sgpb-newsletter-test-success-message').addClass('sgpb-hide');},fromEmail:fromEmail,emailsInFlow:emailsInFlow,newsletterSubject:newsletterSubject,messageBody:messageBody,testSendingStatus:testSendingStatus,testSendingEmails:testSendingEmails}};jQuery.post(ajaxurl,data,function(response){if(response==='test'){jQuery('.sgpb-newsletter-test-success-message').removeClass('sgpb-hide');}
11
  else{jQuery('.sgpb-newsletter-success-message').removeClass('sgpb-hide');}
12
  jQuery('.sgpb-newsletter-notice').removeClass('sgpb-hide');jQuery('.sgpb-js-newsletter-spinner').addClass('sgpb-hide');});});};jQuery(document).ready(function(){new SGPBNewsletter();});
public/js/NotificationCenter.js CHANGED
@@ -1,11 +1,10 @@
1
  function SGPBNotificationCenter(){}
2
  SGPBNotificationCenter.prototype.init=function()
3
  {this.dontShowAgain();this.dismiss();this.reactivate();this.closePromotionalNotification();};SGPBNotificationCenter.prototype.dismiss=function()
4
- {var that=this;jQuery('.sgpb-dismiss-notification-js').click(function(){var id=jQuery(this).attr('data-id');jQuery(this).addClass('disabled');jQuery(this).parent().prev().addClass('sgpb-disabled');var data={nonce:SGPB_JS_PARAMS.nonce,action:'sgpb_dismiss_notification',id:id};jQuery.post(ajaxurl,data,function(response){response=JSON.parse(response);jQuery('.sgpb-each-notification-wrapper-js').empty();jQuery('.sgpb-each-notification-wrapper-js').html(response['content']);jQuery('.sgpb-notifications-count-span').html(response['count']);jQuery('.sgpb-menu-item-notification').html(response['count']);if(response['count']==0){jQuery('.sgpb-menu-item-notification').addClass('sgpb-hide-add-button');}
5
  that.init();});});};SGPBNotificationCenter.prototype.reactivate=function()
6
  {var that=this;jQuery('.sgpb-activate-notification-js').click(function(){var id=jQuery(this).attr('data-id');jQuery(this).addClass('disabled');var data={nonce:SGPB_JS_PARAMS.nonce,action:'sgpb_reactivate_notification',id:id};jQuery.post(ajaxurl,data,function(response){response=JSON.parse(response);jQuery('.sgpb-each-notification-wrapper-js').empty();jQuery('.sgpb-each-notification-wrapper-js').html(response['content']);jQuery('.sgpb-notifications-count-span').html(response['count']);jQuery('.sgpb-menu-item-notification').removeClass('sgpb-hide-add-button');jQuery('.sgpb-menu-item-notification').html(response['count']);that.init();});});};SGPBNotificationCenter.prototype.closePromotionalNotification=function()
7
- {var that=this;jQuery('.sgpb-dont-show-again-support-notification').click(function(){var currentNotification=jQuery(this).parents('.sgpb-single-notification-wrapper');currentNotification.addClass('sgpb-disabled');var data={action:'sgpb_close_banner',nonce:SGPB_JS_PARAMS.nonce,};jQuery.post(ajaxurl,data,function(response){currentNotification.remove();});});jQuery('.sgpb-close-promo-notification').each(function(){jQuery(this).click(function(){jQuery(this).parents('.sgpb-single-notification-wrapper').addClass('sgpb-disabled');var dataAction=jQuery(this).attr('data-action');if(dataAction=='sg-show-popup-period'){jQuery(this).parents('.sgpb-single-notification-wrapper').find('.sgpb-dismiss-notification-js').click();return true;}
8
  var ajaxData={action:'sgpb_dont_show_review_popup',nonce:SGPB_JS_PARAMS.nonce};jQuery.post(SGPB_JS_PARAMS.url,ajaxData,function(res){if(jQuery('.sgpb-review-wrapper').length){jQuery('.sgpb-review-wrapper').parents('.sgpb-single-notification-wrapper').remove();}
9
- if(dataAction=='sg-you-worth-it'){window.open(SGPB_JS_EXTENSIONS_PARAMS.reviewUrl,'_blank');}});});});};SGPBNotificationCenter.prototype.dontShowAgain=function()
10
- {var that=this;jQuery('.sgpb-hide-notification-at-all').click(function(){var id=jQuery(this).attr('data-id');jQuery(this).parent().addClass('disabled');jQuery(this).parent().addClass('sgpb-disabled');var data={nonce:SGPB_JS_PARAMS.nonce,action:'sgpb_remove_notification',id:id};jQuery.post(ajaxurl,data,function(response){location.reload();});});}
11
- jQuery(document).ready(function(){var notificationCenter=new SGPBNotificationCenter();notificationCenter.init();});
1
  function SGPBNotificationCenter(){}
2
  SGPBNotificationCenter.prototype.init=function()
3
  {this.dontShowAgain();this.dismiss();this.reactivate();this.closePromotionalNotification();};SGPBNotificationCenter.prototype.dismiss=function()
4
+ {var that=this;jQuery('.sgpb-dismiss-notification-js').click(function(){var id=jQuery(this).attr('data-id');jQuery(this).addClass('disabled');jQuery(this).parent().prev().addClass('sgpb-disabled');var data={nonce:SGPB_JS_PARAMS.nonce,action:'sgpb_dismiss_notification',id:id};jQuery.post(ajaxurl,data,function(response){response=JSON.parse(response);jQuery('.sgpb-each-notification-wrapper-js').empty();jQuery('.sgpb-each-notification-wrapper-js').html(response['content']);jQuery('.sgpb-notifications-count-span').html(response['count']);jQuery('.sgpb-menu-item-notification').html(response['count']);if(response['count']===0){jQuery('.sgpb-menu-item-notification').addClass('sgpb-hide-add-button');}
5
  that.init();});});};SGPBNotificationCenter.prototype.reactivate=function()
6
  {var that=this;jQuery('.sgpb-activate-notification-js').click(function(){var id=jQuery(this).attr('data-id');jQuery(this).addClass('disabled');var data={nonce:SGPB_JS_PARAMS.nonce,action:'sgpb_reactivate_notification',id:id};jQuery.post(ajaxurl,data,function(response){response=JSON.parse(response);jQuery('.sgpb-each-notification-wrapper-js').empty();jQuery('.sgpb-each-notification-wrapper-js').html(response['content']);jQuery('.sgpb-notifications-count-span').html(response['count']);jQuery('.sgpb-menu-item-notification').removeClass('sgpb-hide-add-button');jQuery('.sgpb-menu-item-notification').html(response['count']);that.init();});});};SGPBNotificationCenter.prototype.closePromotionalNotification=function()
7
+ {var that=this;jQuery('.sgpb-dont-show-again-support-notification').click(function(){var currentNotification=jQuery(this).parents('.sgpb-single-notification-wrapper');currentNotification.addClass('sgpb-disabled');var data={action:'sgpb_close_banner',nonce:SGPB_JS_PARAMS.nonce,};jQuery.post(ajaxurl,data,function(response){currentNotification.remove();});});jQuery('.sgpb-close-promo-notification').each(function(){jQuery(this).click(function(){jQuery(this).parents('.sgpb-single-notification-wrapper').addClass('sgpb-disabled');var dataAction=jQuery(this).attr('data-action');if(dataAction==='sg-show-popup-period'){jQuery(this).parents('.sgpb-single-notification-wrapper').find('.sgpb-dismiss-notification-js').click();return true;}
8
  var ajaxData={action:'sgpb_dont_show_review_popup',nonce:SGPB_JS_PARAMS.nonce};jQuery.post(SGPB_JS_PARAMS.url,ajaxData,function(res){if(jQuery('.sgpb-review-wrapper').length){jQuery('.sgpb-review-wrapper').parents('.sgpb-single-notification-wrapper').remove();}
9
+ if(dataAction==='sg-you-worth-it'){window.open(SGPB_JS_EXTENSIONS_PARAMS.reviewUrl,'_blank');}});});});};SGPBNotificationCenter.prototype.dontShowAgain=function()
10
+ {var that=this;jQuery('.sgpb-hide-notification-at-all').click(function(){var id=jQuery(this).attr('data-id');jQuery(this).parent().addClass('disabled');jQuery(this).parent().addClass('sgpb-disabled');var data={nonce:SGPB_JS_PARAMS.nonce,action:'sgpb_remove_notification',id:id};jQuery.post(ajaxurl,data,function(response){location.reload();});});};jQuery(document).ready(function(){var notificationCenter=new SGPBNotificationCenter();notificationCenter.init();});
 
public/js/Popup.js CHANGED
@@ -1,40 +1,40 @@
1
  function SGPopup(config)
2
- {var integrations=config.integrations;var popupName=config.popupName;var initialConfig=config;var prefix=config.prefix||'sgpb';var isInited=false;var mainDiv=null;var contentDiv=null;var DIV=null;var opened=false;var resizeTimeout=null;var overlayDiv=null;var defaultZIndex=config.contentBox.zIndex||9999;var defaultWidth="640px";var defaultHeight=config.autoHeight;var closeButtonImage=null;var popupId=config.id;var showOnce=config.showOnce||false;var events=config.events||[];var openDelay=config.openDelay||0;var popupTheme=config.popupTheme;var popupType=config.popupType;var fitBackgroundImg=null;var parentThis=this;var openAnimation=config.openAnimation||{type:"none",speed:0};var closeAnimation=config.closeAnimation||{type:"none",speed:0};var closeBehavior=config.closeBehavior||{allowed:true,showButton:true,buttonPosition:'topLeft',buttonInside:true,autoclose:false,overlayShouldClose:true,contentShouldClose:false,escShouldClose:true};var closeButton=config.closeButton||{data:sgpbPublicUrl+'img/close.png',width:16,height:16,widthType:'px',heightType:'px',closeButtonType:'IMG',closeButtonText:'Close'};var overlay=config.overlay||{visible:true,color:"#000",opacity:0.7};var contentBox=config.contentBox||{padding:8,showBackground:true,backgroundColor:"#fff",borderStyle:"solid",borderColor:"#ccc",borderRadius:config.contentBox.borderRadius,borderRadiusType:config.contentBox.borderRadiusType,borderWidth:1,shadowColor:"#ccc",shadowSpread:0,shadowBlur:10,scrollingEnabled:true,backgroundPosition:''};var contents=config.contents||"";var inline=config.inline||false;var href=config.href||false;var position=config.position||{left:"center",top:"center"};if((typeof position.left=="undefined"||(isNaN(parseInt(position.left))&&position.left!="center"))&&(typeof position.right=="undefined"||(isNaN(parseInt(position.right))&&position.right!="center"))){position.left="center";}
3
- if((typeof position.top=="undefined"||(isNaN(parseInt(position.top))&&position.top!="center"))&&(typeof position.bottom=="undefined"||(isNaN(parseInt(position.bottom))&&position.bottom!="center"))){position.top="center";}
4
  var sizingRanges=config.sizingRanges||[{screenFrom:{width:-1,height:-1},screenTo:{width:-1,height:-1},width:defaultWidth,height:defaultHeight,maxWidth:-1,maxHeight:-1,minWidth:-1,minHeight:-1}];var shouldOpen=config.shouldOpen||function(){return true;};var willOpen=config.willOpen||function(){};var didOpen=config.didOpen||function(){};var shouldClose=config.shouldClose||function(){return true;};var willClose=config.willClose||function(){};var didClose=config.didClose||function(){};SGPopup.inlinePrevTarget=SGPopup.inlinePrevTarget||{};function resetInlineContent()
5
- {if(inline){var htmlElement=document.getElementById(inline);if(SGPopup.inlinePrevTarget.hasPreviousElement){if(typeof SGPopup.inlinePrevTarget.parentNode!='undefined'){SGPopup.inlinePrevTarget.parentNode.insertBefore(htmlElement,SGPopup.inlinePrevTarget.node.nextSibling);}}
6
  else{SGPopup.inlinePrevTarget.node.appendChild(htmlElement);}}}
7
  var OPEN_ANIMATION_POP="@-webkit-keyframes popin{from{-webkit-transform:scale(.8);opacity:0}to{-webkit-transform:scale(1);opacity:1}}@-moz-keyframes popin{from{-moz-transform:scale(.8);opacity:0}to{-moz-transform:scale(1);opacity:1}}@keyframes popin{from{transform:scale(.8);opacity:0}to{transform:scale(1);opacity:1}}";var OPEN_ANIMATION_FADE="@-webkit-keyframes fadein{from{opacity:0}to{opacity:1}}@-moz-keyframes fadein{from{opacity:0}to{opacity:1}}@keyframes fadein{from{opacity:0}to{opacity:1}}";var OPEN_ANIMATION_FLIP="@-webkit-keyframes flipintoright{from{-webkit-transform:rotateY(90deg) scale(.9)}to{-webkit-transform:rotateY(0)}}@-moz-keyframes flipintoright{from{-moz-transform:rotateY(90deg) scale(.9)}to{-moz-transform:rotateY(0)}}@keyframes flipintoright{from{transform:rotateY(90deg) scale(.9)}to{transform:rotateY(0)}}";var OPEN_ANIMATION_SLIDELEFT="@-webkit-keyframes slideinfromright{from{-webkit-transform:translate3d({start},0,0)}to{-webkit-transform:translate3d(0,0,0)}}@-moz-keyframes slideinfromright{from{-moz-transform:translateX({start})}to{-moz-transform:translateX(0)}}@keyframes slideinfromright{from{transform:translateX({start})}to{transform:translateX(0)}}";var OPEN_ANIMATION_SLIDERIGHT="@-webkit-keyframes slideinfromleft{from{-webkit-transform:translate3d({start},0,0)}to{-webkit-transform:translate3d(0,0,0)}}@-moz-keyframes slideinfromleft{from{-moz-transform:translateX({start})}to{-moz-transform:translateX(0)}}@keyframes slideinfromleft{from{transform:translateX({start})}to{transform:translateX(0)}}";var OPEN_ANIMATION_FLOW="@-webkit-keyframes flowinfromright{0%{-webkit-transform:translateX(100%) scale(.7)}30%,40%{-webkit-transform:translateX(0) scale(.7)}100%{-webkit-transform:translateX(0) scale(1)}}@-moz-keyframes flowinfromright{0%{-moz-transform:translateX(100%) scale(.7)}30%,40%{-moz-transform:translateX(0) scale(.7)}100%{-moz-transform:translateX(0) scale(1)}}@keyframes flowinfromright{0%{transform:translateX(100%) scale(.7)}30%,40%{transform:translateX(0) scale(.7)}100%{transform:translateX(0) scale(1)}}";var OPEN_ANIMATION_SLIDEUP="@-webkit-keyframes slideinfrombottom{from{-webkit-transform:translateY({start})}to{-webkit-transform:translateY(0)}}@-moz-keyframes slideinfrombottom{from{-moz-transform:translateY({start})}to{-moz-transform:translateY(0)}}@keyframes slideinfrombottom{from{transform:translateY({start})}to{transform:translateY(0)}}";var OPEN_ANIMATION_SLIDEDOWN="@-webkit-keyframes slideinfromtop{from{-webkit-transform:translateY({start})}to{-webkit-transform:translateY(0)}}@-moz-keyframes slideinfromtop{from{-moz-transform:translateY({start})}to{-moz-transform:translateY(0)}}@keyframes slideinfromtop{from{transform:translateY({start})}to{transform:translateY(0)}}";var CLOSE_ANIMATION_SLIDELEFT="@-webkit-keyframes slideouttoleft{from{-webkit-transform:translate3d(0,0,0)}to{-webkit-transform:translate3d({end},0,0)}}@-moz-keyframes slideouttoleft{from{-moz-transform:translateX(0)}to{-moz-transform:translateX({end})}}@keyframes slideouttoleft{from{transform:translateX(0)}to{transform:translateX({end})}}";var CLOSE_ANIMATION_SLIDERIGHT="@-webkit-keyframes slideouttoright{from{-webkit-transform:translate3d(0,0,0)}to{-webkit-transform:translate3d({end},0,0)}}@-moz-keyframes slideouttoright{from{-moz-transform:translateX(0)}to{-moz-transform:translateX({end})}}@keyframes slideouttoright{from{transform:translateX(0)}to{transform:translateX({end})}}";var CLOSE_ANIMATION_POP="@-webkit-keyframes popout{from{-webkit-transform:scale(1);opacity:1}to{-webkit-transform:scale(.8);opacity:0}}@-moz-keyframes popout{from{-moz-transform:scale(1);opacity:1}to{-moz-transform:scale(.8);opacity:0}}@keyframes popout{from{transform:scale(1);opacity:1}to{transform:scale(.8);opacity:0}}";var CLOSE_ANIMATION_FADE="@-webkit-keyframes fadeout{from{opacity:1}to{opacity:0}}@-moz-keyframes fadeout{from{opacity:1}to{opacity:0}}@keyframes fadeout{from{opacity:1}to{opacity:0}}";var CLOSE_ANIMATION_FLIP="@-webkit-keyframes flipouttoright{from{-webkit-transform:rotateY(0)}to{-webkit-transform:rotateY(90deg) scale(.9)}}@-moz-keyframes flipouttoright{from{-moz-transform:rotateY(0)}to{-moz-transform:rotateY(90deg) scale(.9)}}@keyframes flipouttoright{from{transform:rotateY(0)}to{transform:rotateY(90deg) scale(.9)}}";var CLOSE_ANIMATION_FLOW="@-webkit-keyframes flowouttoright{0%{-webkit-transform:translateX(0) scale(1)}60%,70%{-webkit-transform:translateX(0) scale(.7)}100%{-webkit-transform:translateX(100%) scale(.7)}}@-moz-keyframes flowouttoright{0%{-moz-transform:translateX(0) scale(1)}60%,70%{-moz-transform:translateX(0) scale(.7)}100%{-moz-transform:translateX(100%) scale(.7)}}@keyframes flowouttoright{0%{transform:translateX(0) scale(1)}60%,70%{transform:translateX(0) scale(.7)}100%{transform:translateX(100%) scale(.7)}}";var CLOSE_ANIMATION_SLIDEUP="@-webkit-keyframes slideouttotop{from{-webkit-transform:translateY(0)}to{-webkit-transform:translateY({end})}}@-moz-keyframes slideouttotop{from{-moz-transform:translateY(0)}to{-moz-transform:translateY({end})}}@keyframes slideouttotop{from{transform:translateY(0)}to{transform:translateY({end})}}";var CLOSE_ANIMATION_SLIDEDOWN="@-webkit-keyframes slideouttobottom{from{-webkit-transform:translateY(0)}to{-webkit-transform:translateY({end})}}@-moz-keyframes slideouttobottom{from{-moz-transform:translateY(0)}to{-moz-transform:translateY({end})}}@keyframes slideouttobottom{from{transform:translateY(0)}to{transform:translateY({end})}}";function addAnimationClass(classString)
8
  {var style=document.createElement('style');style.type='text/css';style.innerHTML=classString;style.id=prefix+"-effect-custom-style";document.getElementsByTagName('head')[0].appendChild(style);}
9
  function setMainDivStyles(sizeConfig)
10
- {jQuery(window).trigger('sgpbPopupBuilderAdditionalDimensionSettings');contentDiv.style.zIndex=defaultZIndex+10;mainDiv.style.boxSizing='content-box';if(sizeConfig.minHeight!=-1){var minHeight=sizeConfig.minHeight;var popupMinHeight=window.innerHeight;if(typeof minHeight=='string'&&minHeight.indexOf('%')!=-1){var popupMinhHeight=(popupMinhHeight/100)*parseInt(minHeight);mainDiv.style.minHeight=popupMinhHeight+'px';}
11
  else{mainDiv.style.minHeight=parseInt(minHeight)+'px';}}
12
- if(sizeConfig.minWidth!=-1){var popupMinhWidth=window.innerWidth;var minWidth=sizeConfig.minWidth;if(typeof minWidth=='string'&&minWidth.indexOf('%')!=-1){var popupMinhWidth=(popupMinhWidth/100)*parseInt(minWidth);mainDiv.style.minWidth=popupMinhWidth+'px';}
13
  else{mainDiv.style.minWidth=parseInt(minWidth)+'px';}}
14
- if(sizeConfig.maxHeight!=-1&&sizeConfig.maxHeight){var maxHeight=sizeConfig.maxHeight;var popupMaxHeight=window.innerHeight;if(maxHeight.indexOf('%')!=-1){var popupMaxHeight=(popupMaxHeight/100)*parseInt(maxHeight);this.calculatedMaxHeight=calculateMaxHeight(popupMaxHeight);mainDiv.style.maxHeight=this.calculatedMaxHeight;}
15
  else{this.calculatedMaxHeight=calculateMaxHeight(parseInt(maxHeight));mainDiv.style.maxHeight=this.calculatedMaxHeight;}}
16
  else{var popupMaxHeight=window.innerHeight;mainDiv.style.maxHeight=calculateMaxHeight(popupMaxHeight);}
17
- if(sizeConfig.maxWidth!=-1&&sizeConfig.maxWidth){var maxWidth=sizeConfig.maxWidth;var popupMaxWidth=window.innerWidth;if(maxWidth.indexOf('%')!=-1){var popupMaxWidth=(popupMaxWidth/100)*parseInt(maxWidth);this.calculatedMaxWidth=calculateMaxWidth(popupMaxWidth);mainDiv.style.maxWidth=this.calculatedMaxWidth;}
18
  else{this.calculatedMaxWidth=calculateMaxWidth(parseInt(maxWidth));mainDiv.style.maxWidth=this.calculatedMaxWidth;}}
19
  else{var popupMaxWidth=window.innerWidth;mainDiv.style.maxWidth=calculateMaxWidth(popupMaxWidth);}
20
  if(contentBox.borderStyle){mainDiv.style.borderStyle=contentBox.borderStyle;}
21
  if(contentBox.borderColor){mainDiv.style.borderColor=contentBox.borderColor;}
22
- if(contentBox.borderRadius){var borderRadiusMeasure='%';if(contentBox.borderRadiusType){var borderRadiusMeasure=contentBox.borderRadiusType;}
23
  mainDiv.style.borderRadius=contentBox.borderRadius+borderRadiusMeasure;}
24
  mainDiv.style.borderWidth=contentBox.borderWidth+"px";if(contentBox.padding){mainDiv.style.padding=contentBox.padding+"px";}
25
  var widthToSet=sizeConfig.width||defaultWidth;if(widthToSet.indexOf("%")>-1){var widthNum=parseFloat(widthToSet);if(widthToSet.indexOf("fullScreen")>-1){widthNum=window.innerWidth;}
26
- var closeButtonWidthToSubtract=parseInt(closeButton.width);if(closeBehavior.showButton==false||config.closeButton.type=='button'){closeButtonWidthToSubtract=0;}
27
  widthToSet=(((widthNum/100)*window.innerWidth)-(2*(contentBox.padding?contentBox.padding:0))-parseFloat(mainDiv.style.borderLeftWidth)-parseFloat(mainDiv.style.borderRightWidth)-(parseFloat(contentBox.shadowSpread)/2)-closeButtonWidthToSubtract)+'px';}
28
  else{widthToSet=parseFloat(widthToSet)-2*(contentBox.padding?contentBox.padding:0)+'px';}
29
- mainDiv.style.width=widthToSet;if(config.popupType=='image'){mainDiv.style.backgroundImage="url("+contentBox.backgroundImage+")";}
30
  if(contentBox.showBackground){if(contentBox.backgroundImage){mainDiv.style.backgroundImage="url("+contentBox.backgroundImage+")";}
31
- if(contentBox.backgroundMode=="cover"){mainDiv.style.backgroundSize="cover";mainDiv.style.backgroundRepeat="no-repeat";}
32
- else if(contentBox.backgroundMode=="contain"){mainDiv.style.backgroundSize="contain";mainDiv.style.backgroundRepeat="no-repeat";}
33
- else if(contentBox.backgroundMode=="repeat"){mainDiv.style.backgroundRepeat="repeat";}
34
- else if(contentBox.backgroundMode=='fit'){if(!fitBackgroundImg){fitBackgroundImg=document.createElement('img');fitBackgroundImg.style.position='fixed';fitBackgroundImg.style.bottom='-9999999999999px';fitBackgroundImg.className='sgpb-background-image-'+config.popupId;document.body.appendChild(fitBackgroundImg);fitBackgroundImg.onload=function(){changePopupDimensionRelatedImage(this);};fitBackgroundImg.src=contentBox.backgroundImage;mainDiv.style.backgroundSize='100% 100%';mainDiv.style.backgroundRepeat='no-repeat';}}
35
  else{mainDiv.style.backgroundRepeat="no-repeat";}}
36
- if(window.sgWindowOldWidth!=window.innerWidth||window.sgWindowOldHeight!=window.innerHeight){window.sgWindowOldWidth=window.innerWidth;window.sgWindowOldHeight=window.innerHeight;var images=document.getElementsByClassName('sgpb-background-image-'+config.popupId);if(images.length){changePopupDimensionRelatedImage(images[0]);}}
37
- mainDiv.style.backgroundPosition=contentBox.backgroundPosition;var heightToSet=sizeConfig.height||defaultHeight;if(typeof heightToSet!='undefined'&&heightToSet.indexOf("%")>-1){var heightNum=parseFloat(heightToSet);heightToSet=(((heightNum/100)*window.innerHeight)-(2*(contentBox.padding?contentBox.padding:0))-parseInt(mainDiv.style.borderTopWidth)-parseInt(mainDiv.style.borderBottomWidth))+"px";}
38
  else{heightToSet=parseInt(heightToSet)-2*(contentBox.padding?contentBox.padding:0)+"px";if(sizeConfig.width.indexOf("fullScreen")>-1){heightToSet=(window.innerHeight)+"px";}}
39
  mainDiv.style.height=heightToSet;if(contentBox.showBackground&&contentBox.backgroundColor){mainDiv.style.backgroundColor=contentBox.backgroundColor;}
40
  if(contentBox.shadowColor){mainDiv.style.boxShadow="0 0 "+contentBox.shadowBlur+"px "+contentBox.shadowSpread+"px "+contentBox.shadowColor;}
@@ -49,13 +49,14 @@ var widthDifference=imageWidth-maxWidth;var heightDifference=imageHeight-maxHeig
49
  else if(imageWidth>maxWidth){var modifiedWidthPercent=Math.floor((widthDifference/imageWidth)*100);var heightMustDecrease=Math.floor((imageHeight*modifiedWidthPercent)/100);var modifiedHeight=imageHeight-heightMustDecrease;imageWidth-=widthDifference;imageHeight-=heightMustDecrease;}
50
  var result={width:imageWidth,height:imageHeight};return result;}
51
  function calculateMaxWidth(maxWidth)
52
- {var sizeConfig=getSizeConfig();var dimension=sizeConfig.width;var contentPadding=(contentBox.padding||0)*2;var shadowSpread=(contentBox.shadowSpread||0)*2;var borderWidth=(contentBox.borderWidth||0)*2;var boxBorderWidth=(contentBox.boxBorderWidth||0)*4;var closeButtonRight=(parseInt(closeBehavior.right)||0)*2;var closeButtonLeft=(parseInt(closeBehavior.left)||0)*2;if(dimension.indexOf('fullScreen')=='-1'){maxWidth-=contentPadding;maxWidth-=34;maxWidth-=shadowSpread;maxWidth-=borderWidth;maxWidth-=boxBorderWidth;}
53
  if(!closeBehavior.buttonInside){if(closeButtonRight){maxWidth-=Math.abs(closeButtonRight);}
54
  if(closeButtonLeft){maxWidth-=Math.abs(closeButtonLeft);}}
55
  if(maxWidth<0){return'30px';}
56
  return maxWidth+'px';}
57
  function setFitBackground()
58
- {if(!fitBackgroundImg)return;var imgHeight=fitBackgroundImg.height;var imgWidth=fitBackgroundImg.width;var winHeight=window.innerHeight;var winWidth=window.innerWidth;var minMargin=40;var popupWidth=0,popupHeight=0;if(imgWidth<(winWidth-2*minMargin)&&imgHeight<(winHeight-2*minMargin)){popupWidth=imgWidth;popupHeight=imgHeight;}else{var widthDif=winWidth-imgWidth;var heightDif=winHeight-imgHeight;if(widthDif<heightDif){popupWidth=winWidth-2*minMargin;popupHeight=popupWidth*imgHeight/imgWidth;}else{popupHeight=winHeight-2*minMargin;popupWidth=popupHeight*imgWidth/imgHeight;}}
 
59
  var sizeConfig=getSizeConfig();var maxWidth=sizeConfig.maxWidth;var maxHeight=sizeConfig.maxHeight;var border=contentBox.borderWidth||0;var padding=contentBox.padding||0;var shadow=contentBox.shadowSpread||0;popupWidth=parseInt(popupWidth-2);sizeConfig.height=popupHeight+'px';}
60
  function calculateMaxHeight(maxHeight)
61
  {var sizeConfig=getSizeConfig();var dimension=sizeConfig.width;var contentPadding=(contentBox.padding||0)*2;var shadowSpread=(contentBox.shadowSpread||0)*4;var borderHeight=(contentBox.borderWidth||0)*2;var boxBorderHeight=(contentBox.boxBorderWidth||0)*4;var closeButtonTop=(parseInt(closeBehavior.top)||0)*2;var closeButtonBottom=(parseInt(closeBehavior.bottom)||0)*2;if(dimension.indexOf('fullScreen')!='-1'){}
@@ -65,16 +66,16 @@ if(closeButtonTop){maxHeight-=Math.abs(closeButtonTop);}}}
65
  if(maxHeight<0){return'30px';}
66
  return maxHeight+'px';}
67
  function positionPopup()
68
- {contentDiv.style.position="fixed";var border=contentBox.borderWidth||0;var padding=contentBox.padding||0;if(typeof position.left!="undefined"&&(!isNaN(parseInt(position.left))||position.left=="center")){if(position.left=="center"){contentDiv.style.left=(window.innerWidth-parseInt(mainDiv.clientWidth)-2*border)/2+"px";}
69
  else{contentDiv.style.left=parseInt(position.left)+"px";}}
70
- else{if(position.right=="center"){contentDiv.style.left=(window.innerWidth-parseInt(mainDiv.clientWidth)-2*border)/2+"px";}
71
  else{contentDiv.style.left=(window.innerWidth-parseInt(position.right)-parseInt(mainDiv.clientWidth)-2*border)+"px";}}
72
- if(typeof position.top!="undefined"&&(!isNaN(parseInt(position.top))||position.top=="center")){if(position.top=="center"){contentDiv.style.top=(window.innerHeight-parseInt(mainDiv.clientHeight)-2*border)/2+"px";}
73
  else{contentDiv.style.top=position.top+"px";}}
74
- else{if(position.bottom=="center"){contentDiv.style.top=(window.innerHeight-parseInt(mainDiv.clientHeight)-2*border)/2+"px";}
75
  else{contentDiv.style.bottom=position.bottom+"px";}}}
76
  function getSizeConfig()
77
- {var windowWidth=window.innerWidth;var windowHeight=window.innerHeight;var config=null;var candidates=[];for(var i=0;i<sizingRanges.length;i++){var tmpConf=sizingRanges[i];if((tmpConf.screenFrom.width==-1&&tmpConf.screenTo.width==-1)||(tmpConf.screenFrom.width==-1&&windowWidth<tmpConf.screenTo.width)||(tmpConf.screenTo.width==-1&&windowWidth>tmpConf.screenFrom.width)||(windowWidth<tmpConf.screenTo.width&&windowWidth>tmpConf.screenFrom.width)){candidates.push(tmpConf);}}
78
  for(var i=0;i<candidates.length;i++){var tmpConf=candidates[i];if((tmpConf.screenFrom.height==-1&&tmpConf.screenTo.height==-1)||(tmpConf.screenFrom.height==-1&&windowHeight<tmpConf.screenTo.height)||(tmpConf.screenTo.height==-1&&windowHeight>tmpConf.screenFrom.height)||(windowHeight<tmpConf.screenTo.height&&windowHeight>tmpConf.screenFrom.height)){continue;}
79
  else{candidates.splice(i,1);i--;}}
80
  config=candidates[0];if(!config){config={screenFrom:{width:-1,height:-1},screenTo:{width:-1,height:-1},width:"640px",height:defaultHeight,maxWidth:-1,maxHeight:-1,minWidth:-1,minHeight:-1}}
@@ -94,7 +95,7 @@ closeButtonImage.style.width=closeButton.width+closeButton.widthType;closeButton
94
  function positionCloseButton(mainDiv)
95
  {if(closeBehavior.buttonPosition=="left"){closeButtonImage.style.left=(closeButton.width/2+parseFloat(closeBehavior.leftPosition))+"px";}
96
  else if(closeBehavior.buttonPosition=="right"){var border=contentBox.borderWidth||0;var left=0;var mainDivWidth=mainDiv.style.width;if(mainDiv.style.maxWidth&&parseInt(mainDivWidth)>parseInt(mainDiv.style.maxWidth)){mainDivWidth=mainDiv.style.maxWidth;}
97
- left=parseFloat(mainDivWidth)-Math.ceil(closeButton.width/2)+2*contentBox.padding+2*border;if(closeBehavior.leftPosition){left=left-parseFloat(closeBehavior.leftPosition);}
98
  closeButtonImage.style.left=left+"px";}
99
  closeButtonImage.style.top=parseFloat(closeBehavior.topPosition)+"px";}
100
  function onWindowRsize()
1
  function SGPopup(config)
2
+ {var integrations=config.integrations;var popupName=config.popupName;var initialConfig=config;var prefix=config.prefix||'sgpb';var isInited=false;var mainDiv=null;var contentDiv=null;var DIV=null;var opened=false;var resizeTimeout=null;var overlayDiv=null;var defaultZIndex=config.contentBox.zIndex||9999;var defaultWidth="640px";var defaultHeight=config.autoHeight;var closeButtonImage=null;var popupId=config.id;var showOnce=config.showOnce||false;var events=config.events||[];var openDelay=config.openDelay||0;var popupTheme=config.popupTheme;var popupType=config.popupType;var fitBackgroundImg=null;var parentThis=this;var openAnimation=config.openAnimation||{type:"none",speed:0};var closeAnimation=config.closeAnimation||{type:"none",speed:0};var closeBehavior=config.closeBehavior||{allowed:true,showButton:true,buttonPosition:'topLeft',buttonInside:true,autoclose:false,overlayShouldClose:true,contentShouldClose:false,escShouldClose:true};var closeButton=config.closeButton||{data:sgpbPublicUrl+'img/close.png',width:16,height:16,widthType:'px',heightType:'px',closeButtonType:'IMG',closeButtonText:'Close'};var overlay=config.overlay||{visible:true,color:"#000",opacity:0.7};var contentBox=config.contentBox||{padding:8,showBackground:true,backgroundColor:"#fff",borderStyle:"solid",borderColor:"#ccc",borderRadius:config.contentBox.borderRadius,borderRadiusType:config.contentBox.borderRadiusType,borderWidth:1,shadowColor:"#ccc",shadowSpread:0,shadowBlur:10,scrollingEnabled:true,backgroundPosition:''};var contents=config.contents||"";var inline=config.inline||false;var href=config.href||false;var position=config.position||{left:"center",top:"center"};if((typeof position.left==="undefined"||(isNaN(parseInt(position.left))&&position.left!=="center"))&&(typeof position.right==="undefined"||(isNaN(parseInt(position.right))&&position.right!=="center"))){position.left="center";}
3
+ if((typeof position.top==="undefined"||(isNaN(parseInt(position.top))&&position.top!=="center"))&&(typeof position.bottom==="undefined"||(isNaN(parseInt(position.bottom))&&position.bottom!=="center"))){position.top="center";}
4
  var sizingRanges=config.sizingRanges||[{screenFrom:{width:-1,height:-1},screenTo:{width:-1,height:-1},width:defaultWidth,height:defaultHeight,maxWidth:-1,maxHeight:-1,minWidth:-1,minHeight:-1}];var shouldOpen=config.shouldOpen||function(){return true;};var willOpen=config.willOpen||function(){};var didOpen=config.didOpen||function(){};var shouldClose=config.shouldClose||function(){return true;};var willClose=config.willClose||function(){};var didClose=config.didClose||function(){};SGPopup.inlinePrevTarget=SGPopup.inlinePrevTarget||{};function resetInlineContent()
5
+ {if(inline){var htmlElement=document.getElementById(inline);if(SGPopup.inlinePrevTarget.hasPreviousElement){if(typeof SGPopup.inlinePrevTarget.parentNode!=='undefined'){SGPopup.inlinePrevTarget.parentNode.insertBefore(htmlElement,SGPopup.inlinePrevTarget.node.nextSibling);}}
6
  else{SGPopup.inlinePrevTarget.node.appendChild(htmlElement);}}}
7
  var OPEN_ANIMATION_POP="@-webkit-keyframes popin{from{-webkit-transform:scale(.8);opacity:0}to{-webkit-transform:scale(1);opacity:1}}@-moz-keyframes popin{from{-moz-transform:scale(.8);opacity:0}to{-moz-transform:scale(1);opacity:1}}@keyframes popin{from{transform:scale(.8);opacity:0}to{transform:scale(1);opacity:1}}";var OPEN_ANIMATION_FADE="@-webkit-keyframes fadein{from{opacity:0}to{opacity:1}}@-moz-keyframes fadein{from{opacity:0}to{opacity:1}}@keyframes fadein{from{opacity:0}to{opacity:1}}";var OPEN_ANIMATION_FLIP="@-webkit-keyframes flipintoright{from{-webkit-transform:rotateY(90deg) scale(.9)}to{-webkit-transform:rotateY(0)}}@-moz-keyframes flipintoright{from{-moz-transform:rotateY(90deg) scale(.9)}to{-moz-transform:rotateY(0)}}@keyframes flipintoright{from{transform:rotateY(90deg) scale(.9)}to{transform:rotateY(0)}}";var OPEN_ANIMATION_SLIDELEFT="@-webkit-keyframes slideinfromright{from{-webkit-transform:translate3d({start},0,0)}to{-webkit-transform:translate3d(0,0,0)}}@-moz-keyframes slideinfromright{from{-moz-transform:translateX({start})}to{-moz-transform:translateX(0)}}@keyframes slideinfromright{from{transform:translateX({start})}to{transform:translateX(0)}}";var OPEN_ANIMATION_SLIDERIGHT="@-webkit-keyframes slideinfromleft{from{-webkit-transform:translate3d({start},0,0)}to{-webkit-transform:translate3d(0,0,0)}}@-moz-keyframes slideinfromleft{from{-moz-transform:translateX({start})}to{-moz-transform:translateX(0)}}@keyframes slideinfromleft{from{transform:translateX({start})}to{transform:translateX(0)}}";var OPEN_ANIMATION_FLOW="@-webkit-keyframes flowinfromright{0%{-webkit-transform:translateX(100%) scale(.7)}30%,40%{-webkit-transform:translateX(0) scale(.7)}100%{-webkit-transform:translateX(0) scale(1)}}@-moz-keyframes flowinfromright{0%{-moz-transform:translateX(100%) scale(.7)}30%,40%{-moz-transform:translateX(0) scale(.7)}100%{-moz-transform:translateX(0) scale(1)}}@keyframes flowinfromright{0%{transform:translateX(100%) scale(.7)}30%,40%{transform:translateX(0) scale(.7)}100%{transform:translateX(0) scale(1)}}";var OPEN_ANIMATION_SLIDEUP="@-webkit-keyframes slideinfrombottom{from{-webkit-transform:translateY({start})}to{-webkit-transform:translateY(0)}}@-moz-keyframes slideinfrombottom{from{-moz-transform:translateY({start})}to{-moz-transform:translateY(0)}}@keyframes slideinfrombottom{from{transform:translateY({start})}to{transform:translateY(0)}}";var OPEN_ANIMATION_SLIDEDOWN="@-webkit-keyframes slideinfromtop{from{-webkit-transform:translateY({start})}to{-webkit-transform:translateY(0)}}@-moz-keyframes slideinfromtop{from{-moz-transform:translateY({start})}to{-moz-transform:translateY(0)}}@keyframes slideinfromtop{from{transform:translateY({start})}to{transform:translateY(0)}}";var CLOSE_ANIMATION_SLIDELEFT="@-webkit-keyframes slideouttoleft{from{-webkit-transform:translate3d(0,0,0)}to{-webkit-transform:translate3d({end},0,0)}}@-moz-keyframes slideouttoleft{from{-moz-transform:translateX(0)}to{-moz-transform:translateX({end})}}@keyframes slideouttoleft{from{transform:translateX(0)}to{transform:translateX({end})}}";var CLOSE_ANIMATION_SLIDERIGHT="@-webkit-keyframes slideouttoright{from{-webkit-transform:translate3d(0,0,0)}to{-webkit-transform:translate3d({end},0,0)}}@-moz-keyframes slideouttoright{from{-moz-transform:translateX(0)}to{-moz-transform:translateX({end})}}@keyframes slideouttoright{from{transform:translateX(0)}to{transform:translateX({end})}}";var CLOSE_ANIMATION_POP="@-webkit-keyframes popout{from{-webkit-transform:scale(1);opacity:1}to{-webkit-transform:scale(.8);opacity:0}}@-moz-keyframes popout{from{-moz-transform:scale(1);opacity:1}to{-moz-transform:scale(.8);opacity:0}}@keyframes popout{from{transform:scale(1);opacity:1}to{transform:scale(.8);opacity:0}}";var CLOSE_ANIMATION_FADE="@-webkit-keyframes fadeout{from{opacity:1}to{opacity:0}}@-moz-keyframes fadeout{from{opacity:1}to{opacity:0}}@keyframes fadeout{from{opacity:1}to{opacity:0}}";var CLOSE_ANIMATION_FLIP="@-webkit-keyframes flipouttoright{from{-webkit-transform:rotateY(0)}to{-webkit-transform:rotateY(90deg) scale(.9)}}@-moz-keyframes flipouttoright{from{-moz-transform:rotateY(0)}to{-moz-transform:rotateY(90deg) scale(.9)}}@keyframes flipouttoright{from{transform:rotateY(0)}to{transform:rotateY(90deg) scale(.9)}}";var CLOSE_ANIMATION_FLOW="@-webkit-keyframes flowouttoright{0%{-webkit-transform:translateX(0) scale(1)}60%,70%{-webkit-transform:translateX(0) scale(.7)}100%{-webkit-transform:translateX(100%) scale(.7)}}@-moz-keyframes flowouttoright{0%{-moz-transform:translateX(0) scale(1)}60%,70%{-moz-transform:translateX(0) scale(.7)}100%{-moz-transform:translateX(100%) scale(.7)}}@keyframes flowouttoright{0%{transform:translateX(0) scale(1)}60%,70%{transform:translateX(0) scale(.7)}100%{transform:translateX(100%) scale(.7)}}";var CLOSE_ANIMATION_SLIDEUP="@-webkit-keyframes slideouttotop{from{-webkit-transform:translateY(0)}to{-webkit-transform:translateY({end})}}@-moz-keyframes slideouttotop{from{-moz-transform:translateY(0)}to{-moz-transform:translateY({end})}}@keyframes slideouttotop{from{transform:translateY(0)}to{transform:translateY({end})}}";var CLOSE_ANIMATION_SLIDEDOWN="@-webkit-keyframes slideouttobottom{from{-webkit-transform:translateY(0)}to{-webkit-transform:translateY({end})}}@-moz-keyframes slideouttobottom{from{-moz-transform:translateY(0)}to{-moz-transform:translateY({end})}}@keyframes slideouttobottom{from{transform:translateY(0)}to{transform:translateY({end})}}";function addAnimationClass(classString)
8
  {var style=document.createElement('style');style.type='text/css';style.innerHTML=classString;style.id=prefix+"-effect-custom-style";document.getElementsByTagName('head')[0].appendChild(style);}
9
  function setMainDivStyles(sizeConfig)
10
+ {jQuery(window).trigger('sgpbPopupBuilderAdditionalDimensionSettings');contentDiv.style.zIndex=defaultZIndex+10;mainDiv.style.boxSizing='content-box';if(sizeConfig.minHeight!==-1){var minHeight=sizeConfig.minHeight;var popupMinHeight=window.innerHeight;if(typeof minHeight==='string'&&minHeight.indexOf('%')!==-1){var popupMinhHeight=(popupMinhHeight/100)*parseInt(minHeight);mainDiv.style.minHeight=popupMinhHeight+'px';}
11
  else{mainDiv.style.minHeight=parseInt(minHeight)+'px';}}
12
+ if(sizeConfig.minWidth!==-1){var popupMinhWidth=window.innerWidth;var minWidth=sizeConfig.minWidth;if(typeof minWidth==='string'&&minWidth.indexOf('%')!==-1){popupMinhWidth=(popupMinhWidth/100)*parseInt(minWidth);mainDiv.style.minWidth=popupMinhWidth+'px';}
13
  else{mainDiv.style.minWidth=parseInt(minWidth)+'px';}}
14
+ if(sizeConfig.maxHeight!==-1&&sizeConfig.maxHeight){var maxHeight=sizeConfig.maxHeight;var popupMaxHeight=window.innerHeight;if(maxHeight.indexOf('%')!==-1){popupMaxHeight=(popupMaxHeight/100)*parseInt(maxHeight);this.calculatedMaxHeight=calculateMaxHeight(popupMaxHeight);mainDiv.style.maxHeight=this.calculatedMaxHeight;}
15
  else{this.calculatedMaxHeight=calculateMaxHeight(parseInt(maxHeight));mainDiv.style.maxHeight=this.calculatedMaxHeight;}}
16
  else{var popupMaxHeight=window.innerHeight;mainDiv.style.maxHeight=calculateMaxHeight(popupMaxHeight);}
17
+ if(sizeConfig.maxWidth!==-1&&sizeConfig.maxWidth){var maxWidth=sizeConfig.maxWidth;var popupMaxWidth=window.innerWidth;if(maxWidth.indexOf('%')!==-1){popupMaxWidth=(popupMaxWidth/100)*parseInt(maxWidth);this.calculatedMaxWidth=calculateMaxWidth(popupMaxWidth);mainDiv.style.maxWidth=this.calculatedMaxWidth;}
18
  else{this.calculatedMaxWidth=calculateMaxWidth(parseInt(maxWidth));mainDiv.style.maxWidth=this.calculatedMaxWidth;}}
19
  else{var popupMaxWidth=window.innerWidth;mainDiv.style.maxWidth=calculateMaxWidth(popupMaxWidth);}
20
  if(contentBox.borderStyle){mainDiv.style.borderStyle=contentBox.borderStyle;}
21
  if(contentBox.borderColor){mainDiv.style.borderColor=contentBox.borderColor;}
22
+ if(contentBox.borderRadius){var borderRadiusMeasure='%';if(contentBox.borderRadiusType){borderRadiusMeasure=contentBox.borderRadiusType;}
23
  mainDiv.style.borderRadius=contentBox.borderRadius+borderRadiusMeasure;}
24
  mainDiv.style.borderWidth=contentBox.borderWidth+"px";if(contentBox.padding){mainDiv.style.padding=contentBox.padding+"px";}
25
  var widthToSet=sizeConfig.width||defaultWidth;if(widthToSet.indexOf("%")>-1){var widthNum=parseFloat(widthToSet);if(widthToSet.indexOf("fullScreen")>-1){widthNum=window.innerWidth;}
26
+ var closeButtonWidthToSubtract=parseInt(closeButton.width);if(closeBehavior.showButton===false||config.closeButton.type==='button'){closeButtonWidthToSubtract=0;}
27
  widthToSet=(((widthNum/100)*window.innerWidth)-(2*(contentBox.padding?contentBox.padding:0))-parseFloat(mainDiv.style.borderLeftWidth)-parseFloat(mainDiv.style.borderRightWidth)-(parseFloat(contentBox.shadowSpread)/2)-closeButtonWidthToSubtract)+'px';}
28
  else{widthToSet=parseFloat(widthToSet)-2*(contentBox.padding?contentBox.padding:0)+'px';}
29
+ mainDiv.style.width=widthToSet;if(config.popupType==='image'){mainDiv.style.backgroundImage="url("+contentBox.backgroundImage+")";}
30
  if(contentBox.showBackground){if(contentBox.backgroundImage){mainDiv.style.backgroundImage="url("+contentBox.backgroundImage+")";}
31
+ if(contentBox.backgroundMode==="cover"){mainDiv.style.backgroundSize="cover";mainDiv.style.backgroundRepeat="no-repeat";}
32
+ else if(contentBox.backgroundMode==="contain"){mainDiv.style.backgroundSize="contain";mainDiv.style.backgroundRepeat="no-repeat";}
33
+ else if(contentBox.backgroundMode==="repeat"){mainDiv.style.backgroundRepeat="repeat";}
34
+ else if(contentBox.backgroundMode==='fit'){if(!fitBackgroundImg){fitBackgroundImg=document.createElement('img');fitBackgroundImg.style.position='fixed';fitBackgroundImg.style.bottom='-9999999999999px';fitBackgroundImg.className='sgpb-background-image-'+config.popupId;document.body.appendChild(fitBackgroundImg);fitBackgroundImg.onload=function(){changePopupDimensionRelatedImage(this);};fitBackgroundImg.src=contentBox.backgroundImage;mainDiv.style.backgroundSize='100% 100%';mainDiv.style.backgroundRepeat='no-repeat';}}
35
  else{mainDiv.style.backgroundRepeat="no-repeat";}}
36
+ if(window.sgWindowOldWidth!==window.innerWidth||window.sgWindowOldHeight!==window.innerHeight){window.sgWindowOldWidth=window.innerWidth;window.sgWindowOldHeight=window.innerHeight;var images=document.getElementsByClassName('sgpb-background-image-'+config.popupId);if(images.length){changePopupDimensionRelatedImage(images[0]);}}
37
+ mainDiv.style.backgroundPosition=contentBox.backgroundPosition;var heightToSet=sizeConfig.height||defaultHeight;if(typeof heightToSet!=='undefined'&&heightToSet.indexOf("%")>-1){var heightNum=parseFloat(heightToSet);heightToSet=(((heightNum/100)*window.innerHeight)-(2*(contentBox.padding?contentBox.padding:0))-parseInt(mainDiv.style.borderTopWidth)-parseInt(mainDiv.style.borderBottomWidth))+"px";}
38
  else{heightToSet=parseInt(heightToSet)-2*(contentBox.padding?contentBox.padding:0)+"px";if(sizeConfig.width.indexOf("fullScreen")>-1){heightToSet=(window.innerHeight)+"px";}}
39
  mainDiv.style.height=heightToSet;if(contentBox.showBackground&&contentBox.backgroundColor){mainDiv.style.backgroundColor=contentBox.backgroundColor;}
40
  if(contentBox.shadowColor){mainDiv.style.boxShadow="0 0 "+contentBox.shadowBlur+"px "+contentBox.shadowSpread+"px "+contentBox.shadowColor;}
49
  else if(imageWidth>maxWidth){var modifiedWidthPercent=Math.floor((widthDifference/imageWidth)*100);var heightMustDecrease=Math.floor((imageHeight*modifiedWidthPercent)/100);var modifiedHeight=imageHeight-heightMustDecrease;imageWidth-=widthDifference;imageHeight-=heightMustDecrease;}
50
  var result={width:imageWidth,height:imageHeight};return result;}
51
  function calculateMaxWidth(maxWidth)
52
+ {var sizeConfig=getSizeConfig();var dimension=sizeConfig.width;var contentPadding=(contentBox.padding||0)*2;var shadowSpread=(contentBox.shadowSpread||0)*2;var borderWidth=(contentBox.borderWidth||0)*2;var boxBorderWidth=(contentBox.boxBorderWidth||0)*4;var closeButtonRight=(parseInt(closeBehavior.right)||0)*2;var closeButtonLeft=(parseInt(closeBehavior.left)||0)*2;if(dimension.indexOf('fullScreen')==='-1'){maxWidth-=contentPadding;maxWidth-=34;maxWidth-=shadowSpread;maxWidth-=borderWidth;maxWidth-=boxBorderWidth;}
53
  if(!closeBehavior.buttonInside){if(closeButtonRight){maxWidth-=Math.abs(closeButtonRight);}
54
  if(closeButtonLeft){maxWidth-=Math.abs(closeButtonLeft);}}
55
  if(maxWidth<0){return'30px';}
56
  return maxWidth+'px';}
57
  function setFitBackground()
58
+ {if(!fitBackgroundImg){return;}
59
+ var imgHeight=fitBackgroundImg.height;var imgWidth=fitBackgroundImg.width;var winHeight=window.innerHeight;var winWidth=window.innerWidth;var minMargin=40;var popupWidth=0,popupHeight=0;if(imgWidth<(winWidth-2*minMargin)&&imgHeight<(winHeight-2*minMargin)){popupWidth=imgWidth;popupHeight=imgHeight;}else{var widthDif=winWidth-imgWidth;var heightDif=winHeight-imgHeight;if(widthDif<heightDif){popupWidth=winWidth-2*minMargin;popupHeight=popupWidth*imgHeight/imgWidth;}else{popupHeight=winHeight-2*minMargin;popupWidth=popupHeight*imgWidth/imgHeight;}}
60
  var sizeConfig=getSizeConfig();var maxWidth=sizeConfig.maxWidth;var maxHeight=sizeConfig.maxHeight;var border=contentBox.borderWidth||0;var padding=contentBox.padding||0;var shadow=contentBox.shadowSpread||0;popupWidth=parseInt(popupWidth-2);sizeConfig.height=popupHeight+'px';}
61
  function calculateMaxHeight(maxHeight)
62
  {var sizeConfig=getSizeConfig();var dimension=sizeConfig.width;var contentPadding=(contentBox.padding||0)*2;var shadowSpread=(contentBox.shadowSpread||0)*4;var borderHeight=(contentBox.borderWidth||0)*2;var boxBorderHeight=(contentBox.boxBorderWidth||0)*4;var closeButtonTop=(parseInt(closeBehavior.top)||0)*2;var closeButtonBottom=(parseInt(closeBehavior.bottom)||0)*2;if(dimension.indexOf('fullScreen')!='-1'){}
66
  if(maxHeight<0){return'30px';}
67
  return maxHeight+'px';}
68
  function positionPopup()
69
+ {contentDiv.style.position="fixed";var border=contentBox.borderWidth||0;var padding=contentBox.padding||0;if(typeof position.left!=="undefined"&&(!isNaN(parseInt(position.left))||position.left==="center")){if(position.left==="center"){contentDiv.style.left=(window.innerWidth-parseInt(mainDiv.clientWidth)-2*border)/2+"px";}
70
  else{contentDiv.style.left=parseInt(position.left)+"px";}}
71
+ else{if(position.right==="center"){contentDiv.style.left=(window.innerWidth-parseInt(mainDiv.clientWidth)-2*border)/2+"px";}
72
  else{contentDiv.style.left=(window.innerWidth-parseInt(position.right)-parseInt(mainDiv.clientWidth)-2*border)+"px";}}
73
+ if(typeof position.top!=="undefined"&&(!isNaN(parseInt(position.top))||position.top==="center")){if(position.top==="center"){contentDiv.style.top=(window.innerHeight-parseInt(mainDiv.clientHeight)-2*border)/2+"px";}
74
  else{contentDiv.style.top=position.top+"px";}}
75
+ else{if(position.bottom==="center"){contentDiv.style.top=(window.innerHeight-parseInt(mainDiv.clientHeight)-2*border)/2+"px";}
76
  else{contentDiv.style.bottom=position.bottom+"px";}}}
77
  function getSizeConfig()
78
+ {var windowWidth=window.innerWidth;var windowHeight=window.innerHeight;var config=null;var candidates=[];for(var i=0;i<sizingRanges.length;i++){var tmpConf=sizingRanges[i];if((tmpConf.screenFrom.width===-1&&tmpConf.screenTo.width===-1)||(tmpConf.screenFrom.width===-1&&windowWidth<tmpConf.screenTo.width)||(tmpConf.screenTo.width===-1&&windowWidth>tmpConf.screenFrom.width)||(windowWidth<tmpConf.screenTo.width&&windowWidth>tmpConf.screenFrom.width)){candidates.push(tmpConf);}}
79
  for(var i=0;i<candidates.length;i++){var tmpConf=candidates[i];if((tmpConf.screenFrom.height==-1&&tmpConf.screenTo.height==-1)||(tmpConf.screenFrom.height==-1&&windowHeight<tmpConf.screenTo.height)||(tmpConf.screenTo.height==-1&&windowHeight>tmpConf.screenFrom.height)||(windowHeight<tmpConf.screenTo.height&&windowHeight>tmpConf.screenFrom.height)){continue;}
80
  else{candidates.splice(i,1);i--;}}
81
  config=candidates[0];if(!config){config={screenFrom:{width:-1,height:-1},screenTo:{width:-1,height:-1},width:"640px",height:defaultHeight,maxWidth:-1,maxHeight:-1,minWidth:-1,minHeight:-1}}
95
  function positionCloseButton(mainDiv)
96
  {if(closeBehavior.buttonPosition=="left"){closeButtonImage.style.left=(closeButton.width/2+parseFloat(closeBehavior.leftPosition))+"px";}
97
  else if(closeBehavior.buttonPosition=="right"){var border=contentBox.borderWidth||0;var left=0;var mainDivWidth=mainDiv.style.width;if(mainDiv.style.maxWidth&&parseInt(mainDivWidth)>parseInt(mainDiv.style.maxWidth)){mainDivWidth=mainDiv.style.maxWidth;}
98
+ left=parseFloat(mainDivWidth)-Math.ceil(closeButton.width/2)+2*contentBox.padding+2*border;if(closeBehavior.leftPosition){left-=parseFloat(closeBehavior.leftPosition);}
99
  closeButtonImage.style.left=left+"px";}
100
  closeButtonImage.style.top=parseFloat(closeBehavior.topPosition)+"px";}
101
  function onWindowRsize()
public/js/PopupBuilder.js CHANGED
@@ -63,18 +63,18 @@ SGPBPopup.htmlCustomButton = function()
63
  button.bind('click', function() {
64
  var behavior = settings['sgpb-custom-button'];
65
 
66
- if (behavior == 'redirectToURL') {
67
  if (settings['sgpb-custom-button-redirect-new-tab']) {
68
  window.open(settings['sgpb-custom-button-redirect-URL']);
69
  }
70
  else {
71
- window.location.href = settings['sgpb-custom-button-redirect-URL']
72
  }
73
  }
74
- if (behavior == 'hidePopup') {
75
  SGPBPopup.closePopup();
76
  }
77
- if (behavior == 'copyToClipBoard') {
78
  var textAreaId = 1;
79
  var value = settings['sgpb-custom-button-copy-to-clipboard-text'];
80
  var textArea = jQuery('<textarea>', {
@@ -95,7 +95,7 @@ SGPBPopup.htmlCustomButton = function()
95
  }
96
 
97
  if (settings['sgpb-custom-button-copy-to-clipboard-alert']) {
98
- alert(settings['sgpb-custom-button-copy-to-clipboard-message'])
99
  }
100
  }
101
  });
@@ -104,8 +104,7 @@ SGPBPopup.htmlCustomButton = function()
104
  buttons.each(function() {
105
  var settings = jQuery.parseJSON(decodeURIComponent(jQuery(this).attr('data-options')));
106
  buttonActionBehaviors(jQuery(this), settings);
107
- })
108
-
109
  };
110
 
111
  SGPBPopup.listeners = function () {
@@ -144,7 +143,7 @@ SGPBPopup.listeners = function () {
144
  var obj = e.detail.currentObj.sgpbPopupObj;
145
 
146
  /* if no analytics extension */
147
- if (typeof SGPB_ANALYTICS_PARAMS == 'undefined') {
148
  if (obj.getCountPopupOpen()) {
149
  obj.addToCounter(popupOptions);
150
  }
@@ -180,9 +179,9 @@ SGPBPopup.listeners = function () {
180
 
181
  SGPBPopup.mobileSafariAdditionalSettings = function(e)
182
  {
183
- if (typeof e == 'undefined') {
184
  var args = SGPBPopup.prototype.getAdditionalPopupData();
185
- if (typeof args == 'undefined') {
186
  return false;
187
  }
188
  var popupOptions = args.popupData;
@@ -199,14 +198,14 @@ SGPBPopup.mobileSafariAdditionalSettings = function(e)
199
  }
200
  var userAgent = window.navigator.userAgent;
201
  if (userAgent.match(/iPad/i) || userAgent.match(/iPhone/i)) {
202
- if (typeof popupOptions['sgpb-popup-dimension-mode'] != 'undefined' && popupOptions['sgpb-popup-dimension-mode'] == 'responsiveMode') {
203
  var openedPopupWidth = parseInt(window.innerHeight-100);
204
  if (jQuery('.sgpb-popup-builder-content-'+popupId +' iframe').length) {
205
  jQuery('.sgpb-popup-builder-content-'+popupId).attr('style', 'height:'+openedPopupWidth+'px !important;');
206
  }
207
  }
208
  }
209
- }
210
 
211
  SGPBPopup.prototype.setAdditionalPopupData = function(additionalPopupData)
212
  {
@@ -221,12 +220,12 @@ SGPBPopup.prototype.getAdditionalPopupData = function()
221
  SGPBPopup.prototype.setCountPopupOpen = function(countPopupOpen)
222
  {
223
  this.countPopupOpen = countPopupOpen;
224
- }
225
 
226
  SGPBPopup.prototype.getCountPopupOpen = function()
227
  {
228
  return this.countPopupOpen;
229
- }
230
 
231
  SGPBPopup.playMusic = function(e) {
232
  var args = e.detail;
@@ -268,7 +267,7 @@ SGPBPopup.prototype.onceListener = function()
268
  document.onkeydown = function(e) {
269
  e = e || window.event;
270
 
271
- if (e.keyCode == 27) { /*esc pressed*/
272
  var currentPopup = that.getPopupIdForNextEsc();
273
  if (!currentPopup) {
274
  return false;
@@ -280,23 +279,23 @@ SGPBPopup.prototype.onceListener = function()
280
  });
281
 
282
  sgAddEvent(window, 'sgpbDidClose', function(e) {
283
- if (window.sgPopupBuilder.length != 0) {
284
  var popups = [].concat(window.sgPopupBuilder).reverse();
285
  for (var i in popups) {
286
  var nextIndex = ++i;
287
  var nextObj = popups[nextIndex];
288
 
289
- if (typeof nextObj == 'undefined') {
290
  jQuery('html').removeClass('sgpb-overflow-hidden');
291
  jQuery('body').removeClass('sgpb-overflow-hidden-body');
292
  break;
293
  }
294
 
295
- if (nextObj.isOpen == false) {
296
  continue;
297
  }
298
  var options = SGPBPopup.getPopupOptionsById(nextObj.popupId);
299
- if (typeof options['sgpb-disable-page-scrolling'] == 'undefined') {
300
  jQuery('html').removeClass('sgpb-overflow-hidden');
301
  jQuery('body').removeClass('sgpb-overflow-hidden-body');
302
  }
@@ -463,7 +462,7 @@ SGPBPopup.prototype.prepareOpen = function()
463
  var F = new Function (instructions);
464
 
465
  return(F());
466
- }
467
 
468
  popupConfig.customShouldClose = function()
469
  {
@@ -472,7 +471,7 @@ SGPBPopup.prototype.prepareOpen = function()
472
  var F = new Function (instructions);
473
 
474
  return(F());
475
- }
476
 
477
  this.setPopupDimensions();
478
 
@@ -734,7 +733,7 @@ SGPBPopup.prototype.setPopupLimitationCookie = function(popupData)
734
  var popupShowingLimitExpiry = parseInt(popupData['sgpb-show-popup-same-user-expiry']);
735
 
736
  SGPBPopup.setCookie(cookieData.cookieName, JSON.stringify(cookie), popupShowingLimitExpiry, currentUrl);
737
- }
738
 
739
  SGPBPopup.prototype.isSatistfyForShowingLimitation = function(popupData)
740
  {
@@ -753,7 +752,7 @@ SGPBPopup.prototype.isSatistfyForShowingLimitation = function(popupData)
753
  }
754
 
755
  return popupData['sgpb-show-popup-same-user-count'] > cookieData.cookie.openingCount;
756
- }
757
 
758
  SGPBPopup.prototype.getPopupShowLimitationCookie = function(popupData)
759
  {
@@ -761,7 +760,7 @@ SGPBPopup.prototype.getPopupShowLimitationCookie = function(popupData)
761
  var savedCookie = this.filterPopupLimitationCookie(savedCookie);
762
 
763
  return savedCookie;
764
- }
765
 
766
  SGPBPopup.prototype.filterPopupLimitationCookie = function(cookie)
767
  {
@@ -787,7 +786,7 @@ SGPBPopup.prototype.filterPopupLimitationCookie = function(cookie)
787
  SGPBPopup.deleteCookie(cookie.pageLevelCookieName, currentUrl);
788
 
789
  return result;
790
- }
791
 
792
  SGPBPopup.prototype.getPopupShowLimitationCookieDetails = function(popupData)
793
  {
@@ -815,10 +814,10 @@ SGPBPopup.prototype.getPopupShowLimitationCookieDetails = function(popupData)
815
  'pageLevelCookie': popupLimitationPageLevelCookie,
816
  'domainLevelCookie': popupLimitationDomainCookie,
817
  'isPageLevel': pageLevelCookie
818
- }
819
 
820
  return result;
821
- }
822
 
823
  SGPBPopup.prototype.themeCreator = function()
824
  {
@@ -1851,13 +1850,13 @@ SGPBPopup.b64DecodeUnicode = function(str)
1851
  chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
1852
  chr3 = ((enc3 & 3) << 6) | enc4;
1853
 
1854
- output = output + String.fromCharCode(chr1);
1855
 
1856
  if (enc3 != 64) {
1857
- output = output + String.fromCharCode(chr2);
1858
  }
1859
  if (enc4 != 64) {
1860
- output = output + String.fromCharCode(chr3);
1861
  }
1862
 
1863
  }
@@ -1911,7 +1910,7 @@ SGPBPopup.unserialize = function(data)
1911
  var utf8Overhead = function(str) {
1912
  var s = str.length;
1913
  for (var i = str.length - 1; i >= 0; i--) {
1914
- var code = str.charCodeAt(i)
1915
  if (code > 0x7f && code <= 0x7ff) {
1916
  s++;
1917
  }
@@ -1924,11 +1923,11 @@ SGPBPopup.unserialize = function(data)
1924
  }
1925
  }
1926
  return s - 1;
1927
- }
1928
 
1929
  var error = function(type, msg, filename, line) {
1930
  throw new $global[type](msg, filename, line);
1931
- }
1932
  var readUntil = function(data, offset, stopchr) {
1933
  var i = 2;
1934
  var buf = [];
@@ -1943,54 +1942,54 @@ SGPBPopup.unserialize = function(data)
1943
  i += 1;
1944
  }
1945
  return [buf.length, buf.join('')];
1946
- }
1947
  var readChrs = function(data, offset, length) {
1948
- var i, chr, buf
1949
 
1950
- buf = []
1951
  for (i = 0; i < length; i++) {
1952
  chr = data.slice(offset + (i - 1), offset + i);
1953
  buf.push(chr);
1954
  length -= utf8Overhead(chr);
1955
  }
1956
  return [buf.length, buf.join('')];
1957
- }
1958
  function _unserialize(data, offset) {
1959
- var dtype
1960
- var dataoffset
1961
- var keyandchrs
1962
- var keys
1963
- var contig
1964
- var length
1965
- var array
1966
- var readdata
1967
- var readData
1968
- var ccount
1969
- var stringlength
1970
- var i
1971
- var key
1972
- var kprops
1973
- var kchrs
1974
- var vprops
1975
- var vchrs
1976
- var value
1977
- var chrs = 0
1978
  var typeconvert = function(x) {
1979
  return x
1980
- }
1981
 
1982
  if (!offset) {
1983
  offset = 0
1984
  }
1985
- dtype = (data.slice(offset, offset + 1)).toLowerCase()
1986
 
1987
- dataoffset = offset + 2
1988
 
1989
  switch (dtype) {
1990
  case 'i':
1991
  typeconvert = function(x) {
1992
  return parseInt(x, 10);
1993
- }
1994
  readData = readUntil(data, dataoffset, ';');
1995
  chrs = readData[0];
1996
  readdata = readData[1];
@@ -1999,7 +1998,7 @@ SGPBPopup.unserialize = function(data)
1999
  case 'b':
2000
  typeconvert = function(x) {
2001
  return parseInt(x, 10) !== 0;
2002
- }
2003
  readData = readUntil(data, dataoffset, ';');
2004
  chrs = readData[0];
2005
  readdata = readData[1];
@@ -2008,25 +2007,25 @@ SGPBPopup.unserialize = function(data)
2008
  case 'd':
2009
  typeconvert = function(x) {
2010
  return parseFloat(x);
2011
- }
2012
  readData = readUntil(data, dataoffset, ';');
2013
  chrs = readData[0];
2014
  readdata = readData[1];
2015
  dataoffset += chrs + 1;
2016
  break;
2017
  case 'n':
2018
- readdata = null
2019
- break
2020
  case 's':
2021
- ccount = readUntil(data, dataoffset, ':')
2022
- chrs = ccount[0]
2023
- stringlength = ccount[1]
2024
- dataoffset += chrs + 2
2025
-
2026
- readData = readChrs(data, dataoffset + 1, parseInt(stringlength, 10))
2027
- chrs = readData[0]
2028
- readdata = readData[1]
2029
- dataoffset += chrs + 2
2030
  if (chrs !== parseInt(stringlength, 10) && chrs !== readdata.length) {
2031
  error('SyntaxError', 'String length mismatch')
2032
  }
@@ -2061,7 +2060,7 @@ SGPBPopup.unserialize = function(data)
2061
  }
2062
 
2063
  if (contig) {
2064
- array = new Array(length)
2065
  for (i = 0; i < length; i++) {
2066
  array[i] = readdata[i];
2067
  }
@@ -2235,7 +2234,7 @@ SGPBPopup.setCookie = function(cName, cValue, exDays, cPageLevel)
2235
  }
2236
  }
2237
 
2238
- if ((typeof cPageLevel == 'boolean' && cPageLevel == false) || cPageLevel == '' || typeof cPageLevel == 'undefined') {
2239
  cookiePageLevel = 'path=/;';
2240
  }
2241
 
@@ -2474,7 +2473,7 @@ SgpbEventListener.prototype.sgpbLoad = function(listenerObj, eventData)
2474
  var timeout = parseInt(eventData.value);
2475
  var popupObj = listenerObj.getPopupObj();
2476
  var popupOptions = popupObj.getPopupData();
2477
- timeout = timeout*1000;
2478
  var timerId,
2479
  repetitiveTimeout = null;
2480
 
63
  button.bind('click', function() {
64
  var behavior = settings['sgpb-custom-button'];
65
 
66
+ if (behavior === 'redirectToURL') {
67
  if (settings['sgpb-custom-button-redirect-new-tab']) {
68
  window.open(settings['sgpb-custom-button-redirect-URL']);
69
  }
70
  else {
71
+ window.location.href = settings['sgpb-custom-button-redirect-URL'];
72
  }
73
  }
74
+ if (behavior === 'hidePopup') {
75
  SGPBPopup.closePopup();
76
  }
77
+ if (behavior === 'copyToClipBoard') {
78
  var textAreaId = 1;
79
  var value = settings['sgpb-custom-button-copy-to-clipboard-text'];
80
  var textArea = jQuery('<textarea>', {
95
  }
96
 
97
  if (settings['sgpb-custom-button-copy-to-clipboard-alert']) {
98
+ alert(settings['sgpb-custom-button-copy-to-clipboard-message']);
99
  }
100
  }
101
  });
104
  buttons.each(function() {
105
  var settings = jQuery.parseJSON(decodeURIComponent(jQuery(this).attr('data-options')));
106
  buttonActionBehaviors(jQuery(this), settings);
107
+ });
 
108
  };
109
 
110
  SGPBPopup.listeners = function () {
143
  var obj = e.detail.currentObj.sgpbPopupObj;
144
 
145
  /* if no analytics extension */
146
+ if (typeof SGPB_ANALYTICS_PARAMS === 'undefined') {
147
  if (obj.getCountPopupOpen()) {
148
  obj.addToCounter(popupOptions);
149
  }
179
 
180
  SGPBPopup.mobileSafariAdditionalSettings = function(e)
181
  {
182
+ if (typeof e === 'undefined') {
183
  var args = SGPBPopup.prototype.getAdditionalPopupData();
184
+ if (typeof args === 'undefined') {
185
  return false;
186
  }
187
  var popupOptions = args.popupData;
198
  }
199
  var userAgent = window.navigator.userAgent;
200
  if (userAgent.match(/iPad/i) || userAgent.match(/iPhone/i)) {
201
+ if (typeof popupOptions['sgpb-popup-dimension-mode'] !== 'undefined' && popupOptions['sgpb-popup-dimension-mode'] === 'responsiveMode') {
202
  var openedPopupWidth = parseInt(window.innerHeight-100);
203
  if (jQuery('.sgpb-popup-builder-content-'+popupId +' iframe').length) {
204
  jQuery('.sgpb-popup-builder-content-'+popupId).attr('style', 'height:'+openedPopupWidth+'px !important;');
205
  }
206
  }
207
  }
208
+ };
209
 
210
  SGPBPopup.prototype.setAdditionalPopupData = function(additionalPopupData)
211
  {
220
  SGPBPopup.prototype.setCountPopupOpen = function(countPopupOpen)
221
  {
222
  this.countPopupOpen = countPopupOpen;
223
+ };
224
 
225
  SGPBPopup.prototype.getCountPopupOpen = function()
226
  {
227
  return this.countPopupOpen;
228
+ };
229
 
230
  SGPBPopup.playMusic = function(e) {
231
  var args = e.detail;
267
  document.onkeydown = function(e) {
268
  e = e || window.event;
269
 
270
+ if (e.keyCode === 27) { /*esc pressed*/
271
  var currentPopup = that.getPopupIdForNextEsc();
272
  if (!currentPopup) {
273
  return false;
279
  });
280
 
281
  sgAddEvent(window, 'sgpbDidClose', function(e) {
282
+ if (window.sgPopupBuilder.length !== 0) {
283
  var popups = [].concat(window.sgPopupBuilder).reverse();
284
  for (var i in popups) {
285
  var nextIndex = ++i;
286
  var nextObj = popups[nextIndex];
287
 
288
+ if (typeof nextObj === 'undefined') {
289
  jQuery('html').removeClass('sgpb-overflow-hidden');
290
  jQuery('body').removeClass('sgpb-overflow-hidden-body');
291
  break;
292
  }
293
 
294
+ if (nextObj.isOpen === false) {
295
  continue;
296
  }
297
  var options = SGPBPopup.getPopupOptionsById(nextObj.popupId);
298
+ if (typeof options['sgpb-disable-page-scrolling'] === 'undefined') {
299
  jQuery('html').removeClass('sgpb-overflow-hidden');
300
  jQuery('body').removeClass('sgpb-overflow-hidden-body');
301
  }
462
  var F = new Function (instructions);
463
 
464
  return(F());
465
+ };
466
 
467
  popupConfig.customShouldClose = function()
468
  {
471
  var F = new Function (instructions);
472
 
473
  return(F());
474
+ };
475
 
476
  this.setPopupDimensions();
477
 
733
  var popupShowingLimitExpiry = parseInt(popupData['sgpb-show-popup-same-user-expiry']);
734
 
735
  SGPBPopup.setCookie(cookieData.cookieName, JSON.stringify(cookie), popupShowingLimitExpiry, currentUrl);
736
+ };
737
 
738
  SGPBPopup.prototype.isSatistfyForShowingLimitation = function(popupData)
739
  {
752
  }
753
 
754
  return popupData['sgpb-show-popup-same-user-count'] > cookieData.cookie.openingCount;
755
+ };
756
 
757
  SGPBPopup.prototype.getPopupShowLimitationCookie = function(popupData)
758
  {
760
  var savedCookie = this.filterPopupLimitationCookie(savedCookie);
761
 
762
  return savedCookie;
763
+ };
764
 
765
  SGPBPopup.prototype.filterPopupLimitationCookie = function(cookie)
766
  {
786
  SGPBPopup.deleteCookie(cookie.pageLevelCookieName, currentUrl);
787
 
788
  return result;
789
+ };
790
 
791
  SGPBPopup.prototype.getPopupShowLimitationCookieDetails = function(popupData)
792
  {
814
  'pageLevelCookie': popupLimitationPageLevelCookie,
815
  'domainLevelCookie': popupLimitationDomainCookie,
816
  'isPageLevel': pageLevelCookie
817
+ };
818
 
819
  return result;
820
+ };
821
 
822
  SGPBPopup.prototype.themeCreator = function()
823
  {
1850
  chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
1851
  chr3 = ((enc3 & 3) << 6) | enc4;
1852
 
1853
+ output += String.fromCharCode(chr1);
1854
 
1855
  if (enc3 != 64) {
1856
+ output += String.fromCharCode(chr2);
1857
  }
1858
  if (enc4 != 64) {
1859
+ output += String.fromCharCode(chr3);
1860
  }
1861
 
1862
  }
1910
  var utf8Overhead = function(str) {
1911
  var s = str.length;
1912
  for (var i = str.length - 1; i >= 0; i--) {
1913
+ var code = str.charCodeAt(i);
1914
  if (code > 0x7f && code <= 0x7ff) {
1915
  s++;
1916
  }
1923
  }
1924
  }
1925
  return s - 1;
1926
+ };
1927
 
1928
  var error = function(type, msg, filename, line) {
1929
  throw new $global[type](msg, filename, line);
1930
+ };
1931
  var readUntil = function(data, offset, stopchr) {
1932
  var i = 2;
1933
  var buf = [];
1942
  i += 1;
1943
  }
1944
  return [buf.length, buf.join('')];
1945
+ };
1946
  var readChrs = function(data, offset, length) {
1947
+ var i, chr, buf;
1948
 
1949
+ buf = [];
1950
  for (i = 0; i < length; i++) {
1951
  chr = data.slice(offset + (i - 1), offset + i);
1952
  buf.push(chr);
1953
  length -= utf8Overhead(chr);
1954
  }
1955
  return [buf.length, buf.join('')];
1956
+ };
1957
  function _unserialize(data, offset) {
1958
+ var dtype;
1959
+ var dataoffset;
1960
+ var keyandchrs;
1961
+ var keys;
1962
+ var contig;
1963
+ var length;
1964
+ var array;
1965
+ var readdata;
1966
+ var readData;
1967
+ var ccount;
1968
+ var stringlength;
1969
+ var i;
1970
+ var key;
1971
+ var kprops;
1972
+ var kchrs;
1973
+ var vprops;
1974
+ var vchrs;
1975
+ var value;
1976
+ var chrs = 0;
1977
  var typeconvert = function(x) {
1978
  return x
1979
+ };
1980
 
1981
  if (!offset) {
1982
  offset = 0
1983
  }
1984
+ dtype = (data.slice(offset, offset + 1)).toLowerCase();
1985
 
1986
+ dataoffset = offset + 2;
1987
 
1988
  switch (dtype) {
1989
  case 'i':
1990
  typeconvert = function(x) {
1991
  return parseInt(x, 10);
1992
+ };
1993
  readData = readUntil(data, dataoffset, ';');
1994
  chrs = readData[0];
1995
  readdata = readData[1];
1998
  case 'b':
1999
  typeconvert = function(x) {
2000
  return parseInt(x, 10) !== 0;
2001
+ };
2002
  readData = readUntil(data, dataoffset, ';');
2003
  chrs = readData[0];
2004
  readdata = readData[1];
2007
  case 'd':
2008
  typeconvert = function(x) {
2009
  return parseFloat(x);
2010
+ };
2011
  readData = readUntil(data, dataoffset, ';');
2012
  chrs = readData[0];
2013
  readdata = readData[1];
2014
  dataoffset += chrs + 1;
2015
  break;
2016
  case 'n':
2017
+ readdata = null;
2018
+ break;
2019
  case 's':
2020
+ ccount = readUntil(data, dataoffset, ':');
2021
+ chrs = ccount[0];
2022
+ stringlength = ccount[1];
2023
+ dataoffset += chrs + 2;
2024
+
2025
+ readData = readChrs(data, dataoffset + 1, parseInt(stringlength, 10));
2026
+ chrs = readData[0];
2027
+ readdata = readData[1];
2028
+ dataoffset += chrs + 2;
2029
  if (chrs !== parseInt(stringlength, 10) && chrs !== readdata.length) {
2030
  error('SyntaxError', 'String length mismatch')
2031
  }
2060
  }
2061
 
2062
  if (contig) {
2063
+ array = new Array(length);
2064
  for (i = 0; i < length; i++) {
2065
  array[i] = readdata[i];
2066
  }
2234
  }
2235
  }
2236
 
2237
+ if (Boolean(cPageLevel)) {
2238
  cookiePageLevel = 'path=/;';
2239
  }
2240
 
2473
  var timeout = parseInt(eventData.value);
2474
  var popupObj = listenerObj.getPopupObj();
2475
  var popupOptions = popupObj.getPopupData();
2476
+ timeout *= 1000;
2477
  var timerId,
2478
  repetitiveTimeout = null;
2479
 
public/js/Subscribers.js CHANGED
@@ -1,8 +1,8 @@
1
  function SGPBSubscribers(){}
2
  SGPBSubscribers.prototype.init=function()
3
  {this.openAddSubscriberPopup();this.openImportSubscriberPopup();this.subscriberFileUploader();this.closeAddSubscriberPopup();this.importSubscriber();this.dataImport();this.deleteSubscribers();this.addSubscribers();this.toggleCheckedSubscribers();this.fixSubscriptionBulkCheckbox();this.exportSubscribers();};SGPBSubscribers.prototype.deleteSubscribers=function()
4
- {var checkedSubscribersList=[];var that=this;jQuery('.sg-subs-delete-button').bind('click',function(){var data={};data.ajaxNonce=jQuery(this).attr('data-ajaxNonce');jQuery('.subs-delete-checkbox').each(function(){var isChecked=jQuery(this).prop('checked');if(isChecked){var subscriberId=jQuery(this).attr('data-delete-id');checkedSubscribersList.push(subscriberId);}});if(checkedSubscribersList.length==0){alert('Please select at least one subscriber.');}
5
- else{var isSure=confirm(SGPB_JS_LOCALIZATION.areYouSure);if(isSure){that.deleteSubscribersAjax(checkedSubscribersList,data);}}})};SGPBSubscribers.prototype.openImportSubscriberPopup=function()
6
  {if(jQuery('.bulkactions').empty()){jQuery('.bulkactions').remove();}
7
  var that=this;jQuery('.sgpb-import-subscriber').bind('click',function(){jQuery('#sgpb-import-subscribers').addClass('sgpb-show-add-subscriber-popup');SGPBSubscribers.prototype.escKeyClosePopup();that.closePopup();});};SGPBSubscribers.prototype.subscriberFileUploader=function()
8
  {var uploadButton=jQuery('#js-import-subscriber-button');var supportedAudioTypes=['text/plain','text/x-csv','text/csv'];if(!uploadButton.length){return false;}
@@ -16,22 +16,20 @@ selectOptioon.bind('change',function(){var currentVal=jQuery(this).val();jQuery(
16
  {jQuery('.sgpb-subscriber-popup-close-btn-js').bind('click',function(){jQuery(this).parents('.sgpb-subscribers-popup').first().removeClass('sgpb-show-add-subscriber-popup');jQuery('.sgpb-add-subscriber-input:selected').prop('selected',false);jQuery('.sgpb-add-subscriber-input').val('');});};SGPBSubscribers.prototype.openAddSubscriberPopup=function()
17
  {if(jQuery('.bulkactions').empty()){jQuery('.bulkactions').remove();}
18
  jQuery('.sgpb-add-subscriber').bind('click',function(){jQuery('#sgpb-add-new-subscriber').addClass('sgpb-show-add-subscriber-popup');SGPBSubscribers.prototype.escKeyClosePopup();});};SGPBSubscribers.prototype.escKeyClosePopup=function()
19
- {jQuery(document).keyup(function(e){if(e.keyCode==27){if(jQuery('#sgpb-add-new-subscriber').hasClass('sgpb-show-add-subscriber-popup')){jQuery('#sgpb-add-new-subscriber').removeClass('sgpb-show-add-subscriber-popup');}}});};SGPBSubscribers.prototype.closeAddSubscriberPopup=function()
20
  {jQuery('.sgpb-add-subscriber-popup-close-btn-js').bind('click',function(){jQuery('#sgpb-add-new-subscriber').removeClass('sgpb-show-add-subscriber-popup');jQuery('.sgpb-add-subscriber-input:selected').prop('selected',false);jQuery('.sgpb-add-subscriber-input').val('');});};SGPBSubscribers.prototype.addSubscribers=function()
21
- {var that=this;jQuery('.sgpb-add-to-list-js').bind('click',function(){jQuery('.sgpb-subscription-error').addClass('sg-hide-element');jQuery('.sgpb-email-error').addClass('sg-hide-element');var email=jQuery('.sgpb-add-subscribers-email').val();var firstName=jQuery('.sgpb-add-subscribers-first-name').val();var lastName=jQuery('.sgpb-add-subscribers-last-name').val();var subscriptionPopups=[];jQuery('.js-sg-newsletter-forms > option').each(function(){if(jQuery(this).prop('selected')){subscriptionPopups.push(jQuery(this).val());}});var validationString=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;var validEmail=email.search(validationString);if(jQuery('.js-sg-newsletter-forms > option').is(':checked')==false&&validEmail==-1){jQuery('.sgpb-subscription-error').removeClass('sg-hide-element');jQuery('.sgpb-email-error').removeClass('sg-hide-element');return;}
22
- if(jQuery('.js-sg-newsletter-forms > option').is(':checked')==false){jQuery('.sgpb-subscription-error').removeClass('sg-hide-element');return;}
23
- if(validEmail==-1){jQuery('.sgpb-email-error').removeClass('sg-hide-element');return;}
24
  jQuery('.sgpb-email-error').addClass('sg-hide-element');var data={action:'sgpb_add_subscribers',nonce:SGPB_JS_PARAMS.nonce,firstName:firstName,lastName:lastName,email:email,popups:subscriptionPopups,beforeSend:function(){jQuery('.js-sgpb-add-spinner').removeClass('sg-hide-element');}};that.addToSubscribersAjax(data);});};SGPBSubscribers.prototype.exportSubscribers=function()
25
- {var that=this;jQuery('#sgpb-subscription-popup').on('change',function(){jQuery('.sgpb-subscription-popup-id').val(jQuery(this).val());})
26
- jQuery('#sgpb-subscribers-dates').on('change',function(){jQuery('.sgpb-subscribers-date').val(jQuery(this).val());})
27
- jQuery('.sgpb-export-subscriber').bind('click',function(){var parameters='';var params={};params['sgpb-subscription-popup-id']=that.getUrlParameter('sgpb-subscription-popup-id');params['s']=that.getUrlParameter('s');params['sgpb-subscribers-date']=that.getUrlParameter('sgpb-subscribers-date');params['orderby']=that.getUrlParameter('orderby');params['order']=that.getUrlParameter('order');for(var i in params){if(typeof params[i]!='undefined'&&params[i]!=''){parameters+='&'+i+'='+params[i];}}
28
  window.location.href=SGPB_JS_ADMIN_URL.url+'?action=csv_file'+parameters;});};SGPBSubscribers.prototype.getUrlParameter=function(key)
29
- {var pageUrl=window.location.search.substring(1);var urlVariables=pageUrl.split('&');for(var i=0;i<urlVariables.length;i++){var param=urlVariables[i].split('=');if(param[0]==key){if(typeof param[1]!='undefined'){return param[1];}
30
  else{return'';}}}};SGPBSubscribers.prototype.addToSubscribersAjax=function(data)
31
- {jQuery.post(ajaxurl,data,function(response){if(response!=1){jQuery('.sgpb-subscriber-adding-error').removeClass('sg-hide-element');jQuery('.sgpb-subscribers-add-spinner').addClass('sg-hide-element');}
32
  else{location.reload();}});};SGPBSubscribers.prototype.toggleCheckedSubscribers=function()
33
  {var that=this;jQuery('.subs-bulk').each(function(){jQuery(this).bind('click',function(){var bulkStatus=jQuery(this).prop('checked');that.changeCheckedSubscribers(bulkStatus);});});};SGPBSubscribers.prototype.changeCheckedSubscribers=function(bulkStatus)
34
- {jQuery('.subs-delete-checkbox').each(function(){jQuery(this).prop('checked',bulkStatus);})};SGPBSubscribers.prototype.fixSubscriptionBulkCheckbox=function()
35
  {jQuery('#bulk,.column-bulk').removeClass().addClass('manage-column column-cb check-column');};SGPBSubscribers.prototype.dataImport=function()
36
  {var custom_uploader;jQuery('#js-upload-export-file').click(function(e){e.preventDefault();var ajaxNonce=jQuery(this).attr('data-ajaxNonce');if(custom_uploader){custom_uploader.open();return;}
37
  custom_uploader=wp.media.frames.file_frame=wp.media({titleFF:'Select Export File',button:{text:'Select Export File'},multiple:false,library:{type:'text/plain'}});custom_uploader.on('select',function(){attachment=custom_uploader.state().get('selection').first().toJSON();var data={action:'import_popups',ajaxNonce:ajaxNonce,attachmentUrl:attachment.url};jQuery('.js-sg-import-gif').removeClass('sg-hide-element');jQuery.post(ajaxurl,data,function(response,d){location.reload();jQuery('.js-sg-import-gif').addClass('sg-hide-element');});});custom_uploader.open();});};SGPBSubscribers.prototype.deleteSubscribersAjax=function(checkedSubscribersList)
1
  function SGPBSubscribers(){}
2
  SGPBSubscribers.prototype.init=function()
3
  {this.openAddSubscriberPopup();this.openImportSubscriberPopup();this.subscriberFileUploader();this.closeAddSubscriberPopup();this.importSubscriber();this.dataImport();this.deleteSubscribers();this.addSubscribers();this.toggleCheckedSubscribers();this.fixSubscriptionBulkCheckbox();this.exportSubscribers();};SGPBSubscribers.prototype.deleteSubscribers=function()
4
+ {var checkedSubscribersList=[];var that=this;jQuery('.sg-subs-delete-button').bind('click',function(){var data={};data.ajaxNonce=jQuery(this).attr('data-ajaxNonce');jQuery('.subs-delete-checkbox').each(function(){var isChecked=jQuery(this).prop('checked');if(isChecked){var subscriberId=jQuery(this).attr('data-delete-id');checkedSubscribersList.push(subscriberId);}});if(checkedSubscribersList.length===0){alert('Please select at least one subscriber.');}
5
+ else{var isSure=confirm(SGPB_JS_LOCALIZATION.areYouSure);if(isSure){that.deleteSubscribersAjax(checkedSubscribersList,data);}}});};SGPBSubscribers.prototype.openImportSubscriberPopup=function()
6
  {if(jQuery('.bulkactions').empty()){jQuery('.bulkactions').remove();}
7
  var that=this;jQuery('.sgpb-import-subscriber').bind('click',function(){jQuery('#sgpb-import-subscribers').addClass('sgpb-show-add-subscriber-popup');SGPBSubscribers.prototype.escKeyClosePopup();that.closePopup();});};SGPBSubscribers.prototype.subscriberFileUploader=function()
8
  {var uploadButton=jQuery('#js-import-subscriber-button');var supportedAudioTypes=['text/plain','text/x-csv','text/csv'];if(!uploadButton.length){return false;}
16
  {jQuery('.sgpb-subscriber-popup-close-btn-js').bind('click',function(){jQuery(this).parents('.sgpb-subscribers-popup').first().removeClass('sgpb-show-add-subscriber-popup');jQuery('.sgpb-add-subscriber-input:selected').prop('selected',false);jQuery('.sgpb-add-subscriber-input').val('');});};SGPBSubscribers.prototype.openAddSubscriberPopup=function()
17
  {if(jQuery('.bulkactions').empty()){jQuery('.bulkactions').remove();}
18
  jQuery('.sgpb-add-subscriber').bind('click',function(){jQuery('#sgpb-add-new-subscriber').addClass('sgpb-show-add-subscriber-popup');SGPBSubscribers.prototype.escKeyClosePopup();});};SGPBSubscribers.prototype.escKeyClosePopup=function()
19
+ {jQuery(document).keyup(function(e){if(e.keyCode===27){if(jQuery('#sgpb-add-new-subscriber').hasClass('sgpb-show-add-subscriber-popup')){jQuery('#sgpb-add-new-subscriber').removeClass('sgpb-show-add-subscriber-popup');}}});};SGPBSubscribers.prototype.closeAddSubscriberPopup=function()
20
  {jQuery('.sgpb-add-subscriber-popup-close-btn-js').bind('click',function(){jQuery('#sgpb-add-new-subscriber').removeClass('sgpb-show-add-subscriber-popup');jQuery('.sgpb-add-subscriber-input:selected').prop('selected',false);jQuery('.sgpb-add-subscriber-input').val('');});};SGPBSubscribers.prototype.addSubscribers=function()
21
+ {var that=this;jQuery('.sgpb-add-to-list-js').bind('click',function(){jQuery('.sgpb-subscription-error').addClass('sg-hide-element');jQuery('.sgpb-email-error').addClass('sg-hide-element');var email=jQuery('.sgpb-add-subscribers-email').val();var firstName=jQuery('.sgpb-add-subscribers-first-name').val();var lastName=jQuery('.sgpb-add-subscribers-last-name').val();var subscriptionPopups=[];jQuery('.js-sg-newsletter-forms > option').each(function(){if(jQuery(this).prop('selected')){subscriptionPopups.push(jQuery(this).val());}});var validationString=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;var validEmail=email.search(validationString);if(jQuery('.js-sg-newsletter-forms > option').is(':checked')===false&&validEmail===-1){jQuery('.sgpb-subscription-error').removeClass('sg-hide-element');jQuery('.sgpb-email-error').removeClass('sg-hide-element');return;}
22
+ if(jQuery('.js-sg-newsletter-forms > option').is(':checked')===false){jQuery('.sgpb-subscription-error').removeClass('sg-hide-element');return;}
23
+ if(validEmail===-1){jQuery('.sgpb-email-error').removeClass('sg-hide-element');return;}
24
  jQuery('.sgpb-email-error').addClass('sg-hide-element');var data={action:'sgpb_add_subscribers',nonce:SGPB_JS_PARAMS.nonce,firstName:firstName,lastName:lastName,email:email,popups:subscriptionPopups,beforeSend:function(){jQuery('.js-sgpb-add-spinner').removeClass('sg-hide-element');}};that.addToSubscribersAjax(data);});};SGPBSubscribers.prototype.exportSubscribers=function()
25
+ {var that=this;jQuery('#sgpb-subscription-popup').on('change',function(){jQuery('.sgpb-subscription-popup-id').val(jQuery(this).val());});jQuery('#sgpb-subscribers-dates').on('change',function(){jQuery('.sgpb-subscribers-date').val(jQuery(this).val());});jQuery('.sgpb-export-subscriber').bind('click',function(){var parameters='';var params={};params['sgpb-subscription-popup-id']=that.getUrlParameter('sgpb-subscription-popup-id');params['s']=that.getUrlParameter('s');params['sgpb-subscribers-date']=that.getUrlParameter('sgpb-subscribers-date');params['orderby']=that.getUrlParameter('orderby');params['order']=that.getUrlParameter('order');for(var i in params){if(typeof params[i]!=='undefined'&&params[i]!==''){parameters+='&'+i+'='+params[i];}}
 
 
26
  window.location.href=SGPB_JS_ADMIN_URL.url+'?action=csv_file'+parameters;});};SGPBSubscribers.prototype.getUrlParameter=function(key)
27
+ {var pageUrl=window.location.search.substring(1);var urlVariables=pageUrl.split('&');for(var i=0;i<urlVariables.length;i++){var param=urlVariables[i].split('=');if(param[0]===key){if(typeof param[1]!=='undefined'){return param[1];}
28
  else{return'';}}}};SGPBSubscribers.prototype.addToSubscribersAjax=function(data)
29
+ {jQuery.post(ajaxurl,data,function(response){if(response!==1){jQuery('.sgpb-subscriber-adding-error').removeClass('sg-hide-element');jQuery('.sgpb-subscribers-add-spinner').addClass('sg-hide-element');}
30
  else{location.reload();}});};SGPBSubscribers.prototype.toggleCheckedSubscribers=function()
31
  {var that=this;jQuery('.subs-bulk').each(function(){jQuery(this).bind('click',function(){var bulkStatus=jQuery(this).prop('checked');that.changeCheckedSubscribers(bulkStatus);});});};SGPBSubscribers.prototype.changeCheckedSubscribers=function(bulkStatus)
32
+ {jQuery('.subs-delete-checkbox').each(function(){jQuery(this).prop('checked',bulkStatus);});};SGPBSubscribers.prototype.fixSubscriptionBulkCheckbox=function()
33
  {jQuery('#bulk,.column-bulk').removeClass().addClass('manage-column column-cb check-column');};SGPBSubscribers.prototype.dataImport=function()
34
  {var custom_uploader;jQuery('#js-upload-export-file').click(function(e){e.preventDefault();var ajaxNonce=jQuery(this).attr('data-ajaxNonce');if(custom_uploader){custom_uploader.open();return;}
35
  custom_uploader=wp.media.frames.file_frame=wp.media({titleFF:'Select Export File',button:{text:'Select Export File'},multiple:false,library:{type:'text/plain'}});custom_uploader.on('select',function(){attachment=custom_uploader.state().get('selection').first().toJSON();var data={action:'import_popups',ajaxNonce:ajaxNonce,attachmentUrl:attachment.url};jQuery('.js-sg-import-gif').removeClass('sg-hide-element');jQuery.post(ajaxurl,data,function(response,d){location.reload();jQuery('.js-sg-import-gif').addClass('sg-hide-element');});});custom_uploader.open();});};SGPBSubscribers.prototype.deleteSubscribersAjax=function(checkedSubscribersList)
public/js/Subscription.js CHANGED
@@ -1,52 +1,52 @@
1
  function SGPBSubscription()
2
  {this.expiryTime=365;this.submissionPopupId=0;this.newWindow=null;this.init();}
3
  SGPBSubscription.cookieName='SGPBSubscription';SGPBSubscription.prototype.init=function()
4
- {if(typeof SGPBFormBuilder!='undefined'){return false;}
5
  this.livePreview();this.formSubmission();};SGPBSubscription.prototype.formSubmission=function()
6
- {var that=this;if(typeof sgAddEvent=='undefined'){return false;}
7
- sgAddEvent(window,'sgpbDidOpen',function(e){var popupArgs=e.detail;var popupId=popupArgs.popupId;var popupOptions=SGPBPopup.getPopupOptionsById(popupId);var additionalPopupParams={};var subscriptionForm=jQuery('#sgpb-popup-dialog-main-div .sgpb-subs-form-'+popupId+' form');var submitButton=subscriptionForm.find('.js-subs-submit-btn');var sgpbSubsValidateObj={};try{sgpbSubsValidateObj=eval('sgpbSubsValidateObj'+popupId)}
8
  catch(err){}
9
- if(typeof sgpbSubsValidateObj!='object'){return false;}
10
  jQuery.validator.setDefaults({errorPlacement:function(error,element){var errorWrapperClassName=jQuery(element).attr('data-error-message-class');jQuery('.sgpb-subs-form-'+popupId+' .'+errorWrapperClassName).html(error);}});sgpbSubsValidateObj.submitHandler=function()
11
- {var formData=subscriptionForm.serialize();var ajaxData={action:'sgpb_subscription_submission',nonce:SGPB_JS_PARAMS.nonce,beforeSend:function(){submitButton.val(submitButton.attr('data-progress-title'));if(popupOptions['sgpb-subs-success-behavior']=='redirectToURL'&&popupOptions['sgpb-subs-success-redirect-new-tab']){that.newWindow=window.open(popupOptions['sgpb-subs-success-redirect-URL']);}},formData:formData,popupPostId:popupId};jQuery.post(SGPB_JS_PARAMS.ajaxUrl,ajaxData,function(res){that.submissionPopupId=popupId;jQuery('.sgpb-subs-form-'+popupId+' .sgpb-alert').addClass('sg-hide-element');submitButton.val(submitButton.attr('data-title'));additionalPopupParams['res']=res;that.showMessages(additionalPopupParams);that.processAfterSuccessfulSubmission(ajaxData);})};subscriptionForm.validate(sgpbSubsValidateObj);});jQuery(window).on('sgpbDidClose',function(e){var popupArgs=e.detail;var popupId=popupArgs.popupId;jQuery('.sgpb-subs-form-'+popupId+' form label.error').hide();});};SGPBSubscription.prototype.processAfterSuccessfulSubmission=function(ajaxData)
12
  {if(jQuery.isEmptyObject(ajaxData)){return false;}
13
  ajaxData.action='sgpb_process_after_submission';jQuery.post(SGPB_JS_PARAMS.ajaxUrl,ajaxData,function(res){});};SGPBSubscription.prototype.showMessages=function(res)
14
- {var that=this;if(res['res']==1){this.subscriptionSuccessBehavior();}
15
- else{if(that.newWindow!=null){that.newWindow.close();}
16
  this.showErrorMessage();}
17
  window.dispatchEvent(new Event('resize'));return true;};SGPBSubscription.prototype.showErrorMessage=function()
18
  {var popupId=parseInt(this.submissionPopupId);jQuery('.sgpb-subs-form-'+popupId+' .sgpb-alert-danger').removeClass('sg-hide-element');};SGPBSubscription.prototype.subscriptionSuccessBehavior=function()
19
- {var settings={popupId:this.submissionPopupId,eventName:'sgpbSubscriptionSuccess'};jQuery(window).trigger('sgpbFormSuccess',settings);var popupId=parseInt(this.submissionPopupId);var popupOptions=SGPBPopup.getPopupOptionsById(popupId);var behavior='showMessage';jQuery('.sgpb-subs-form-'+popupId+' form').remove();if(typeof popupOptions['sgpb-subs-hide-subs-users']!='undefined'){this.setSubscriptionCookie(popupId);}
20
- if(typeof popupOptions['sgpb-subs-success-behavior']!='undefined'){behavior=popupOptions['sgpb-subs-success-behavior'];}
21
  this.resetFieldsValues();switch(behavior){case'showMessage':jQuery('.sgpb-subs-form-'+popupId+' .sgpb-alert-success').removeClass('sg-hide-element');break;case'redirectToURL':this.redirectToURL(popupOptions);break;case'openPopup':this.openSuccessPopup(popupOptions);break;case'hidePopup':SGPBPopup.closePopupById(this.submissionPopupId);break;}};SGPBSubscription.prototype.openSuccessPopup=function(popupOptions)
22
- {var that=this;setTimeout(function(){SGPBPopup.closePopupById(that.submissionPopupId);},0);if(typeof popupOptions['sgpb-subs-success-popup']!='undefined'){sgAddEvent(window,'sgpbDidClose',this.openPopup(popupOptions));}};SGPBSubscription.prototype.openPopup=function(popupOptions)
23
- {if(typeof popupOptions['sgpb-subs-success-popup']=='undefined'){return false;}
24
  var subPopupId=parseInt(popupOptions['sgpb-subs-success-popup']);var subPopupOptions=SGPBPopup.getPopupOptionsById(subPopupId);var popupObj=new SGPBPopup();popupObj.setPopupId(subPopupId);popupObj.setPopupData(subPopupOptions);setTimeout(function(){popupObj.prepareOpen();},500);};SGPBSubscription.prototype.setSubscriptionCookie=function(popupId)
25
- {var currentUrl=window.location.href;var cookieName=SGPBSubscription.cookieName+popupId;var expiryTime=this.expiryTime;if(SGPopup.getCookie(cookieName)==''){var cookieObject=[currentUrl];SGPBPopup.setCookie(cookieName,JSON.stringify(cookieObject),expiryTime);}};SGPBSubscription.prototype.redirectToURL=function(popupOptions)
26
  {var redirectURL=popupOptions['sgpb-subs-success-redirect-URL'];var redirectToNewTab=popupOptions['sgpb-subs-success-redirect-new-tab'];SGPBPopup.closePopupById(this.submissionPopupId);if(redirectToNewTab){return true;}
27
  window.location.href=redirectURL;};SGPBSubscription.prototype.resetFieldsValues=function()
28
  {if(!jQuery('.js-subs-text-inputs').length){return false;}
29
  jQuery('.js-subs-text-inputs').each(function(){jQuery(this).val('');});};SGPBSubscription.prototype.livePreview=function()
30
- {this.binding();this.changeLabels();this.changeButtonTitle();this.changeColor();this.changeOpacity();this.changePadding();this.changeDimension();this.preventDefaultSubmission();if(typeof SGPBBackend=='function'){SGPBBackend.makeContactAndSubscriptionFieldsRequired();}};SGPBSubscription.prototype.preventDefaultSubmission=function()
31
  {var formSubmitButton=jQuery('.sgpb-subscription-admin-wrapper input[type="submit"]');if(!formSubmitButton.length){return false;}
32
  formSubmitButton.bind('click',function(e){e.preventDefault();});};SGPBSubscription.prototype.changeDimension=function()
33
- {var that=this;jQuery('.js-subs-dimension').change(function(){var element=jQuery(this);var dimension=that.changeDimensionMode(element.val());var styleType=element.attr('data-style-type');var fieldtype=element.attr('data-field-type');var selector=element.attr('data-subs-rel');if(fieldtype=='input'){jQuery('.sgpb-gdpr-label-wrapper').css('width',dimension);jQuery('.sgpb-gdpr-info').css('width',dimension);}
34
  var styleObj={};styleObj[styleType]=dimension;jQuery('.'+selector).css(styleObj);});};SGPBSubscription.prototype.changePadding=function()
35
  {jQuery('.js-sgpb-form-padding').on('change keydown keyup',function(){var padding=jQuery(this).val();jQuery('.sgpb-subscription-admin-wrapper').css('padding',padding+'px');});};SGPBSubscription.prototype.changeColor=function()
36
- {var that=this;if(typeof jQuery.wp=='undefined'||typeof jQuery.wp.wpColorPicker!=='function'){return false;}
37
  jQuery('.js-subs-color-picker').each(function(){var currentColorPicker=jQuery(this);currentColorPicker.wpColorPicker({change:function(){that.colorPickerChange(jQuery(this));}});});jQuery('.wp-picker-holder').mouseover(function(){var selectedInput=jQuery(this).prev().find('.js-subs-color-picker');that.colorPickerChange(selectedInput);});jQuery('.wp-picker-holder').bind('click',function(){var selectedInput=jQuery(this).prev().find('.js-subs-color-picker');that.colorPickerChange(selectedInput);});};SGPBSubscription.prototype.changeOpacity=function()
38
  {var that=this;jQuery('.js-subs-bg-opacity').next().find('.range-handle').on('change mousemove',function(){that.colorPickerChange(jQuery('input[name=sgpb-subs-form-bg-color]'));});};SGPBSubscription.prototype.setupPlaceholderColor=function(element,color)
39
  {jQuery('.'+element).each(function(){jQuery('#sgpb-placeholder-style').remove();var styleContent='.'+element+'::-webkit-input-placeholder {color: '+color+' !important;}';styleContent+='.'+element+'::-moz-placeholder {color: '+color+' !important;}';styleContent+='.'+element+'::-ms-placeholder {color: '+color+' !important;}';var styleBlock='<style id="sgpb-placeholder-style">'+styleContent+'</style>';jQuery('head').append(styleBlock);});};SGPBSubscription.prototype.colorPickerChange=function(colorPicker)
40
- {var that=this;var opacity=jQuery('input[name=sgpb-subs-form-bg-opacity]').val();var colorValue=colorPicker.val();if(typeof colorValue=='undefined'){return false;}
41
- colorValue=SGPBBackend.hexToRgba(colorValue,opacity);var styleType=colorPicker.attr('data-style-type');var selector=colorPicker.attr('data-subs-rel');if('placeholder'==styleType){that.setupPlaceholderColor(selector,colorValue);return false;}
42
- var styleObj={};styleObj[styleType]=colorValue;jQuery('.'+selector).each(function(){jQuery(this).css(styleObj);})};SGPBSubscription.prototype.changeButtonTitle=function()
43
  {jQuery('.js-subs-btn-title').bind('input',function(){var className=jQuery(this).attr('data-subs-rel');var val=jQuery(this).val();jQuery('.'+className).val(val);});};SGPBSubscription.prototype.changeLabels=function()
44
- {jQuery('#sgpb-subs-gdpr-text').on('change',function(){var text=jQuery(this).val();jQuery(this).text('');jQuery(this).text(text);jQuery('.sgpb-gdpr-text-js').html(text);});jQuery('.js-subs-field-placeholder').each(function(){jQuery(this).bind('input',function(){var className=jQuery(this).attr('data-subs-rel');var placeholderText=jQuery(this).val();if(className=='js-subs-gdpr-label'){jQuery('.'+className).next().text(placeholderText);}
45
  else{jQuery('.'+className).attr('placeholder',placeholderText);}});});};SGPBSubscription.prototype.binding=function()
46
  {var that=this;jQuery('.js-checkbox-field-status').bind('click',function(){var isChecked=jQuery(this).is(':checked');var elementClassName=jQuery(this).attr('data-subs-field-wrapper');var element=jQuery('.'+elementClassName);that.toggleVisible(element,isChecked);});jQuery('.js-checkbox-acordion').each(function(){var isChecked=jQuery(this).is(':checked');var elementClassName=jQuery(this).attr('data-subs-rel');var element=jQuery('.'+elementClassName);that.toggleVisible(element,isChecked);});};SGPBSubscription.prototype.toggleVisible=function(toggleElement,elementStatus)
47
  {if(elementStatus){toggleElement.css({'display':'block'});}
48
  else{toggleElement.css({'display':'none'});}};SGPBSubscription.prototype.changeDimensionMode=function(dimension)
49
- {var size;size=parseInt(dimension)+'px';if(dimension.indexOf('%')!=-1||dimension.indexOf('px')!=-1){size=dimension;}
50
  return size;};SGPBSubscription.prototype.allowToOpen=function(popupId)
51
  {var allowStatus=true;var cookieName=SGPBSubscription.cookieName+popupId;if(SGPopup.getCookie(cookieName)!=''){allowStatus=false;}
52
  return allowStatus;};jQuery(document).ready(function(){new SGPBSubscription();});
1
  function SGPBSubscription()
2
  {this.expiryTime=365;this.submissionPopupId=0;this.newWindow=null;this.init();}
3
  SGPBSubscription.cookieName='SGPBSubscription';SGPBSubscription.prototype.init=function()
4
+ {if(typeof SGPBFormBuilder!=='undefined'){return false;}
5
  this.livePreview();this.formSubmission();};SGPBSubscription.prototype.formSubmission=function()
6
+ {var that=this;if(typeof sgAddEvent==='undefined'){return false;}
7
+ sgAddEvent(window,'sgpbDidOpen',function(e){var popupArgs=e.detail;var popupId=popupArgs.popupId;var popupOptions=SGPBPopup.getPopupOptionsById(popupId);var additionalPopupParams={};var subscriptionForm=jQuery('#sgpb-popup-dialog-main-div .sgpb-subs-form-'+popupId+' form');var submitButton=subscriptionForm.find('.js-subs-submit-btn');var sgpbSubsValidateObj={};try{sgpbSubsValidateObj=eval('sgpbSubsValidateObj'+popupId);}
8
  catch(err){}
9
+ if(typeof sgpbSubsValidateObj!=='object'){return false;}
10
  jQuery.validator.setDefaults({errorPlacement:function(error,element){var errorWrapperClassName=jQuery(element).attr('data-error-message-class');jQuery('.sgpb-subs-form-'+popupId+' .'+errorWrapperClassName).html(error);}});sgpbSubsValidateObj.submitHandler=function()
11
+ {var formData=subscriptionForm.serialize();var ajaxData={action:'sgpb_subscription_submission',nonce:SGPB_JS_PARAMS.nonce,beforeSend:function(){submitButton.val(submitButton.attr('data-progress-title'));if(popupOptions['sgpb-subs-success-behavior']==='redirectToURL'&&popupOptions['sgpb-subs-success-redirect-new-tab']){that.newWindow=window.open(popupOptions['sgpb-subs-success-redirect-URL']);}},formData:formData,popupPostId:popupId};jQuery.post(SGPB_JS_PARAMS.ajaxUrl,ajaxData,function(res){that.submissionPopupId=popupId;jQuery('.sgpb-subs-form-'+popupId+' .sgpb-alert').addClass('sg-hide-element');submitButton.val(submitButton.attr('data-title'));additionalPopupParams['res']=res;that.showMessages(additionalPopupParams);that.processAfterSuccessfulSubmission(ajaxData);});};subscriptionForm.validate(sgpbSubsValidateObj);});jQuery(window).on('sgpbDidClose',function(e){var popupArgs=e.detail;var popupId=popupArgs.popupId;jQuery('.sgpb-subs-form-'+popupId+' form label.error').hide();});};SGPBSubscription.prototype.processAfterSuccessfulSubmission=function(ajaxData)
12
  {if(jQuery.isEmptyObject(ajaxData)){return false;}
13
  ajaxData.action='sgpb_process_after_submission';jQuery.post(SGPB_JS_PARAMS.ajaxUrl,ajaxData,function(res){});};SGPBSubscription.prototype.showMessages=function(res)
14
+ {var that=this;if(res['res']===1){this.subscriptionSuccessBehavior();}
15
+ else{if(that.newWindow!==null){that.newWindow.close();}
16
  this.showErrorMessage();}
17
  window.dispatchEvent(new Event('resize'));return true;};SGPBSubscription.prototype.showErrorMessage=function()
18
  {var popupId=parseInt(this.submissionPopupId);jQuery('.sgpb-subs-form-'+popupId+' .sgpb-alert-danger').removeClass('sg-hide-element');};SGPBSubscription.prototype.subscriptionSuccessBehavior=function()
19
+ {var settings={popupId:this.submissionPopupId,eventName:'sgpbSubscriptionSuccess'};jQuery(window).trigger('sgpbFormSuccess',settings);var popupId=parseInt(this.submissionPopupId);var popupOptions=SGPBPopup.getPopupOptionsById(popupId);var behavior='showMessage';jQuery('.sgpb-subs-form-'+popupId+' form').remove();if(typeof popupOptions['sgpb-subs-hide-subs-users']!=='undefined'){this.setSubscriptionCookie(popupId);}
20
+ if(typeof popupOptions['sgpb-subs-success-behavior']!=='undefined'){behavior=popupOptions['sgpb-subs-success-behavior'];}
21
  this.resetFieldsValues();switch(behavior){case'showMessage':jQuery('.sgpb-subs-form-'+popupId+' .sgpb-alert-success').removeClass('sg-hide-element');break;case'redirectToURL':this.redirectToURL(popupOptions);break;case'openPopup':this.openSuccessPopup(popupOptions);break;case'hidePopup':SGPBPopup.closePopupById(this.submissionPopupId);break;}};SGPBSubscription.prototype.openSuccessPopup=function(popupOptions)
22
+ {var that=this;setTimeout(function(){SGPBPopup.closePopupById(that.submissionPopupId);},0);if(typeof popupOptions['sgpb-subs-success-popup']!=='undefined'){sgAddEvent(window,'sgpbDidClose',this.openPopup(popupOptions));}};SGPBSubscription.prototype.openPopup=function(popupOptions)
23
+ {if(typeof popupOptions['sgpb-subs-success-popup']==='undefined'){return false;}
24
  var subPopupId=parseInt(popupOptions['sgpb-subs-success-popup']);var subPopupOptions=SGPBPopup.getPopupOptionsById(subPopupId);var popupObj=new SGPBPopup();popupObj.setPopupId(subPopupId);popupObj.setPopupData(subPopupOptions);setTimeout(function(){popupObj.prepareOpen();},500);};SGPBSubscription.prototype.setSubscriptionCookie=function(popupId)
25
+ {var currentUrl=window.location.href;var cookieName=SGPBSubscription.cookieName+popupId;var expiryTime=this.expiryTime;if(SGPopup.getCookie(cookieName)===''){var cookieObject=[currentUrl];SGPBPopup.setCookie(cookieName,JSON.stringify(cookieObject),expiryTime);}};SGPBSubscription.prototype.redirectToURL=function(popupOptions)
26
  {var redirectURL=popupOptions['sgpb-subs-success-redirect-URL'];var redirectToNewTab=popupOptions['sgpb-subs-success-redirect-new-tab'];SGPBPopup.closePopupById(this.submissionPopupId);if(redirectToNewTab){return true;}
27
  window.location.href=redirectURL;};SGPBSubscription.prototype.resetFieldsValues=function()
28
  {if(!jQuery('.js-subs-text-inputs').length){return false;}
29
  jQuery('.js-subs-text-inputs').each(function(){jQuery(this).val('');});};SGPBSubscription.prototype.livePreview=function()
30
+ {this.binding();this.changeLabels();this.changeButtonTitle();this.changeColor();this.changeOpacity();this.changePadding();this.changeDimension();this.preventDefaultSubmission();if(typeof SGPBBackend==='function'){SGPBBackend.makeContactAndSubscriptionFieldsRequired();}};SGPBSubscription.prototype.preventDefaultSubmission=function()
31
  {var formSubmitButton=jQuery('.sgpb-subscription-admin-wrapper input[type="submit"]');if(!formSubmitButton.length){return false;}
32
  formSubmitButton.bind('click',function(e){e.preventDefault();});};SGPBSubscription.prototype.changeDimension=function()
33
+ {var that=this;jQuery('.js-subs-dimension').change(function(){var element=jQuery(this);var dimension=that.changeDimensionMode(element.val());var styleType=element.attr('data-style-type');var fieldtype=element.attr('data-field-type');var selector=element.attr('data-subs-rel');if(fieldtype==='input'){jQuery('.sgpb-gdpr-label-wrapper').css('width',dimension);jQuery('.sgpb-gdpr-info').css('width',dimension);}
34
  var styleObj={};styleObj[styleType]=dimension;jQuery('.'+selector).css(styleObj);});};SGPBSubscription.prototype.changePadding=function()
35
  {jQuery('.js-sgpb-form-padding').on('change keydown keyup',function(){var padding=jQuery(this).val();jQuery('.sgpb-subscription-admin-wrapper').css('padding',padding+'px');});};SGPBSubscription.prototype.changeColor=function()
36
+ {var that=this;if(typeof jQuery.wp==='undefined'||typeof jQuery.wp.wpColorPicker!=='function'){return false;}
37
  jQuery('.js-subs-color-picker').each(function(){var currentColorPicker=jQuery(this);currentColorPicker.wpColorPicker({change:function(){that.colorPickerChange(jQuery(this));}});});jQuery('.wp-picker-holder').mouseover(function(){var selectedInput=jQuery(this).prev().find('.js-subs-color-picker');that.colorPickerChange(selectedInput);});jQuery('.wp-picker-holder').bind('click',function(){var selectedInput=jQuery(this).prev().find('.js-subs-color-picker');that.colorPickerChange(selectedInput);});};SGPBSubscription.prototype.changeOpacity=function()
38
  {var that=this;jQuery('.js-subs-bg-opacity').next().find('.range-handle').on('change mousemove',function(){that.colorPickerChange(jQuery('input[name=sgpb-subs-form-bg-color]'));});};SGPBSubscription.prototype.setupPlaceholderColor=function(element,color)
39
  {jQuery('.'+element).each(function(){jQuery('#sgpb-placeholder-style').remove();var styleContent='.'+element+'::-webkit-input-placeholder {color: '+color+' !important;}';styleContent+='.'+element+'::-moz-placeholder {color: '+color+' !important;}';styleContent+='.'+element+'::-ms-placeholder {color: '+color+' !important;}';var styleBlock='<style id="sgpb-placeholder-style">'+styleContent+'</style>';jQuery('head').append(styleBlock);});};SGPBSubscription.prototype.colorPickerChange=function(colorPicker)
40
+ {var that=this;var opacity=jQuery('input[name=sgpb-subs-form-bg-opacity]').val();var colorValue=colorPicker.val();if(typeof colorValue==='undefined'){return false;}
41
+ colorValue=SGPBBackend.hexToRgba(colorValue,opacity);var styleType=colorPicker.attr('data-style-type');var selector=colorPicker.attr('data-subs-rel');if('placeholder'===styleType){that.setupPlaceholderColor(selector,colorValue);return false;}
42
+ var styleObj={};styleObj[styleType]=colorValue;jQuery('.'+selector).each(function(){jQuery(this).css(styleObj);});};SGPBSubscription.prototype.changeButtonTitle=function()
43
  {jQuery('.js-subs-btn-title').bind('input',function(){var className=jQuery(this).attr('data-subs-rel');var val=jQuery(this).val();jQuery('.'+className).val(val);});};SGPBSubscription.prototype.changeLabels=function()
44
+ {jQuery('#sgpb-subs-gdpr-text').on('change',function(){var text=jQuery(this).val();jQuery(this).text('');jQuery(this).text(text);jQuery('.sgpb-gdpr-text-js').html(text);});jQuery('.js-subs-field-placeholder').each(function(){jQuery(this).bind('input',function(){var className=jQuery(this).attr('data-subs-rel');var placeholderText=jQuery(this).val();if(className==='js-subs-gdpr-label'){jQuery('.'+className).next().text(placeholderText);}
45
  else{jQuery('.'+className).attr('placeholder',placeholderText);}});});};SGPBSubscription.prototype.binding=function()
46
  {var that=this;jQuery('.js-checkbox-field-status').bind('click',function(){var isChecked=jQuery(this).is(':checked');var elementClassName=jQuery(this).attr('data-subs-field-wrapper');var element=jQuery('.'+elementClassName);that.toggleVisible(element,isChecked);});jQuery('.js-checkbox-acordion').each(function(){var isChecked=jQuery(this).is(':checked');var elementClassName=jQuery(this).attr('data-subs-rel');var element=jQuery('.'+elementClassName);that.toggleVisible(element,isChecked);});};SGPBSubscription.prototype.toggleVisible=function(toggleElement,elementStatus)
47
  {if(elementStatus){toggleElement.css({'display':'block'});}
48
  else{toggleElement.css({'display':'none'});}};SGPBSubscription.prototype.changeDimensionMode=function(dimension)
49
+ {var size;size=parseInt(dimension)+'px';if(dimension.indexOf('%')!==-1||dimension.indexOf('px')!==-1){size=dimension;}
50
  return size;};SGPBSubscription.prototype.allowToOpen=function(popupId)
51
  {var allowStatus=true;var cookieName=SGPBSubscription.cookieName+popupId;if(SGPopup.getCookie(cookieName)!=''){allowStatus=false;}
52
  return allowStatus;};jQuery(document).ready(function(){new SGPBSubscription();});
public/views/floatingButton.php ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ use sgpb\AdminHelper;
3
+ $defaultData = ConfigDataHelper::defaultData();
4
+ ?>
5
+ <div class="sgpb-wrapper sgpb-floating-btn-wrapper" id="sgpb-floating-btn-wrapper">
6
+ <div class="row form-group">
7
+ <label for="sgpb-enable-floating-button" class="col-md-5 control-label sgpb-static-padding-top">
8
+ <?php _e('Enable', SG_POPUP_TEXT_DOMAIN)?>:
9
+ </label>
10
+ <div class="col-md-7">
11
+ <input id="sgpb-enable-floating-button" onchange="SGPBFloatingButton.prototype.adminInit()" type="checkbox" class="js-checkbox-accordion" id="sgpb-enable-floating-button" name="sgpb-enable-floating-button" <?php echo $popupTypeObj->getOptionValue('sgpb-enable-floating-button'); ?>>
12
+ </div>
13
+ </div>
14
+ <div class="sg-full-width">
15
+ <div class="row form-group">
16
+ <label for="sgpb-floating-button-style" class="col-md-5 control-label sgpb-static-padding-top">
17
+ <?php _e('Style', SG_POPUP_TEXT_DOMAIN)?>:
18
+ </label>
19
+ <div class="col-md-7">
20
+ <?php echo AdminHelper::createSelectBox($defaultData['floatingButtonStyle'], $popupTypeObj->getOptionValue('sgpb-floating-button-style'), array('name' => 'sgpb-floating-button-style', 'class'=>'js-sg-select2', 'id' => 'sgpb-floating-button-style')); ?>
21
+ </div>
22
+ </div>
23
+ <div class="row form-group">
24
+ <label for="sgpb-floating-button-position" class="col-md-5 control-label sgpb-static-padding-top">
25
+ <?php _e('Position', SG_POPUP_TEXT_DOMAIN)?>:
26
+ </label>
27
+ <div class="col-md-7">
28
+ <?php echo AdminHelper::createSelectBox($defaultData['floatingButtonPositions'], $popupTypeObj->getOptionValue('sgpb-floating-button-position'), array('name' => 'sgpb-floating-button-position', 'class'=>'js-sg-select2', 'id' => 'sgpb-floating-button-position')); ?>
29
+ </div>
30
+ </div>
31
+ <div class="row form-group">
32
+ <label class="col-md-5 sgpb-static-padding-top" for="sgpb-floating-button-font-size">
33
+ <?php _e('Font size', SG_POPUP_TEXT_DOMAIN) ?>:
34
+ </label>
35
+ <div class="col-md-5">
36
+ <input type="number" min="0" name="sgpb-floating-button-font-size" id="sgpb-floating-button-font-size" class="form-control sgpb-full-width-events" value="<?php echo $popupTypeObj->getOptionValue('sgpb-floating-button-font-size'); ?>">
37
+ </div>
38
+ <div class="col-md-1">
39
+ <span class="sgpb-restriction-unit">px</span>
40
+ </div>
41
+ </div>
42
+ <div class="sgpb-basic-button-style-options-wrapper-js sgpb-hide">
43
+ <div class="row form-group">
44
+ <label class="col-md-5 sgpb-static-padding-top" for="sgpb-floating-button-position-top">
45
+ <?php _e('Position top', SG_POPUP_TEXT_DOMAIN) ?>:
46
+ </label>
47
+ <div class="col-md-5">
48
+ <input type="number" min="0" name="sgpb-floating-button-position-top" id="sgpb-floating-button-position-top" class="form-control sgpb-full-width-events" value="<?php echo $popupTypeObj->getOptionValue('sgpb-floating-button-position-top'); ?>">
49
+ </div>
50
+ <div class="col-md-1">
51
+ <span class="sgpb-restriction-unit">%</span>
52
+ </div>
53
+ </div>
54
+ <div class="row form-group">
55
+ <label class="col-md-5 sgpb-static-padding-top" for="sgpb-floating-button-position-right">
56
+ <?php _e('Position right', SG_POPUP_TEXT_DOMAIN) ?>:
57
+ </label>
58
+ <div class="col-md-5">
59
+ <input type="number" min="0" name="sgpb-floating-button-position-right" id="sgpb-floating-button-position-right" class="form-control sgpb-full-width-events" value="<?php echo $popupTypeObj->getOptionValue('sgpb-floating-button-position-right'); ?>">
60
+ </div>
61
+ <div class="col-md-1">
62
+ <span class="sgpb-restriction-unit">%</span>
63
+ </div>
64
+ </div>
65
+ <div class="row form-group">
66
+ <label class="col-md-5 sgpb-static-padding-top" for="sgpb-floating-button-border-size">
67
+ <?php _e('Border size', SG_POPUP_TEXT_DOMAIN) ?>:
68
+ </label>
69
+ <div class="col-md-5">
70
+ <input type="number" min="0" name="sgpb-floating-button-border-size" id="sgpb-floating-button-border-size" class="form-control sgpb-full-width-events" value="<?php echo $popupTypeObj->getOptionValue('sgpb-floating-button-border-size'); ?>">
71
+ </div>
72
+ <div class="col-md-1">
73
+ <span class="sgpb-restriction-unit">px</span>
74
+ </div>
75
+ </div>
76
+ <div class="row form-group">
77
+ <label class="col-md-5 sgpb-static-padding-top" for="sgpb-floating-button-border-radius">
78
+ <?php _e('Border radius', SG_POPUP_TEXT_DOMAIN) ?>:
79
+ </label>
80
+ <div class="col-md-5">
81
+ <input type="number" min="0" name="sgpb-floating-button-border-radius" id="sgpb-floating-button-border-radius" class="form-control sgpb-full-width-events" value="<?php echo $popupTypeObj->getOptionValue('sgpb-floating-button-border-radius'); ?>">
82
+ </div>
83
+ <div class="col-md-1">
84
+ <span class="sgpb-restriction-unit">px</span>
85
+ </div>
86
+ </div>
87
+ <div class="row form-group">
88
+ <label for="sgpb-floating-button-border-color" class="col-md-12 control-label sgpb-static-padding-top">
89
+ <?php _e('Border color', SG_POPUP_TEXT_DOMAIN)?>:
90
+ </label>
91
+ <div class="col-md-12">
92
+ <div class="sgpb-color-picker-wrapper sgpb-floating-button-border-color">
93
+ <input id="sgpb-floating-button-border-color" data-type="borderColor" class="sgpb-color-picker sgpb-floating-button-border-color" type="text" name="sgpb-floating-button-border-color" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-floating-button-border-color')); ?>" >
94
+ </div>
95
+ </div>
96
+ </div>
97
+ </div>
98
+ <div class="row form-group">
99
+ <label for="sgpb-floating-button-bg-color" class="col-md-12 control-label sgpb-static-padding-top">
100
+ <?php _e('Background color', SG_POPUP_TEXT_DOMAIN)?>:
101
+ </label>
102
+ <div class="col-md-12">
103
+ <div class="sgpb-color-picker-wrapper sgpb-floating-button-bg-color">
104
+ <input id="sgpb-floating-button-bg-color" data-type="backgroundColor" class="sgpb-color-picker sgpb-floating-button-bg-color" type="text" name="sgpb-floating-button-bg-color" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-floating-button-bg-color')); ?>" >
105
+ </div>
106
+ </div>
107
+ </div>
108
+ <div class="row form-group">
109
+ <label for="sgpb-floating-button-text-color" class="col-md-12 control-label sgpb-static-padding-top">
110
+ <?php _e('Text color', SG_POPUP_TEXT_DOMAIN)?>:
111
+ </label>
112
+ <div class="col-md-12">
113
+ <div class="sgpb-color-picker-wrapper sgpb-floating-button-text-color">
114
+ <input id="sgpb-floating-button-text-color" data-type="color" class="sgpb-color-picker sgpb-floating-button-text-color" type="text" name="sgpb-floating-button-text-color" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-floating-button-text-color')); ?>" >
115
+ </div>
116
+ </div>
117
+ </div>
118
+ <div class="row form-group">
119
+ <label for="sgpb-floating-button-text" class="col-md-12 control-label sgpb-static-padding-top">
120
+ <?php _e('Text', SG_POPUP_TEXT_DOMAIN)?>:
121
+ </label>
122
+ <div class="col-md-12">
123
+ <div class="sgpb-floating-button-text">
124
+ <input id="sgpb-floating-button-text" class="sgpb-floating-button-text" type="text" name="sgpb-floating-button-text" value="<?php echo esc_html($popupTypeObj->getOptionValue('sgpb-floating-button-text')); ?>" >
125
+ </div>
126
+ </div>
127
+ </div>
128
+ </div>
129
+ </div>
public/views/newsletter.php CHANGED
@@ -3,6 +3,7 @@
3
  use sgpb\SubscriptionPopup;
4
  use sgpb\AdminHelper;
5
  $adminEmail = get_option('admin_email');
 
6
  $subscriptionIdTitle = SubscriptionPopup::getAllSubscriptionForms();
7
 
8
  $subscriptionSelectBox = AdminHelper::createSelectBox(
@@ -74,7 +75,7 @@
74
  <?php _e('Email\'s subject', SG_POPUP_TEXT_DOMAIN); ?>
75
  </label>
76
  <div class="col-md-6">
77
- <input type="email" id="sgpb-newsletter-subject" class="sgpb-newsletter-subject form-control input-sm" value="<?php _e('Your subject here', SG_POPUP_TEXT_DOMAIN); ?>">
78
  </div>
79
  </div>
80
  <div class="row form-group">
@@ -86,11 +87,14 @@
86
  <div class="col-md-12">
87
  <?php
88
  $editorId = 'sgpb-newsletter-text';
89
- $content = '<p>Hi [First name] [Last name],</p>
90
- <p>Super excited to have you on board, we know you’ll just love us.</p>
91
- <p>Sincerely,</p>
92
- <p>[Blog name]</p>
93
- <p>[Unsubscribe title="Unsubscribe"]</p>';
 
 
 
94
  $settings = array(
95
  'wpautop' => false,
96
  'tinymce' => array(
@@ -108,7 +112,7 @@
108
  <input class="sgpb-newlsetter-test-emails form-control input-sm" type="text" name="sgpb-newlsetter-test-emails">
109
  </div>
110
  <div class="col-md-6">
111
- <input type="submit" class="btn btn-sm btn-light js-send-newsletter" data-send-type="test" value="<?php _e('Test send', SG_POPUP_TEXT_DOMAIN)?>">
112
  <img src="<?php echo SG_POPUP_IMG_URL.'ajaxSpinner.gif'; ?>" width="20px" class="sgpb-hide sgpb-js-newsletter-spinner">
113
  </div>
114
  <div class="col-md-3">
3
  use sgpb\SubscriptionPopup;
4
  use sgpb\AdminHelper;
5
  $adminEmail = get_option('admin_email');
6
+ $newsletterSavedOptions = get_option('SGPB_NEWSLETTER_DATA');
7
  $subscriptionIdTitle = SubscriptionPopup::getAllSubscriptionForms();
8
 
9
  $subscriptionSelectBox = AdminHelper::createSelectBox(
75
  <?php _e('Email\'s subject', SG_POPUP_TEXT_DOMAIN); ?>
76
  </label>
77
  <div class="col-md-6">
78
+ <input type="email" id="sgpb-newsletter-subject" class="sgpb-newsletter-subject form-control input-sm" value="<?php echo (empty($newsletterSavedOptions['newsletterSubject'])) ? _e('Your subject here', SG_POPUP_TEXT_DOMAIN) : $newsletterSavedOptions['newsletterSubject']; ?>">
79
  </div>
80
  </div>
81
  <div class="row form-group">
87
  <div class="col-md-12">
88
  <?php
89
  $editorId = 'sgpb-newsletter-text';
90
+ $content = $newsletterSavedOptions['messageBody'];
91
+ if (empty($content)) {
92
+ $content = '<p>Hi [First name] [Last name],</p>
93
+ <p>Super excited to have you on board, we know you’ll just love us.</p>
94
+ <p>Sincerely,</p>
95
+ <p>[Blog name]</p>
96
+ <p>[Unsubscribe title="Unsubscribe"]</p>';
97
+ }
98
  $settings = array(
99
  'wpautop' => false,
100
  'tinymce' => array(
112
  <input class="sgpb-newlsetter-test-emails form-control input-sm" type="text" name="sgpb-newlsetter-test-emails">
113
  </div>
114
  <div class="col-md-6">
115
+ <input type="submit" class="btn btn-sm btn-light js-send-newsletter" data-send-type="test" value="<?php _e('Send a Test', SG_POPUP_TEXT_DOMAIN)?>">
116
  <img src="<?php echo SG_POPUP_IMG_URL.'ajaxSpinner.gif'; ?>" width="20px" class="sgpb-hide sgpb-js-newsletter-spinner">
117
  </div>
118
  <div class="col-md-3">
readme.txt CHANGED
@@ -9,7 +9,7 @@ Tags: popup, pop up, wordpress popup, popup maker, exit popup, popup builder, wo
9
  Requires at least: 4.2
10
  Tested up to: 5.5
11
  Requires PHP: 5.3.3
12
- Stable tag: 3.68.4
13
  License: GPLv2 or later
14
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
15
 
@@ -30,8 +30,9 @@ https://www.youtube.com/watch?v=-wFDJDjczeY
30
  * Set popup animation effect
31
  * Choose between several popup themes
32
  * Set popup location on the screen
33
- * Show popup after X amount of page scrolling/Scroll popups - - sometimes you don't want to show the popup right away, it's a good idea to set this option so the popup will be shown to the visitor only when he scrolls.
34
  * OnClick/OnHover popup
 
35
  * Redirect confirmation popup/Leaving notice popup
36
  * Repetitive pop up - show popup every X period of time
37
 
@@ -185,6 +186,16 @@ Go to the Popup Builder settings and set your desired options.
185
 
186
  == Changelog ==
187
 
 
 
 
 
 
 
 
 
 
 
188
  = Version 3.68.4 =
189
  * Improvement of core JS files.
190
  * Improvement of compatibility with WooCommerce related to Gutenberg blocks.
@@ -1200,7 +1211,7 @@ Leave us a good review :)
1200
 
1201
  == Upgrade Notice ==
1202
 
1203
- Current Version of Popup Builder is 3.68.4
1204
 
1205
  == Other Notes ==
1206
 
9
  Requires at least: 4.2
10
  Tested up to: 5.5
11
  Requires PHP: 5.3.3
12
+ Stable tag: 3.68.5
13
  License: GPLv2 or later
14
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
15
 
30
  * Set popup animation effect
31
  * Choose between several popup themes
32
  * Set popup location on the screen
33
+ * Show popup after X amount of page scrolling/Scroll popups - sometimes you don't want to show the popup right away, it's a good idea to set this option so the popup will be shown to the visitor only when he scrolls.
34
  * OnClick/OnHover popup
35
+ * Floating Button - trigger a popup by clicking on floating button. It comes with many customization options: the style, the position, text formatting, border design, etc. The Floating Button can be designed with the color palette and style which would suit your website design nicely.
36
  * Redirect confirmation popup/Leaving notice popup
37
  * Repetitive pop up - show popup every X period of time
38
 
186
 
187
  == Changelog ==
188
 
189
+ = Version 3.68.5 =
190
+ * Added new feature: Floating Button - Trigger popup by clicking on the button
191
+ * Improvement of Newsletter: Added an option to send test emails before running the email campaign
192
+ * Improvement of Newsletter related to keeping already inserted/sent email content after refresh
193
+ * Improvement of code in Feedback.php file
194
+ * PHP version compatibility improvements
195
+ * Improvement and code optimization of core files
196
+ * Bug fixed related to the jQuery depreciation functionality
197
+ * Bug fixed related to cookie saving
198
+
199
  = Version 3.68.4 =
200
  * Improvement of core JS files.
201
  * Improvement of compatibility with WooCommerce related to Gutenberg blocks.
1211
 
1212
  == Upgrade Notice ==
1213
 
1214
+ Current Version of Popup Builder is 3.68.5
1215
 
1216
  == Other Notes ==
1217