Version Description
- Fix - Further fixes for TinyMCE while being loaded out of WP-editor context.
- Fix - Hide 'add button' setting now also doesn't show Tinymce button
Download this release
Release Info
Developer | basszje |
Plugin | WordPress Button Plugin MaxButtons |
Version | 7.5.2 |
Comparing to | |
See all releases |
Code changes from version 7.5.1 to 7.5.2
- assets/integrations/siteorigins_builder/fields/maxbutton.class.php +0 -15
- classes/maxbuttons-class.php +13 -16
- js/init.js +0 -1
- js/maxajax.js +1 -1
- js/media_button.js +7 -5
- js/min/maxajax.js +1 -1
- js/min/media_button.js +1 -1
- js/min/tinymce.js +1 -1
- js/tinymce.js +1 -1
- maxbuttons.php +3 -3
- readme.txt +7 -2
assets/integrations/siteorigins_builder/fields/maxbutton.class.php
CHANGED
@@ -99,21 +99,6 @@ class MaxButton_Widget_Field_MaxButton extends \SiteOrigin_Widget_Field_Base {
|
|
99 |
return false;
|
100 |
}
|
101 |
|
102 |
-
/*function renderShortcode(shortcode)
|
103 |
-
{
|
104 |
-
var maxajax = window.maxFoundry.maxAjax;
|
105 |
-
var data = maxajax.ajaxInit();
|
106 |
-
data['plugin_action'] = 'shortcode';
|
107 |
-
data['shortcode'] = shortcode;
|
108 |
-
|
109 |
-
maxajax.ajaxPost(data, function(result) {
|
110 |
-
if (result)
|
111 |
-
{
|
112 |
-
var result = JSON.parse(result);
|
113 |
-
jQuery('.mbselected.' + mbbutton_number).find(".the_button").html(result.shortcode);
|
114 |
-
}
|
115 |
-
});
|
116 |
-
} */
|
117 |
|
118 |
function openButtonModal()
|
119 |
{
|
99 |
return false;
|
100 |
}
|
101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
|
103 |
function openButtonModal()
|
104 |
{
|
classes/maxbuttons-class.php
CHANGED
@@ -446,8 +446,6 @@ class maxButtonsPlugin
|
|
446 |
if (! $this->debug_mode)
|
447 |
$js_url .= 'min/';
|
448 |
|
449 |
-
//$this->load_library('fontawesome');
|
450 |
-
|
451 |
wp_register_script('mb-media-button', $js_url . 'media_button.js', array('jquery', 'maxbuttons-modal', 'maxbuttons-ajax'), $version, true);
|
452 |
|
453 |
$this->load_modal_script();
|
@@ -485,23 +483,24 @@ class maxButtonsPlugin
|
|
485 |
if ( ! current_user_can( 'edit_posts' ) && ! current_user_can( 'edit_pages' ) ) {
|
486 |
return;
|
487 |
}
|
|
|
|
|
|
|
488 |
// Media buttons
|
489 |
add_action('media_buttons', array($this,'media_button'), 20);
|
490 |
|
491 |
add_filter('mce_buttons', array($this, 'tinymce_button'));
|
492 |
add_filter('mce_external_plugins', array($this, 'add_tinymce_button'));
|
493 |
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
} );
|
504 |
-
}
|
505 |
|
506 |
}
|
507 |
|
@@ -512,9 +511,6 @@ class maxButtonsPlugin
|
|
512 |
function media_button($editor_id) {
|
513 |
$output = '';
|
514 |
|
515 |
-
// options
|
516 |
-
if (get_option('maxbuttons_noshowtinymce') == 1) return;
|
517 |
-
|
518 |
$this->load_media_script();
|
519 |
|
520 |
// Only run in post/page creation and edit screens
|
@@ -534,6 +530,7 @@ class maxButtonsPlugin
|
|
534 |
|
535 |
public function tinymce_button($buttons)
|
536 |
{
|
|
|
537 |
$buttons[] = 'maxbutton';
|
538 |
return $buttons;
|
539 |
}
|
446 |
if (! $this->debug_mode)
|
447 |
$js_url .= 'min/';
|
448 |
|
|
|
|
|
449 |
wp_register_script('mb-media-button', $js_url . 'media_button.js', array('jquery', 'maxbuttons-modal', 'maxbuttons-ajax'), $version, true);
|
450 |
|
451 |
$this->load_modal_script();
|
483 |
if ( ! current_user_can( 'edit_posts' ) && ! current_user_can( 'edit_pages' ) ) {
|
484 |
return;
|
485 |
}
|
486 |
+
// option
|
487 |
+
if (get_option('maxbuttons_noshowtinymce') == 1) return;
|
488 |
+
|
489 |
// Media buttons
|
490 |
add_action('media_buttons', array($this,'media_button'), 20);
|
491 |
|
492 |
add_filter('mce_buttons', array($this, 'tinymce_button'));
|
493 |
add_filter('mce_external_plugins', array($this, 'add_tinymce_button'));
|
494 |
|
495 |
+
add_action('before_wp_tiny_mce', function($settings) {
|
496 |
+
$icon_url = MB()->get_plugin_url() . 'images/mb-peach-32.png';
|
497 |
+
echo "<script type='text/javascript'>
|
498 |
+
var maxButtonsTinyMCE = {
|
499 |
+
'icon': '$icon_url'
|
500 |
+
};
|
501 |
+
</script>";
|
502 |
+
});
|
503 |
+
|
|
|
|
|
504 |
|
505 |
}
|
506 |
|
511 |
function media_button($editor_id) {
|
512 |
$output = '';
|
513 |
|
|
|
|
|
|
|
514 |
$this->load_media_script();
|
515 |
|
516 |
// Only run in post/page creation and edit screens
|
530 |
|
531 |
public function tinymce_button($buttons)
|
532 |
{
|
533 |
+
|
534 |
$buttons[] = 'maxbutton';
|
535 |
return $buttons;
|
536 |
}
|
js/init.js
CHANGED
@@ -6,7 +6,6 @@ jQuery(document).ready(function(jq) {
|
|
6 |
|
7 |
function runMaxInit()
|
8 |
{
|
9 |
-
|
10 |
if (typeof window.maxFoundry === 'undefined')
|
11 |
window.maxFoundry = {};
|
12 |
|
6 |
|
7 |
function runMaxInit()
|
8 |
{
|
|
|
9 |
if (typeof window.maxFoundry === 'undefined')
|
10 |
window.maxFoundry = {};
|
11 |
|
js/maxajax.js
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
|
2 |
/** New AJAX Call methods
|
3 |
/* Get the standard AJAX vars for this plugin */
|
4 |
-
|
5 |
function maxAjax() {
|
6 |
this.spinnerFunction = this.showSpinner;
|
7 |
this.successHandler = this.defaultSuccesHandler;
|
8 |
this.errorHandler = this.defaultErrorHandler;
|
|
|
9 |
}
|
10 |
|
11 |
maxAjax.prototype.init = function()
|
1 |
|
2 |
/** New AJAX Call methods
|
3 |
/* Get the standard AJAX vars for this plugin */
|
|
|
4 |
function maxAjax() {
|
5 |
this.spinnerFunction = this.showSpinner;
|
6 |
this.successHandler = this.defaultSuccesHandler;
|
7 |
this.errorHandler = this.defaultErrorHandler;
|
8 |
+
|
9 |
}
|
10 |
|
11 |
maxAjax.prototype.init = function()
|
js/media_button.js
CHANGED
@@ -12,19 +12,20 @@ jQuery(document).ready(function(jq) {
|
|
12 |
shortcodeData: null,
|
13 |
getPage: 1,
|
14 |
ajaxSuccessHandler: null,
|
15 |
-
|
16 |
-
|
17 |
};
|
18 |
|
19 |
function maxMedia() {
|
20 |
-
|
|
|
21 |
{
|
22 |
window.maxFoundry.maxmodal = new maxModal();
|
23 |
window.maxFoundry.maxmodal.init();
|
24 |
}
|
25 |
-
if (typeof window.maxFoundry.maxAjax
|
26 |
{
|
|
|
27 |
window.maxFoundry.maxAjax = new maxAjax();
|
|
|
28 |
window.maxFoundry.maxAjax.init();
|
29 |
}
|
30 |
|
@@ -32,6 +33,7 @@ jQuery(document).ready(function(jq) {
|
|
32 |
this.maxajax = window.maxFoundry.maxAjax;
|
33 |
}
|
34 |
|
|
|
35 |
// here the vars go.
|
36 |
maxMedia.prototype.init = function(options)
|
37 |
{
|
@@ -204,7 +206,7 @@ jQuery(document).ready(function(jq) {
|
|
204 |
this.maxajax.ajaxPost(data, this.ajaxSuccessHandler);
|
205 |
}
|
206 |
|
207 |
-
|
208 |
|
209 |
maxMedia.prototype.doPagination = function (e)
|
210 |
{
|
12 |
shortcodeData: null,
|
13 |
getPage: 1,
|
14 |
ajaxSuccessHandler: null,
|
|
|
|
|
15 |
};
|
16 |
|
17 |
function maxMedia() {
|
18 |
+
|
19 |
+
if (typeof window.maxFoundry.maxmodal !== 'object')
|
20 |
{
|
21 |
window.maxFoundry.maxmodal = new maxModal();
|
22 |
window.maxFoundry.maxmodal.init();
|
23 |
}
|
24 |
+
if (typeof window.maxFoundry.maxAjax !== 'object')
|
25 |
{
|
26 |
+
|
27 |
window.maxFoundry.maxAjax = new maxAjax();
|
28 |
+
|
29 |
window.maxFoundry.maxAjax.init();
|
30 |
}
|
31 |
|
33 |
this.maxajax = window.maxFoundry.maxAjax;
|
34 |
}
|
35 |
|
36 |
+
|
37 |
// here the vars go.
|
38 |
maxMedia.prototype.init = function(options)
|
39 |
{
|
206 |
this.maxajax.ajaxPost(data, this.ajaxSuccessHandler);
|
207 |
}
|
208 |
|
209 |
+
|
210 |
|
211 |
maxMedia.prototype.doPagination = function (e)
|
212 |
{
|
js/min/maxajax.js
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
|
2 |
/** New AJAX Call methods
|
3 |
/* Get the standard AJAX vars for this plugin */
|
4 |
-
|
5 |
function maxAjax() {
|
6 |
this.spinnerFunction = this.showSpinner;
|
7 |
this.successHandler = this.defaultSuccesHandler;
|
8 |
this.errorHandler = this.defaultErrorHandler;
|
|
|
9 |
}
|
10 |
|
11 |
maxAjax.prototype.init = function()
|
1 |
|
2 |
/** New AJAX Call methods
|
3 |
/* Get the standard AJAX vars for this plugin */
|
|
|
4 |
function maxAjax() {
|
5 |
this.spinnerFunction = this.showSpinner;
|
6 |
this.successHandler = this.defaultSuccesHandler;
|
7 |
this.errorHandler = this.defaultErrorHandler;
|
8 |
+
|
9 |
}
|
10 |
|
11 |
maxAjax.prototype.init = function()
|
js/min/media_button.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function(t){function o(){
|
1 |
+
jQuery(document).ready(function(t){function o(){"object"!=typeof window.maxFoundry.maxmodal&&(window.maxFoundry.maxmodal=new maxModal,window.maxFoundry.maxmodal.init()),"object"!=typeof window.maxFoundry.maxAjax&&(window.maxFoundry.maxAjax=new maxAjax,window.maxFoundry.maxAjax.init()),this.maxmodal=window.maxFoundry.maxmodal,this.maxajax=window.maxFoundry.maxAjax}$=t,(o.prototype={parent:"body",is_active:!1,maxmodal:null,maxajax:null,callback:null,useShortCodeOptions:!0,shortcodeData:null,getPage:1,ajaxSuccessHandler:null}).init=function(t){void 0!==t&&(void 0!==t.callback&&(this.callback=t.callback||null),void 0!==t.useShortCodeOptions&&(this.useShortCodeOptions=t.useShortCodeOptions),void 0!==t.parent&&(this.parent=t.parent)),this.ajaxSuccessHandler=$.proxy(this.putContent,this),$(document).off("click",".pagination span, .pagination-links a",$.proxy(this.doPagination,this)),$(document).on("click",".pagination span, .pagination-links a",$.proxy(this.doPagination,this)),$(document).off("media_button_content_buttons_load",$.proxy(this.hookButtonAction,this)),$(document).on("media_button_content_buttons_load",$.proxy(this.hookButtonAction,this)),$(document).off("media_button_content_shortcode_options",$.proxy(this.hookShortCodeAction,this)),$(document).on("media_button_content_shortcode_options",$.proxy(this.hookShortCodeAction,this))},o.prototype.openModal=function(){this.maxmodal.newModal("media-popup"),this.maxmodal.parent=this.parent,this.maxmodal.setTitle(mbtrans.windowtitle),this.maxmodal.setContent('<span class="loading"></span>'),this.maxmodal.show(),this.maxajax.showSpinner($(".loading")),this.loadButtons(),this.is_active=!0},o.prototype.loadButtons=function(){var t=this.maxajax.ajaxInit();t.plugin_action="getAjaxButtons",t.page=this.getPage,this.maxajax.ajaxPost(t,this.ajaxSuccessHandler)},o.prototype.putContent=function(t){t=JSON.parse(t);this.maxajax.removeSpinner(),void 0!==t.output&&this.maxmodal.setContent(t.output),void 0!==t.action&&$(document).trigger("media_button_content_"+t.action,t)},o.prototype.hookButtonAction=function(){$(document).off("click",".button-list"),$(document).on("click",".button-list",$.proxy(function(t){var o=$(t.target);void 0===$(o).data("button")&&(o=$(o).parents(".button-list"));var a=$(o).data("button");$(".button-list").removeClass("selected"),$(o).addClass("selected"),$(".controls .button-primary").data("button",a),this.maxmodal.currentModal.find(".controls .button-primary").removeClass("disabled")},this)),$(document).off("click",".button-preview a"),$(document).on("click",".button-preview a",function(t){t.preventDefault()}),this.maxmodal.resetControls(),this.useShortCodeOptions?this.maxmodal.addControl(mbtrans.use,"",$.proxy(this.shortCodeOptions,this)):this.maxmodal.addControl(mbtrans.insert,"",$.proxy(this.selectAction,this)),this.maxmodal.setControls(),this.maxmodal.currentModal.find(".controls .button-primary").addClass("disabled"),this.maxmodal.checkResize()},o.prototype.hookShortCodeAction=function(t,o){this.shortcodeData=o.shortcodeData;var a=o.button_id;this.maxmodal.resetControls(),this.maxmodal.addControl(mbtrans.insert,"",$.proxy(this.selectAction,this)),this.maxmodal.setControls(),$(this.maxmodal.currentModal).find(".controls .button-primary").data("button",a),$(this.maxmodal.currentModal).find(".more-options a").off("click"),$(this.maxmodal.currentModal).find(".more-options a").on("click",$.proxy(function(t){$(this.maxmodal.currentModal).find(".more-field").show(),$(t.target).parents(".option .more").hide(),this.maxmodal.checkResize()},this)),this.maxmodal.checkResize()},o.prototype.selectAction=function(t){if(t.preventDefault(),!$(t.target).hasClass("disabled")){var o=$(t.target).data("button");void 0===o||parseInt(o)<=0||("function"==typeof this.callback?this.callback(o,$(t.target)):(this.buttonToEditor(o),this.close()))}},o.prototype.shortCodeOptions=function(t){if(t.preventDefault(),!$(t.target).hasClass("disabled")){var o=$(t.target).data("button"),a=this.maxajax.ajaxInit();a.plugin_action="mediaShortcodeOptions",a.button_id=o,this.maxajax.ajaxPost(a,this.ajaxSuccessHandler)}},o.prototype.doPagination=function(t){if(t.preventDefault(),$(t.target).hasClass("disabled"))return!1;var o=$(t.target).data("page");o<=1&&(o=1),this.getPage=o,this.loadButtons()},o.prototype.generateShortcode=function(t){var o='[maxbutton id="'+t+'"';return void 0!==this.shortcodeData&&$(this.shortcodeData).each(function(t,a){var n=$('input[name="'+a.name+'"]'),i=$('input[name="'+a.name+'"]').val();if("checkbox"==n.attr("type")){var e=n.is(":checked");e!=a.original&&(o+=e?" "+a.shortcode+'="'+a.checked+'"':" "+a.shortcode+'="'+a.unchecked+'"')}else i!=a.original&&(o+=" "+a.shortcode+'="'+i+'"')}),o+=" ] "},o.prototype.buttonToEditor=function(t){shortcode=this.generateShortcode(t),window.send_to_editor(shortcode,t)},o.prototype.close=function(){this.maxmodal.close()},void 0===window.maxFoundry&&(window.maxFoundry={}),window.maxFoundry.maxMedia=o});
|
js/min/tinymce.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
tinymce.create("tinymce.plugins.maxButtons",{init:function(n,t){n.addButton("maxbutton",{title:"Insert MaxButton",image:maxButtonsTinyMCE.icon,onclick:function(){var n=new window.maxFoundry.maxMedia;n.init(),n.openModal()}})},createControl:function(n,t){return null}}),tinymce.PluginManager.add("maxButtons_tinymce",tinymce.plugins.maxButtons);
|
1 |
+
tinymce.create("tinymce.plugins.maxButtons",{init:function(n,t){n.addButton("maxbutton",{title:"Insert MaxButton",image:"undefined"!=typeof maxButtonsTinyMCE?maxButtonsTinyMCE.icon:null,onclick:function(){var n=new window.maxFoundry.maxMedia;n.init(),n.openModal()}})},createControl:function(n,t){return null}}),tinymce.PluginManager.add("maxButtons_tinymce",tinymce.plugins.maxButtons);
|
js/tinymce.js
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
|
9 |
ed.addButton( 'maxbutton', {
|
10 |
title : 'Insert MaxButton',
|
11 |
-
image : maxButtonsTinyMCE.icon,
|
12 |
onclick : function() {
|
13 |
var mm = new window.maxFoundry.maxMedia();
|
14 |
mm.init();
|
8 |
|
9 |
ed.addButton( 'maxbutton', {
|
10 |
title : 'Insert MaxButton',
|
11 |
+
image : (typeof maxButtonsTinyMCE !== 'undefined') ? maxButtonsTinyMCE.icon : null,
|
12 |
onclick : function() {
|
13 |
var mm = new window.maxFoundry.maxMedia();
|
14 |
mm.init();
|
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: 7.5.
|
7 |
Author: Max Foundry
|
8 |
Author URI: http://maxfoundry.com
|
9 |
Text Domain: maxbuttons
|
@@ -16,9 +16,9 @@ namespace MaxButtons;
|
|
16 |
if (! defined('MAXBUTTONS_ROOT_FILE'))
|
17 |
define("MAXBUTTONS_ROOT_FILE", __FILE__);
|
18 |
if (! defined('MAXBUTTONS_VERSION_NUM'))
|
19 |
-
define('MAXBUTTONS_VERSION_NUM', '7.5.
|
20 |
|
21 |
-
define('MAXBUTTONS_RELEASE',"
|
22 |
|
23 |
|
24 |
if (! function_exists('MaxButtons\maxbutton_double_load'))
|
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: 7.5.2
|
7 |
Author: Max Foundry
|
8 |
Author URI: http://maxfoundry.com
|
9 |
Text Domain: maxbuttons
|
16 |
if (! defined('MAXBUTTONS_ROOT_FILE'))
|
17 |
define("MAXBUTTONS_ROOT_FILE", __FILE__);
|
18 |
if (! defined('MAXBUTTONS_VERSION_NUM'))
|
19 |
+
define('MAXBUTTONS_VERSION_NUM', '7.5.2');
|
20 |
|
21 |
+
define('MAXBUTTONS_RELEASE',"26 Sept 2018");
|
22 |
|
23 |
|
24 |
if (! function_exists('MaxButtons\maxbutton_double_load'))
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: wordpress button plugin, share button, wordpress buttons, css3 button gene
|
|
4 |
Requires at least: 4.8
|
5 |
Tested up to: 4.9.8
|
6 |
Requires PHP: 5.4
|
7 |
-
Stable tag: 7.5.
|
8 |
|
9 |
WordPress button plugin so powerful and easy to use anyone can create beautiful buttons, share buttons and social icons.
|
10 |
|
@@ -255,9 +255,14 @@ Secondly, please use latin only characters for button name ( Basic settings) and
|
|
255 |
|
256 |
== Changelog ==
|
257 |
|
|
|
|
|
|
|
|
|
|
|
258 |
= 7.5.1 =
|
259 |
|
260 |
-
* Fix - Error when loading tinymce button resulted in crash for some users
|
261 |
|
262 |
= 7.5 =
|
263 |
|
4 |
Requires at least: 4.8
|
5 |
Tested up to: 4.9.8
|
6 |
Requires PHP: 5.4
|
7 |
+
Stable tag: 7.5.2
|
8 |
|
9 |
WordPress button plugin so powerful and easy to use anyone can create beautiful buttons, share buttons and social icons.
|
10 |
|
255 |
|
256 |
== Changelog ==
|
257 |
|
258 |
+
= 7.5.2 =
|
259 |
+
|
260 |
+
* Fix - Further fixes for TinyMCE while being loaded out of WP-editor context.
|
261 |
+
* Fix - Hide 'add button' setting now also doesn't show Tinymce button
|
262 |
+
|
263 |
= 7.5.1 =
|
264 |
|
265 |
+
* Fix - Error when loading tinymce button resulted in crash for some users (PHP 5.3)
|
266 |
|
267 |
= 7.5 =
|
268 |
|