Version Description
- Button load data hook added
- Fixed - Add button dialog showing scrollbars without need in certain cases
- Fixed - Minor notice in Social share when buttons are not in database
Download this release
Release Info
Developer | basszje |
Plugin | WordPress Button Plugin MaxButtons |
Version | 6.17 |
Comparing to | |
See all releases |
Code changes from version 6.16 to 6.17
- classes/button.php +15 -10
- collections/picker-block.php +2 -1
- js/maxbuttons_media_button.js +3 -3
- js/maxmodal.js +1 -1
- js/min/maxbuttons_media_button.js +1 -1
- maxbuttons.php +3 -3
- readme.txt +13 -5
classes/button.php
CHANGED
@@ -196,7 +196,7 @@ class maxButton
|
|
196 |
$this->id = 0; // clear id
|
197 |
$this->button_css = array('normal' => array() ,':hover' => array() ,':visited' => array(), "responsive" => array());
|
198 |
$this->button_js = array();
|
199 |
-
$this->data = array();
|
200 |
$this->data = $this->save(array(),false);
|
201 |
$this->cache = '';
|
202 |
$this->button_loaded = false;
|
@@ -218,14 +218,10 @@ class maxButton
|
|
218 |
}
|
219 |
|
220 |
}
|
221 |
-
else
|
222 |
-
{
|
223 |
-
// else block does not exist in this dataset - ignoring.
|
224 |
-
//exit("Fatal: Something wrong with provider on $block ");
|
225 |
-
}
|
226 |
}
|
227 |
|
228 |
$this->id = $data["id"];
|
|
|
229 |
$this->document_id = maxButtons::getDocumentID(array("button_id" => $this->id));
|
230 |
$this->cache = isset($data["cache"]) ? trim($data["cache"]) : ''; // not set at button packs / non-dbase buttons!
|
231 |
$this->data["id"] = $this->id; // needed for certain blocks, to be button aware.
|
@@ -453,6 +449,7 @@ class maxButton
|
|
453 |
|
454 |
$data = apply_filters("mb-save-fields", array(), array() ); // load defaults
|
455 |
$data["id"] = 0;
|
|
|
456 |
do_action('mb-data-load', $data);
|
457 |
}
|
458 |
|
@@ -474,8 +471,14 @@ class maxButton
|
|
474 |
$compile = false;
|
475 |
break;
|
476 |
}
|
477 |
-
|
478 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
479 |
if ( $this->load_css == "element" || $args["preview_part"] != "full" || $args["compile"] == true) { // if css output is on element, for to compile - otherwise inline styles will not be loaded.
|
480 |
$compile = true;
|
481 |
|
@@ -484,6 +487,7 @@ class maxButton
|
|
484 |
$compile = false;
|
485 |
|
486 |
|
|
|
487 |
$domObj = $this->parse_button($mode);
|
488 |
|
489 |
maxUtils::startTime('button-parse-css-'. $this->id);
|
@@ -874,15 +878,16 @@ class maxButton
|
|
874 |
$this->data = $this->shortcode_overrides($this->data, $atts);
|
875 |
$this->data = apply_filters('mb/shortcode/data', $this->data, $atts);
|
876 |
|
877 |
-
if ($data !== $this->data)
|
878 |
{
|
879 |
$overrides = true;
|
880 |
}
|
881 |
-
|
882 |
-
if ($overrides)
|
883 |
{
|
884 |
do_action('mb-data-load', $this->data);
|
885 |
}
|
|
|
886 |
// if there are no reasons not to display; display
|
887 |
$args = array("echo" => false,
|
888 |
"load_css" => $load_css,
|
196 |
$this->id = 0; // clear id
|
197 |
$this->button_css = array('normal' => array() ,':hover' => array() ,':visited' => array(), "responsive" => array());
|
198 |
$this->button_js = array();
|
199 |
+
$this->data = array('id' => 0);
|
200 |
$this->data = $this->save(array(),false);
|
201 |
$this->cache = '';
|
202 |
$this->button_loaded = false;
|
218 |
}
|
219 |
|
220 |
}
|
|
|
|
|
|
|
|
|
|
|
221 |
}
|
222 |
|
223 |
$this->id = $data["id"];
|
224 |
+
|
225 |
$this->document_id = maxButtons::getDocumentID(array("button_id" => $this->id));
|
226 |
$this->cache = isset($data["cache"]) ? trim($data["cache"]) : ''; // not set at button packs / non-dbase buttons!
|
227 |
$this->data["id"] = $this->id; // needed for certain blocks, to be button aware.
|
449 |
|
450 |
$data = apply_filters("mb-save-fields", array(), array() ); // load defaults
|
451 |
$data["id"] = 0;
|
452 |
+
$this->data = $data;
|
453 |
do_action('mb-data-load', $data);
|
454 |
}
|
455 |
|
471 |
$compile = false;
|
472 |
break;
|
473 |
}
|
|
|
474 |
|
475 |
+
//echo "<PRE>"; print_R($this->id); print_R($this->data); echo "</PRE>";
|
476 |
+
// Apply filters for genera data override
|
477 |
+
|
478 |
+
$this->data = apply_filters('mb/button/data_before_display', $this->data, $mode, array('preview' => $preview, 'compile' => $compile) ); // hooks
|
479 |
+
$this->reloadData(); // reload
|
480 |
+
|
481 |
+
|
482 |
if ( $this->load_css == "element" || $args["preview_part"] != "full" || $args["compile"] == true) { // if css output is on element, for to compile - otherwise inline styles will not be loaded.
|
483 |
$compile = true;
|
484 |
|
487 |
$compile = false;
|
488 |
|
489 |
|
490 |
+
|
491 |
$domObj = $this->parse_button($mode);
|
492 |
|
493 |
maxUtils::startTime('button-parse-css-'. $this->id);
|
878 |
$this->data = $this->shortcode_overrides($this->data, $atts);
|
879 |
$this->data = apply_filters('mb/shortcode/data', $this->data, $atts);
|
880 |
|
881 |
+
/* if ($data !== $this->data)
|
882 |
{
|
883 |
$overrides = true;
|
884 |
}
|
885 |
+
*/
|
886 |
+
/* if ($overrides)
|
887 |
{
|
888 |
do_action('mb-data-load', $this->data);
|
889 |
}
|
890 |
+
*/
|
891 |
// if there are no reasons not to display; display
|
892 |
$args = array("echo" => false,
|
893 |
"load_css" => $load_css,
|
collections/picker-block.php
CHANGED
@@ -244,13 +244,14 @@ class pickerCollectionBlock extends collectionBlock
|
|
244 |
<div class="sortable buttons">
|
245 |
|
246 |
<?php
|
|
|
247 |
foreach($selection as $button_id)
|
248 |
{
|
249 |
echo "<div class='shortcode-container item' data-id='$button_id'>";
|
250 |
$button = MB()->getClass("button");
|
251 |
$button->set($button_id);
|
252 |
echo "<div id='maxbutton-$button_id'>";
|
253 |
-
$button->display(array( "load_css" => "inline" ));
|
254 |
echo "</div>";
|
255 |
echo "<div class='button-remove'><span class='dashicons dashicons-no'></span></div>";
|
256 |
echo "</div>";
|
244 |
<div class="sortable buttons">
|
245 |
|
246 |
<?php
|
247 |
+
|
248 |
foreach($selection as $button_id)
|
249 |
{
|
250 |
echo "<div class='shortcode-container item' data-id='$button_id'>";
|
251 |
$button = MB()->getClass("button");
|
252 |
$button->set($button_id);
|
253 |
echo "<div id='maxbutton-$button_id'>";
|
254 |
+
$button->display(array( "load_css" => "inline", 'mode' => 'preview' ));
|
255 |
echo "</div>";
|
256 |
echo "<div class='button-remove'><span class='dashicons dashicons-no'></span></div>";
|
257 |
echo "</div>";
|
js/maxbuttons_media_button.js
CHANGED
@@ -109,7 +109,8 @@ maxMedia.prototype.showShortcodeOptions = function(button_id, target)
|
|
109 |
|
110 |
|
111 |
this.maxm.setContent( options );
|
112 |
-
this.maxm.
|
|
|
113 |
}
|
114 |
|
115 |
maxMedia.prototype.addShortcodeOptions = function(e)
|
@@ -233,10 +234,9 @@ maxMedia.prototype.putResults = function(res)
|
|
233 |
this.maxm.addControl('insert', '', $.proxy(this.insertAction, this) );
|
234 |
this.maxm.setContent(res);
|
235 |
this.maxm.setControls();
|
236 |
-
this.maxm.checkResize();
|
237 |
|
238 |
// this feature resizes
|
239 |
-
this.resize();
|
240 |
$(window).on('resize', $.proxy(this.resize, this));
|
241 |
|
242 |
// events
|
109 |
|
110 |
|
111 |
this.maxm.setContent( options );
|
112 |
+
this.maxm.checkResize();
|
113 |
+
|
114 |
}
|
115 |
|
116 |
maxMedia.prototype.addShortcodeOptions = function(e)
|
234 |
this.maxm.addControl('insert', '', $.proxy(this.insertAction, this) );
|
235 |
this.maxm.setContent(res);
|
236 |
this.maxm.setControls();
|
237 |
+
this.maxm.checkResize();
|
238 |
|
239 |
// this feature resizes
|
|
|
240 |
$(window).on('resize', $.proxy(this.resize, this));
|
241 |
|
242 |
// events
|
js/maxmodal.js
CHANGED
@@ -73,7 +73,7 @@ jQuery(document).ready(function($) {
|
|
73 |
|
74 |
if (modalHeight > this.windowHeight)
|
75 |
this.currentModal.height(this.windowHeight - top - 5 + 'px');
|
76 |
-
|
77 |
this.currentModal.css('left', left + 'px');
|
78 |
this.currentModal.css('top', top + 'px');
|
79 |
this.currentModal.css('height', modalHeight);
|
73 |
|
74 |
if (modalHeight > this.windowHeight)
|
75 |
this.currentModal.height(this.windowHeight - top - 5 + 'px');
|
76 |
+
|
77 |
this.currentModal.css('left', left + 'px');
|
78 |
this.currentModal.css('top', top + 'px');
|
79 |
this.currentModal.css('height', modalHeight);
|
js/min/maxbuttons_media_button.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var maxMedia;jQuery(document).ready(function($){var maxMedia=function(){this.callback=null,this.parent="#poststuff",this.window_loaded=null,this.maxm=null,this.closeOnCallback=!0};maxMedia.prototype.init=function(){this.maxm=new maxModal,this.maxm.init(),$(document).on("click",".maxbutton_media_button",$.proxy(this.clickAddButton,this)),this.callback="this.buttonToEditor"},maxMedia.prototype.setCallback=function(callback){if("function"!=typeof callback)if("function"==typeof window[callback])callback=window[callback];else{if("function"!=typeof eval(callback))return!1;callback=eval(callback)}this.callback=callback},maxMedia.prototype.showShortcodeOptions=function(t){this.closeOnCallback=!1,$currentModal=this.maxm.currentModal;var e=$('[data-button="'+t+'"]').find(".shortcode-container");options=$('<div class="shortcode_options">'),$("<input>",{type:"hidden",id:"mb_shortcode_id",name:"button_id"}).val(t).appendTo(options),$("<h3>").text("Shortcode Options").appendTo(options),$('<div class="button_example">').append(e).appendTo(options),$("<label>",{"for":"mb_shortcode_url"}).text(mbtrans.short_url_label).appendTo(options),$("<input>",{type:"text",id:"mb_shortcode_url",name:"shortcode_url",placeholder:"http://"}).on("change, keyup",function(t){var e=$(t.target).val();$(".button_example").find(".maxbutton").prop("href",e)}).appendTo(options),$("<label>",{"for":"mb_shortcode_text"}).text(mbtrans.short_text_label).appendTo(options),$("<input>",{type:"text",name:"shortcode_text",id:"mb_shortcode_text"}).on("change, keyup",function(t){var e=$(t.target).val();$(".button_example").find(".mb-text").text(e)}).appendTo(options),$("<p>").text(mbtrans.short_options_explain).appendTo(options),$("<input>",{type:"button",name:"add_shortcode","class":"button-primary",value:mbtrans.short_add_button}).on("click",$.proxy(this.addShortcodeOptions,this)).appendTo(options),this.maxm.setContent(options),this.maxm.
|
1 |
+
var maxMedia;jQuery(document).ready(function($){var maxMedia=function(){this.callback=null,this.parent="#poststuff",this.window_loaded=null,this.maxm=null,this.closeOnCallback=!0};maxMedia.prototype.init=function(){this.maxm=new maxModal,this.maxm.init(),$(document).on("click",".maxbutton_media_button",$.proxy(this.clickAddButton,this)),this.callback="this.buttonToEditor"},maxMedia.prototype.setCallback=function(callback){if("function"!=typeof callback)if("function"==typeof window[callback])callback=window[callback];else{if("function"!=typeof eval(callback))return!1;callback=eval(callback)}this.callback=callback},maxMedia.prototype.showShortcodeOptions=function(t){this.closeOnCallback=!1,$currentModal=this.maxm.currentModal;var e=$('[data-button="'+t+'"]').find(".shortcode-container");options=$('<div class="shortcode_options">'),$("<input>",{type:"hidden",id:"mb_shortcode_id",name:"button_id"}).val(t).appendTo(options),$("<h3>").text("Shortcode Options").appendTo(options),$('<div class="button_example">').append(e).appendTo(options),$("<label>",{"for":"mb_shortcode_url"}).text(mbtrans.short_url_label).appendTo(options),$("<input>",{type:"text",id:"mb_shortcode_url",name:"shortcode_url",placeholder:"http://"}).on("change, keyup",function(t){var e=$(t.target).val();$(".button_example").find(".maxbutton").prop("href",e)}).appendTo(options),$("<label>",{"for":"mb_shortcode_text"}).text(mbtrans.short_text_label).appendTo(options),$("<input>",{type:"text",name:"shortcode_text",id:"mb_shortcode_text"}).on("change, keyup",function(t){var e=$(t.target).val();$(".button_example").find(".mb-text").text(e)}).appendTo(options),$("<p>").text(mbtrans.short_options_explain).appendTo(options),$("<input>",{type:"button",name:"add_shortcode","class":"button-primary",value:mbtrans.short_add_button}).on("click",$.proxy(this.addShortcodeOptions,this)).appendTo(options),this.maxm.setContent(options),this.maxm.checkResize()},maxMedia.prototype.addShortcodeOptions=function(t){t.preventDefault();var e=$("#mb_shortcode_url").val(),a=$("#mb_shortcode_text").val(),o=$("#mb_shortcode_id").val();this.buttonToEditor(o,e,a)},maxMedia.prototype.clickAddButton=function(t){t.preventDefault(),t.stopPropagation(),$(document).off("click",".pagination span");var e=this;"undefined"!=typeof $(t.target).data("callback")&&this.setCallback($(t.target).data("callback")),"undefined"!=typeof $(t.target).data("parent")&&(this.parent=$(t.target).data("parent")),$(document).on("click",".button-row",$.proxy(function(t){var e=$(t.target);"undefined"==typeof $(e).data("button")&&(e=$(e).parents(".button-row"));var a=$(e).data("button");$(".button-row").removeClass("selected"),$(e).addClass("selected"),$(".controls .insert").data("button",a),this.maxm.currentModal.find(".controls .insert").removeClass("disabled")},this)),$(document).on("click",".pagination span, .pagination-links a",function(t){if(t.preventDefault(),$(t.target).hasClass("disabled"))return!1;var a=$(t.target).data("page");1>=a&&(a=1),e.loadPostEditScreen(a)}),$(document).on("change",".input-paging",function(t){t.preventDefault();var a=parseInt($(t.target).val());e.loadPostEditScreen(a)}),this.loadPostEditScreen(0)},maxMedia.prototype.loadPostEditScreen=function(t){"undefined"==typeof t&&(t=0);var e={action:"getAjaxButtons",paged:t},a=mbtrans.ajax_url,o=this;return $(".media-buttons .loading").css("visibility","visible"),$.ajax({url:a,data:e,success:function(t){o.putResults(t)}}),!1},maxMedia.prototype.showPostEditScreen=function(){this.maxm.parent=this.parent,this.maxm.newModal("media-buttons"),this.maxm.setTitle(mbtrans.windowtitle),$(document).trigger("mb_media_buttons_open",this.maxm),this.maxm.show(),this.window_loaded=!0},maxMedia.prototype.putResults=function(t){this.showPostEditScreen(),$(".media-buttons .loading").css("visibility","hidden"),this.maxm.addControl("insert","",$.proxy(this.insertAction,this)),this.maxm.setContent(t),this.maxm.setControls(),this.maxm.checkResize(),$(window).on("resize",$.proxy(this.resize,this)),$(document).on("click",".maxbutton-preview",function(t){t.preventDefault()}),$(document).trigger("mb_media_put_results",[t,this.maxm])},maxMedia.prototype.resize=function(){topHeight=this.maxm.currentModal.find(".modal_header").height()+17,controlsHeight=this.maxm.currentModal.find(".controls").height()+21,modalHeight=this.maxm.currentModal.height(),this.maxm.currentModal.find(".modal_content").css("height",modalHeight-topHeight-controlsHeight),this.maxm.currentModal.find(".controls .insert").addClass("disabled")},maxMedia.prototype.insertAction=function(t){t.preventDefault();var e=$(t.target).data("button");"undefined"==typeof e||parseInt(e)<=0||("function"==typeof this.callback&&this.callback(e,$(t.target)),this.closeOnCallback&&this.maxm.close())},maxMedia.prototype.buttonToEditor=function(t,e,a){var o='[maxbutton id="'+t+'"';"undefined"!=typeof e&&e.length>1&&(o+=' url="'+e+'"'),"undefined"!=typeof a&&a.length>1&&(o+=' text="'+a+'"'),o+=" ] ",window.send_to_editor(o),this.maxm.close()},maxMedia.prototype.getEditor=function(){var t='line-height: 32px; padding-left: 40px; background: url("'+mbtrans.icon+'") no-repeat',e=$("<div>",{id:"maxbutton-add-button","class":"content"});return e.append($("<h2>",{style:t}).text(mbtrans.insert)).append($("<p>").text(mbtrans.select)).append($("<div>",{id:"mb_media_buttons"}).append('<div class="loading"></div>')),e},maxMedia=new maxMedia,maxMedia.init(),window.maxMedia=maxMedia});
|
maxbuttons.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: MaxButtons
|
4 |
Plugin URI: http://maxbuttons.com
|
5 |
Description: The best WordPress button generator. This is the free version; the Pro version <a href="http://maxbuttons.com/?ref=mbfree">can be found here</a>.
|
6 |
-
Version: 6.
|
7 |
Author: Max Foundry
|
8 |
Author URI: http://maxfoundry.com
|
9 |
Text Domain: maxbuttons
|
@@ -45,8 +45,8 @@ if (function_exists("MB"))
|
|
45 |
|
46 |
|
47 |
define("MAXBUTTONS_ROOT_FILE", __FILE__);
|
48 |
-
define('MAXBUTTONS_VERSION_NUM', '6.
|
49 |
-
define('MAXBUTTONS_RELEASE',"
|
50 |
|
51 |
// In case of development, copy this to wp-config.php
|
52 |
// define("MAXBUTTONS_DEBUG", true);
|
3 |
Plugin Name: MaxButtons
|
4 |
Plugin URI: http://maxbuttons.com
|
5 |
Description: The best WordPress button generator. This is the free version; the Pro version <a href="http://maxbuttons.com/?ref=mbfree">can be found here</a>.
|
6 |
+
Version: 6.17
|
7 |
Author: Max Foundry
|
8 |
Author URI: http://maxfoundry.com
|
9 |
Text Domain: maxbuttons
|
45 |
|
46 |
|
47 |
define("MAXBUTTONS_ROOT_FILE", __FILE__);
|
48 |
+
define('MAXBUTTONS_VERSION_NUM', '6.17');
|
49 |
+
define('MAXBUTTONS_RELEASE',"29 Mar 2017");
|
50 |
|
51 |
// In case of development, copy this to wp-config.php
|
52 |
// define("MAXBUTTONS_DEBUG", true);
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== WordPress Button Plugin MaxButtons ===
|
2 |
Contributors: maxfoundry, basszje, arcware, johnbhartley
|
3 |
-
Tags: wordpress
|
4 |
Requires at least: 4.0
|
5 |
Tested up to: 4.7.3
|
6 |
-
Stable tag: 6.
|
7 |
|
8 |
WordPress button plugin so powerful and easy to use anyone can create beautiful buttons and social share icons.
|
9 |
|
@@ -160,9 +160,11 @@ For manual installation:
|
|
160 |
|
161 |
1. Button overview - Everything in one view
|
162 |
2. Button editor - Your own look and feel
|
163 |
-
3.
|
164 |
-
4.
|
165 |
-
5.
|
|
|
|
|
166 |
|
167 |
== Frequently Asked Questions ==
|
168 |
|
@@ -243,6 +245,12 @@ This depends on the slider plugin you are using. Most of the well-known ones are
|
|
243 |
|
244 |
== Changelog ==
|
245 |
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
= 6.16 =
|
247 |
|
248 |
* New option for better accuracy of preview if site theme runs 'border-box'
|
1 |
=== WordPress Button Plugin MaxButtons ===
|
2 |
Contributors: maxfoundry, basszje, arcware, johnbhartley
|
3 |
+
Tags: wordpress buttons, wordpress buttons plugin, social icons, css3 button generator, responsive buttons, css wordpress button
|
4 |
Requires at least: 4.0
|
5 |
Tested up to: 4.7.3
|
6 |
+
Stable tag: 6.17
|
7 |
|
8 |
WordPress button plugin so powerful and easy to use anyone can create beautiful buttons and social share icons.
|
9 |
|
160 |
|
161 |
1. Button overview - Everything in one view
|
162 |
2. Button editor - Your own look and feel
|
163 |
+
3. Amazing color options
|
164 |
+
4. Social sharing - Unleash the power of the social networks
|
165 |
+
5. Simple but powerful options
|
166 |
+
6. Clear and fast output.
|
167 |
+
|
168 |
|
169 |
== Frequently Asked Questions ==
|
170 |
|
245 |
|
246 |
== Changelog ==
|
247 |
|
248 |
+
= 6.17 =
|
249 |
+
|
250 |
+
* Button load data hook added
|
251 |
+
* Fixed - Add button dialog showing scrollbars without need in certain cases
|
252 |
+
* Fixed - Minor notice in Social share when buttons are not in database
|
253 |
+
|
254 |
= 6.16 =
|
255 |
|
256 |
* New option for better accuracy of preview if site theme runs 'border-box'
|