Black Studio TinyMCE Widget - Version 2.7.1

Version Description

(2022-07-01) = * Fixed issue on Media Library with new Block-based Widgets Editor

Download this release

Release Info

Developer marcochiesi
Plugin Icon 128x128 Black Studio TinyMCE Widget
Version 2.7.1
Comparing to
See all releases

Code changes from version 2.7.0 to 2.7.1

black-studio-tinymce-widget.php CHANGED
@@ -3,11 +3,11 @@
3
  Plugin Name: Black Studio TinyMCE Widget
4
  Plugin URI: https://wordpress.org/plugins/black-studio-tinymce-widget/
5
  Description: Adds a new "Visual Editor" widget type based on the native WordPress TinyMCE editor.
6
- Version: 2.7.0
7
  Author: Black Studio
8
  Author URI: https://www.blackstudio.it
9
  Requires at least: 3.1
10
- Tested up to: 5.8
11
  License: GPLv3
12
  Text Domain: black-studio-tinymce-widget
13
  Domain Path: /languages
@@ -35,7 +35,7 @@ if ( ! class_exists( 'Black_Studio_TinyMCE_Plugin' ) ) {
35
  * @var string
36
  * @since 2.0.0
37
  */
38
- public static $version = '2.7.0';
39
 
40
  /**
41
  * The single instance of the plugin class
3
  Plugin Name: Black Studio TinyMCE Widget
4
  Plugin URI: https://wordpress.org/plugins/black-studio-tinymce-widget/
5
  Description: Adds a new "Visual Editor" widget type based on the native WordPress TinyMCE editor.
6
+ Version: 2.7.1
7
  Author: Black Studio
8
  Author URI: https://www.blackstudio.it
9
  Requires at least: 3.1
10
+ Tested up to: 6.0
11
  License: GPLv3
12
  Text Domain: black-studio-tinymce-widget
13
  Domain Path: /languages
35
  * @var string
36
  * @since 2.0.0
37
  */
38
+ public static $version = '2.7.1';
39
 
40
  /**
41
  * The single instance of the plugin class
includes/class-admin.php CHANGED
@@ -202,7 +202,7 @@ if ( ! class_exists( 'Black_Studio_TinyMCE_Admin' ) ) {
202
  wp_enqueue_style(
203
  $style,
204
  plugins_url( 'css/' . $style . $suffix. '.css', dirname( __FILE__ ) ),
205
- array(),
206
  bstw()->get_version()
207
  );
208
  }
202
  wp_enqueue_style(
203
  $style,
204
  plugins_url( 'css/' . $style . $suffix. '.css', dirname( __FILE__ ) ),
205
+ array( 'media-views' ),
206
  bstw()->get_version()
207
  );
208
  }
js/black-studio-tinymce-widget-pointer.min.js CHANGED
@@ -1,3 +1,2 @@
1
  /* Black Studio TinyMCE Widget */
2
-
3
  jQuery(document).ready(function(t){var n,o;n=0,o=bstw_pointers.pointers[n],n=t.extend(o.options,{close:function(){t.post(ajaxurl,{pointer:o.pointer_id,action:"dismiss-wp-pointer"})}}),t(o.target).pointer(n).pointer("open")});
1
  /* Black Studio TinyMCE Widget */
 
2
  jQuery(document).ready(function(t){var n,o;n=0,o=bstw_pointers.pointers[n],n=t.extend(o.options,{close:function(){t.post(ajaxurl,{pointer:o.pointer_id,action:"dismiss-wp-pointer"})}}),t(o.target).pointer(n).pointer("open")});
js/black-studio-tinymce-widget-pre33.min.js CHANGED
@@ -1,3 +1,2 @@
1
  /* Black Studio TinyMCE Widget */
2
-
3
  !function(e){function n(t){var i=null;return"string"==typeof t?i=t:"object"==typeof t&&t instanceof jQuery&&(i=e("textarea[id^=widget-black-studio-tinymce]",t.closest(bstw_data.container_selectors)).attr("id")),{activate:function(){if(e("#"+i).addClass("mceEditor"),"object"==typeof tinymce&&"function"==typeof tinymce.execCommand){this.deactivate();try{tinymce.execCommand("mceAddControl",!1,i)}catch(t){window.alert(t)}}return this},deactivate:function(){var t;return"object"==typeof tinymce&&"function"==typeof tinymce.execCommand&&this.is_tinymce_active()&&(t=tinymce.get(i).getContent(),tinymce.get(i).remove(),e("#"+i).val(t)),this},activate_after_open:function(){return"visual"===this.get_mode()&&(0===e("div.widget:has(#"+i+") :animated").size()&&!this.is_tinymce_active()&&this.is_textearea_visible()||this.is_tinymce_active()?this.set_mode("visual"):setTimeout(function(){n(i).activate_after_open()},100)),this},activate_after_ajax:function(){return"visual"===this.get_mode()&&(0===e.active&&!this.is_tinymce_active()&&this.is_textearea_visible()?this.set_mode("visual"):this.is_widget_inside_visible()&&!this.is_tinymce_active()&&setTimeout(function(){n(i).activate_after_ajax()},100)),this},get_widget:function(){return e("#"+i).closest("div.widget")},get_widget_inside:function(){return e("#"+i).closest("div.widget-inside")},get_editor_wrap:function(){return e("#"+i).closest("div.wp-editor-wrap")},get_textarea:function(){return e("#"+i)},get_id:function(){return i},get_tinymce:function(){return tinymce.get(i)},get_mode:function(){return e("input[id^=widget-black-studio-tinymce][id$=type]",this.get_widget_inside()).val()},set_mode:function(t){return"visual"===t&&(this.get_editor_wrap().removeClass("html-active").addClass("tmce-active"),this.activate()),"html"===t&&(this.get_editor_wrap().removeClass("tmce-active").addClass("html-active"),this.deactivate()),e("input[id^=widget-black-studio-tinymce][id$=type]",this.get_widget_inside()).val(t),this},is_tinymce_active:function(){return"object"==typeof tinymce&&"object"==typeof tinymce.get(i)&&null!==tinymce.get(i)},is_textearea_visible:function(){return e("#"+i).is(":visible")},is_widget_inside_visible:function(){return e(" div.widget-inside:has(#"+i+")").is(":visible")},check_duplicates:function(){return 1<e('[name="'+this.get_textarea().attr("name")+'"]').size()&&0===e("div.error",this.get_widget_inside()).length&&this.get_widget_inside().prepend('<div class="error"><strong>'+bstw_data.error_duplicate_id+"</strong></div>"),this},fix_css:function(){return this.get_widget().css("position","relative").css("z-index","100000"),e("#wpbody-content").css("overflow","visible"),this},set_media_target:function(){return e(".insert-media",this.get_widget()).data("editor",i),this}}}e(document).ready(function(){e("div.widget[id*=black-studio-tinymce] .widget-title, div.widget[id*=black-studio-tinymce] a.widget-action").live("click",function(){n(e(this)).check_duplicates().fix_css().set_media_target().activate_after_open(),e("input[name=savewidget]",n(e(this)).get_widget()).click(function(){n(e(this)).is_tinymce_active()&&n(e(this)).deactivate(),e(this).unbind("ajaxSuccess").ajaxSuccess(function(){n(e(this)).activate_after_ajax()})})}),e("div.widget[id*=black-studio-tinymce] input[name=savewidget]").live("click",function(){n(e(this)).is_tinymce_active()&&n(e(this)).deactivate(),e(this).unbind("ajaxSuccess").ajaxSuccess(function(){n(e(this)).activate_after_ajax()})}),e("a[id^=widget-black-studio-tinymce][id$=tmce]").live("click",function(){n(e(this)).set_mode("visual")}),e("a[id^=widget-black-studio-tinymce][id$=html]").live("click",function(){n(e(this)).set_mode("html")}),e(".wp-media-buttons a").live("click",function(){edCanvas=n(e(this)).get_textarea().get(),wpActiveEditor=n(e(this)).get_id()}),0<e("body.widgets_access").size()&&n(e("textarea[id^=widget-black-studio-tinymce]").attr("id")).activate_after_open(),e(".bstw-links-icon").live("click",function(t){t.preventDefault(),e(this).closest(".bstw-links").children(".bstw-links-list").toggle()})})}(jQuery);
1
  /* Black Studio TinyMCE Widget */
 
2
  !function(e){function n(t){var i=null;return"string"==typeof t?i=t:"object"==typeof t&&t instanceof jQuery&&(i=e("textarea[id^=widget-black-studio-tinymce]",t.closest(bstw_data.container_selectors)).attr("id")),{activate:function(){if(e("#"+i).addClass("mceEditor"),"object"==typeof tinymce&&"function"==typeof tinymce.execCommand){this.deactivate();try{tinymce.execCommand("mceAddControl",!1,i)}catch(t){window.alert(t)}}return this},deactivate:function(){var t;return"object"==typeof tinymce&&"function"==typeof tinymce.execCommand&&this.is_tinymce_active()&&(t=tinymce.get(i).getContent(),tinymce.get(i).remove(),e("#"+i).val(t)),this},activate_after_open:function(){return"visual"===this.get_mode()&&(0===e("div.widget:has(#"+i+") :animated").size()&&!this.is_tinymce_active()&&this.is_textearea_visible()||this.is_tinymce_active()?this.set_mode("visual"):setTimeout(function(){n(i).activate_after_open()},100)),this},activate_after_ajax:function(){return"visual"===this.get_mode()&&(0===e.active&&!this.is_tinymce_active()&&this.is_textearea_visible()?this.set_mode("visual"):this.is_widget_inside_visible()&&!this.is_tinymce_active()&&setTimeout(function(){n(i).activate_after_ajax()},100)),this},get_widget:function(){return e("#"+i).closest("div.widget")},get_widget_inside:function(){return e("#"+i).closest("div.widget-inside")},get_editor_wrap:function(){return e("#"+i).closest("div.wp-editor-wrap")},get_textarea:function(){return e("#"+i)},get_id:function(){return i},get_tinymce:function(){return tinymce.get(i)},get_mode:function(){return e("input[id^=widget-black-studio-tinymce][id$=type]",this.get_widget_inside()).val()},set_mode:function(t){return"visual"===t&&(this.get_editor_wrap().removeClass("html-active").addClass("tmce-active"),this.activate()),"html"===t&&(this.get_editor_wrap().removeClass("tmce-active").addClass("html-active"),this.deactivate()),e("input[id^=widget-black-studio-tinymce][id$=type]",this.get_widget_inside()).val(t),this},is_tinymce_active:function(){return"object"==typeof tinymce&&"object"==typeof tinymce.get(i)&&null!==tinymce.get(i)},is_textearea_visible:function(){return e("#"+i).is(":visible")},is_widget_inside_visible:function(){return e(" div.widget-inside:has(#"+i+")").is(":visible")},check_duplicates:function(){return 1<e('[name="'+this.get_textarea().attr("name")+'"]').size()&&0===e("div.error",this.get_widget_inside()).length&&this.get_widget_inside().prepend('<div class="error"><strong>'+bstw_data.error_duplicate_id+"</strong></div>"),this},fix_css:function(){return this.get_widget().css("position","relative").css("z-index","100000"),e("#wpbody-content").css("overflow","visible"),this},set_media_target:function(){return e(".insert-media",this.get_widget()).data("editor",i),this}}}e(document).ready(function(){e("div.widget[id*=black-studio-tinymce] .widget-title, div.widget[id*=black-studio-tinymce] a.widget-action").live("click",function(){n(e(this)).check_duplicates().fix_css().set_media_target().activate_after_open(),e("input[name=savewidget]",n(e(this)).get_widget()).click(function(){n(e(this)).is_tinymce_active()&&n(e(this)).deactivate(),e(this).unbind("ajaxSuccess").ajaxSuccess(function(){n(e(this)).activate_after_ajax()})})}),e("div.widget[id*=black-studio-tinymce] input[name=savewidget]").live("click",function(){n(e(this)).is_tinymce_active()&&n(e(this)).deactivate(),e(this).unbind("ajaxSuccess").ajaxSuccess(function(){n(e(this)).activate_after_ajax()})}),e("a[id^=widget-black-studio-tinymce][id$=tmce]").live("click",function(){n(e(this)).set_mode("visual")}),e("a[id^=widget-black-studio-tinymce][id$=html]").live("click",function(){n(e(this)).set_mode("html")}),e(".wp-media-buttons a").live("click",function(){edCanvas=n(e(this)).get_textarea().get(),wpActiveEditor=n(e(this)).get_id()}),0<e("body.widgets_access").size()&&n(e("textarea[id^=widget-black-studio-tinymce]").attr("id")).activate_after_open(),e(".bstw-links-icon").live("click",function(t){t.preventDefault(),e(this).closest(".bstw-links").children(".bstw-links-list").toggle()})})}(jQuery);
js/black-studio-tinymce-widget-pre39.min.js CHANGED
@@ -1,3 +1,2 @@
1
  /* Black Studio TinyMCE Widget */
2
-
3
- !function(s){function a(t){var i=null;return"string"==typeof t?i=t:"object"==typeof t&&t instanceof jQuery&&(i=s("textarea[id^=widget-black-studio-tinymce]",t.closest(bstw_data.container_selectors)).attr("id")),{activate:function(){if(s("#"+i).addClass("mceEditor"),"object"==typeof tinymce&&"function"==typeof tinymce.execCommand){this.deactivate(),tinyMCEPreInit.mceInit[i]=tinyMCEPreInit.mceInit["black-studio-tinymce-widget"],tinyMCEPreInit.mceInit[i].selector="#"+i;try{tinymce.init(tinymce.extend({},tinyMCEPreInit.mceInit["black-studio-tinymce-widget"],tinyMCEPreInit.mceInit[i])),tinymce.execCommand("mceAddControl",!1,i)}catch(t){window.alert(t)}this.is_tinymce_active()&&"function"==typeof tinymce.get(i).on&&tinymce.get(i).on("keyup change",function(){var t=tinymce.get(i).getContent();s("#"+i).val(t).change()})}return this},deactivate:function(){var t;return"object"==typeof tinymce&&"function"==typeof tinymce.execCommand&&this.is_tinymce_active()&&(t=tinymce.get(i).getContent(),tinymce.get(i).remove(),s("#"+i).val(t)),this},activate_after_open:function(){return"visual"===this.get_mode()&&(0===s("div.widget:has(#"+i+") :animated").size()&&!this.is_tinymce_active()&&this.is_textearea_visible()||this.is_tinymce_active()?this.set_mode("visual"):setTimeout(function(){a(i).activate_after_open()},100)),this},activate_after_ajax:function(){return"visual"===this.get_mode()&&(0===s.active&&!this.is_tinymce_active()&&this.is_textearea_visible()?this.set_mode("visual"):this.is_widget_inside_visible()&&!this.is_tinymce_active()&&setTimeout(function(){a(i).activate_after_ajax()},100)),this},get_widget:function(){return s("#"+i).closest("div.widget")},get_widget_inside:function(){return s("#"+i).closest("div.widget-inside")},get_editor_wrap:function(){return s("#"+i).closest("div.wp-editor-wrap")},get_textarea:function(){return s("#"+i)},get_id:function(){return i},get_tinymce:function(){return tinymce.get(i)},get_mode:function(){return s("input[id^=widget-black-studio-tinymce][id$=type]",this.get_widget_inside()).val()},set_mode:function(t){return"visual"===t&&(this.get_editor_wrap().removeClass("html-active").addClass("tmce-active"),this.activate()),"html"===t&&(this.get_editor_wrap().removeClass("tmce-active").addClass("html-active"),this.deactivate()),s("input[id^=widget-black-studio-tinymce][id$=type]",this.get_widget_inside()).val(t),this},is_tinymce_active:function(){return"object"==typeof tinymce&&"object"==typeof tinymce.get(i)&&null!==tinymce.get(i)},is_textearea_visible:function(){return s("#"+i).is(":visible")},is_widget_inside_visible:function(){return s(" div.widget-inside:has(#"+i+")").is(":visible")},check_duplicates:function(){return 1<s('[name="'+this.get_textarea().attr("name")+'"]').size()&&0===s("div.error",this.get_widget_inside()).length&&this.get_widget_inside().prepend('<div class="error"><strong>'+bstw_data.error_duplicate_id+"</strong></div>"),this},fix_css:function(){return this.get_widget().css("position","relative").css("z-index","100000"),s("#wpbody-content").css("overflow","visible"),this},set_media_target:function(){return s(".insert-media",this.get_widget()).data("editor",i),this}}}s(document).ready(function(){s(document).on("click","div.widget[id*=black-studio-tinymce] .widget-title, div.widget[id*=black-studio-tinymce] a.widget-action",function(){var t,i,e,n,c;a(s(this)).check_duplicates().fix_css().set_media_target().activate_after_open(),s("input[name=savewidget]",a(s(this)).get_widget()).on("click",function(){a(s(this)).is_tinymce_active()&&a(s(this)).deactivate(),s(this).unbind("ajaxSuccess").ajaxSuccess(function(){a(s(this)).activate_after_ajax()})}),s(this).parents("#available-widgets").length||(t=parseInt(s("input[name=widget-width]",a(s(this)).get_widget()).val(),10),i=s(window).width(),e=a(s(this)).get_widget().parent().width(),n=parseInt(s("#wpcontent").css("margin-left"),10),c=!("undefined"==typeof isRtl||!isRtl),i<t+n+30&&(c=a(s(this)).get_widget().closest("div.widget-liquid-right").length?c?"margin-right":"margin-left":c?"margin-left":"margin-right",s(a(s(this)).get_widget()).css(c,e-(i-30-n)+"px")))}),s("div.widget[id*=black-studio-tinymce] input[name=savewidget]").on("click",function(){a(s(this)).is_tinymce_active()&&a(s(this)).deactivate(),s(this).unbind("ajaxSuccess").ajaxSuccess(function(){a(s(this)).activate_after_ajax()})}),s(document).on("click","a[id^=widget-black-studio-tinymce][id$=tmce]",function(){a(s(this)).set_mode("visual")}),s(document).on("click","a[id^=widget-black-studio-tinymce][id$=html]",function(){a(s(this)).set_mode("html")}),s(document).on("widget-added",function(t,i){i.is("[id*=black-studio-tinymce]")&&(t.preventDefault(),a(i).activate_after_open())}),s(document).on("click",".wp-media-buttons a",function(){window.wpActiveEditor=a(s(this)).get_id()}),0<s("body.widgets_access").size()&&a(s("textarea[id^=widget-black-studio-tinymce]").attr("id")).activate_after_open(),s(document).on("click",".bstw-links-icon",function(t){t.preventDefault(),s(this).closest(".bstw-links").children(".bstw-links-list").toggle()})})}(jQuery);
1
  /* Black Studio TinyMCE Widget */
2
+ !function(s){function a(t){var i=null;return"string"==typeof t?i=t:"object"==typeof t&&t instanceof jQuery&&(i=s("textarea[id^=widget-black-studio-tinymce]",t.closest(bstw_data.container_selectors)).attr("id")),{activate:function(){if(s("#"+i).addClass("mceEditor"),"object"==typeof tinymce&&"function"==typeof tinymce.execCommand){this.deactivate(),tinyMCEPreInit.mceInit[i]=tinyMCEPreInit.mceInit["black-studio-tinymce-widget"],tinyMCEPreInit.mceInit[i].selector="#"+i;try{tinymce.init(tinymce.extend({},tinyMCEPreInit.mceInit["black-studio-tinymce-widget"],tinyMCEPreInit.mceInit[i])),tinymce.execCommand("mceAddControl",!1,i)}catch(t){window.alert(t)}this.is_tinymce_active()&&"function"==typeof tinymce.get(i).on&&tinymce.get(i).on("keyup change",function(){var t=tinymce.get(i).getContent();s("#"+i).val(t).change()})}return this},deactivate:function(){var t;return"object"==typeof tinymce&&"function"==typeof tinymce.execCommand&&this.is_tinymce_active()&&(t=tinymce.get(i).getContent(),tinymce.get(i).remove(),s("#"+i).val(t)),this},activate_after_open:function(){return"visual"===this.get_mode()&&(0===s("div.widget:has(#"+i+") :animated").size()&&!this.is_tinymce_active()&&this.is_textearea_visible()||this.is_tinymce_active()?this.set_mode("visual"):setTimeout(function(){a(i).activate_after_open()},100)),this},activate_after_ajax:function(){return"visual"===this.get_mode()&&(0===s.active&&!this.is_tinymce_active()&&this.is_textearea_visible()?this.set_mode("visual"):this.is_widget_inside_visible()&&!this.is_tinymce_active()&&setTimeout(function(){a(i).activate_after_ajax()},100)),this},get_widget:function(){return s("#"+i).closest("div.widget")},get_widget_inside:function(){return s("#"+i).closest("div.widget-inside")},get_editor_wrap:function(){return s("#"+i).closest("div.wp-editor-wrap")},get_textarea:function(){return s("#"+i)},get_id:function(){return i},get_tinymce:function(){return tinymce.get(i)},get_mode:function(){return s("input[id^=widget-black-studio-tinymce][id$=type]",this.get_widget_inside()).val()},set_mode:function(t){return"visual"===t&&(this.get_editor_wrap().removeClass("html-active").addClass("tmce-active"),this.activate()),"html"===t&&(this.get_editor_wrap().removeClass("tmce-active").addClass("html-active"),this.deactivate()),s("input[id^=widget-black-studio-tinymce][id$=type]",this.get_widget_inside()).val(t),this},is_tinymce_active:function(){return"object"==typeof tinymce&&"object"==typeof tinymce.get(i)&&null!==tinymce.get(i)},is_textearea_visible:function(){return s("#"+i).is(":visible")},is_widget_inside_visible:function(){return s(" div.widget-inside:has(#"+i+")").is(":visible")},check_duplicates:function(){return 1<s('[name="'+this.get_textarea().attr("name")+'"]').size()&&0===s("div.error",this.get_widget_inside()).length&&this.get_widget_inside().prepend('<div class="error"><strong>'+bstw_data.error_duplicate_id+"</strong></div>"),this},fix_css:function(){return this.get_widget().css("position","relative").css("z-index","100000"),s("#wpbody-content").css("overflow","visible"),this},set_media_target:function(){return s(".insert-media",this.get_widget()).data("editor",i),this}}}s(document).ready(function(){s(document).on("click","div.widget[id*=black-studio-tinymce] .widget-title, div.widget[id*=black-studio-tinymce] a.widget-action",function(){var t,i,e,n,c;a(s(this)).check_duplicates().fix_css().set_media_target().activate_after_open(),s("input[name=savewidget]",a(s(this)).get_widget()).on("click",function(){a(s(this)).is_tinymce_active()&&a(s(this)).deactivate(),s(this).unbind("ajaxSuccess").ajaxSuccess(function(){a(s(this)).activate_after_ajax()})}),s(this).parents("#available-widgets").length||(c=parseInt(s("input[name=widget-width]",a(s(this)).get_widget()).val(),10),t=s(window).width(),i=a(s(this)).get_widget().parent().width(),e=parseInt(s("#wpcontent").css("margin-left"),10),n=!("undefined"==typeof isRtl||!isRtl),t<c+e+30&&(c=a(s(this)).get_widget().closest("div.widget-liquid-right").length?n?"margin-right":"margin-left":n?"margin-left":"margin-right",s(a(s(this)).get_widget()).css(c,i-(t-30-e)+"px")))}),s("div.widget[id*=black-studio-tinymce] input[name=savewidget]").on("click",function(){a(s(this)).is_tinymce_active()&&a(s(this)).deactivate(),s(this).unbind("ajaxSuccess").ajaxSuccess(function(){a(s(this)).activate_after_ajax()})}),s(document).on("click","a[id^=widget-black-studio-tinymce][id$=tmce]",function(){a(s(this)).set_mode("visual")}),s(document).on("click","a[id^=widget-black-studio-tinymce][id$=html]",function(){a(s(this)).set_mode("html")}),s(document).on("widget-added",function(t,i){i.is("[id*=black-studio-tinymce]")&&(t.preventDefault(),a(i).activate_after_open())}),s(document).on("click",".wp-media-buttons a",function(){window.wpActiveEditor=a(s(this)).get_id()}),0<s("body.widgets_access").size()&&a(s("textarea[id^=widget-black-studio-tinymce]").attr("id")).activate_after_open(),s(document).on("click",".bstw-links-icon",function(t){t.preventDefault(),s(this).closest(".bstw-links").children(".bstw-links-list").toggle()})})}(jQuery);
 
js/black-studio-tinymce-widget-setup.min.js CHANGED
@@ -1,3 +1,2 @@
1
  /* Black Studio TinyMCE Widget */
2
-
3
  !function(i){function t(t){t.on("keyup change",function(){"visual"===bstw(t.id).get_mode()&&bstw(t.id).update_content(),i("#"+t.id).change()}),i("#"+t.id).addClass("active").removeClass("activating")}for(var n in tinyMCEPreInit.mceInit)0<=n.search("black-studio-tinymce")&&(tinyMCEPreInit.mceInit[n].setup=t)}(jQuery);
1
  /* Black Studio TinyMCE Widget */
 
2
  !function(i){function t(t){t.on("keyup change",function(){"visual"===bstw(t.id).get_mode()&&bstw(t.id).update_content(),i("#"+t.id).change()}),i("#"+t.id).addClass("active").removeClass("activating")}for(var n in tinyMCEPreInit.mceInit)0<=n.search("black-studio-tinymce")&&(tinyMCEPreInit.mceInit[n].setup=t)}(jQuery);
js/black-studio-tinymce-widget.min.js CHANGED
@@ -1,3 +1,2 @@
1
  /* Black Studio TinyMCE Widget */
2
-
3
- var bstw;!function(c){bstw=function(t){var n=null;return"string"==typeof t?n=t:"object"==typeof t&&t instanceof jQuery&&(n=c("textarea[id^=widget-black-studio-tinymce][id$=text]",t.closest(bstw_data.container_selectors)).attr("id")),{activate:function(t){var i,e;return t=void 0===t||t,c("#"+n).hasClass("active")||(c("#"+n).hasClass("activating")||c("#"+n).addClass("activating"),this.is_quicktags_configured()||(tinyMCEPreInit.qtInit[n]=tinyMCEPreInit.qtInit["black-studio-tinymce-widget"],tinyMCEPreInit.qtInit[n].id=n),this.is_quicktags_active()||(e=QTags.instances,QTags.instances=[],quicktags(tinyMCEPreInit.qtInit[n]),QTags._buttonsInit(),i=QTags.instances[n],QTags.instances=e,QTags.instances[n]=i),this.is_tinymce_configured()||void 0!==tinyMCEPreInit.mceInit["black-studio-tinymce-widget"]&&(tinyMCEPreInit.mceInit[n]=tinyMCEPreInit.mceInit["black-studio-tinymce-widget"],tinyMCEPreInit.mceInit[n].selector="#"+n),this.is_tinymce_configured()&&(this.is_tinymce_active()||"visual"!==this.get_mode()||!c("#"+n).is(":visible")&&void 0===wp.blockEditor?this.is_tinymce_active()||"visual"!==this.get_mode()?c("#"+n).addClass("active").removeClass("activating"):setTimeout(function(){bstw(n).activate(t)},500):(tinyMCEPreInit.mceInit[n].setup=function(t){t.on("keyup change",function(){"visual"===bstw(n).get_mode()&&bstw(n).update_content(),c("#"+n).change()}),c("#"+n).addClass("active").removeClass("activating")},t?tinymce.init(tinyMCEPreInit.mceInit[n]):this.go()))),this},deactivate:function(){return c("#"+n).hasClass("activating")||(this.is_tinymce_active()&&tinymce.get(n).remove(),this.is_tinymce_configured()&&delete tinyMCEPreInit.mceInit[n],this.is_quicktags_active()&&(c(".quicktags-toolbar",this.get_widget_inside()).remove(),delete QTags.instances[n]),this.is_quicktags_configured()&&delete tinyMCEPreInit.qtInit[n],c("#"+n).removeClass("active")),this},update_content:function(){var t;return this.is_tinymce_configured()&&("visual"===this.get_mode()?(t=tinymce.get(n).save(),tinyMCEPreInit.mceInit[n].wpautop&&(t=window.switchEditors.pre_wpautop(t)),this.get_textarea().val(t)):this.is_tinymce_active()&&(t=this.get_textarea().val(),tinyMCEPreInit.mceInit[n].wpautop&&(t=window.switchEditors.wpautop(t)),tinymce.get(n).setContent(t))),this},go:function(t){return void 0===t&&(t=this.get_mode()),window.switchEditors.go(n,"visual"===t?"tmce":"html"),this},get_mode:function(){return c("input[id^=widget-black-studio-tinymce][id$=type]",this.get_container()).val()},set_mode:function(t){return c("input[id^=widget-black-studio-tinymce][id$=type]",this.get_container()).val(t),this},get_container:function(){return c("#"+n).closest(bstw_data.container_selectors)},get_widget:function(){return c("#"+n).closest("div.widget")},get_widget_inside:function(){return c("#"+n).closest("div.widget-inside")},get_textarea:function(){return c("#"+n)},is_tinymce_active:function(){return"object"==typeof tinymce&&"object"==typeof tinymce.get(n)&&null!==tinymce.get(n)},is_tinymce_configured:function(){return void 0!==tinyMCEPreInit.mceInit[n]},is_quicktags_active:function(){return"object"==typeof QTags.instances[n]},is_quicktags_configured:function(){return"object"==typeof tinyMCEPreInit.qtInit[n]},prepare:function(){return 1<c('[name="'+this.get_textarea().attr("name")+'"]').size()&&0===c("div.error",this.get_widget_inside()).length&&this.get_widget_inside().prepend('<div class="error"><strong>'+bstw_data.error_duplicate_id+"</strong></div>"),this.get_widget().css("position","relative").css("z-index","100000"),c("#wpbody-content").css("overflow","visible"),this},responsive:function(){var t,i,e,n,s;return this.get_widget_inside().is(":visible")&&(t=parseInt(c("input[name=widget-width]",this.get_widget()).val(),10),i=c(window).width(),e=this.get_widget().parent().width(),n=parseInt(c("#wpcontent").css("margin-left"),10),s=!("undefined"==typeof isRtl||!isRtl),i<t+n+30&&(s=this.get_widget().closest("div.widget-liquid-right").length?s?"margin-right":"margin-left":s?"margin-left":"margin-right",this.get_widget().css(s,e-(i-30-n)+"px"))),this}}},c(document).ready(function(){c(document).on("click","div.widget[id*=black-studio-tinymce] .widget-title, div.widget[id*=black-studio-tinymce] .widget-title-action",function(){c(this).parents("#available-widgets").length||(bstw(c(this)).prepare().responsive().activate(!1),c("input[name=savewidget]",bstw(c(this)).get_widget()).on("click",function(){var t=c(this).closest(".widget").find(".wp-editor-wrap").height();c(this).closest(".widget").find(".wp-editor-wrap").height(t).append('<div class="bstw-loading"></div>'),c(this).closest(".widget").find(".bstw-loading").height(t).show(),bstw(c(this)).update_content()}))}),c(document).on("widget-added",function(t,i){(i.is("[id*=black-studio-tinymce]")||i.has("[id*=black-studio-tinymce]"))&&(t.preventDefault(),bstw(i).activate())}),c(document).on("widget-updated",function(t,i){i.is("[id*=black-studio-tinymce]")&&(t.preventDefault(),bstw(i).deactivate().activate())}),c(document).on("widget-synced",function(t,i){i.is("[id*=black-studio-tinymce]")&&(t.preventDefault(),"visual"===bstw(i).get_mode()&&bstw(i).update_content())}),c(document).on("click","[id^=widget-black-studio-tinymce][id$=tmce]",function(){bstw(c(this)).set_mode("visual")}),c(document).on("click","[id^=widget-black-studio-tinymce][id$=html]",function(){bstw(c(this)).set_mode("html")}),c(document).on("click.wp-editor",".wp-editor-wrap",function(){this.id&&(window.wpActiveEditor=this.id.slice(3,-5))}),c(document).on("sortstart",function(t,i){(c(i.item).is(".widget")||c(i.item).is(".customize-control"))&&(c(i.item).is(".ui-draggable")||(c(["body.wp-customizer .expanded > div[id*=black-studio-tinymce].widget",".widget-liquid-right div[id*=black-studio-tinymce].widget.open"].join(", ")).filter(":has(.widget-inside:visible)").each(function(){c(".widget-title",this).trigger("click"),bstw(c(this)).deactivate()}),i.item.is("[id*=black-studio-tinymce]")&&bstw(i.item.find("textarea[id^=widget-black-studio-tinymce]")).deactivate()))}),c(document).on("sortupdate",function(t,i){(null===t||c(i.item).is(".widget")&&!c(i.item).is(".ui-draggable"))&&(c("body").addClass("wait"),setTimeout(function(){c("textarea[id^=widget-black-studio-tinymce].active").each(function(){bstw(c(this)).deactivate()}),c("body").removeClass("wait")},1e3))}),c(document).on("click","body.wp-customizer div[id*=black-studio-tinymce].widget .move-widget-btn",function(){c("body").addClass("wait");var t=c(this);setTimeout(function(){c("textarea[id^=widget-black-studio-tinymce].active").each(function(){bstw(c(this)).deactivate()}),bstw(t).activate(),c("body").removeClass("wait")},1e3)}),"object"==typeof bstw_data.activate_events&&0<bstw_data.activate_events.length&&c(document).on(bstw_data.activate_events.join(" "),function(t){bstw(c(t.target)).activate()}),"object"==typeof bstw_data.deactivate_events&&0<bstw_data.deactivate_events.length&&c(document).on(bstw_data.deactivate_events.join(" "),function(t){bstw(c(t.target)).deactivate()}),c(window).resize(function(){c("textarea[id^=widget-black-studio-tinymce]").each(function(){bstw(c(this)).responsive()})}),c(document).on("click",".bstw-visual-editor-disabled-notice .notice-dismiss",function(){c.ajax({url:ajaxurl,data:{action:"bstw_visual_editor_disabled_dismiss_notice"}})}),c("#qt_widget-black-studio-tinymce-__i__-text_toolbar").remove(),c(document).on("click",".bstw-links-icon",function(t){t.preventDefault(),c(this).closest(".bstw-links").children(".bstw-links-list").toggle()})})}(jQuery);
1
  /* Black Studio TinyMCE Widget */
2
+ var bstw;!function(c){bstw=function(t){var n=null;return"string"==typeof t?n=t:"object"==typeof t&&t instanceof jQuery&&(n=c("textarea[id^=widget-black-studio-tinymce][id$=text]",t.closest(bstw_data.container_selectors)).attr("id")),{activate:function(t){var i,e;return t=void 0===t||t,c("#"+n).hasClass("active")||(c("#"+n).hasClass("activating")||c("#"+n).addClass("activating"),this.is_quicktags_configured()||(tinyMCEPreInit.qtInit[n]=tinyMCEPreInit.qtInit["black-studio-tinymce-widget"],tinyMCEPreInit.qtInit[n].id=n),this.is_quicktags_active()||(e=QTags.instances,QTags.instances=[],quicktags(tinyMCEPreInit.qtInit[n]),QTags._buttonsInit(),i=QTags.instances[n],QTags.instances=e,QTags.instances[n]=i),this.is_tinymce_configured()||void 0!==tinyMCEPreInit.mceInit["black-studio-tinymce-widget"]&&(tinyMCEPreInit.mceInit[n]=tinyMCEPreInit.mceInit["black-studio-tinymce-widget"],tinyMCEPreInit.mceInit[n].selector="#"+n),this.is_tinymce_configured()&&(this.is_tinymce_active()||"visual"!==this.get_mode()||!c("#"+n).is(":visible")&&void 0===wp.blockEditor?this.is_tinymce_active()||"visual"!==this.get_mode()?c("#"+n).addClass("active").removeClass("activating"):setTimeout(function(){bstw(n).activate(t)},500):(tinyMCEPreInit.mceInit[n].setup=function(t){t.on("keyup change",function(){"visual"===bstw(n).get_mode()&&bstw(n).update_content(),c("#"+n).change()}),c("#"+n).addClass("active").removeClass("activating")},t?tinymce.init(tinyMCEPreInit.mceInit[n]):this.go()))),this},deactivate:function(){return c("#"+n).hasClass("activating")||(this.is_tinymce_active()&&tinymce.get(n).remove(),this.is_tinymce_configured()&&delete tinyMCEPreInit.mceInit[n],this.is_quicktags_active()&&(c(".quicktags-toolbar",this.get_widget_inside()).remove(),delete QTags.instances[n]),this.is_quicktags_configured()&&delete tinyMCEPreInit.qtInit[n],c("#"+n).removeClass("active")),this},update_content:function(){var t;return this.is_tinymce_configured()&&("visual"===this.get_mode()?(t=tinymce.get(n).save(),tinyMCEPreInit.mceInit[n].wpautop&&(t=window.switchEditors.pre_wpautop(t)),this.get_textarea().val(t)):this.is_tinymce_active()&&(t=this.get_textarea().val(),tinyMCEPreInit.mceInit[n].wpautop&&(t=window.switchEditors.wpautop(t)),tinymce.get(n).setContent(t))),this},go:function(t){return void 0===t&&(t=this.get_mode()),window.switchEditors.go(n,"visual"===t?"tmce":"html"),this},get_mode:function(){return c("input[id^=widget-black-studio-tinymce][id$=type]",this.get_container()).val()},set_mode:function(t){return c("input[id^=widget-black-studio-tinymce][id$=type]",this.get_container()).val(t),this},get_container:function(){return c("#"+n).closest(bstw_data.container_selectors)},get_widget:function(){return c("#"+n).closest("div.widget")},get_widget_inside:function(){return c("#"+n).closest("div.widget-inside")},get_textarea:function(){return c("#"+n)},is_tinymce_active:function(){return"object"==typeof tinymce&&"object"==typeof tinymce.get(n)&&null!==tinymce.get(n)},is_tinymce_configured:function(){return void 0!==tinyMCEPreInit.mceInit[n]},is_quicktags_active:function(){return"object"==typeof QTags.instances[n]},is_quicktags_configured:function(){return"object"==typeof tinyMCEPreInit.qtInit[n]},prepare:function(){return 1<c('[name="'+this.get_textarea().attr("name")+'"]').size()&&0===c("div.error",this.get_widget_inside()).length&&this.get_widget_inside().prepend('<div class="error"><strong>'+bstw_data.error_duplicate_id+"</strong></div>"),this.get_widget().css("position","relative").css("z-index","100000"),c("#wpbody-content").css("overflow","visible"),this},responsive:function(){var t,i,e,n,s;return this.get_widget_inside().is(":visible")&&(s=parseInt(c("input[name=widget-width]",this.get_widget()).val(),10),t=c(window).width(),i=this.get_widget().parent().width(),e=parseInt(c("#wpcontent").css("margin-left"),10),n=!("undefined"==typeof isRtl||!isRtl),t<s+e+30&&(s=this.get_widget().closest("div.widget-liquid-right").length?n?"margin-right":"margin-left":n?"margin-left":"margin-right",this.get_widget().css(s,i-(t-30-e)+"px"))),this}}},c(document).ready(function(){c(document).on("click","div.widget[id*=black-studio-tinymce] .widget-title, div.widget[id*=black-studio-tinymce] .widget-title-action",function(){c(this).parents("#available-widgets").length||(bstw(c(this)).prepare().responsive().activate(!1),c("input[name=savewidget]",bstw(c(this)).get_widget()).on("click",function(){var t=c(this).closest(".widget").find(".wp-editor-wrap").height();c(this).closest(".widget").find(".wp-editor-wrap").height(t).append('<div class="bstw-loading"></div>'),c(this).closest(".widget").find(".bstw-loading").height(t).show(),bstw(c(this)).update_content()}))}),c(document).on("widget-added",function(t,i){(i.is("[id*=black-studio-tinymce]")||i.has("[id*=black-studio-tinymce]"))&&(t.preventDefault(),bstw(i).activate())}),c(document).on("widget-updated",function(t,i){i.is("[id*=black-studio-tinymce]")&&(t.preventDefault(),bstw(i).deactivate().activate())}),c(document).on("widget-synced",function(t,i){i.is("[id*=black-studio-tinymce]")&&(t.preventDefault(),"visual"===bstw(i).get_mode()&&bstw(i).update_content())}),c(document).on("click","[id^=widget-black-studio-tinymce][id$=tmce]",function(){bstw(c(this)).set_mode("visual")}),c(document).on("click","[id^=widget-black-studio-tinymce][id$=html]",function(){bstw(c(this)).set_mode("html")}),c(document).on("click.wp-editor",".wp-editor-wrap",function(){this.id&&(window.wpActiveEditor=this.id.slice(3,-5))}),c(document).on("sortstart",function(t,i){!c(i.item).is(".widget")&&!c(i.item).is(".customize-control")||c(i.item).is(".ui-draggable")||(c(["body.wp-customizer .expanded > div[id*=black-studio-tinymce].widget",".widget-liquid-right div[id*=black-studio-tinymce].widget.open"].join(", ")).filter(":has(.widget-inside:visible)").each(function(){c(".widget-title",this).trigger("click"),bstw(c(this)).deactivate()}),i.item.is("[id*=black-studio-tinymce]")&&bstw(i.item.find("textarea[id^=widget-black-studio-tinymce]")).deactivate())}),c(document).on("sortupdate",function(t,i){(null===t||c(i.item).is(".widget")&&!c(i.item).is(".ui-draggable"))&&(c("body").addClass("wait"),setTimeout(function(){c("textarea[id^=widget-black-studio-tinymce].active").each(function(){bstw(c(this)).deactivate()}),c("body").removeClass("wait")},1e3))}),c(document).on("click","body.wp-customizer div[id*=black-studio-tinymce].widget .move-widget-btn",function(){c("body").addClass("wait");var t=c(this);setTimeout(function(){c("textarea[id^=widget-black-studio-tinymce].active").each(function(){bstw(c(this)).deactivate()}),bstw(t).activate(),c("body").removeClass("wait")},1e3)}),"object"==typeof bstw_data.activate_events&&0<bstw_data.activate_events.length&&c(document).on(bstw_data.activate_events.join(" "),function(t){bstw(c(t.target)).activate()}),"object"==typeof bstw_data.deactivate_events&&0<bstw_data.deactivate_events.length&&c(document).on(bstw_data.deactivate_events.join(" "),function(t){bstw(c(t.target)).deactivate()}),c(window).resize(function(){c("textarea[id^=widget-black-studio-tinymce]").each(function(){bstw(c(this)).responsive()})}),c(document).on("click",".bstw-visual-editor-disabled-notice .notice-dismiss",function(){c.ajax({url:ajaxurl,data:{action:"bstw_visual_editor_disabled_dismiss_notice"}})}),c("#qt_widget-black-studio-tinymce-__i__-text_toolbar").remove(),c(document).on("click",".bstw-links-icon",function(t){t.preventDefault(),c(this).closest(".bstw-links").children(".bstw-links-list").toggle()})})}(jQuery);
 
js/wp-page-widget.min.js CHANGED
@@ -1,3 +1,2 @@
1
  /* Black Studio TinyMCE Widget */
2
-
3
  !function(t){t(document).ready(function(){t(document).on("click","#pw-sidebars-customize div[id*=black-studio-tinymce].widget input.widget-control-save",function(){t(this).unbind("ajaxSuccess").ajaxSuccess(function(){t(this).trigger("widget-updated",[bstw(t(this)).get_widget()]).unbind("ajaxSuccess")})}),t(document).on("click","#pw-sidebars-customize div[id*=black-studio-tinymce].widget .widget-title",function(){bstw(t(this)).get_textarea().hasClass("active")&&(bstw(t(this)).deactivate(),t(this).trigger("widget-added",[bstw(t(this)).get_widget()]))})})}(jQuery);
1
  /* Black Studio TinyMCE Widget */
 
2
  !function(t){t(document).ready(function(){t(document).on("click","#pw-sidebars-customize div[id*=black-studio-tinymce].widget input.widget-control-save",function(){t(this).unbind("ajaxSuccess").ajaxSuccess(function(){t(this).trigger("widget-updated",[bstw(t(this)).get_widget()]).unbind("ajaxSuccess")})}),t(document).on("click","#pw-sidebars-customize div[id*=black-studio-tinymce].widget .widget-title",function(){bstw(t(this)).get_textarea().hasClass("active")&&(bstw(t(this)).deactivate(),t(this).trigger("widget-added",[bstw(t(this)).get_widget()]))})})}(jQuery);
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: black-studio, marcochiesi, thedarkmist
3
  Donate link: https://www.blackstudio.it/en/wordpress-plugins/black-studio-tinymce-widget/
4
  Tags: widget, visual, editor, wysiwyg, html, text, tinymce, image, media, gallery, embed, wpml
5
  Requires at least: 3.1
6
- Tested up to: 5.8
7
  Requires PHP: 5.2
8
- Stable tag: 2.7.0
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl.html
11
 
@@ -213,6 +213,9 @@ DELETE FROM wp_usermeta WHERE meta_key LIKE '_bstw%';
213
 
214
  == Changelog ==
215
 
 
 
 
216
  = 2.7.0 (2021-10-27) =
217
  * Added compatibility with Block-based Widgets Editor (WordPress 5.8)
218
 
@@ -549,5 +552,5 @@ DELETE FROM wp_usermeta WHERE meta_key LIKE '_bstw%';
549
 
550
  == Upgrade Notice ==
551
 
552
- = 2.7.0 =
553
  Important: Always ensure to backup your database before upgrading.
3
  Donate link: https://www.blackstudio.it/en/wordpress-plugins/black-studio-tinymce-widget/
4
  Tags: widget, visual, editor, wysiwyg, html, text, tinymce, image, media, gallery, embed, wpml
5
  Requires at least: 3.1
6
+ Tested up to: 6.0
7
  Requires PHP: 5.2
8
+ Stable tag: 2.7.1
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl.html
11
 
213
 
214
  == Changelog ==
215
 
216
+ = 2.7.1 (2022-07-01) =
217
+ * Fixed issue on Media Library with new Block-based Widgets Editor
218
+
219
  = 2.7.0 (2021-10-27) =
220
  * Added compatibility with Block-based Widgets Editor (WordPress 5.8)
221
 
552
 
553
  == Upgrade Notice ==
554
 
555
+ = 2.7.1 =
556
  Important: Always ensure to backup your database before upgrading.