Version Description
Current Version of Popup Builder is 2.2.8
Download this release
Release Info
Developer | Sygnoos |
Plugin | Popup Builder – Responsive WordPress Pop up |
Version | 2.2.8 |
Comparing to | |
See all releases |
Code changes from version 2.2.6 to 2.2.8
- config.php +1 -1
- files/sg_admin_post.php +36 -2
- files/sg_popup_ajax.php +24 -3
- files/sg_popup_create_new.php +1 -1
- files/sg_popup_media_button.php +36 -17
- javascript/sg_popup_backend.js +1 -1
- javascript/sg_popup_frontend.js +27 -13
- javascript/sg_popup_javascript.php +4 -2
- javascript/sg_popup_support_plugins.js +15 -0
- popup-builder.php +32 -3
- readme.txt +9 -2
config.php
CHANGED
@@ -8,7 +8,7 @@ define('SG_APP_POPUP_FILES', SG_APP_POPUP_PATH . '/files');
|
|
8 |
define('SG_APP_POPUP_CLASSES', SG_APP_POPUP_PATH . '/classes');
|
9 |
define('SG_APP_POPUP_JS', SG_APP_POPUP_PATH . '/javascript');
|
10 |
define('SG_APP_POPUP_TABLE_LIMIT', 15);
|
11 |
-
define('SG_POPUP_VERSION', 2.
|
12 |
define('SG_POPUP_PRO_URL', 'http://sygnoos.com/wordpress-popup/');
|
13 |
define('SG_IP_TO_COUNTRY_SERVICE_TIMEOUT', 2);
|
14 |
define('SG_IP_TO_COUNTRY_SERVICE_URL', 'http://sygnoos.in/ip2data/?ip=');
|
8 |
define('SG_APP_POPUP_CLASSES', SG_APP_POPUP_PATH . '/classes');
|
9 |
define('SG_APP_POPUP_JS', SG_APP_POPUP_PATH . '/javascript');
|
10 |
define('SG_APP_POPUP_TABLE_LIMIT', 15);
|
11 |
+
define('SG_POPUP_VERSION', 2.18);
|
12 |
define('SG_POPUP_PRO_URL', 'http://sygnoos.com/wordpress-popup/');
|
13 |
define('SG_IP_TO_COUNTRY_SERVICE_TIMEOUT', 2);
|
14 |
define('SG_IP_TO_COUNTRY_SERVICE_URL', 'http://sygnoos.in/ip2data/?ip=');
|
files/sg_admin_post.php
CHANGED
@@ -85,8 +85,16 @@ add_action('admin_post_popup_clone', 'sgPopupClone');
|
|
85 |
|
86 |
function sgPopupDataExport() {
|
87 |
global $wpdb;
|
88 |
-
|
|
|
89 |
$exportArray = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
$mainTable = PopupInstaller::$maintablename;
|
91 |
|
92 |
$popupDataSql = "SELECT * FROM ".$wpdb->prefix.$mainTable;
|
@@ -122,7 +130,33 @@ function sgPopupDataExport() {
|
|
122 |
'childTableName' => $table
|
123 |
);
|
124 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
|
|
|
|
|
|
|
|
|
|
|
126 |
header("Pragma: public");
|
127 |
header("Expires: 0");
|
128 |
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
@@ -130,7 +164,7 @@ function sgPopupDataExport() {
|
|
130 |
header("Content-Type: application/octet-stream");
|
131 |
header("Content-Disposition: attachment; filename=\"sgexportdata.txt\";" );
|
132 |
header("Content-Transfer-Encoding: binary");
|
133 |
-
echo serialize($
|
134 |
}
|
135 |
|
136 |
add_action('admin_post_popup_export', 'sgPopupDataExport');
|
85 |
|
86 |
function sgPopupDataExport() {
|
87 |
global $wpdb;
|
88 |
+
|
89 |
+
$allData = array();
|
90 |
$exportArray = array();
|
91 |
+
$wpOptions = array();
|
92 |
+
$optionsName = array(
|
93 |
+
"SG_ALL_PAGES",
|
94 |
+
"SG_ALL_POSTS",
|
95 |
+
"SG_MULTIPLE_POPUP"
|
96 |
+
);
|
97 |
+
|
98 |
$mainTable = PopupInstaller::$maintablename;
|
99 |
|
100 |
$popupDataSql = "SELECT * FROM ".$wpdb->prefix.$mainTable;
|
130 |
'childTableName' => $table
|
131 |
);
|
132 |
}
|
133 |
+
$customTables['sg_popup_in_pages'] = $wpdb->prefix."sg_popup_in_pages";
|
134 |
+
$customTables['sg_subscribers'] = $wpdb->prefix."sg_subscribers";
|
135 |
+
$customTablesColumsName = array();
|
136 |
+
$customTablesData = array();
|
137 |
+
|
138 |
+
foreach ($customTables as $key => $tableName) {
|
139 |
+
|
140 |
+
$showColumnsSql = "SHOW COLUMNS FROM ".$tableName;
|
141 |
+
$colums = $wpdb->get_results($showColumnsSql, ARRAY_A);
|
142 |
+
$customTablesColumsName[$key] = $colums;
|
143 |
+
|
144 |
+
$getCustomDataSql = "SELECT * FROM ".$tableName;
|
145 |
+
$getCustomData = $wpdb->get_results($getCustomDataSql, ARRAY_A);
|
146 |
+
$customTablesData[$key] = $getCustomData;
|
147 |
+
}
|
148 |
+
|
149 |
+
foreach ($optionsName as $optionName) {
|
150 |
+
if(get_option($optionName)) {
|
151 |
+
$wpOptions[$optionName] = get_option($optionName);
|
152 |
+
}
|
153 |
+
}
|
154 |
|
155 |
+
$allData['exportArray'] = $exportArray;
|
156 |
+
$allData['customData'] = $customTablesData;
|
157 |
+
$allData['customTablesColumsName'] = $customTablesColumsName;
|
158 |
+
$allData['wpOptions'] = $wpOptions;
|
159 |
+
|
160 |
header("Pragma: public");
|
161 |
header("Expires: 0");
|
162 |
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
164 |
header("Content-Type: application/octet-stream");
|
165 |
header("Content-Disposition: attachment; filename=\"sgexportdata.txt\";" );
|
166 |
header("Content-Transfer-Encoding: binary");
|
167 |
+
echo base64_encode(serialize($allData));
|
168 |
}
|
169 |
|
170 |
add_action('admin_post_popup_export', 'sgPopupDataExport');
|
files/sg_popup_ajax.php
CHANGED
@@ -61,13 +61,34 @@ function sgContactForm()
|
|
61 |
add_action('wp_ajax_nopriv_contact_send_mail', 'sgContactForm');
|
62 |
add_action('wp_ajax_contact_send_mail', 'sgContactForm');
|
63 |
|
64 |
-
function sgImportPopups()
|
|
|
65 |
global $wpdb;
|
66 |
$url = $_POST['attachmentUrl'];
|
67 |
|
68 |
-
$contents = unserialize(file_get_contents($url));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
-
foreach ($contents as $
|
|
|
|
|
|
|
|
|
71 |
//Main popup table data
|
72 |
$popupData = $content['mainPopupData'];
|
73 |
$popupType = $popupData['type'];
|
61 |
add_action('wp_ajax_nopriv_contact_send_mail', 'sgContactForm');
|
62 |
add_action('wp_ajax_contact_send_mail', 'sgContactForm');
|
63 |
|
64 |
+
function sgImportPopups()
|
65 |
+
{
|
66 |
global $wpdb;
|
67 |
$url = $_POST['attachmentUrl'];
|
68 |
|
69 |
+
$contents = unserialize(base64_decode(file_get_contents($url)));
|
70 |
+
|
71 |
+
/* For tables wich they are not popup tables child ex. subscribers */
|
72 |
+
foreach ($contents['customData'] as $tableName => $datas) {
|
73 |
+
$columns = '';
|
74 |
+
|
75 |
+
$columsArray = array();
|
76 |
+
foreach ($contents['customTablesColumsName'][$tableName] as $key => $value) {
|
77 |
+
$columsArray[$key] = $value['Field'];
|
78 |
+
}
|
79 |
+
$columns .= implode(array_values($columsArray), ', ');
|
80 |
+
foreach ($datas as $key => $data) {
|
81 |
+
$values = "'".implode(array_values($data), "','")."'";
|
82 |
+
$customInsertSql = $wpdb->prepare("INSERT INTO ".$wpdb->prefix.$tableName."($columns) VALUES ($values)");
|
83 |
+
$wpdb->query($customInsertSql);
|
84 |
+
}
|
85 |
+
}
|
86 |
|
87 |
+
foreach ($contents['wpOptions'] as $key => $option) {
|
88 |
+
update_option($key,$option);
|
89 |
+
}
|
90 |
+
|
91 |
+
foreach ($contents['exportArray'] as $content) {
|
92 |
//Main popup table data
|
93 |
$popupData = $content['mainPopupData'];
|
94 |
$popupType = $popupData['type'];
|
files/sg_popup_create_new.php
CHANGED
@@ -1091,7 +1091,7 @@
|
|
1091 |
</div>
|
1092 |
<?php if (POPUP_BUILDER_PKG != POPUP_BUILDER_PKG_FREE) : require_once("options_section/pro.php"); ?>
|
1093 |
<?php else: ?>
|
1094 |
-
<div class="pro-options" onclick="window.open('
|
1095 |
<?php endif; ?>
|
1096 |
</div>
|
1097 |
</div>
|
1091 |
</div>
|
1092 |
<?php if (POPUP_BUILDER_PKG != POPUP_BUILDER_PKG_FREE) : require_once("options_section/pro.php"); ?>
|
1093 |
<?php else: ?>
|
1094 |
+
<div class="pro-options" onclick="window.open('<?php echo SG_POPUP_PRO_URL;?>')"></div>
|
1095 |
<?php endif; ?>
|
1096 |
</div>
|
1097 |
</div>
|
files/sg_popup_media_button.php
CHANGED
@@ -71,20 +71,25 @@ function sgPopupMediaButtonThickboxs()
|
|
71 |
alert('Select your popup');
|
72 |
return;
|
73 |
}
|
|
|
|
|
74 |
selectionText = '';
|
75 |
if (typeof(tinyMCE.editors.content) != "undefined") {
|
76 |
selectionText = (tinyMCE.activeEditor.selection.getContent()) ? tinyMCE.activeEditor.selection.getContent() : '';
|
77 |
}
|
78 |
/* For plugin editor selected text */
|
79 |
-
else if(typeof(tinyMCE.editors[0]
|
80 |
var pluginEditorId = tinyMCE.editors[0]['id'];
|
81 |
selectionText = (tinyMCE['editors'][pluginEditorId].selection.getContent()) ? tinyMCE['editors'][pluginEditorId].selection.getContent() : '';
|
82 |
}
|
|
|
|
|
|
|
83 |
<?php if( $currentPageParams['id'] == 'popup-builder_page_edit-popup'){ ?>
|
84 |
window.send_to_editor('[sg_popup id="' + id + '" insidePopup="on"]'+selectionText+"[/sg_popup]");
|
85 |
<?php }
|
86 |
else { ?>
|
87 |
-
window.send_to_editor('[sg_popup id="' + id + '"]'+selectionText+"[/sg_popup]");
|
88 |
<?php } ?>
|
89 |
jQuery('#sgpb-thickbox').dialog( "close" );
|
90 |
});
|
@@ -95,21 +100,35 @@ function sgPopupMediaButtonThickboxs()
|
|
95 |
<div class="wrap">
|
96 |
<p>Insert the shortcode for showing a Popup.</p>
|
97 |
<div>
|
98 |
-
<
|
99 |
-
<
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
</div>
|
114 |
<p class="submit">
|
115 |
<input type="button" id="sg-ptp-popup-insert" class="button-primary dashicons-welcome-widgets-menus" value="Insert"/>
|
71 |
alert('Select your popup');
|
72 |
return;
|
73 |
}
|
74 |
+
var appearEvent = jQuery("#openEvent").val();
|
75 |
+
|
76 |
selectionText = '';
|
77 |
if (typeof(tinyMCE.editors.content) != "undefined") {
|
78 |
selectionText = (tinyMCE.activeEditor.selection.getContent()) ? tinyMCE.activeEditor.selection.getContent() : '';
|
79 |
}
|
80 |
/* For plugin editor selected text */
|
81 |
+
else if(typeof(tinyMCE.editors[0]) != "undefined") {
|
82 |
var pluginEditorId = tinyMCE.editors[0]['id'];
|
83 |
selectionText = (tinyMCE['editors'][pluginEditorId].selection.getContent()) ? tinyMCE['editors'][pluginEditorId].selection.getContent() : '';
|
84 |
}
|
85 |
+
if(appearEvent == 'onload') {
|
86 |
+
selectionText = '';
|
87 |
+
}
|
88 |
<?php if( $currentPageParams['id'] == 'popup-builder_page_edit-popup'){ ?>
|
89 |
window.send_to_editor('[sg_popup id="' + id + '" insidePopup="on"]'+selectionText+"[/sg_popup]");
|
90 |
<?php }
|
91 |
else { ?>
|
92 |
+
window.send_to_editor('[sg_popup id="' + id + '" event="'+appearEvent+'"]'+selectionText+"[/sg_popup]");
|
93 |
<?php } ?>
|
94 |
jQuery('#sgpb-thickbox').dialog( "close" );
|
95 |
});
|
100 |
<div class="wrap">
|
101 |
<p>Insert the shortcode for showing a Popup.</p>
|
102 |
<div>
|
103 |
+
<div class="sg-select-popup">
|
104 |
+
<span>Select Popup</span>
|
105 |
+
<select id="sg-insert-popup-id" style="margin-bottom: 5px;">
|
106 |
+
<option value="">Please select...</option>
|
107 |
+
<?php
|
108 |
+
global $wpdb;
|
109 |
+
$proposedTypes = array();
|
110 |
+
$orderBy = 'id DESC';
|
111 |
+
$allPopups = SGPopup::findAll($orderBy);
|
112 |
+
foreach ($allPopups as $popup) :
|
113 |
+
if((isset($_GET['id']) && $popup->getId() == (int)@$_GET['id'] || $popup->getType() == 'exitIntent') && $currentPageParams['id'] == 'popup-builder_page_edit-popup') {
|
114 |
+
continue;
|
115 |
+
}
|
116 |
+
?>
|
117 |
+
<option value="<?=$popup->getId()?>"><?php echo $popup->getTitle();?><?php echo " - ".$popup->getType();?></option>;
|
118 |
+
<?php endforeach; ?>
|
119 |
+
</select>
|
120 |
+
</div>
|
121 |
+
<?php /* Becouse in popup content must be have only click */
|
122 |
+
if($pagenow !== 'admin.php'): ?>
|
123 |
+
<div class="sg-select-popup">
|
124 |
+
<span>Select Event</span>
|
125 |
+
<select id="openEvent">
|
126 |
+
<option value="onload">On load</option>
|
127 |
+
<option value="click">Click</option>
|
128 |
+
<option value="hover">Hover</option>
|
129 |
+
</select>
|
130 |
+
</div>
|
131 |
+
<?php endif;?>
|
132 |
</div>
|
133 |
<p class="submit">
|
134 |
<input type="button" id="sg-ptp-popup-insert" class="button-primary dashicons-welcome-widgets-menus" value="Insert"/>
|
javascript/sg_popup_backend.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function($){
|
2 |
this.titleNotEmpty(); /* Check title is Empty */
|
3 |
this.showThemePicture(); /* Show themes pictures */
|
4 |
this.showEffects(); /* Show effect type */
|
5 |
this.pageAcordion(); /* For page acordion divs */
|
6 |
this.fixedPostionSelection(); /* Fuctionality for selected postion */
|
7 |
this.showInfo(); /* Show description options */
|
8 |
this.opasictyRange(); /* Opcity range */
|
9 |
this.subOptionContents();
|
10 |
this.addCountris();
|
11 |
this.showCloseTextFieldForTheme();
|
12 |
this.popupReview();
|
13 |
this.popupTimer();
|
14 |
|
15 |
});
|
|
|
16 |
this.titleNotEmpty(); /* Check title is Empty */
|
17 |
this.showThemePicture(); /* Show themes pictures */
|
18 |
this.showEffects(); /* Show effect type */
|
19 |
this.pageAcordion(); /* For page acordion divs */
|
20 |
this.fixedPostionSelection(); /* Fuctionality for selected postion */
|
21 |
this.showInfo(); /* Show description options */
|
22 |
this.opasictyRange(); /* Opcity range */
|
23 |
this.subOptionContents();
|
24 |
this.addCountris();
|
25 |
this.showCloseTextFieldForTheme();
|
26 |
this.popupReview();
|
27 |
this.popupTimer();
|
28 |
this.colorPicekr(); /* Color picker */
|
29 |
});
|
|
|
1 |
this.titleNotEmpty(); /* Check title is Empty */
|
2 |
this.showThemePicture(); /* Show themes pictures */
|
3 |
this.showEffects(); /* Show effect type */
|
4 |
this.pageAcordion(); /* For page acordion divs */
|
5 |
this.fixedPostionSelection(); /* Fuctionality for selected postion */
|
6 |
this.showInfo(); /* Show description options */
|
7 |
this.opasictyRange(); /* Opcity range */
|
8 |
this.subOptionContents();
|
9 |
this.addCountris();
|
10 |
this.showCloseTextFieldForTheme();
|
11 |
this.popupReview();
|
12 |
this.popupTimer();
|
13 |
|
14 |
});
|
15 |
+
jQuery(document).ready(function($){
|
16 |
this.titleNotEmpty(); /* Check title is Empty */
|
17 |
this.showThemePicture(); /* Show themes pictures */
|
18 |
this.showEffects(); /* Show effect type */
|
19 |
this.pageAcordion(); /* For page acordion divs */
|
20 |
this.fixedPostionSelection(); /* Fuctionality for selected postion */
|
21 |
this.showInfo(); /* Show description options */
|
22 |
this.opasictyRange(); /* Opcity range */
|
23 |
this.subOptionContents();
|
24 |
this.addCountris();
|
25 |
this.showCloseTextFieldForTheme();
|
26 |
this.popupReview();
|
27 |
this.popupTimer();
|
28 |
this.colorPicekr(); /* Color picker */
|
29 |
});
|
javascript/sg_popup_frontend.js
CHANGED
@@ -20,16 +20,28 @@ SGPopup.prototype.init = function() {
|
|
20 |
var that = this;
|
21 |
|
22 |
this.onCompleate();
|
23 |
-
jQuery(".sg-show-popup").
|
24 |
-
var
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
});
|
27 |
}
|
28 |
|
29 |
SGPopup.prototype.onCompleate = function() {
|
30 |
|
31 |
jQuery("#sgcolorbox").bind("sgColorboxOnCompleate", function() {
|
32 |
-
|
33 |
/* Scroll only inside popup */
|
34 |
jQuery('#sgcboxLoadedContent').isolatedScroll();
|
35 |
});
|
@@ -179,9 +191,9 @@ SGPopup.prototype.sgShowColorboxWithOptions = function() {
|
|
179 |
if (popupShortCode && popupHtml == false) {
|
180 |
popupHtml = popupShortCode;
|
181 |
}
|
182 |
-
|
183 |
if(popupHtml && popupWidth == '' && popupHeight == '' && popupMaxWidth =='' && popupMaxHeight == '') {
|
184 |
-
|
185 |
jQuery(popupHtml).find('img:first').attr('onload', 'jQuery.sgcolorbox.resize();');
|
186 |
}
|
187 |
if (popupIframeUrl) {
|
@@ -292,7 +304,7 @@ SGPopup.prototype.sgShowColorboxWithOptions = function() {
|
|
292 |
if (popupOverlayColor) {
|
293 |
jQuery("#sgcboxOverlay").css({'background' : 'none', 'background-color' : popupOverlayColor});
|
294 |
}
|
295 |
-
|
296 |
jQuery('#sgcolorbox').trigger("sgColorboxOnOpen", []);
|
297 |
},
|
298 |
onLoad: function(){
|
@@ -305,12 +317,12 @@ SGPopup.prototype.sgShowColorboxWithOptions = function() {
|
|
305 |
if(popupWidth == '' && popupHeight == '') {
|
306 |
jQuery.sgcolorbox.resize();
|
307 |
}
|
308 |
-
|
309 |
var sgpopupInit = new SgPopupInit(that.popupData);
|
310 |
sgpopupInit.overallInit();
|
311 |
/* For specific popup Like Countdown AgeRestcion popups */
|
312 |
sgpopupInit.initByPopupType();
|
313 |
-
|
314 |
},
|
315 |
onClosed: function() {
|
316 |
jQuery('#sgcolorbox').trigger("sgPopupClose", []);
|
@@ -339,7 +351,7 @@ SGPopup.prototype.sgShowColorboxWithOptions = function() {
|
|
339 |
|
340 |
jQuery.sgcolorbox(SG_POPUP_SETTINGS);
|
341 |
|
342 |
-
|
343 |
if(countryStatus == true && typeof SgUserData != "undefined") {
|
344 |
jQuery.cookie("SG_POPUP_USER_COUNTRY_NAME", SgUserData.countryIsoName, { expires: 365});
|
345 |
}
|
@@ -347,7 +359,7 @@ SGPopup.prototype.sgShowColorboxWithOptions = function() {
|
|
347 |
sgCookieData = '';
|
348 |
jQuery.cookie.defaults = {path:'/'};
|
349 |
var currentCookie = jQuery.cookie('sgPopupDetails');
|
350 |
-
|
351 |
if(typeof currentCookie == 'undefined') {
|
352 |
openCounter = 1;
|
353 |
}
|
@@ -364,7 +376,7 @@ SGPopup.prototype.sgShowColorboxWithOptions = function() {
|
|
364 |
}
|
365 |
|
366 |
if (that.popupContentClick) {
|
367 |
-
|
368 |
/* If has url for redirect */
|
369 |
if((contentClickBehavior !== 'close' || clickRedirectToUrl !== '') && typeof contentClickBehavior !== 'undefined') {
|
370 |
jQuery('#sgcolorbox').css({
|
@@ -378,11 +390,13 @@ SGPopup.prototype.sgShowColorboxWithOptions = function() {
|
|
378 |
else {
|
379 |
window.location = clickRedirectToUrl;
|
380 |
}
|
381 |
-
|
382 |
});
|
383 |
}
|
384 |
|
385 |
jQuery('#sgcolorbox').bind('sgPopupClose', function(e) {
|
|
|
|
|
386 |
jQuery('#sgcolorbox').removeClass(customClassName); /* Remove custom class for another popup */
|
387 |
jQuery('#sgcboxOverlay').removeClass(customClassName);
|
388 |
jQuery('#sgcolorbox').removeClass(popupEffect); /* Remove animated effect for another popup */
|
20 |
var that = this;
|
21 |
|
22 |
this.onCompleate();
|
23 |
+
jQuery(".sg-show-popup").each(function() {
|
24 |
+
var popupEvent = jQuery(this).attr("data-popup-event");
|
25 |
+
if(typeof popupEvent == 'undefined') {
|
26 |
+
popupEvent = 'click';
|
27 |
+
}
|
28 |
+
/* For counting execute and did it one time for popup open */
|
29 |
+
sgEventExecuteCount = 0;
|
30 |
+
jQuery(this).bind(popupEvent, function() {
|
31 |
+
++sgEventExecuteCount;
|
32 |
+
if(sgEventExecuteCount > 1) {
|
33 |
+
return;
|
34 |
+
}
|
35 |
+
var sgPopupID = jQuery(this).attr("data-sgpopupid");
|
36 |
+
that.showPopup(sgPopupID,false);
|
37 |
+
});
|
38 |
});
|
39 |
}
|
40 |
|
41 |
SGPopup.prototype.onCompleate = function() {
|
42 |
|
43 |
jQuery("#sgcolorbox").bind("sgColorboxOnCompleate", function() {
|
44 |
+
|
45 |
/* Scroll only inside popup */
|
46 |
jQuery('#sgcboxLoadedContent').isolatedScroll();
|
47 |
});
|
191 |
if (popupShortCode && popupHtml == false) {
|
192 |
popupHtml = popupShortCode;
|
193 |
}
|
194 |
+
|
195 |
if(popupHtml && popupWidth == '' && popupHeight == '' && popupMaxWidth =='' && popupMaxHeight == '') {
|
196 |
+
|
197 |
jQuery(popupHtml).find('img:first').attr('onload', 'jQuery.sgcolorbox.resize();');
|
198 |
}
|
199 |
if (popupIframeUrl) {
|
304 |
if (popupOverlayColor) {
|
305 |
jQuery("#sgcboxOverlay").css({'background' : 'none', 'background-color' : popupOverlayColor});
|
306 |
}
|
307 |
+
|
308 |
jQuery('#sgcolorbox').trigger("sgColorboxOnOpen", []);
|
309 |
},
|
310 |
onLoad: function(){
|
317 |
if(popupWidth == '' && popupHeight == '') {
|
318 |
jQuery.sgcolorbox.resize();
|
319 |
}
|
320 |
+
|
321 |
var sgpopupInit = new SgPopupInit(that.popupData);
|
322 |
sgpopupInit.overallInit();
|
323 |
/* For specific popup Like Countdown AgeRestcion popups */
|
324 |
sgpopupInit.initByPopupType();
|
325 |
+
|
326 |
},
|
327 |
onClosed: function() {
|
328 |
jQuery('#sgcolorbox').trigger("sgPopupClose", []);
|
351 |
|
352 |
jQuery.sgcolorbox(SG_POPUP_SETTINGS);
|
353 |
|
354 |
+
|
355 |
if(countryStatus == true && typeof SgUserData != "undefined") {
|
356 |
jQuery.cookie("SG_POPUP_USER_COUNTRY_NAME", SgUserData.countryIsoName, { expires: 365});
|
357 |
}
|
359 |
sgCookieData = '';
|
360 |
jQuery.cookie.defaults = {path:'/'};
|
361 |
var currentCookie = jQuery.cookie('sgPopupDetails');
|
362 |
+
|
363 |
if(typeof currentCookie == 'undefined') {
|
364 |
openCounter = 1;
|
365 |
}
|
376 |
}
|
377 |
|
378 |
if (that.popupContentClick) {
|
379 |
+
|
380 |
/* If has url for redirect */
|
381 |
if((contentClickBehavior !== 'close' || clickRedirectToUrl !== '') && typeof contentClickBehavior !== 'undefined') {
|
382 |
jQuery('#sgcolorbox').css({
|
390 |
else {
|
391 |
window.location = clickRedirectToUrl;
|
392 |
}
|
393 |
+
|
394 |
});
|
395 |
}
|
396 |
|
397 |
jQuery('#sgcolorbox').bind('sgPopupClose', function(e) {
|
398 |
+
/* reset event execute count for popup open */
|
399 |
+
sgEventExecuteCount = 0;
|
400 |
jQuery('#sgcolorbox').removeClass(customClassName); /* Remove custom class for another popup */
|
401 |
jQuery('#sgcboxOverlay').removeClass(customClassName);
|
402 |
jQuery('#sgcolorbox').removeClass(popupEffect); /* Remove animated effect for another popup */
|
javascript/sg_popup_javascript.php
CHANGED
@@ -7,16 +7,18 @@ function sg_set_admin_url($hook) {
|
|
7 |
}
|
8 |
|
9 |
function sg_popup_admin_scripts($hook) {
|
|
|
10 |
if ( 'popup-builder_page_edit-popup' == $hook || 'popup-builder_page_create-popup' == $hook || 'popup-builder_page_subscribers' == $hook) {
|
11 |
|
12 |
wp_enqueue_media();
|
13 |
-
wp_register_script('javascript', SG_APP_POPUP_URL . '/javascript/sg_popup_backend.js', array('jquery'));
|
14 |
wp_enqueue_script('jquery');
|
15 |
wp_enqueue_script('javascript');
|
16 |
|
17 |
}
|
18 |
else if('toplevel_page_PopupBuilder' == $hook){
|
19 |
-
wp_register_script('javascript', SG_APP_POPUP_URL . '/javascript/sg_popup_backend.js', array('jquery'));
|
|
|
20 |
wp_enqueue_script('javascript');
|
21 |
if(POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
|
22 |
wp_register_script('sg_popup_pro', SG_APP_POPUP_URL . '/javascript/sg_popup_backend_pro.js');
|
7 |
}
|
8 |
|
9 |
function sg_popup_admin_scripts($hook) {
|
10 |
+
|
11 |
if ( 'popup-builder_page_edit-popup' == $hook || 'popup-builder_page_create-popup' == $hook || 'popup-builder_page_subscribers' == $hook) {
|
12 |
|
13 |
wp_enqueue_media();
|
14 |
+
wp_register_script('javascript', SG_APP_POPUP_URL . '/javascript/sg_popup_backend.js', array('jquery', 'wp-color-picker'));
|
15 |
wp_enqueue_script('jquery');
|
16 |
wp_enqueue_script('javascript');
|
17 |
|
18 |
}
|
19 |
else if('toplevel_page_PopupBuilder' == $hook){
|
20 |
+
wp_register_script('javascript', SG_APP_POPUP_URL . '/javascript/sg_popup_backend.js', array('jquery', 'wp-color-picker'));
|
21 |
+
wp_enqueue_script('jquery');
|
22 |
wp_enqueue_script('javascript');
|
23 |
if(POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
|
24 |
wp_register_script('sg_popup_pro', SG_APP_POPUP_URL . '/javascript/sg_popup_backend_pro.js');
|
javascript/sg_popup_support_plugins.js
CHANGED
@@ -30,5 +30,20 @@ jQuery(document).ready(function() {
|
|
30 |
jQuery('.pdfemb-viewer').pdfEmbedder();
|
31 |
}
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
});
|
|
|
34 |
});
|
30 |
jQuery('.pdfemb-viewer').pdfEmbedder();
|
31 |
}
|
32 |
|
33 |
+
/* Google Maps Easy */
|
34 |
+
if(typeof(gmpAllMapsInfo) !== 'undefined' && gmpAllMapsInfo && gmpAllMapsInfo.length) {
|
35 |
+
for(var i = 0; i < gmpAllMapsInfo.length; i++) {
|
36 |
+
if(jQuery('#'+ gmpAllMapsInfo[i].view_html_id).size()) {
|
37 |
+
gmpInitMapOnPage( gmpAllMapsInfo[i] );
|
38 |
+
}
|
39 |
+
}
|
40 |
+
}
|
41 |
+
});
|
42 |
+
|
43 |
+
/* Gravity forms Supprt when happen ajax call our js init */
|
44 |
+
jQuery(document).bind('gform_post_render', function(event, formId){
|
45 |
+
var obj = new SGPopup();
|
46 |
+
obj.init();
|
47 |
});
|
48 |
+
|
49 |
});
|
popup-builder.php
CHANGED
@@ -3,12 +3,13 @@
|
|
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.2.
|
7 |
* Author: Sygnoos
|
8 |
* Author URI: http://www.sygnoos.com
|
9 |
* License: GPLv2
|
10 |
*/
|
11 |
|
|
|
12 |
require_once(dirname(__FILE__)."/config.php");
|
13 |
|
14 |
require_once(SG_APP_POPUP_CLASSES .'/SGPopup.php');
|
@@ -161,14 +162,42 @@ function sgShowShortCode($args, $content)
|
|
161 |
if(!empty($content)) {
|
162 |
sgRenderPopupScript($args['id']);
|
163 |
$attr = '';
|
|
|
164 |
|
165 |
if(isset($args['insidepopup'])) {
|
166 |
$attr .= 'insidePopup="on"';
|
167 |
}
|
168 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
}
|
170 |
else {
|
171 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
}
|
173 |
$shortcodeContent = ob_get_contents();
|
174 |
ob_end_clean();
|
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.2.8
|
7 |
* Author: Sygnoos
|
8 |
* Author URI: http://www.sygnoos.com
|
9 |
* License: GPLv2
|
10 |
*/
|
11 |
|
12 |
+
|
13 |
require_once(dirname(__FILE__)."/config.php");
|
14 |
|
15 |
require_once(SG_APP_POPUP_CLASSES .'/SGPopup.php');
|
162 |
if(!empty($content)) {
|
163 |
sgRenderPopupScript($args['id']);
|
164 |
$attr = '';
|
165 |
+
$eventName = @$args['event'];
|
166 |
|
167 |
if(isset($args['insidepopup'])) {
|
168 |
$attr .= 'insidePopup="on"';
|
169 |
}
|
170 |
+
if(@$args['event'] == 'onload') {
|
171 |
+
$content = '';
|
172 |
+
}
|
173 |
+
if(!isset($args['event'])) {
|
174 |
+
$eventName = 'click';
|
175 |
+
}
|
176 |
+
echo "<a href='javascript:void(0)' class='sg-show-popup' data-sgpopupid=".@$args['id']." $attr data-popup-event=".$eventName.">".$content."</a>";
|
177 |
}
|
178 |
else {
|
179 |
+
/* Free user does not have QUEUE possibility */
|
180 |
+
if(POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
|
181 |
+
$page = get_queried_object_id();
|
182 |
+
$popupsId = SgPopupPro::allowPopupInAllPages($page);
|
183 |
+
|
184 |
+
/* When have many popups in current page */
|
185 |
+
if(count($popupsId) > 0) {
|
186 |
+
/* Add shordcode popup id in the QUEUE for php side */
|
187 |
+
array_push($popupsId,$args['id']);
|
188 |
+
/* Add shordcode popup id at the first in the QUEUE for javascript side */
|
189 |
+
echo "<script type=\"text/javascript\">SG_POPUPS_QUEUE.splice(0, 0, ".$args['id'].");</script>";
|
190 |
+
update_option("SG_MULTIPLE_POPUP",$popupsId);
|
191 |
+
sgRenderPopupScript($args['id']);
|
192 |
+
}
|
193 |
+
else {
|
194 |
+
echo redenderScriptMode($args['id']);
|
195 |
+
}
|
196 |
+
}
|
197 |
+
else {
|
198 |
+
echo redenderScriptMode($args['id']);
|
199 |
+
}
|
200 |
+
|
201 |
}
|
202 |
$shortcodeContent = ob_get_contents();
|
203 |
ob_end_clean();
|
readme.txt
CHANGED
@@ -58,7 +58,7 @@ With popup builder plugin you can insert any type of content, right into your Po
|
|
58 |
|
59 |
* Create countdown popup - your site is under construction and you are planning to open it in some amount of time, in this case countdown popup is exactly for you.
|
60 |
|
61 |
-
* Exit Intent popup - catch your users attention when they decide to leave your site without doing any of the things you want them to do. Exit
|
62 |
|
63 |
* Subscription popup - this kind of popup provides the easiest way to create an efficient connection between users and your website through subscription popup. With this simple popup solution you can quickly collect subscribers in a very pleasant and elegant way.
|
64 |
|
@@ -134,6 +134,13 @@ Go to the Popup Builder settings and set your desired options.
|
|
134 |
|
135 |
== Changelog ==
|
136 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
= Version 2.2.6 =
|
138 |
* Bug fixed with redirection logic.
|
139 |
|
@@ -353,7 +360,7 @@ Leave us a good review :)
|
|
353 |
|
354 |
== Upgrade Notice ==
|
355 |
|
356 |
-
Current Version of Popup Builder is 2.2.
|
357 |
|
358 |
== Other Notes ==
|
359 |
|
58 |
|
59 |
* Create countdown popup - your site is under construction and you are planning to open it in some amount of time, in this case countdown popup is exactly for you.
|
60 |
|
61 |
+
* Exit Intent popup - catch your users attention when they decide to leave your site without doing any of the things you want them to do. Exit-Intent popup can briefly interrupt them with a popup message, steering them towards a singular call to action.
|
62 |
|
63 |
* Subscription popup - this kind of popup provides the easiest way to create an efficient connection between users and your website through subscription popup. With this simple popup solution you can quickly collect subscribers in a very pleasant and elegant way.
|
64 |
|
134 |
|
135 |
== Changelog ==
|
136 |
|
137 |
+
= Version 2.2.8 =
|
138 |
+
* Bug fixed connected to version 2.2.7
|
139 |
+
|
140 |
+
= Version 2.2.7 =
|
141 |
+
* Shortcode bug fixed.
|
142 |
+
* Show popup on element hover (New Feature).
|
143 |
+
|
144 |
= Version 2.2.6 =
|
145 |
* Bug fixed with redirection logic.
|
146 |
|
360 |
|
361 |
== Upgrade Notice ==
|
362 |
|
363 |
+
Current Version of Popup Builder is 2.2.8
|
364 |
|
365 |
== Other Notes ==
|
366 |
|