Version Description
Release date: 19 April 2018
We've added duplicate buttons! Oh, and we have changed the name of 'Page categories' to 'Page rules'.
New features: - Duplicate buttons
Bug fixes: - Button order - Serval PHP notices
Download this release
Release Info
Developer | buttonizer |
Plugin | Smart Floating / Sticky Buttons – Call, Sharing, Chat Widgets & More – Buttonizer |
Version | 1.5 |
Comparing to | |
See all releases |
Code changes from version 1.4.5 to 1.5
- buttonizer.php +2 -2
- classes/Admin/Admin.php +3 -3
- classes/Admin/Buttons.php +5 -2
- classes/Admin/PageCategories.php +2 -1
- classes/Button.php +8 -7
- css/style.css +0 -3
- js/dashboard.js +76 -25
- readme.txt +13 -1
buttonizer.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Buttonizer - Smart Floating Action Button
|
4 |
Plugin URI: https://buttonizer.pro
|
5 |
Description: The Buttonizer is a new way to give a boost to your number of interactions, actions and conversions from your website visitor by adding one or multiple Customizable Smart Floating Button in the corner of your website.
|
6 |
-
Version: 1.
|
7 |
Author: Buttonizer
|
8 |
Author URI: https://buttonizer.pro
|
9 |
License: GPL2
|
@@ -34,7 +34,7 @@ define('BUTTONIZER_NAME', 'buttonizer');
|
|
34 |
define('BUTTONIZER_DIR', dirname(__FILE__));
|
35 |
define('BUTTONIZER_SLUG', basename(BUTTONIZER_DIR));
|
36 |
define('BUTTONIZER_PLUGIN_DIR', __FILE__ );
|
37 |
-
define('BUTTONIZER_VERSION','1.
|
38 |
|
39 |
# No script kiddies
|
40 |
defined( 'ABSPATH' ) or die('No script kiddies please!');
|
3 |
Plugin Name: Buttonizer - Smart Floating Action Button
|
4 |
Plugin URI: https://buttonizer.pro
|
5 |
Description: The Buttonizer is a new way to give a boost to your number of interactions, actions and conversions from your website visitor by adding one or multiple Customizable Smart Floating Button in the corner of your website.
|
6 |
+
Version: 1.5
|
7 |
Author: Buttonizer
|
8 |
Author URI: https://buttonizer.pro
|
9 |
License: GPL2
|
34 |
define('BUTTONIZER_DIR', dirname(__FILE__));
|
35 |
define('BUTTONIZER_SLUG', basename(BUTTONIZER_DIR));
|
36 |
define('BUTTONIZER_PLUGIN_DIR', __FILE__ );
|
37 |
+
define('BUTTONIZER_VERSION','1.5');
|
38 |
|
39 |
# No script kiddies
|
40 |
defined( 'ABSPATH' ) or die('No script kiddies please!');
|
classes/Admin/Admin.php
CHANGED
@@ -370,16 +370,16 @@ class Admin {
|
|
370 |
|
371 |
/* Buttonizer Page Categories */
|
372 |
private function register_buttonizer_page_categories() {
|
373 |
-
$this->aPluginTabs['buttonizer_page_categories'] = __('Page
|
374 |
|
375 |
register_setting( 'buttonizer_page_categories', 'buttonizer_page_categories');
|
376 |
|
377 |
// FAB Button Settings
|
378 |
add_settings_section(
|
379 |
'buttonizer_page_categories', // ID
|
380 |
-
'Page
|
381 |
|
382 |
-
<a href="javascript:buttonizer.categories.add()" id="new-button" class="button button-primary"><i class="fa fa-plus"></i> New
|
383 |
array( $this, 'getPagePageCategories' ), // Callback
|
384 |
'buttonizer_page_categories' // Page
|
385 |
);
|
370 |
|
371 |
/* Buttonizer Page Categories */
|
372 |
private function register_buttonizer_page_categories() {
|
373 |
+
$this->aPluginTabs['buttonizer_page_categories'] = __('Page rules', BUTTONIZER_SLUG);
|
374 |
|
375 |
register_setting( 'buttonizer_page_categories', 'buttonizer_page_categories');
|
376 |
|
377 |
// FAB Button Settings
|
378 |
add_settings_section(
|
379 |
'buttonizer_page_categories', // ID
|
380 |
+
'Page rules <a href="javascript:buttonizer.categories.save()" class="button button-primary save-category savebutton_margin"><i class="fa fa-floppy-o"></i> Save</a>
|
381 |
|
382 |
+
<a href="javascript:buttonizer.categories.add()" id="new-button" class="button button-primary"><i class="fa fa-plus"></i> New page rule</a>', // Title
|
383 |
array( $this, 'getPagePageCategories' ), // Callback
|
384 |
'buttonizer_page_categories' // Page
|
385 |
);
|
classes/Admin/Buttons.php
CHANGED
@@ -94,14 +94,17 @@ class Buttons
|
|
94 |
|
95 |
<a href="javascript:buttonizer.removeRow(<?php
|
96 |
echo $iButtonId ;
|
97 |
-
?>)" class="delete-button"
|
|
|
|
|
|
|
98 |
|
99 |
<a href="javascript:buttonizer.toggleMobile(<?php
|
100 |
echo $iButtonId ;
|
101 |
?>)" class="mobiledesktop mobile-button <?php
|
102 |
echo ( $onMobile == "" ? 'selected' : '' ) ;
|
103 |
?>"><i class="fa fa-mobile"></i></a>
|
104 |
-
|
105 |
echo $iButtonId ;
|
106 |
?>)" class="mobiledesktop desktop-button <?php
|
107 |
echo ( $onDesktop == "" ? 'selected' : '' ) ;
|
94 |
|
95 |
<a href="javascript:buttonizer.removeRow(<?php
|
96 |
echo $iButtonId ;
|
97 |
+
?>)" class="delete-button"><i class="fa fa-trash-o"></i></a>
|
98 |
+
<a href="javascript:buttonizer.copyRow(<?php
|
99 |
+
echo $iButtonId ;
|
100 |
+
?>)" class="mobiledesktop selected copy-button"><i class="fa fa-copy"></i></a>
|
101 |
|
102 |
<a href="javascript:buttonizer.toggleMobile(<?php
|
103 |
echo $iButtonId ;
|
104 |
?>)" class="mobiledesktop mobile-button <?php
|
105 |
echo ( $onMobile == "" ? 'selected' : '' ) ;
|
106 |
?>"><i class="fa fa-mobile"></i></a>
|
107 |
+
<a href="javascript:buttonizer.toggleDesktop(<?php
|
108 |
echo $iButtonId ;
|
109 |
?>)" class="mobiledesktop desktop-button <?php
|
110 |
echo ( $onDesktop == "" ? 'selected' : '' ) ;
|
classes/Admin/PageCategories.php
CHANGED
@@ -54,7 +54,8 @@ class PageCategories
|
|
54 |
You cannot edit the \'All pages\' item.
|
55 |
</div>
|
56 |
</div>' ;
|
57 |
-
echo '<script>jQuery("h2 #new-button").click(buttonizer.proInfoWindow);</script><div class="buttonizer-pro-text"><i class="fa fa-lock"></i> You are missing the fun! When upgrading to <a href="admin.php?page=Buttonizer-pricing">Buttonizer Pro</a> you will unlock page
|
|
|
58 |
echo '</div>' ;
|
59 |
echo '<script>buttonizer.categories.initialize(/* READY */);</script>' ;
|
60 |
}
|
54 |
You cannot edit the \'All pages\' item.
|
55 |
</div>
|
56 |
</div>' ;
|
57 |
+
echo '<script>jQuery("h2 #new-button").click(buttonizer.proInfoWindow);</script><div class="buttonizer-pro-text" style="text-align: center"><i class="fa fa-lock"></i> You are missing the fun! When upgrading to <a href="admin.php?page=Buttonizer-pricing">Buttonizer Pro</a> you will unlock page rules. Look at an example how it works:</div>' ;
|
58 |
+
echo '<img src="https://i.gyazo.com/a9f311ff026963d7c5d5f5234856d4f1.gif" style="display: block; margin: 0px auto; max-width: 100%;" />' ;
|
59 |
echo '</div>' ;
|
60 |
echo '<script>buttonizer.categories.initialize(/* READY */);</script>' ;
|
61 |
}
|
classes/Button.php
CHANGED
@@ -100,6 +100,7 @@ class Button
|
|
100 |
private function generate()
|
101 |
{
|
102 |
$aButtons = ( isset( $this->aButtons['buttonorder'] ) && is_array( $this->aButtons['buttonorder'] ) ? $this->aButtons['buttonorder'] : [] );
|
|
|
103 |
foreach ( $aButtons as $sKey => $iId ) {
|
104 |
if ( '-1' == $iId ) {
|
105 |
continue;
|
@@ -109,7 +110,7 @@ class Button
|
|
109 |
if ( 'continue' == $sButton ) {
|
110 |
continue;
|
111 |
} else {
|
112 |
-
$this->sOutput
|
113 |
}
|
114 |
|
115 |
$this->iAmountOfButtons++;
|
@@ -567,7 +568,7 @@ class Button
|
|
567 |
|
568 |
}
|
569 |
|
570 |
-
list( $sShadowColorRed, $sShadowColorGreen, $sShadowColorBlue ) = sscanf( $this->aSettings['button_unpushed'], "#%02x%02x%02x" );
|
571 |
// Mobile button size vs Desktop button size
|
572 |
|
573 |
if ( $this->bIsMobile ) {
|
@@ -579,9 +580,9 @@ class Button
|
|
579 |
echo '
|
580 |
<style>
|
581 |
.buttonizer-button a:hover,
|
582 |
-
.buttonizer-button a:focus{ background:' . $this->aSettings['button_pushed'] . '; }
|
583 |
-
.buttonizer-button a { background:' . $this->aSettings['button_unpushed'] . '; }
|
584 |
-
.buttonizer-button a i { color: ' . $this->aSettings['icon_color'] . '; }
|
585 |
|
586 |
.buttonizer-button a.buttonizer_head, .buttonizer-button a.buttonizer_head i {
|
587 |
height: ' . $iconSize . 'px !important;
|
@@ -614,8 +615,8 @@ class Button
|
|
614 |
}
|
615 |
|
616 |
.buttonizer-button a .text{
|
617 |
-
background-color: ' . $this->aSettings['label_color'] . ';
|
618 |
-
color: ' . $this->aSettings['
|
619 |
}
|
620 |
|
621 |
|
100 |
private function generate()
|
101 |
{
|
102 |
$aButtons = ( isset( $this->aButtons['buttonorder'] ) && is_array( $this->aButtons['buttonorder'] ) ? $this->aButtons['buttonorder'] : [] );
|
103 |
+
krsort( $aButtons );
|
104 |
foreach ( $aButtons as $sKey => $iId ) {
|
105 |
if ( '-1' == $iId ) {
|
106 |
continue;
|
110 |
if ( 'continue' == $sButton ) {
|
111 |
continue;
|
112 |
} else {
|
113 |
+
$this->sOutput .= $sButton;
|
114 |
}
|
115 |
|
116 |
$this->iAmountOfButtons++;
|
568 |
|
569 |
}
|
570 |
|
571 |
+
list( $sShadowColorRed, $sShadowColorGreen, $sShadowColorBlue ) = sscanf( ( isset( $this->aSettings['button_unpushed'] ) ? $this->aSettings['button_unpushed'] : '#1D9BDB' ), "#%02x%02x%02x" );
|
572 |
// Mobile button size vs Desktop button size
|
573 |
|
574 |
if ( $this->bIsMobile ) {
|
580 |
echo '
|
581 |
<style>
|
582 |
.buttonizer-button a:hover,
|
583 |
+
.buttonizer-button a:focus{ background:' . (( isset( $this->aSettings['button_pushed'] ) ? $this->aSettings['button_pushed'] : '' )) . '; }
|
584 |
+
.buttonizer-button a { background:' . (( isset( $this->aSettings['button_unpushed'] ) ? $this->aSettings['button_unpushed'] : '' )) . '; }
|
585 |
+
.buttonizer-button a i { color: ' . (( isset( $this->aSettings['icon_color'] ) ? $this->aSettings['icon_color'] : '' )) . '; }
|
586 |
|
587 |
.buttonizer-button a.buttonizer_head, .buttonizer-button a.buttonizer_head i {
|
588 |
height: ' . $iconSize . 'px !important;
|
615 |
}
|
616 |
|
617 |
.buttonizer-button a .text{
|
618 |
+
background-color: ' . (( isset( $this->aSettings['label_color'] ) ? $this->aSettings['label_color'] : '#4e4c4c' )) . ';
|
619 |
+
color: ' . (( isset( $this->aSettings['label_text_color'] ) ? $this->aSettings['label_text_color'] : '#FFFFFF' )) . ';
|
620 |
}
|
621 |
|
622 |
|
css/style.css
CHANGED
@@ -195,13 +195,10 @@ h2 .button {
|
|
195 |
.button-row .row-info .delete-button {
|
196 |
color: #c31414;
|
197 |
float: right;
|
198 |
-
font-size: 13px;
|
199 |
text-decoration: none;
|
200 |
-
margin-left: 15px;
|
201 |
}
|
202 |
|
203 |
.button-row .row-info .delete-button i {
|
204 |
-
font-size: 14px;
|
205 |
margin-right: 5px;
|
206 |
}
|
207 |
|
195 |
.button-row .row-info .delete-button {
|
196 |
color: #c31414;
|
197 |
float: right;
|
|
|
198 |
text-decoration: none;
|
|
|
199 |
}
|
200 |
|
201 |
.button-row .row-info .delete-button i {
|
|
|
202 |
margin-right: 5px;
|
203 |
}
|
204 |
|
js/dashboard.js
CHANGED
@@ -158,6 +158,16 @@ var buttonizer = {
|
|
158 |
iconImageHandler: function(currentContainer) {
|
159 |
var type = currentContainer.data("type");
|
160 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
// Chooser
|
162 |
currentContainer.find(".placeholder-choose a").click(function() {
|
163 |
if(type == 'image') {
|
@@ -188,10 +198,42 @@ var buttonizer = {
|
|
188 |
currentContainer.find('.button-preview img').attr( 'src', attachment.url).show();
|
189 |
currentContainer.find(".button-preview").show();
|
190 |
|
191 |
-
currentContainer.find('
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
})
|
193 |
.open();
|
194 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
},
|
196 |
|
197 |
colorPaletHandler: function(colorPalet) {
|
@@ -535,7 +577,7 @@ var buttonizer = {
|
|
535 |
jQuery("#btn_row_" + rowId + " .row-info .must-save-button").show();
|
536 |
},
|
537 |
|
538 |
-
addRow: function() {
|
539 |
if(jQuery("#new-button").hasClass('disabled')) {
|
540 |
return;
|
541 |
}
|
@@ -546,15 +588,21 @@ var buttonizer = {
|
|
546 |
var isCategory = jQuery(".button-row[button-id=-1]").hasClass("is_category");
|
547 |
|
548 |
jQuery("#new-button").attr('disabled', 'disabled').addClass('disabled');
|
549 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
550 |
var numberOfButtons = jQuery(".button-row").length - (isCategory ? 1 : 0);
|
551 |
|
552 |
numberOfButtons = Math.floor(Date.now() / 1000);
|
553 |
numberOfButtons = numberOfButtons + "-" + Math.floor((Math.random() * 999) + 100);
|
554 |
numberOfButtons = numberOfButtons.replace('-', '');
|
555 |
|
556 |
-
var newData = defaultRow.replace('
|
557 |
-
newData = newData.replace(
|
558 |
|
559 |
jQuery("#button-rows, #page-categories").append((!isCategory ? '<li>' : '') + '<div class="button-row ' + (isCategory ? 'is_category' : '') + '" id="btn_row_'+ numberOfButtons +'" button-id="'+ numberOfButtons +'">' + newData + '</div>' + (!isCategory ? '</li>' : ''));
|
560 |
|
@@ -579,18 +627,9 @@ var buttonizer = {
|
|
579 |
|
580 |
buttonizer.setTimouts.b = setTimeout(function() {
|
581 |
buttonizer.initButtons();
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
jQuery("#btn_row_"+ numberOfButtons + " input.button_title").focus();
|
586 |
-
}else{
|
587 |
-
console.log("Initialize new page category");
|
588 |
-
jQuery("#btn_row_"+ numberOfButtons + " #categoryIsUsed").val(numberOfButtons);
|
589 |
-
jQuery("#btn_row_"+ numberOfButtons + " #categoryIsUsed").attr("name", buttonizer.settings.wpCategorySaveKey + '[categorieOrder][]');
|
590 |
-
jQuery("#btn_row_"+ numberOfButtons + " .delete-button").attr("href", "javascript:buttonizer.removeRow("+ numberOfButtons +")");
|
591 |
-
jQuery("#btn_row_"+ numberOfButtons + " .button_title").attr("name", buttonizer.settings.wpCategorySaveKey + "[category_"+ numberOfButtons +"_title]").val('New page category ' + (jQuery(".button-row").length - 1));
|
592 |
-
jQuery("#btn_row_"+ numberOfButtons + " .row-title").html("New page category " + (jQuery(".button-row").length - 1));
|
593 |
-
}
|
594 |
buttonizer.faInit();
|
595 |
buttonizer.loadPageCategorie();
|
596 |
jQuery("#new-button").removeAttr('disabled').removeClass('disabled');
|
@@ -599,6 +638,10 @@ var buttonizer = {
|
|
599 |
}, 400);
|
600 |
},
|
601 |
|
|
|
|
|
|
|
|
|
602 |
updateRowInputNames: function(buttonId) {
|
603 |
// Textfield
|
604 |
jQuery("#btn_row_"+ buttonId + " .button_textfield")
|
@@ -636,35 +679,35 @@ var buttonizer = {
|
|
636 |
.attr("name", buttonizer.settings.wpButtonSaveKey + "[button_"+ buttonId +"_show_on_phone]")
|
637 |
.attr("id", "button_"+ buttonId +"_show_on_phone");
|
638 |
|
639 |
-
jQuery("label[for='button_"+
|
640 |
|
641 |
// Show on desktop
|
642 |
jQuery("#btn_row_"+ buttonId + " .button_showondesktop")
|
643 |
.attr("name", buttonizer.settings.wpButtonSaveKey + "[button_"+ buttonId +"_show_on_desktop]")
|
644 |
.attr("id", "button_"+ buttonId +"_show_on_desktop");
|
645 |
|
646 |
-
jQuery("label[for='button_"+
|
647 |
|
648 |
// Url
|
649 |
jQuery("#btn_row_"+ buttonId + " .button_isurl")
|
650 |
.attr("name", buttonizer.settings.wpButtonSaveKey + "[button_"+ buttonId +"_url]")
|
651 |
.attr("id", "button_"+ buttonId +"_url");
|
652 |
|
653 |
-
jQuery("label[for='button_"+
|
654 |
|
655 |
// Is phone buttonId
|
656 |
jQuery("#btn_row_"+ buttonId + " .button_isphonenumber")
|
657 |
.attr("name", buttonizer.settings.wpButtonSaveKey + "[button_"+ buttonId +"_is_phonenumber]")
|
658 |
.attr("id", "button_"+ buttonId +"_is_phonenumber");
|
659 |
|
660 |
-
jQuery("label[for='button_"+
|
661 |
|
662 |
// New tab
|
663 |
jQuery("#btn_row_"+ buttonId + " .button_isnewtab")
|
664 |
.attr("name", buttonizer.settings.wpButtonSaveKey + "[button_"+ buttonId +"_url_newtab]")
|
665 |
.attr("id", "button_"+ buttonId +"_url_newtab");
|
666 |
|
667 |
-
jQuery("label[for='button_"+
|
668 |
|
669 |
|
670 |
// Show only on opening hours
|
@@ -672,28 +715,36 @@ var buttonizer = {
|
|
672 |
.attr("name", buttonizer.settings.wpButtonSaveKey + "[button_"+ buttonId +"_show_when_opened]")
|
673 |
.attr("id", "button_"+ buttonId +"_show_when_opened");
|
674 |
|
675 |
-
jQuery("label[for='button_"+
|
676 |
|
677 |
// Show only on opening hours
|
678 |
jQuery("#btn_row_"+ buttonId + " .button_showlabelonhover")
|
679 |
.attr("name", buttonizer.settings.wpButtonSaveKey + "[button_"+ buttonId +"_show_label_on_hover]")
|
680 |
.attr("id", "button_"+ buttonId +"_show_label_on_hover");
|
681 |
|
682 |
-
jQuery("label[for='button_"+
|
683 |
|
684 |
// Custom class
|
685 |
jQuery("#btn_row_"+ buttonId + " .button_custom_class")
|
686 |
.attr("name", buttonizer.settings.wpButtonSaveKey + "[button_"+ buttonId +"_custom_class]")
|
687 |
.attr("id", "button_"+ buttonId +"_custom_class");
|
688 |
|
689 |
-
jQuery("label[for='button_"+
|
|
|
|
|
|
|
|
|
|
|
690 |
|
|
|
691 |
/*
|
692 |
* Link fixes
|
693 |
*/
|
694 |
// Delete button link
|
695 |
jQuery("#btn_row_"+ buttonId + " .delete-button").attr("href", "javascript:buttonizer.removeRow("+ buttonId +")");
|
696 |
|
|
|
|
|
697 |
// Show on mobile button link
|
698 |
jQuery("#btn_row_"+ buttonId + " .mobiledesktop.mobile-button").attr("href", "javascript:buttonizer.toggleMobile("+ buttonId +")");
|
699 |
|
158 |
iconImageHandler: function(currentContainer) {
|
159 |
var type = currentContainer.data("type");
|
160 |
|
161 |
+
// Init
|
162 |
+
if(currentContainer.find(".image-background-checkbox").is(":checked")) {
|
163 |
+
currentContainer.find('.button-preview').css({
|
164 |
+
'background-image': "url('"+ currentContainer.find(".field_image_data").val() +"')",
|
165 |
+
'background-size': 'cover',
|
166 |
+
'background-position': 'center center'
|
167 |
+
});
|
168 |
+
currentContainer.find('.button-preview img').hide();
|
169 |
+
}
|
170 |
+
|
171 |
// Chooser
|
172 |
currentContainer.find(".placeholder-choose a").click(function() {
|
173 |
if(type == 'image') {
|
198 |
currentContainer.find('.button-preview img').attr( 'src', attachment.url).show();
|
199 |
currentContainer.find(".button-preview").show();
|
200 |
|
201 |
+
currentContainer.find('.field_image_data').val(attachment.url);
|
202 |
+
|
203 |
+
if(currentContainer.find(".image-background-checkbox").is(":checked")) {
|
204 |
+
currentContainer.find('.button-preview').css({
|
205 |
+
'background-image': "url('"+ attachment.url +"')",
|
206 |
+
'background-size': 'cover',
|
207 |
+
'background-position': 'center center'
|
208 |
+
});
|
209 |
+
currentContainer.find('.button-preview img').hide();
|
210 |
+
}
|
211 |
})
|
212 |
.open();
|
213 |
});
|
214 |
+
|
215 |
+
// Insert image and icon type
|
216 |
+
currentContainer.find(".image-background-checkbox").click(function(e) {
|
217 |
+
var attachment = currentContainer.find(".field_image_data").val();
|
218 |
+
|
219 |
+
console.log(attachment);
|
220 |
+
|
221 |
+
if(!jQuery(this).is(":checked")) {
|
222 |
+
currentContainer.find('img').attr('src', attachment).show();
|
223 |
+
|
224 |
+
currentContainer.find('.button-preview').css({
|
225 |
+
'background-image': "",
|
226 |
+
'background-size': 'cover'
|
227 |
+
});
|
228 |
+
}else{
|
229 |
+
currentContainer.find('img').hide();
|
230 |
+
currentContainer.find('.button-preview').css({
|
231 |
+
'background-image': "url('"+ attachment +"')",
|
232 |
+
'background-size': 'cover',
|
233 |
+
'background-position': 'center center'
|
234 |
+
});
|
235 |
+
}
|
236 |
+
});
|
237 |
},
|
238 |
|
239 |
colorPaletHandler: function(colorPalet) {
|
577 |
jQuery("#btn_row_" + rowId + " .row-info .must-save-button").show();
|
578 |
},
|
579 |
|
580 |
+
addRow: function(copyButton) {
|
581 |
if(jQuery("#new-button").hasClass('disabled')) {
|
582 |
return;
|
583 |
}
|
588 |
var isCategory = jQuery(".button-row[button-id=-1]").hasClass("is_category");
|
589 |
|
590 |
jQuery("#new-button").attr('disabled', 'disabled').addClass('disabled');
|
591 |
+
|
592 |
+
var defaultRow = "";
|
593 |
+
if(!copyButton) {
|
594 |
+
defaultRow = jQuery(".button-row[button-id=-1]").html();
|
595 |
+
}else{
|
596 |
+
defaultRow = jQuery(".button-row[button-id="+ copyButton +"]").html();
|
597 |
+
}
|
598 |
var numberOfButtons = jQuery(".button-row").length - (isCategory ? 1 : 0);
|
599 |
|
600 |
numberOfButtons = Math.floor(Date.now() / 1000);
|
601 |
numberOfButtons = numberOfButtons + "-" + Math.floor((Math.random() * 999) + 100);
|
602 |
numberOfButtons = numberOfButtons.replace('-', '');
|
603 |
|
604 |
+
var newData = defaultRow.replace('/'+ copyButton +'/g', numberOfButtons);
|
605 |
+
newData = newData.replace(copyButton, numberOfButtons);
|
606 |
|
607 |
jQuery("#button-rows, #page-categories").append((!isCategory ? '<li>' : '') + '<div class="button-row ' + (isCategory ? 'is_category' : '') + '" id="btn_row_'+ numberOfButtons +'" button-id="'+ numberOfButtons +'">' + newData + '</div>' + (!isCategory ? '</li>' : ''));
|
608 |
|
627 |
|
628 |
buttonizer.setTimouts.b = setTimeout(function() {
|
629 |
buttonizer.initButtons();
|
630 |
+
buttonizer.updateRowInputNames(numberOfButtons);
|
631 |
+
jQuery("#btn_row_"+ numberOfButtons).addClass('opened');
|
632 |
+
jQuery("#btn_row_"+ numberOfButtons + " input.button_title").focus();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
633 |
buttonizer.faInit();
|
634 |
buttonizer.loadPageCategorie();
|
635 |
jQuery("#new-button").removeAttr('disabled').removeClass('disabled');
|
638 |
}, 400);
|
639 |
},
|
640 |
|
641 |
+
copyRow: function(id) {
|
642 |
+
this.addRow(id);
|
643 |
+
},
|
644 |
+
|
645 |
updateRowInputNames: function(buttonId) {
|
646 |
// Textfield
|
647 |
jQuery("#btn_row_"+ buttonId + " .button_textfield")
|
679 |
.attr("name", buttonizer.settings.wpButtonSaveKey + "[button_"+ buttonId +"_show_on_phone]")
|
680 |
.attr("id", "button_"+ buttonId +"_show_on_phone");
|
681 |
|
682 |
+
jQuery("label[for='button_"+ buttonId +"_show_on_phone']").attr("for", "button_"+ buttonId +"_show_on_phone");
|
683 |
|
684 |
// Show on desktop
|
685 |
jQuery("#btn_row_"+ buttonId + " .button_showondesktop")
|
686 |
.attr("name", buttonizer.settings.wpButtonSaveKey + "[button_"+ buttonId +"_show_on_desktop]")
|
687 |
.attr("id", "button_"+ buttonId +"_show_on_desktop");
|
688 |
|
689 |
+
jQuery("label[for='button_"+ buttonId +"_show_on_desktop']").attr("for", "button_"+ buttonId +"_show_on_desktop");
|
690 |
|
691 |
// Url
|
692 |
jQuery("#btn_row_"+ buttonId + " .button_isurl")
|
693 |
.attr("name", buttonizer.settings.wpButtonSaveKey + "[button_"+ buttonId +"_url]")
|
694 |
.attr("id", "button_"+ buttonId +"_url");
|
695 |
|
696 |
+
jQuery("label[for='button_"+ buttonId +"_url']").attr("for", "button_"+ buttonId +"_url");
|
697 |
|
698 |
// Is phone buttonId
|
699 |
jQuery("#btn_row_"+ buttonId + " .button_isphonenumber")
|
700 |
.attr("name", buttonizer.settings.wpButtonSaveKey + "[button_"+ buttonId +"_is_phonenumber]")
|
701 |
.attr("id", "button_"+ buttonId +"_is_phonenumber");
|
702 |
|
703 |
+
jQuery("label[for='button_"+ buttonId +"_is_phonenumber']").attr("for", "button_"+ buttonId +"_is_phonenumber");
|
704 |
|
705 |
// New tab
|
706 |
jQuery("#btn_row_"+ buttonId + " .button_isnewtab")
|
707 |
.attr("name", buttonizer.settings.wpButtonSaveKey + "[button_"+ buttonId +"_url_newtab]")
|
708 |
.attr("id", "button_"+ buttonId +"_url_newtab");
|
709 |
|
710 |
+
jQuery("label[for='button_"+ buttonId +"_url_newtab']").attr("for", "button_"+ buttonId +"_url_newtab");
|
711 |
|
712 |
|
713 |
// Show only on opening hours
|
715 |
.attr("name", buttonizer.settings.wpButtonSaveKey + "[button_"+ buttonId +"_show_when_opened]")
|
716 |
.attr("id", "button_"+ buttonId +"_show_when_opened");
|
717 |
|
718 |
+
jQuery("label[for='button_"+ buttonId +"_show_when_opened']").attr("for", "button_"+ buttonId +"_show_when_opened");
|
719 |
|
720 |
// Show only on opening hours
|
721 |
jQuery("#btn_row_"+ buttonId + " .button_showlabelonhover")
|
722 |
.attr("name", buttonizer.settings.wpButtonSaveKey + "[button_"+ buttonId +"_show_label_on_hover]")
|
723 |
.attr("id", "button_"+ buttonId +"_show_label_on_hover");
|
724 |
|
725 |
+
jQuery("label[for='button_"+ buttonId +"_show_label_on_hover']").attr("for", "button_"+ buttonId +"_show_label_on_hover");
|
726 |
|
727 |
// Custom class
|
728 |
jQuery("#btn_row_"+ buttonId + " .button_custom_class")
|
729 |
.attr("name", buttonizer.settings.wpButtonSaveKey + "[button_"+ buttonId +"_custom_class]")
|
730 |
.attr("id", "button_"+ buttonId +"_custom_class");
|
731 |
|
732 |
+
jQuery("label[for='button_"+ buttonId +"_custom_class']").attr("for", "button_"+ buttonId +"_custom_class");
|
733 |
+
|
734 |
+
// Change background
|
735 |
+
jQuery("#btn_row_"+ buttonId + " .image-background-checkbox")
|
736 |
+
.attr("name", buttonizer.settings.wpButtonSaveKey + "[button_"+ buttonId +"_image_background]")
|
737 |
+
.attr("id", buttonizer.settings.wpButtonSaveKey + "[button_"+ buttonId +"_image_background]");
|
738 |
|
739 |
+
jQuery("#btn_row_"+ buttonId + " .icon-or-image label").attr("for", buttonizer.settings.wpButtonSaveKey + "[button_"+ buttonId +"_image_background]")
|
740 |
/*
|
741 |
* Link fixes
|
742 |
*/
|
743 |
// Delete button link
|
744 |
jQuery("#btn_row_"+ buttonId + " .delete-button").attr("href", "javascript:buttonizer.removeRow("+ buttonId +")");
|
745 |
|
746 |
+
jQuery("#btn_row_"+ buttonId + " .copy-button").attr("href", "javascript:buttonizer.copyRow("+ buttonId +")");
|
747 |
+
|
748 |
// Show on mobile button link
|
749 |
jQuery("#btn_row_"+ buttonId + " .mobiledesktop.mobile-button").attr("href", "javascript:buttonizer.toggleMobile("+ buttonId +")");
|
750 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Buy plugin: https://buttonizer.pro
|
|
4 |
Tags: Conversion, action button, call, marketing, Social Sharing
|
5 |
Requires at least: 4.2
|
6 |
Tested up to: 4.9.4
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -121,6 +121,18 @@ And the beauty of all: All actions are hidden in one button. The moment a visito
|
|
121 |
In fact the Buttonizer is an addiction to use. You're website visitors will interact as never before.
|
122 |
|
123 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
= 1.4.5 =
|
125 |
Release date: 10 April 2018
|
126 |
|
4 |
Tags: Conversion, action button, call, marketing, Social Sharing
|
5 |
Requires at least: 4.2
|
6 |
Tested up to: 4.9.4
|
7 |
+
Stable tag: 1.5
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
121 |
In fact the Buttonizer is an addiction to use. You're website visitors will interact as never before.
|
122 |
|
123 |
== Changelog ==
|
124 |
+
= 1.5 =
|
125 |
+
Release date: 19 April 2018
|
126 |
+
|
127 |
+
We've added duplicate buttons! Oh, and we have changed the name of 'Page categories' to 'Page rules'.
|
128 |
+
|
129 |
+
New features:
|
130 |
+
- Duplicate buttons
|
131 |
+
|
132 |
+
Bug fixes:
|
133 |
+
- Button order
|
134 |
+
- Serval PHP notices
|
135 |
+
|
136 |
= 1.4.5 =
|
137 |
Release date: 10 April 2018
|
138 |
|