Version Description
Current Version of Popup Builder is 2.5.2
Download this release
Release Info
Developer | Sygnoos |
Plugin | Popup Builder – Responsive WordPress Pop up |
Version | 2.5.2 |
Comparing to | |
See all releases |
Code changes from version 2.5.1 to 2.5.2
- classes/PopupInstaller.php +1 -1
- classes/SGFblikePopup.php +4 -11
- classes/SGHtmlPopup.php +2 -7
- classes/SGPopup.php +10 -4
- classes/SGShortcodePopup.php +4 -5
- config.php +98 -81
- files/main_section/image.php +1 -1
- files/sg_functions.php +17 -0
- files/sg_popup_actions.php +13 -0
- files/sg_popup_create_new.php +2 -1
- files/sg_popup_save.php +16 -25
- helpers/Helper_functions.php +0 -15
- helpers/SgPopupGetData.php +4 -4
- javascript/sg_popup_frontend.js +75 -55
- javascript/sg_popup_init.js +1 -39
- javascript/sg_popup_javascript.php +0 -6
- popup-builder.php +1 -1
- readme.txt +11 -2
- style/sgcolorbox/sgthemes.css +1 -1
classes/PopupInstaller.php
CHANGED
@@ -20,7 +20,7 @@ class PopupInstaller {
|
|
20 |
PRIMARY KEY (id)
|
21 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ";
|
22 |
$optionsDefault = SgPopupGetData::getDefaultValues();
|
23 |
-
$sgPopupInsertSettingsSql = $wpdb->prepare("INSERT IGNORE ". $wpdb->prefix.$blogId."sg_popup_settings (id, options) VALUES(%d,%s) ", 1, json_encode($optionsDefault['
|
24 |
|
25 |
$sgPopupImageBase = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$blogId."sg_image_popup (
|
26 |
`id` int(11) NOT NULL,
|
20 |
PRIMARY KEY (id)
|
21 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ";
|
22 |
$optionsDefault = SgPopupGetData::getDefaultValues();
|
23 |
+
$sgPopupInsertSettingsSql = $wpdb->prepare("INSERT IGNORE ". $wpdb->prefix.$blogId."sg_popup_settings (id, options) VALUES(%d,%s) ", 1, json_encode($optionsDefault['settingsParams']));
|
24 |
|
25 |
$sgPopupImageBase = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$blogId."sg_image_popup (
|
26 |
`id` int(11) NOT NULL,
|
classes/SGFblikePopup.php
CHANGED
@@ -77,7 +77,7 @@ class SGFblikePopup extends SGPopup
|
|
77 |
$options = json_decode($this->getFblikeOptions(), true);
|
78 |
$url = $options['fblike-like-url'];
|
79 |
$layout = $options['fblike-layout'];
|
80 |
-
|
81 |
$content = $this->getContent();
|
82 |
|
83 |
$content .= "<div id=\"sg-facebook-like\"><script type=\"text/javascript\">
|
@@ -104,17 +104,10 @@ class SGFblikePopup extends SGPopup
|
|
104 |
if($hasShortcode) {
|
105 |
|
106 |
$content = $this->improveContent($content);
|
107 |
-
/*Add this part of code right into the page to escape conflicts with shortcodes init functionlity*/
|
108 |
-
$currentPopupContent = "<div id=\"sg-popup-content-".$this->getId()."\" style=\"display: none;\"> <div id=\"sgpb-all-content-".$this->getId()."\">".$content."</div></div>";
|
109 |
-
|
110 |
-
$this->sgAddPopupContentToFooter($currentPopupContent);
|
111 |
-
|
112 |
-
$content = ' ';
|
113 |
}
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
return array('html'=>$content);
|
119 |
}
|
120 |
|
77 |
$options = json_decode($this->getFblikeOptions(), true);
|
78 |
$url = $options['fblike-like-url'];
|
79 |
$layout = $options['fblike-layout'];
|
80 |
+
$popupId = (int)$this->getId();
|
81 |
$content = $this->getContent();
|
82 |
|
83 |
$content .= "<div id=\"sg-facebook-like\"><script type=\"text/javascript\">
|
104 |
if($hasShortcode) {
|
105 |
|
106 |
$content = $this->improveContent($content);
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
}
|
108 |
+
$this->sgAddPopupContentToFooter($content, $popupId);
|
109 |
+
|
110 |
+
$content = trim($content);
|
|
|
111 |
return array('html'=>$content);
|
112 |
}
|
113 |
|
classes/SGHtmlPopup.php
CHANGED
@@ -50,17 +50,12 @@ class SGHtmlPopup extends SGPopup {
|
|
50 |
protected function getExtraRenderOptions() {
|
51 |
$content = trim($this->getContent());
|
52 |
$hasShortcode = $this->hasPopupContentShortcode($content);
|
|
|
53 |
|
54 |
if($hasShortcode) {
|
55 |
-
|
56 |
$content = $this->improveContent($content);
|
57 |
-
/*Add this part of code right into the page to escape conflicts with shortcodes init functionlity*/
|
58 |
-
$currentPopupContent = "<div id=\"sg-popup-content-".$this->getId()."\" style=\"display: none;\"> <div id=\"sgpb-all-content-".$this->getId()."\">".$content."</div></div>";
|
59 |
-
|
60 |
-
$this->sgAddPopupContentToFooter($currentPopupContent);
|
61 |
-
|
62 |
-
$content = ' ';
|
63 |
}
|
|
|
64 |
|
65 |
return array('html' => $content);
|
66 |
}
|
50 |
protected function getExtraRenderOptions() {
|
51 |
$content = trim($this->getContent());
|
52 |
$hasShortcode = $this->hasPopupContentShortcode($content);
|
53 |
+
$popupId = (int)$this->getId();
|
54 |
|
55 |
if($hasShortcode) {
|
|
|
56 |
$content = $this->improveContent($content);
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
}
|
58 |
+
$this->sgAddPopupContentToFooter($content, $popupId);
|
59 |
|
60 |
return array('html' => $content);
|
61 |
}
|
classes/SGPopup.php
CHANGED
@@ -429,18 +429,24 @@ abstract class SGPopup {
|
|
429 |
/**
|
430 |
* Add popup data to footer
|
431 |
*
|
432 |
-
* @since 2.5.
|
433 |
*
|
434 |
* @param string $content popup html content
|
|
|
435 |
*
|
436 |
* @return void
|
437 |
*
|
438 |
*/
|
439 |
|
440 |
-
public function sgAddPopupContentToFooter($content) {
|
441 |
|
442 |
-
add_action('wp_footer', function() use ($content){
|
443 |
-
|
|
|
|
|
|
|
|
|
|
|
444 |
}, 1);
|
445 |
}
|
446 |
|
429 |
/**
|
430 |
* Add popup data to footer
|
431 |
*
|
432 |
+
* @since 2.5.2
|
433 |
*
|
434 |
* @param string $content popup html content
|
435 |
+
* @param int $popupId popup Id
|
436 |
*
|
437 |
* @return void
|
438 |
*
|
439 |
*/
|
440 |
|
441 |
+
public function sgAddPopupContentToFooter($content, $popupId) {
|
442 |
|
443 |
+
add_action('wp_footer', function() use ($content, $popupId){
|
444 |
+
$content = apply_filters('sg_popup_content', $content, $popupId);
|
445 |
+
if(empty($content)) {
|
446 |
+
$content = '';
|
447 |
+
}
|
448 |
+
$popupContent = "<div style=\"display:none\"><div id=\"sg-popup-content-wrapper-$popupId\">$content</div></div>";
|
449 |
+
echo $popupContent;
|
450 |
}, 1);
|
451 |
}
|
452 |
|
classes/SGShortcodePopup.php
CHANGED
@@ -45,13 +45,12 @@ class SGShortcodePopup extends SGPopup {
|
|
45 |
}
|
46 |
|
47 |
protected function getExtraRenderOptions() {
|
48 |
-
$
|
49 |
-
|
50 |
-
$currentPopupContent = "<div id=\"sg-popup-content-".$this->getId()."\" style=\"display: none;\"> <div id=\"sgpb-all-content-".$this->getId()."\">".$content."</div></div>";
|
51 |
|
52 |
-
$this->sgAddPopupContentToFooter($
|
53 |
|
54 |
-
return array('
|
55 |
}
|
56 |
|
57 |
public function render() {
|
45 |
}
|
46 |
|
47 |
protected function getExtraRenderOptions() {
|
48 |
+
$popupId = (int)$this->getId();
|
49 |
+
$content = do_shortcode($this->getShortcode());
|
|
|
50 |
|
51 |
+
$this->sgAddPopupContentToFooter($content, $popupId);
|
52 |
|
53 |
+
return array('html'=> $content);
|
54 |
}
|
55 |
|
56 |
public function render() {
|
config.php
CHANGED
@@ -1,90 +1,107 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
|
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
private function init() {
|
9 |
-
|
10 |
-
if (!defined( 'ABSPATH' )) {
|
11 |
-
exit();
|
12 |
}
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
'
|
51 |
-
'
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
78 |
|
79 |
-
$popupBuilderVersion = SG_POPUP_VERSION;
|
80 |
-
if (POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
|
81 |
-
$popupBuilderVersion = SG_POPUP_PRO_VERSION;
|
82 |
}
|
83 |
|
84 |
-
|
85 |
-
|
86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
}
|
88 |
-
}
|
89 |
|
90 |
-
$popupConf = new SgPopupBuilderConfig();
|
|
1 |
<?php
|
2 |
+
if(!class_exists('SgPopupBuilderConfig')) {
|
3 |
+
class SgPopupBuilderConfig
|
4 |
+
{
|
5 |
|
6 |
+
public function __construct()
|
7 |
+
{
|
8 |
+
$this->init();
|
|
|
|
|
|
|
|
|
|
|
9 |
}
|
10 |
|
11 |
+
private function init()
|
12 |
+
{
|
13 |
+
|
14 |
+
if (!defined('ABSPATH')) {
|
15 |
+
exit();
|
16 |
+
}
|
17 |
+
|
18 |
+
define("SG_APP_POPUP_PATH", dirname(__FILE__));
|
19 |
+
define('SG_APP_POPUP_URL', plugins_url('', __FILE__));
|
20 |
+
define('SG_APP_POPUP_ADMIN_URL', admin_url());
|
21 |
+
define('SG_APP_POPUP_FILE', plugin_basename(__FILE__));
|
22 |
+
define('SG_APP_POPUP_FILES', SG_APP_POPUP_PATH . '/files');
|
23 |
+
define('SG_APP_POPUP_CLASSES', SG_APP_POPUP_PATH . '/classes');
|
24 |
+
define('SG_APP_POPUP_JS', SG_APP_POPUP_PATH . '/javascript');
|
25 |
+
define('SG_APP_POPUP_HELPERS', SG_APP_POPUP_PATH . '/helpers/');
|
26 |
+
define('SG_APP_POPUP_TABLE_LIMIT', 15);
|
27 |
+
define('SG_POPUP_VERSION', 2.52);
|
28 |
+
define('SG_POPUP_PRO_VERSION', 3.22);
|
29 |
+
define('SG_POPUP_PRO_URL', 'http://popup-builder.com/');
|
30 |
+
define('SG_POPUP_EXTENSION_URL', 'http://popup-builder.com/extensions');
|
31 |
+
define('SG_MAILCHIMP_EXTENSION_URL', 'http://popup-builder.com/downloads/mailchimp/');
|
32 |
+
define('SG_ANALYTICS_EXTENSION_URL', 'http://popup-builder.com/downloads/analytics/');
|
33 |
+
define('SG_AWEBER_EXTENSION_URL', 'http://popup-builder.com/downloads/aweber/');
|
34 |
+
define('SG_EXITINTENT_EXTENSION_URL', 'http://popup-builder.com/downloads/exit-intent/');
|
35 |
+
define('SG_ADBLOCK_EXTENSION_URL', 'http://popup-builder.com/downloads/adblock/');
|
36 |
+
define('SG_IP_TO_COUNTRY_SERVICE_TIMEOUT', 2);
|
37 |
+
define("SG_SHOW_POPUP_REVIEW", get_option("SG_COLOSE_REVIEW_BLOCK"));
|
38 |
+
define("SG_POSTS_PER_PAGE", 1000);
|
39 |
+
define("SG_POPUP_MINIMUM_PHP_VERSION", '5.3.3');
|
40 |
+
/*Example 1 minute*/
|
41 |
+
define("SG_FILTER_REPEAT_INTERVAL", 1);
|
42 |
+
define("SG_POST_TYPE_PAGE", "allPages");
|
43 |
+
define("SG_POST_TYPE_POST", "allPosts");
|
44 |
+
|
45 |
+
define('POPUP_BUILDER_PKG_FREE', 1);
|
46 |
+
define('POPUP_BUILDER_PKG_SILVER', 2);
|
47 |
+
define('POPUP_BUILDER_PKG_GOLD', 3);
|
48 |
+
define('POPUP_BUILDER_PKG_PLATINUM', 4);
|
49 |
+
|
50 |
+
global $POPUP_TITLES;
|
51 |
+
global $POPUP_ADDONS;
|
52 |
+
|
53 |
+
$POPUP_TITLES = array(
|
54 |
+
'image' => 'Image',
|
55 |
+
'html' => 'HTML',
|
56 |
+
'fblike' => 'Facebook',
|
57 |
+
'iframe' => 'Iframe',
|
58 |
+
'video' => 'Video',
|
59 |
+
'shortcode' => 'Shortcode',
|
60 |
+
'ageRestriction' => 'Age Restriction',
|
61 |
+
'countdown' => 'Countdown',
|
62 |
+
'social' => 'Social',
|
63 |
+
'exitIntent' => 'Exit Intent',
|
64 |
+
'subscription' => 'Subscription',
|
65 |
+
'contactForm' => 'Contact Form'
|
66 |
+
);
|
67 |
+
|
68 |
+
$POPUP_ADDONS = array(
|
69 |
+
'aweber',
|
70 |
+
'mailchimp',
|
71 |
+
'analytics',
|
72 |
+
'exitIntent',
|
73 |
+
'adBlock'
|
74 |
+
);
|
75 |
+
|
76 |
+
|
77 |
+
require_once(dirname(__FILE__) . '/config-pkg.php');
|
78 |
|
|
|
|
|
|
|
79 |
}
|
80 |
|
81 |
+
public static function popupJsDataInit()
|
82 |
+
{
|
83 |
+
|
84 |
+
$popupBuilderVersion = SG_POPUP_VERSION;
|
85 |
+
if (POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
|
86 |
+
$popupBuilderVersion = SG_POPUP_PRO_VERSION;
|
87 |
+
}
|
88 |
+
|
89 |
+
$dataString = "<script type='text/javascript'>
|
90 |
+
SG_POPUPS_QUEUE = [];
|
91 |
+
SG_POPUP_DATA = [];
|
92 |
+
SG_APP_POPUP_URL = '" . SG_APP_POPUP_URL . "';
|
93 |
+
SG_POPUP_VERSION='" . $popupBuilderVersion . "_" . POPUP_BUILDER_PKG . ";';
|
94 |
+
function sgAddEvent(element, eventName, fn) {
|
95 |
+
if (element.addEventListener)
|
96 |
+
element.addEventListener(eventName, fn, false);
|
97 |
+
else if (element.attachEvent)
|
98 |
+
element.attachEvent('on' + eventName, fn);
|
99 |
+
}
|
100 |
+
</script>";
|
101 |
+
|
102 |
+
return $dataString;
|
103 |
+
}
|
104 |
}
|
|
|
105 |
|
106 |
+
$popupConf = new SgPopupBuilderConfig();
|
107 |
+
}
|
files/main_section/image.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<div class="sg-wp-editor-container">
|
2 |
<h1 class="image-popup-headline">Please choose your picture</h1>
|
3 |
<div class="image-uploader-wrapper">
|
4 |
-
<input class="input-width-static" id="js-upload-image" type="text" size="36" name="ad_image" value="<?php echo esc_attr($sgPopupDataImage); ?>">
|
5 |
<input id="js-upload-image-button" class="button" type="button" value="Select image">
|
6 |
</div>
|
7 |
<div class="show-image-contenier">
|
1 |
<div class="sg-wp-editor-container">
|
2 |
<h1 class="image-popup-headline">Please choose your picture</h1>
|
3 |
<div class="image-uploader-wrapper">
|
4 |
+
<input class="input-width-static" id="js-upload-image" type="text" size="36" name="ad_image" value="<?php echo esc_attr($sgPopupDataImage); ?>" required>
|
5 |
<input id="js-upload-image-button" class="button" type="button" value="Select image">
|
6 |
</div>
|
7 |
<div class="show-image-contenier">
|
files/sg_functions.php
CHANGED
@@ -285,6 +285,23 @@ class SGFunctions
|
|
285 |
return false;
|
286 |
}
|
287 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
288 |
public static function countrisSelect() {
|
289 |
|
290 |
return '<select id="sameWidthinputs" name="countris" class="optionsCountry" data-role="tagsinput">
|
285 |
return false;
|
286 |
}
|
287 |
|
288 |
+
public static function getCurrentPopupIdFromOptions($id) {
|
289 |
+
|
290 |
+
$allPosts = get_option("SG_ALL_POSTS");
|
291 |
+
|
292 |
+
if(!is_array($allPosts)) {
|
293 |
+
return false;
|
294 |
+
}
|
295 |
+
|
296 |
+
foreach ($allPosts as $key => $post) {
|
297 |
+
if($post['id'] == $id) {
|
298 |
+
return $key;
|
299 |
+
}
|
300 |
+
}
|
301 |
+
|
302 |
+
return false;
|
303 |
+
}
|
304 |
+
|
305 |
public static function countrisSelect() {
|
306 |
|
307 |
return '<select id="sameWidthinputs" name="countris" class="optionsCountry" data-role="tagsinput">
|
files/sg_popup_actions.php
CHANGED
@@ -15,6 +15,19 @@ class sgPopupActions {
|
|
15 |
|
16 |
$extensionManagerObj = new SGPBExtensionManager();
|
17 |
$extensionManagerObj->deletePopupFromConnection($args['popupId']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
}
|
19 |
}
|
20 |
|
15 |
|
16 |
$extensionManagerObj = new SGPBExtensionManager();
|
17 |
$extensionManagerObj->deletePopupFromConnection($args['popupId']);
|
18 |
+
$this->deletePopupFromAllPostTypes($args['popupId']);
|
19 |
+
}
|
20 |
+
|
21 |
+
private function deletePopupFromAllPostTypes($popupId) {
|
22 |
+
|
23 |
+
$popupId = (int)$popupId;
|
24 |
+
$allPosts = get_option("SG_ALL_POSTS");
|
25 |
+
$popupKey = SGFunctions::getCurrentPopupIdFromOptions($popupId);
|
26 |
+
|
27 |
+
if(!$popupKey) {
|
28 |
+
unset($allPosts[$popupKey]);
|
29 |
+
update_option("SG_ALL_POSTS", $allPosts);
|
30 |
+
}
|
31 |
}
|
32 |
}
|
33 |
|
files/sg_popup_create_new.php
CHANGED
@@ -283,7 +283,7 @@ $sgPopup = array(
|
|
283 |
'width' => '640px',
|
284 |
'height' => '480px',
|
285 |
'popup-dimension-mode' => 'customMode',
|
286 |
-
'popup-responsive-dimension-measure' =>
|
287 |
'initialWidth' => '300',
|
288 |
'initialHeight' => '100',
|
289 |
'maxWidth' => false,
|
@@ -992,6 +992,7 @@ $sgTheme = array(
|
|
992 |
);
|
993 |
|
994 |
$sgResponsiveMeasure = array(
|
|
|
995 |
'10' => '10%',
|
996 |
'20' => '20%',
|
997 |
'30' => '30%',
|
283 |
'width' => '640px',
|
284 |
'height' => '480px',
|
285 |
'popup-dimension-mode' => 'customMode',
|
286 |
+
'popup-responsive-dimension-measure' => 'auto',
|
287 |
'initialWidth' => '300',
|
288 |
'initialHeight' => '100',
|
289 |
'maxWidth' => false,
|
992 |
);
|
993 |
|
994 |
$sgResponsiveMeasure = array(
|
995 |
+
'auto' => 'Auto',
|
996 |
'10' => '10%',
|
997 |
'20' => '20%',
|
998 |
'30' => '30%',
|
files/sg_popup_save.php
CHANGED
@@ -424,10 +424,10 @@ function sgPopupSave()
|
|
424 |
}
|
425 |
|
426 |
/**
|
427 |
-
*
|
|
|
|
|
428 |
*
|
429 |
-
* @since 3.1.5
|
430 |
-
*
|
431 |
* @param int $id popup id number
|
432 |
* @param array $postTypes page post types
|
433 |
* @param bool $isInsert true for insert false for remove
|
@@ -446,15 +446,23 @@ function updatePopupOptions($id, $postTypes, $isInsert) {
|
|
446 |
$allPosts = array();
|
447 |
}
|
448 |
|
|
|
|
|
|
|
|
|
449 |
if($allPosts && !empty($allPosts)) {
|
450 |
-
/*
|
451 |
-
$key = getCurrentPopupIdFromOptions($id);
|
452 |
}
|
453 |
|
454 |
/*When isset like id data in wp options*/
|
455 |
if($key !== false) {
|
456 |
$popupPostTypes = $allPosts[$key]['popstTypes'];
|
|
|
|
|
|
|
457 |
|
|
|
458 |
if($isInsert) {
|
459 |
$popupPostTypes = array_merge($popupPostTypes, $postTypes);
|
460 |
$popupPostTypes = array_unique($popupPostTypes);
|
@@ -463,9 +471,10 @@ function updatePopupOptions($id, $postTypes, $isInsert) {
|
|
463 |
if(!empty($postTypes)) {
|
464 |
$popupPostTypes = array_diff($popupPostTypes, $postTypes);
|
465 |
}
|
466 |
-
|
467 |
}
|
468 |
|
|
|
469 |
if(empty($popupPostTypes)) {
|
470 |
unset($allPosts[$key]);
|
471 |
}
|
@@ -474,28 +483,10 @@ function updatePopupOptions($id, $postTypes, $isInsert) {
|
|
474 |
}
|
475 |
|
476 |
}
|
477 |
-
else if($isInsert) {
|
478 |
$data = array('id'=>$id, 'popstTypes'=>$postTypes);
|
479 |
array_push($allPosts, $data);
|
480 |
}
|
481 |
|
482 |
update_option("SG_ALL_POSTS", $allPosts);
|
483 |
}
|
484 |
-
|
485 |
-
function getCurrentPopupIdFromOptions($id) {
|
486 |
-
|
487 |
-
$allPosts = get_option("SG_ALL_POSTS");
|
488 |
-
|
489 |
-
if(!is_array($allPosts)) {
|
490 |
-
return false;
|
491 |
-
}
|
492 |
-
|
493 |
-
foreach ($allPosts as $key => $post) {
|
494 |
-
if($post['id'] == $id) {
|
495 |
-
return $key;
|
496 |
-
}
|
497 |
-
}
|
498 |
-
|
499 |
-
return false;
|
500 |
-
}
|
501 |
-
|
424 |
}
|
425 |
|
426 |
/**
|
427 |
+
* Save data to wp options
|
428 |
+
*
|
429 |
+
* @since 3.2.2
|
430 |
*
|
|
|
|
|
431 |
* @param int $id popup id number
|
432 |
* @param array $postTypes page post types
|
433 |
* @param bool $isInsert true for insert false for remove
|
446 |
$allPosts = array();
|
447 |
}
|
448 |
|
449 |
+
if(empty($postTypes)) {
|
450 |
+
$postTypes = array();
|
451 |
+
}
|
452 |
+
|
453 |
if($allPosts && !empty($allPosts)) {
|
454 |
+
/*Get current popup id key from assoc array*/
|
455 |
+
$key = SGFunctions::getCurrentPopupIdFromOptions($id);
|
456 |
}
|
457 |
|
458 |
/*When isset like id data in wp options*/
|
459 |
if($key !== false) {
|
460 |
$popupPostTypes = $allPosts[$key]['popstTypes'];
|
461 |
+
if(empty($popupPostTypes)) {
|
462 |
+
$popupPostTypes = array();
|
463 |
+
}
|
464 |
|
465 |
+
/*Insert or remove from exist post types*/
|
466 |
if($isInsert) {
|
467 |
$popupPostTypes = array_merge($popupPostTypes, $postTypes);
|
468 |
$popupPostTypes = array_unique($popupPostTypes);
|
471 |
if(!empty($postTypes)) {
|
472 |
$popupPostTypes = array_diff($popupPostTypes, $postTypes);
|
473 |
}
|
474 |
+
|
475 |
}
|
476 |
|
477 |
+
/*After modificition remove popup id from all post types or cghanged exist value*/
|
478 |
if(empty($popupPostTypes)) {
|
479 |
unset($allPosts[$key]);
|
480 |
}
|
483 |
}
|
484 |
|
485 |
}
|
486 |
+
else if($isInsert && !empty($postTypes)) {
|
487 |
$data = array('id'=>$id, 'popstTypes'=>$postTypes);
|
488 |
array_push($allPosts, $data);
|
489 |
}
|
490 |
|
491 |
update_option("SG_ALL_POSTS", $allPosts);
|
492 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
helpers/Helper_functions.php
CHANGED
@@ -1,20 +1,6 @@
|
|
1 |
<?php
|
2 |
class HelperFunctions {
|
3 |
|
4 |
-
private function isFreePluginActive() {
|
5 |
-
|
6 |
-
$sgpbActivePlugins = get_option('active_plugins');
|
7 |
-
|
8 |
-
if(is_array($sgpbActivePlugins)) {
|
9 |
-
$hasFreeVersion = in_array('popup-builder/popup-builder.php', $sgpbActivePlugins);
|
10 |
-
$mainFileName = basename(__FILE__, ".php");
|
11 |
-
|
12 |
-
if($hasFreeVersion && $mainFileName == 'popup-builderPro') {
|
13 |
-
wp_die("Please, deactivate the FREE version of our plugin before upgrading to PRO");
|
14 |
-
}
|
15 |
-
}
|
16 |
-
}
|
17 |
-
|
18 |
private function checkPhpVersion() {
|
19 |
|
20 |
if (version_compare(PHP_VERSION, SG_POPUP_MINIMUM_PHP_VERSION, '<')) {
|
@@ -25,7 +11,6 @@ class HelperFunctions {
|
|
25 |
public static function checkRequirements() {
|
26 |
|
27 |
$helperObj = new self();
|
28 |
-
$helperObj->isFreePluginActive();
|
29 |
$helperObj->checkPhpVersion();
|
30 |
}
|
31 |
}
|
1 |
<?php
|
2 |
class HelperFunctions {
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
private function checkPhpVersion() {
|
5 |
|
6 |
if (version_compare(PHP_VERSION, SG_POPUP_MINIMUM_PHP_VERSION, '<')) {
|
11 |
public static function checkRequirements() {
|
12 |
|
13 |
$helperObj = new self();
|
|
|
14 |
$helperObj->checkPhpVersion();
|
15 |
}
|
16 |
}
|
helpers/SgPopupGetData.php
CHANGED
@@ -3,7 +3,7 @@ class SgPopupGetData {
|
|
3 |
|
4 |
public static function getDefaultValues() {
|
5 |
|
6 |
-
$
|
7 |
'tables-delete-status' => 'on',
|
8 |
'plugin_users_role' => array(),
|
9 |
'sg-popup-time-zone' => 'Pacific/Midway'
|
@@ -11,12 +11,12 @@ class SgPopupGetData {
|
|
11 |
|
12 |
$usersRoleList = self::getAllUserRoles();
|
13 |
|
14 |
-
$
|
15 |
-
'
|
16 |
'usersRoleList' => $usersRoleList
|
17 |
);
|
18 |
|
19 |
-
return $
|
20 |
}
|
21 |
|
22 |
public static function getValue($optionName,$optionType) {
|
3 |
|
4 |
public static function getDefaultValues() {
|
5 |
|
6 |
+
$settingsParams = array(
|
7 |
'tables-delete-status' => 'on',
|
8 |
'plugin_users_role' => array(),
|
9 |
'sg-popup-time-zone' => 'Pacific/Midway'
|
11 |
|
12 |
$usersRoleList = self::getAllUserRoles();
|
13 |
|
14 |
+
$defaultParams = array(
|
15 |
+
'settingsParams' => $settingsParams,
|
16 |
'usersRoleList' => $usersRoleList
|
17 |
);
|
18 |
|
19 |
+
return $defaultParams;
|
20 |
}
|
21 |
|
22 |
public static function getValue($optionName,$optionType) {
|
javascript/sg_popup_frontend.js
CHANGED
@@ -19,8 +19,20 @@ function SGPopup() {
|
|
19 |
this.popupClassEvents = ['hover'];
|
20 |
this.eventExecuteCountByClass = 0;
|
21 |
this.sgEventExecuteCount = 0;
|
|
|
|
|
22 |
}
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
/*Popup thems default paddings where key is theme number value padding*/
|
25 |
SGPopup.sgColorBoxDeafults = {1 : 70, 2: 34, 3: 30, 4 : 70, 5 : 62, 6: 70};
|
26 |
|
@@ -28,19 +40,16 @@ SGPopup.prototype.popupOpenById = function (popupId) {
|
|
28 |
|
29 |
var sgOnScrolling = (SG_POPUP_DATA [popupId]['onScrolling']) ? SG_POPUP_DATA [popupId]['onScrolling'] : '';
|
30 |
var sgInActivity = (SG_POPUP_DATA [popupId]['inActivityStatus']) ? SG_POPUP_DATA [popupId]['inActivityStatus'] : '';
|
31 |
-
var beforeScrolingPrsent = (SG_POPUP_DATA [popupId]['onScrolling']) ? SG_POPUP_DATA [popupId]['beforeScrolingPrsent'] : '';
|
32 |
var autoClosePopup = (SG_POPUP_DATA [popupId]['autoClosePopup']) ? SG_POPUP_DATA [popupId]['autoClosePopup'] : '';
|
33 |
-
var popupClosingTimer = (SG_POPUP_DATA [popupId]['popupClosingTimer']) ? SG_POPUP_DATA [popupId]['popupClosingTimer'] : '';
|
34 |
-
var sgPoupFrontendObj = new SGPopup();
|
35 |
|
36 |
if (sgOnScrolling) {
|
37 |
-
|
38 |
}
|
39 |
else if (sgInActivity) {
|
40 |
-
|
41 |
}
|
42 |
else {
|
43 |
-
|
44 |
}
|
45 |
};
|
46 |
|
@@ -492,6 +501,19 @@ SGPopup.prototype.popupThemeDefaultMeasure = function () {
|
|
492 |
return defaults[themeId];
|
493 |
};
|
494 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
495 |
SGPopup.prototype.resizeDimension = function () {
|
496 |
|
497 |
var resizeTimer;
|
@@ -536,24 +558,45 @@ SGPopup.prototype.resizeDimension = function () {
|
|
536 |
window.addEventListener("orientationchange", resizeColorBox, false);
|
537 |
};
|
538 |
|
539 |
-
SGPopup.prototype.
|
540 |
|
541 |
-
var
|
542 |
-
resizeObj['width'] = jQuery("#sgcboxLoadedContent").width();
|
543 |
-
var themeDefault = this.popupThemeDefaultMeasure();
|
544 |
|
545 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
546 |
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
if(heightDiff != 0) {
|
551 |
-
var height = (contentHeight + heightDiff)+themeDefault;
|
552 |
-
resizeObj['height'] = height;
|
553 |
}
|
554 |
|
555 |
-
|
|
|
|
|
|
|
556 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
557 |
};
|
558 |
|
559 |
SGPopup.prototype.sgShowColorboxWithOptions = function () {
|
@@ -585,11 +628,8 @@ SGPopup.prototype.sgShowColorboxWithOptions = function () {
|
|
585 |
if (popupCantClose) {
|
586 |
that.cantPopupClose();
|
587 |
}
|
|
|
588 |
var popupPosition = that.popupData['fixedPostion'];
|
589 |
-
var popupHtml = (that.popupData['html'] == '') ? ' ' : that.popupData['html'];
|
590 |
-
var popupImage = that.popupData['image'];
|
591 |
-
var popupIframeUrl = that.popupData['iframe'];
|
592 |
-
var popupShortCode = that.popupData['shortcode'];
|
593 |
var popupVideo = that.popupData['video'];
|
594 |
var popupOverlayColor = that.popupData['sgOverlayColor'];
|
595 |
var contentBackgroundColor = that.popupData['sg-content-background-color'];
|
@@ -598,7 +638,6 @@ SGPopup.prototype.sgShowColorboxWithOptions = function () {
|
|
598 |
var popupWidth = that.popupData['width'];
|
599 |
var popupHeight = that.popupData['height'];
|
600 |
var popupOpacity = that.popupData['opacity'];
|
601 |
-
var popupMaxWidth = that.popupData['maxWidth'];
|
602 |
var popupMaxHeight = that.popupData['maxHeight'];
|
603 |
var popupInitialWidth = that.popupData['initialWidth'];
|
604 |
var popupInitialHeight = that.popupData['initialHeight'];
|
@@ -617,31 +656,17 @@ SGPopup.prototype.sgShowColorboxWithOptions = function () {
|
|
617 |
var customClassName = popupTheme.substring(0, themeStringLength - 4);
|
618 |
var closeButtonText = that.popupData['theme-close-text'];
|
619 |
|
620 |
-
|
621 |
-
var popupIframe = (popupIframeUrl) ? true : false;
|
622 |
-
popupVideo = (popupVideo) ? popupVideo : false;
|
623 |
-
popupImage = (popupImage) ? popupImage : false;
|
624 |
-
var popupPhoto = (popupImage) ? true : false;
|
625 |
-
popupShortCode = (popupShortCode) ? popupShortCode : false;
|
626 |
-
if (popupShortCode && popupHtml == false) {
|
627 |
-
popupHtml = popupShortCode;
|
628 |
-
}
|
629 |
-
|
630 |
-
if (popupHtml != ' ') {
|
631 |
-
popupHtml = popupHtml;
|
632 |
-
}
|
633 |
|
634 |
if(popupDimensionMode == 'responsiveMode') {
|
635 |
-
|
|
|
|
|
|
|
|
|
636 |
popupHeight = '';
|
637 |
}
|
638 |
-
if (popupHtml && popupWidth == '' && popupHeight == '' && popupMaxWidth == '' && popupMaxHeight == '') {
|
639 |
|
640 |
-
jQuery(popupHtml).find('img:first').attr('onload', 'jQuery.sgcolorbox.resize();');
|
641 |
-
}
|
642 |
-
if (popupIframeUrl) {
|
643 |
-
popupImage = popupIframeUrl;
|
644 |
-
}
|
645 |
if (popupVideo) {
|
646 |
if (popupWidth == '') {
|
647 |
popupWidth = '50%';
|
@@ -649,8 +674,6 @@ SGPopup.prototype.sgShowColorboxWithOptions = function () {
|
|
649 |
if (popupHeight == '') {
|
650 |
popupHeight = '50%';
|
651 |
}
|
652 |
-
popupIframe = true;
|
653 |
-
popupImage = popupVideo;
|
654 |
}
|
655 |
var sgScreenWidth = jQuery(window).width();
|
656 |
var sgScreenHeight = jQuery(window).height();
|
@@ -729,9 +752,14 @@ SGPopup.prototype.sgShowColorboxWithOptions = function () {
|
|
729 |
if (userDevice) {
|
730 |
return;
|
731 |
}
|
732 |
-
|
733 |
SG_POPUP_SETTINGS = {
|
734 |
popupId: popupId,
|
|
|
|
|
|
|
|
|
|
|
735 |
width: popupWidth,
|
736 |
height: popupHeight,
|
737 |
className: customClassName,
|
@@ -764,9 +792,6 @@ SGPopup.prototype.sgShowColorboxWithOptions = function () {
|
|
764 |
}
|
765 |
jQuery("#sgcboxLoadedContent").addClass("sg-current-popup-" + that.popupData['id']);
|
766 |
jQuery('#sgcolorbox').trigger("sgColorboxOnCompleate", [pushToBottom]);
|
767 |
-
if (popupWidth == '' && popupHeight == '') {
|
768 |
-
jQuery.sgcolorbox.resize();
|
769 |
-
}
|
770 |
|
771 |
var sgpopupInit = new SgPopupInit(that.popupData);
|
772 |
sgpopupInit.overallInit();
|
@@ -774,7 +799,6 @@ SGPopup.prototype.sgShowColorboxWithOptions = function () {
|
|
774 |
sgpopupInit.initByPopupType();
|
775 |
that.sgCustomizeThemes(that.popupData['id']);
|
776 |
if(popupDimensionMode == 'responsiveMode') {
|
777 |
-
that.calculateContentDimensions();
|
778 |
that.resizeDimension();
|
779 |
}
|
780 |
},
|
@@ -786,10 +810,6 @@ SGPopup.prototype.sgShowColorboxWithOptions = function () {
|
|
786 |
jQuery('#sgcolorbox').trigger("sgPopupClose", []);
|
787 |
},
|
788 |
trapFocus: that.sgTrapFocus,
|
789 |
-
html: popupHtml,
|
790 |
-
photo: popupPhoto,
|
791 |
-
iframe: popupIframe,
|
792 |
-
href: popupImage,
|
793 |
opacity: popupOpacity,
|
794 |
escKey: that.popupEscKey,
|
795 |
closeButton: that.popupCloseButton,
|
@@ -801,7 +821,7 @@ SGPopup.prototype.sgShowColorboxWithOptions = function () {
|
|
801 |
scrolling: popupScrolling,
|
802 |
reposition: popupReposition,
|
803 |
overlayClose: that.popupOverlayClose,
|
804 |
-
maxWidth: popupMaxWidth,
|
805 |
maxHeight: popupMaxHeight,
|
806 |
initialWidth: popupInitialWidth,
|
807 |
initialHeight: popupInitialHeight
|
19 |
this.popupClassEvents = ['hover'];
|
20 |
this.eventExecuteCountByClass = 0;
|
21 |
this.sgEventExecuteCount = 0;
|
22 |
+
|
23 |
+
this.sgColorboxContentTypeReset();
|
24 |
}
|
25 |
|
26 |
+
SGPopup.prototype.sgColorboxContentTypeReset = function () {
|
27 |
+
|
28 |
+
/*colorbox settings mode*/
|
29 |
+
this.sgColorboxHtml = false;
|
30 |
+
this.sgColorboxPhoto = false;
|
31 |
+
this.sgColorboxIframe = false;
|
32 |
+
this.sgColorboxHref = false;
|
33 |
+
this.sgColorboxInline = false;
|
34 |
+
};
|
35 |
+
|
36 |
/*Popup thems default paddings where key is theme number value padding*/
|
37 |
SGPopup.sgColorBoxDeafults = {1 : 70, 2: 34, 3: 30, 4 : 70, 5 : 62, 6: 70};
|
38 |
|
40 |
|
41 |
var sgOnScrolling = (SG_POPUP_DATA [popupId]['onScrolling']) ? SG_POPUP_DATA [popupId]['onScrolling'] : '';
|
42 |
var sgInActivity = (SG_POPUP_DATA [popupId]['inActivityStatus']) ? SG_POPUP_DATA [popupId]['inActivityStatus'] : '';
|
|
|
43 |
var autoClosePopup = (SG_POPUP_DATA [popupId]['autoClosePopup']) ? SG_POPUP_DATA [popupId]['autoClosePopup'] : '';
|
|
|
|
|
44 |
|
45 |
if (sgOnScrolling) {
|
46 |
+
this.onScrolling(popupId);
|
47 |
}
|
48 |
else if (sgInActivity) {
|
49 |
+
this.showPopupAfterInactivity(popupId);
|
50 |
}
|
51 |
else {
|
52 |
+
this.showPopup(popupId, true);
|
53 |
}
|
54 |
};
|
55 |
|
501 |
return defaults[themeId];
|
502 |
};
|
503 |
|
504 |
+
SGPopup.prototype.changePopupSettings = function () {
|
505 |
+
|
506 |
+
var popupData = this.popupData;
|
507 |
+
var popupDimensionMode = popupData['popup-dimension-mode'];
|
508 |
+
var popupResponsiveDimensionMeasure = popupData['popup-responsive-dimension-measure'];
|
509 |
+
if(popupDimensionMode == 'responsiveMode') {
|
510 |
+
|
511 |
+
if(popupResponsiveDimensionMeasure == 'auto') {
|
512 |
+
this.popupMaxWidth = '100%';
|
513 |
+
}
|
514 |
+
}
|
515 |
+
};
|
516 |
+
|
517 |
SGPopup.prototype.resizeDimension = function () {
|
518 |
|
519 |
var resizeTimer;
|
558 |
window.addEventListener("orientationchange", resizeColorBox, false);
|
559 |
};
|
560 |
|
561 |
+
SGPopup.prototype.sgColorboxContentMode = function() {
|
562 |
|
563 |
+
var that = this;
|
|
|
|
|
564 |
|
565 |
+
this.sgColorboxContentTypeReset();
|
566 |
+
var popupType = this.popupData['type'];
|
567 |
+
var popupHtml = (this.popupData['html'] == '') ? ' ' : this.popupData['html'];
|
568 |
+
var popupImage = this.popupData['image'];
|
569 |
+
var popupIframeUrl = this.popupData['iframe'];
|
570 |
+
var popupVideo = this.popupData['video'];
|
571 |
+
var popupId = this.popupData['id'];
|
572 |
+
|
573 |
+
popupImage = (popupImage) ? popupImage : false;
|
574 |
+
popupVideo = (popupVideo) ? popupVideo : false;
|
575 |
+
popupIframeUrl = (popupIframeUrl) ? popupIframeUrl : false;
|
576 |
+
|
577 |
+
if(popupType == 'image') {
|
578 |
+
this.sgColorboxPhoto = true;
|
579 |
+
this.sgColorboxHref = popupImage;
|
580 |
+
}
|
581 |
|
582 |
+
if(popupIframeUrl) {
|
583 |
+
this.sgColorboxIframe = true;
|
584 |
+
this.sgColorboxHref = popupIframeUrl;
|
|
|
|
|
|
|
585 |
}
|
586 |
|
587 |
+
if(popupVideo) {
|
588 |
+
this.sgColorboxIframe = true;
|
589 |
+
this.sgColorboxHref = popupVideo;
|
590 |
+
}
|
591 |
|
592 |
+
/*this condition jQuery('#sg-popup-content-wrapper-'+popupId).length != 0 for backward compatibility*/
|
593 |
+
if(popupHtml && jQuery('#sg-popup-content-wrapper-'+popupId).length != 0) {
|
594 |
+
this.sgColorboxInline = true;
|
595 |
+
this.sgColorboxHref = '#sg-popup-content-wrapper-'+popupId;
|
596 |
+
}
|
597 |
+
else {
|
598 |
+
this.sgColorboxHtml = popupHtml;
|
599 |
+
}
|
600 |
};
|
601 |
|
602 |
SGPopup.prototype.sgShowColorboxWithOptions = function () {
|
628 |
if (popupCantClose) {
|
629 |
that.cantPopupClose();
|
630 |
}
|
631 |
+
that.popupMaxWidth = that.popupData['maxWidth'];
|
632 |
var popupPosition = that.popupData['fixedPostion'];
|
|
|
|
|
|
|
|
|
633 |
var popupVideo = that.popupData['video'];
|
634 |
var popupOverlayColor = that.popupData['sgOverlayColor'];
|
635 |
var contentBackgroundColor = that.popupData['sg-content-background-color'];
|
638 |
var popupWidth = that.popupData['width'];
|
639 |
var popupHeight = that.popupData['height'];
|
640 |
var popupOpacity = that.popupData['opacity'];
|
|
|
641 |
var popupMaxHeight = that.popupData['maxHeight'];
|
642 |
var popupInitialWidth = that.popupData['initialWidth'];
|
643 |
var popupInitialHeight = that.popupData['initialHeight'];
|
656 |
var customClassName = popupTheme.substring(0, themeStringLength - 4);
|
657 |
var closeButtonText = that.popupData['theme-close-text'];
|
658 |
|
659 |
+
that.sgColorboxContentMode();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
660 |
|
661 |
if(popupDimensionMode == 'responsiveMode') {
|
662 |
+
|
663 |
+
popupWidth = '';
|
664 |
+
if(popupResponsiveDimensionMeasure != 'auto') {
|
665 |
+
popupWidth = parseInt(popupResponsiveDimensionMeasure)+'%';
|
666 |
+
}
|
667 |
popupHeight = '';
|
668 |
}
|
|
|
669 |
|
|
|
|
|
|
|
|
|
|
|
670 |
if (popupVideo) {
|
671 |
if (popupWidth == '') {
|
672 |
popupWidth = '50%';
|
674 |
if (popupHeight == '') {
|
675 |
popupHeight = '50%';
|
676 |
}
|
|
|
|
|
677 |
}
|
678 |
var sgScreenWidth = jQuery(window).width();
|
679 |
var sgScreenHeight = jQuery(window).height();
|
752 |
if (userDevice) {
|
753 |
return;
|
754 |
}
|
755 |
+
that.changePopupSettings();
|
756 |
SG_POPUP_SETTINGS = {
|
757 |
popupId: popupId,
|
758 |
+
html: that.sgColorboxHtml,
|
759 |
+
photo: that.sgColorboxPhoto,
|
760 |
+
iframe: that.sgColorboxIframe,
|
761 |
+
href: that.sgColorboxHref,
|
762 |
+
inline: that.sgColorboxInline,
|
763 |
width: popupWidth,
|
764 |
height: popupHeight,
|
765 |
className: customClassName,
|
792 |
}
|
793 |
jQuery("#sgcboxLoadedContent").addClass("sg-current-popup-" + that.popupData['id']);
|
794 |
jQuery('#sgcolorbox').trigger("sgColorboxOnCompleate", [pushToBottom]);
|
|
|
|
|
|
|
795 |
|
796 |
var sgpopupInit = new SgPopupInit(that.popupData);
|
797 |
sgpopupInit.overallInit();
|
799 |
sgpopupInit.initByPopupType();
|
800 |
that.sgCustomizeThemes(that.popupData['id']);
|
801 |
if(popupDimensionMode == 'responsiveMode') {
|
|
|
802 |
that.resizeDimension();
|
803 |
}
|
804 |
},
|
810 |
jQuery('#sgcolorbox').trigger("sgPopupClose", []);
|
811 |
},
|
812 |
trapFocus: that.sgTrapFocus,
|
|
|
|
|
|
|
|
|
813 |
opacity: popupOpacity,
|
814 |
escKey: that.popupEscKey,
|
815 |
closeButton: that.popupCloseButton,
|
821 |
scrolling: popupScrolling,
|
822 |
reposition: popupReposition,
|
823 |
overlayClose: that.popupOverlayClose,
|
824 |
+
maxWidth: that.popupMaxWidth,
|
825 |
maxHeight: popupMaxHeight,
|
826 |
initialWidth: popupInitialWidth,
|
827 |
initialHeight: popupInitialHeight
|
javascript/sg_popup_init.js
CHANGED
@@ -1,29 +1,10 @@
|
|
1 |
function SgPopupInit(popupData) {
|
2 |
|
3 |
this.popupData = popupData;
|
4 |
-
this.
|
5 |
this.reopenPopupAfterSubmission();
|
6 |
}
|
7 |
|
8 |
-
SgPopupInit.prototype.cloneToHtmlPopup = function() {
|
9 |
-
|
10 |
-
var currentPopupId = this.popupData['id'];
|
11 |
-
|
12 |
-
/*When content does not have shortcode*/
|
13 |
-
if(jQuery("#sgpb-all-content-"+currentPopupId).length == 0) {
|
14 |
-
return;
|
15 |
-
}
|
16 |
-
|
17 |
-
jQuery("#sgpb-all-content-"+currentPopupId).appendTo(jQuery('.sg-current-popup-'+currentPopupId));
|
18 |
-
|
19 |
-
this.popupResizing(currentPopupId);
|
20 |
-
jQuery('#sgcolorbox').bind('sgPopupCleanup', function() {
|
21 |
-
jQuery('#sgpb-all-content-'+currentPopupId).appendTo(jQuery("#sg-popup-content-"+currentPopupId));
|
22 |
-
});
|
23 |
-
|
24 |
-
this.shortcodeInPopupContent();
|
25 |
-
};
|
26 |
-
|
27 |
SgPopupInit.prototype.reopenPopupAfterSubmission = function() {
|
28 |
|
29 |
var that = this;
|
@@ -39,25 +20,6 @@ SgPopupInit.prototype.reopenPopupAfterSubmission = function() {
|
|
39 |
}
|
40 |
};
|
41 |
|
42 |
-
SgPopupInit.prototype.popupResizing = function(currentPopupId) {
|
43 |
-
|
44 |
-
var width = this.popupData['width'];
|
45 |
-
var height = this.popupData['height'];
|
46 |
-
var maxWidth = this.popupData['maxWidth'];
|
47 |
-
var maxHeight = this.popupData['maxHeight'];
|
48 |
-
var popupDimensionMode = this.popupData['popup-dimension-mode'];
|
49 |
-
var popupResponsiveDimensionMeasure = this.popupData['popup-responsive-dimension-measure'];
|
50 |
-
|
51 |
-
if(popupDimensionMode == 'responsiveMode') {
|
52 |
-
width = parseInt(popupResponsiveDimensionMeasure)+'%';
|
53 |
-
height = '';
|
54 |
-
}
|
55 |
-
|
56 |
-
if(maxWidth == '' && maxHeight == '') {
|
57 |
-
jQuery.sgcolorbox.resize({'width': width, 'height': height});
|
58 |
-
}
|
59 |
-
};
|
60 |
-
|
61 |
SgPopupInit.prototype.shortcodeInPopupContent = function() {
|
62 |
|
63 |
jQuery(".sg-show-popup").bind('click',function() {
|
1 |
function SgPopupInit(popupData) {
|
2 |
|
3 |
this.popupData = popupData;
|
4 |
+
this.shortcodeInPopupContent();
|
5 |
this.reopenPopupAfterSubmission();
|
6 |
}
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
SgPopupInit.prototype.reopenPopupAfterSubmission = function() {
|
9 |
|
10 |
var that = this;
|
20 |
}
|
21 |
};
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
SgPopupInit.prototype.shortcodeInPopupContent = function() {
|
24 |
|
25 |
jQuery(".sg-show-popup").bind('click',function() {
|
javascript/sg_popup_javascript.php
CHANGED
@@ -61,12 +61,6 @@ function sg_popup_admin_scripts($hook) {
|
|
61 |
}
|
62 |
}
|
63 |
|
64 |
-
function SgFrontendScripts() {
|
65 |
-
wp_enqueue_script('sg_popup_core', plugins_url('/sg_popup_core.js', __FILE__), '1.0.0', true);
|
66 |
-
}
|
67 |
-
|
68 |
add_action('admin_enqueue_scripts', 'sg_set_admin_url');
|
69 |
add_action('admin_enqueue_scripts', 'sg_popup_admin_scripts');
|
70 |
-
add_action('wp_enqueue_scripts', 'SgFrontendScripts');
|
71 |
-
|
72 |
|
61 |
}
|
62 |
}
|
63 |
|
|
|
|
|
|
|
|
|
64 |
add_action('admin_enqueue_scripts', 'sg_set_admin_url');
|
65 |
add_action('admin_enqueue_scripts', 'sg_popup_admin_scripts');
|
|
|
|
|
66 |
|
popup-builder.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Popup Builder
|
4 |
* Plugin URI: http://sygnoos.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: 2.5.
|
7 |
* Author: Sygnoos
|
8 |
* Author URI: http://www.sygnoos.com
|
9 |
* License: GPLv2
|
3 |
* Plugin Name: Popup Builder
|
4 |
* Plugin URI: http://sygnoos.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: 2.5.2
|
7 |
* Author: Sygnoos
|
8 |
* Author URI: http://www.sygnoos.com
|
9 |
* License: GPLv2
|
readme.txt
CHANGED
@@ -159,6 +159,15 @@ Go to the Popup Builder settings and set your desired options.
|
|
159 |
|
160 |
== Changelog ==
|
161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
= Version 2.5.1 =
|
163 |
* Bug fixed connected to Filename notice.
|
164 |
* Added new feature to control popup Z-Index.
|
@@ -457,7 +466,7 @@ This will open a popup before a user goes to the page from the link.
|
|
457 |
|
458 |
**How to redirect users after clicking on the popup image?**
|
459 |
|
460 |
-
Go to the
|
461 |
Then Select "Redirect" option and in the URL field type the URL of the page you need your users to be redirected to.
|
462 |
|
463 |
**Can I show a popup after a specific amount of time?**
|
@@ -596,7 +605,7 @@ Leave us a good review :)
|
|
596 |
|
597 |
== Upgrade Notice ==
|
598 |
|
599 |
-
Current Version of Popup Builder is 2.5.
|
600 |
|
601 |
== Other Notes ==
|
602 |
|
159 |
|
160 |
== Changelog ==
|
161 |
|
162 |
+
= Version 2.5.2 =
|
163 |
+
* Added new option ‘auto’ inside the responsive mode.
|
164 |
+
* Tweak: popup loading optimization.
|
165 |
+
* Tweak: added compatibility with autoptimize plugin.
|
166 |
+
* Tweak: added e.preventDefault(); for onclick popups to not redirect the page.
|
167 |
+
* Code optimization and typo fixes.
|
168 |
+
* Bug fixes.
|
169 |
+
|
170 |
+
|
171 |
= Version 2.5.1 =
|
172 |
* Bug fixed connected to Filename notice.
|
173 |
* Added new feature to control popup Z-Index.
|
466 |
|
467 |
**How to redirect users after clicking on the popup image?**
|
468 |
|
469 |
+
Go to the “Options†section of your popup and find "Dismiss on content click" option.
|
470 |
Then Select "Redirect" option and in the URL field type the URL of the page you need your users to be redirected to.
|
471 |
|
472 |
**Can I show a popup after a specific amount of time?**
|
605 |
|
606 |
== Upgrade Notice ==
|
607 |
|
608 |
+
Current Version of Popup Builder is 2.5.2
|
609 |
|
610 |
== Other Notes ==
|
611 |
|
style/sgcolorbox/sgthemes.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
/*
|
2 |
The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
|
3 |
when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
|
4 |
See: http://jacklmoore.com/notes/ie-transparency-problems/
|
5 |
The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
|
6 |
when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
|
7 |
See: http://jacklmoore.com/notes/ie-transparency-problems/
|
8 |
Colorbox Core Style:
|
9 |
The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
|
10 |
when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
|
11 |
See: http://jacklmoore.com/notes/ie-transparency-problems/
|
|
|
12 |
The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
|
13 |
when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
|
14 |
See: http://jacklmoore.com/notes/ie-transparency-problems/
|
15 |
The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
|
16 |
when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
|
17 |
See: http://jacklmoore.com/notes/ie-transparency-problems/
|
18 |
Colorbox Core Style:
|
19 |
The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
|
20 |
when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
|
21 |
See: http://jacklmoore.com/notes/ie-transparency-problems/
|
|
|
1 |
The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
|
2 |
when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
|
3 |
See: http://jacklmoore.com/notes/ie-transparency-problems/
|
4 |
The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
|
5 |
when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
|
6 |
See: http://jacklmoore.com/notes/ie-transparency-problems/
|
7 |
Colorbox Core Style:
|
8 |
The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
|
9 |
when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
|
10 |
See: http://jacklmoore.com/notes/ie-transparency-problems/
|
11 |
+
/*
|
12 |
The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
|
13 |
when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
|
14 |
See: http://jacklmoore.com/notes/ie-transparency-problems/
|
15 |
The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
|
16 |
when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
|
17 |
See: http://jacklmoore.com/notes/ie-transparency-problems/
|
18 |
Colorbox Core Style:
|
19 |
The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
|
20 |
when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
|
21 |
See: http://jacklmoore.com/notes/ie-transparency-problems/
|