WordPress Button Plugin MaxButtons - Version 6.18

Version Description

  • Fixed bug where scrollbar didn't show in Add Button dialog
  • Extra check for multi-byte string support
Download this release

Release Info

Developer basszje
Plugin Icon 128x128 WordPress Button Plugin MaxButtons
Version 6.18
Comparing to
See all releases

Code changes from version 6.17 to 6.18

assets/libraries/url_slug.php CHANGED
@@ -15,7 +15,7 @@
15
  * @return string
16
  */
17
  function mb_url_slug($str, $options = array()) {
18
- if (! function_exists('mb_convert_encoding'))
19
  return $str;
20
 
21
  // Make sure string is in UTF-8 and strip invalid UTF-8 characters
15
  * @return string
16
  */
17
  function mb_url_slug($str, $options = array()) {
18
+ if (! function_exists('mb_convert_encoding') || ! function_exists('mb_list_encodings') )
19
  return $str;
20
 
21
  // Make sure string is in UTF-8 and strip invalid UTF-8 characters
blocks/tpl/option_select.tpl ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ {if:label} <label for='%%id%%' class='color'>%%label%%</label> {/if:label}
2
+ {if:before_input} %%before_input%% {/if:before_input}
3
+ <div class="input option_select %%name%%" {if:conditional}data-show="%%conditional%%"{/if:conditional}>
4
+ <select name='%%name%%' id='%%id%%'>
5
+ {for:options}
6
+ <option name='%%key%%'>%%item%%</option>
7
+ {/for:options}
8
+ </select>
9
+ </div>
classes/field.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
  namespace MaxButtons;
 
3
 
4
  class maxField
5
  {
@@ -104,7 +105,6 @@ class maxField
104
  echo $output;
105
  do_action('mb/editor/after-field-'. $this->id); // hook for extra fields.
106
 
107
-
108
  $this->output = $output;
109
  return $output;
110
  }
1
  <?php
2
  namespace MaxButtons;
3
+ defined('ABSPATH') or die('No direct access permitted');
4
 
5
  class maxField
6
  {
105
  echo $output;
106
  do_action('mb/editor/after-field-'. $this->id); // hook for extra fields.
107
 
 
108
  $this->output = $output;
109
  return $output;
110
  }
js/maxbuttons-admin.js CHANGED
@@ -64,7 +64,7 @@ maxAdmin.prototype.init = function () {
64
  cancel: '.nodrag',
65
  });
66
 
67
- $('.color-field').wpColorPicker(
68
  {
69
  width: 300,
70
 
@@ -755,6 +755,92 @@ maxAdmin.prototype.saveDone = function (res)
755
  }
756
  }
757
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
758
 
759
  }); /* END OF JQUERY */
760
 
64
  cancel: '.nodrag',
65
  });
66
 
67
+ $('#maxbuttons .color-field').wpColorPicker(
68
  {
69
  width: 300,
70
 
755
  }
756
  }
757
 
758
+ /** New AJAX Call methods
759
+ /* Get the standard AJAX vars for this plugin */
760
+ maxAdmin.prototype.ajaxInit = function()
761
+ {
762
+ data = {
763
+ action: mb_ajax.ajax_action,
764
+ nonce: mb_ajax.nonce,
765
+ }
766
+
767
+ return data;
768
+ }
769
+
770
+ /* Ajax call functionality for modules etc. */
771
+ maxAdmin.prototype.ajaxCall = function (e)
772
+ {
773
+
774
+ e.preventDefault();
775
+ var target = e.target;
776
+
777
+ var param = false;
778
+ var plugin_action = $(target).data('action');
779
+ var check_param = $(target).data('param');
780
+ var param_input = $(target).data('param-input');
781
+
782
+ if (typeof check_param !== 'undefined')
783
+ param = check_param;
784
+ if (typeof param_input !== 'undefined')
785
+ param = $(param_input).val();
786
+
787
+ data = this.ajaxInit();
788
+
789
+ data['plugin_action'] = plugin_action;
790
+ data['param'] = param;
791
+ data['post'] = $('form').serialize(); // send it all
792
+
793
+ this.showSpinner(target);
794
+
795
+ this.ajaxPost(data);
796
+ }
797
+
798
+ maxAdmin.prototype.showSpinner = function(target)
799
+ {
800
+ var spinner = '<div class="ajax-load-spinner"></div>';
801
+ $('.ajax-load-spinner').remove();
802
+ $(target).after(spinner);
803
+ //return spinner;
804
+ }
805
+
806
+ maxAdmin.prototype.ajaxPost = function(data, successHandler, errorHandler)
807
+ {
808
+
809
+ if (typeof successHandler == 'undefined')
810
+ {
811
+
812
+ var action = data['plugin_action'];
813
+
814
+ var successHandler = function(data)
815
+ {
816
+
817
+ //$(data['spinner']).remove();
818
+ $(document).trigger('mb_ajax_success',[ action, data ]);
819
+ $(document).trigger('mb_ajax_success_' + action, data);
820
+ };
821
+ }
822
+
823
+ if (typeof errorHandler == 'undefined')
824
+ {
825
+ var errorHandler = function (jq,status,error)
826
+ {
827
+ $(document).trigger('mb_ajax_error_' + action, jq, status, error);
828
+ console.log(jq);
829
+ console.log(status);
830
+ console.log(error);
831
+ };
832
+ }
833
+
834
+
835
+ $.ajax({
836
+ type: "POST",
837
+ url: mb_ajax.ajaxurl,
838
+ data: data,
839
+ success: successHandler,
840
+ error: errorHandler,
841
+ });
842
+ }
843
+
844
 
845
  }); /* END OF JQUERY */
846
 
js/maxbuttons_media_button.js CHANGED
@@ -235,6 +235,7 @@ maxMedia.prototype.putResults = function(res)
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));
@@ -245,6 +246,7 @@ maxMedia.prototype.putResults = function(res)
245
  $(document).trigger('mb_media_put_results', [res, this.maxm] );
246
  }
247
 
 
248
  maxMedia.prototype.resize = function(e)
249
  {
250
  //contentHeight = this.maxm.currentModal.find('.modal_content').height();
235
  this.maxm.setContent(res);
236
  this.maxm.setControls();
237
  this.maxm.checkResize();
238
+ this.resize();
239
 
240
  // this feature resizes
241
  $(window).on('resize', $.proxy(this.resize, this));
246
  $(document).trigger('mb_media_put_results', [res, this.maxm] );
247
  }
248
 
249
+ /** Contains the -inner- window to force scrollbar if inner part is bigger. **/
250
  maxMedia.prototype.resize = function(e)
251
  {
252
  //contentHeight = this.maxm.currentModal.find('.modal_content').height();
js/maxmodal.js CHANGED
@@ -96,7 +96,7 @@ jQuery(document).ready(function($) {
96
  {
97
  this.windowHeight = $(window).height();
98
  this.windowWidth = $(window).width();
99
-
100
  if (this.currentModal === null)
101
  return;
102
 
96
  {
97
  this.windowHeight = $(window).height();
98
  this.windowWidth = $(window).width();
99
+
100
  if (this.currentModal === null)
101
  return;
102
 
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.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});
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(),this.resize(),$(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.17
7
  Author: Max Foundry
8
  Author URI: http://maxfoundry.com
9
  Text Domain: maxbuttons
@@ -12,6 +12,11 @@ Domain Path: /languages
12
  Copyright 2017 Max Foundry, LLC (http://maxfoundry.com)
13
  */
14
 
 
 
 
 
 
15
  if (! function_exists('maxbuttons_php52_nono'))
16
  {
17
  function maxbuttons_php52_nono()
@@ -44,10 +49,6 @@ if (function_exists("MB"))
44
  }
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);
53
  // define("MAXBUTTONS_BENCHMARK",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.18
7
  Author: Max Foundry
8
  Author URI: http://maxfoundry.com
9
  Text Domain: maxbuttons
12
  Copyright 2017 Max Foundry, LLC (http://maxfoundry.com)
13
  */
14
 
15
+ define("MAXBUTTONS_ROOT_FILE", __FILE__);
16
+ define('MAXBUTTONS_VERSION_NUM', '6.18');
17
+ define('MAXBUTTONS_RELEASE',"10 Apr 2017");
18
+
19
+
20
  if (! function_exists('maxbuttons_php52_nono'))
21
  {
22
  function maxbuttons_php52_nono()
49
  }
50
 
51
 
 
 
 
 
52
  // In case of development, copy this to wp-config.php
53
  // define("MAXBUTTONS_DEBUG", true);
54
  // define("MAXBUTTONS_BENCHMARK",true);
readme.txt CHANGED
@@ -3,7 +3,7 @@ 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
 
@@ -245,6 +245,11 @@ This depends on the slider plugin you are using. Most of the well-known ones are
245
 
246
  == Changelog ==
247
 
 
 
 
 
 
248
  = 6.17 =
249
 
250
  * Button load data hook added
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.18
7
 
8
  WordPress button plugin so powerful and easy to use anyone can create beautiful buttons and social share icons.
9
 
245
 
246
  == Changelog ==
247
 
248
+ = 6.18 =
249
+
250
+ * Fixed bug where scrollbar didn't show in Add Button dialog
251
+ * Extra check for multi-byte string support
252
+
253
  = 6.17 =
254
 
255
  * Button load data hook added