Black Studio TinyMCE Widget - Version 2.7.0

Version Description

(2021-10-27) = * Added compatibility with Block-based Widgets Editor (WordPress 5.8)

Download this release

Release Info

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

Code changes from version 2.6.9 to 2.7.0

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.6.9
7
  Author: Black Studio
8
  Author URI: https://www.blackstudio.it
9
  Requires at least: 3.1
10
- Tested up to: 5.2
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.6.9';
39
 
40
  /**
41
  * The single instance of the plugin class
@@ -166,15 +166,18 @@ if ( ! class_exists( 'Black_Studio_TinyMCE_Plugin' ) ) {
166
  protected function __construct() {
167
  // Include required files
168
  include_once( plugin_dir_path( __FILE__ ) . 'includes/class-widget.php' );
169
- // Include and instantiate admin class on admin pages
170
- if ( is_admin() ) {
171
  include_once( plugin_dir_path( __FILE__ ) . 'includes/class-admin.php' );
172
  self::$admin = Black_Studio_TinyMCE_Admin::instance();
 
 
 
173
  include_once( plugin_dir_path( __FILE__ ) . 'includes/class-admin-pointer.php' );
174
  self::$admin_pointer = Black_Studio_TinyMCE_Admin_Pointer::instance();
175
  }
176
  // Include and instantiate text filter class on frontend pages
177
- else {
178
  include_once( plugin_dir_path( __FILE__ ) . 'includes/class-text-filters.php' );
179
  self::$text_filters = Black_Studio_TinyMCE_Text_Filters::instance();
180
  }
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
  * @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
166
  protected function __construct() {
167
  // Include required files
168
  include_once( plugin_dir_path( __FILE__ ) . 'includes/class-widget.php' );
169
+ // Include and instantiate admin class on admin pages and REST requests
170
+ if ( is_admin() || ( function_exists( 'wp_is_json_request' ) && wp_is_json_request() ) ) {
171
  include_once( plugin_dir_path( __FILE__ ) . 'includes/class-admin.php' );
172
  self::$admin = Black_Studio_TinyMCE_Admin::instance();
173
+ }
174
+ // Include and instantiate admin pointer class on admin pages
175
+ if ( is_admin() ) {
176
  include_once( plugin_dir_path( __FILE__ ) . 'includes/class-admin-pointer.php' );
177
  self::$admin_pointer = Black_Studio_TinyMCE_Admin_Pointer::instance();
178
  }
179
  // Include and instantiate text filter class on frontend pages
180
+ if ( ! is_admin() ) {
181
  include_once( plugin_dir_path( __FILE__ ) . 'includes/class-text-filters.php' );
182
  self::$text_filters = Black_Studio_TinyMCE_Text_Filters::instance();
183
  }
css/black-studio-tinymce-widget-pre33.min.css CHANGED
@@ -1,2 +1 @@
1
- /* Black Studio TinyMCE Widget */
2
- .bstw-links{font-size:11px;margin-top:-3px;text-align:right;position:absolute;right:18px}.bstw-links .icon-plugins{float:right;padding:3px 6px;margin:-8px -8px 0 -2px;background:url(../../../../wp-admin/images/menu.png) -180px -33px no-repeat;width:16px;height:16px}.bstw-links .bstw-links-list{display:none}.bstw-links a{text-decoration:none}#mce_fullscreen_container{background-color:#fff}#wp-black-studio-tinymce-widget-wrap{display:none}#TB_overlay,#TB_window{z-index:999999}.wp-editor-container{border-style:solid;border-width:1px;border-collapse:separate;-moz-border-radius:3px 3px 0 0;-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;-khtml-border-top-right-radius:3px;-khtml-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px;border-color:#ccc #ccc #dfdfdf;clear:both}.wp-switch-editor{height:18px;margin:5px 5px 0 0;padding:4px 5px 2px;float:right;cursor:pointer;border-width:1px;border-style:solid;-moz-border-radius:3px 3px 0 0;-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;-khtml-border-top-right-radius:3px;-khtml-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px;background-color:#f1f1f1;border-color:#dfdfdf #dfdfdf #ccc;color:#999;position:relative;top:1px}.html-active .switch-html,.tmce-active .switch-tmce{border-color:#ccc #ccc #e9e9e9;background-color:#e9e9e9;color:#333}.wp-media-buttons{cursor:default;padding:8px 8px 0}.wp-media-buttons a{cursor:pointer;padding:0 0 5px 10px}.wp-media-buttons img{vertical-align:middle}.wp_themeSkin .mceStatusbar{border-color:#dfdfdf}
1
+ .bstw-links{font-size:11px;margin-top:-3px;text-align:right;position:absolute;right:18px}.bstw-links .icon-plugins{float:right;padding:3px 6px;margin:-8px -8px 0 -2px;background:transparent url('../../../../wp-admin/images/menu.png') no-repeat scroll -180px -33px;width:16px;height:16px}.bstw-links .bstw-links-list{display:none}.bstw-links a{text-decoration:none}#mce_fullscreen_container{background-color:#fff}#wp-black-studio-tinymce-widget-wrap{display:none}#TB_overlay,#TB_window{z-index:999999}.wp-editor-container{border-style:solid;border-width:1px;border-collapse:separate;-moz-border-radius:3px 3px 0 0;-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;-khtml-border-top-right-radius:3px;-khtml-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px;border-color:#ccc #ccc #dfdfdf;clear:both}.wp-switch-editor{height:18px;margin:5px 5px 0 0;padding:4px 5px 2px;float:right;cursor:pointer;border-width:1px;border-style:solid;-moz-border-radius:3px 3px 0 0;-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;-khtml-border-top-right-radius:3px;-khtml-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px;background-color:#f1f1f1;border-color:#dfdfdf #dfdfdf #ccc;color:#999;position:relative;top:1px}.html-active .switch-html,.tmce-active .switch-tmce{border-color:#ccc #ccc #e9e9e9;background-color:#e9e9e9;color:#333}.wp-media-buttons{cursor:default;padding:8px 8px 0}.wp-media-buttons a{cursor:pointer;padding:0 0 5px 10px}.wp-media-buttons img{vertical-align:middle}.wp_themeSkin .mceStatusbar{border-color:#dfdfdf}
 
css/black-studio-tinymce-widget.css CHANGED
@@ -16,17 +16,22 @@
16
  left: 18px;
17
  }
18
 
19
- .bstw-links .icon16:before {
20
  padding: 0;
21
  }
22
 
23
- .bstw-links .icon16 {
24
  float: right;
25
  padding: 3px 6px;
26
  margin: -6px -8px 0 -2px;
27
  }
28
 
29
- .rtl .bstw-links .icon16 {
 
 
 
 
 
30
  float: left;
31
  margin: -6px -2px 0 -8px;
32
  }
16
  left: 18px;
17
  }
18
 
19
+ .bstw-links .dashicons-before:before {
20
  padding: 0;
21
  }
22
 
23
+ .bstw-links .dashicons-before {
24
  float: right;
25
  padding: 3px 6px;
26
  margin: -6px -8px 0 -2px;
27
  }
28
 
29
+ .bstw-links .dashicons-before:focus {
30
+ outline: none !important;
31
+ box-shadow: none !important;
32
+ }
33
+
34
+ .rtl .bstw-links .dashicons-before {
35
  float: left;
36
  margin: -6px -2px 0 -8px;
37
  }
css/black-studio-tinymce-widget.min.css CHANGED
@@ -1,2 +1 @@
1
- /* Black Studio TinyMCE Widget */
2
- .bstw-links{font-size:11px;margin-top:-3px;text-align:right;position:absolute;right:18px}.rtl .bstw-links{text-align:left;right:auto;left:18px}.bstw-links .icon16:before{padding:0}.bstw-links .icon16{float:right;padding:3px 6px;margin:-6px -8px 0 -2px}.rtl .bstw-links .icon16{float:left;margin:-6px -2px 0 -8px}.bstw-links .bstw-links-list{display:none}.bstw-links a{text-decoration:none}.bstw-loading{position:absolute;left:0;right:0;top:0;bottom:0;background-color:#fff;background-image:url(../../../../wp-admin/images/loading.gif);background-position:center center;background-repeat:no-repeat;z-index:100000;display:none;opacity:.5}#wp-black-studio-tinymce-widget-wrap{display:none}div[id*=black-studio-tinymce] .wp-editor-wrap{margin-bottom:1em}#available-widgets [class*=black-studio-tinymce] .widget-title:before{content:"\f116"}.wp-admin #mce-modal-block,.wp-customizer #mce-modal-block{z-index:500000!important}.wp-admin .mce-menu,.wp-admin .mce-popover,.wp-admin .mce-window,.wp-customizer .mce-menu,.wp-customizer .mce-popover,.wp-customizer .mce-window{z-index:500010!important}div[id*=black-studio-tinymce] .mce-wp-fullscreen{display:none}.ui-dialog.panels-admin-dialog{z-index:100002!important}#TB_overlay,#TB_window{z-index:999999!important}.media-modal{z-index:1000100!important}.wp-customizer #wp-link-backdrop{z-index:500010}.wp-customizer #wp-link-wrap{z-index:500020}.wp-customizer .ui-autocomplete.wplink-autocomplete,.wp-customizer div.mce-inline-toolbar-grp{z-index:500025}.open.widget[id*=black-studio-tinymce]{z-index:100000!important}@media (min-width:1666px){.customize-control-widget_form.wide-widget-control .widget-inside{left:18%}}body.wait,body.wait *{cursor:wait!important}#zedity_content_overlay{z-index:100000!important}.mce-menubar{border-color:#e5e5e5!important;background:#fff!important;border-width:0 0 1px!important}.mce-rtl .mce-colorbutton button{padding-right:3px!important;padding-left:3px!important}.mce-rtl .mce-colorbutton .mce-preview{margin:0!important;padding:0!important}
1
+ .bstw-links{font-size:11px;margin-top:-3px;text-align:right;position:absolute;right:18px}.rtl .bstw-links{text-align:left;right:auto;left:18px}.bstw-links .dashicons-before:before{padding:0}.bstw-links .dashicons-before{float:right;padding:3px 6px;margin:-6px -8px 0 -2px}.bstw-links .dashicons-before:focus{outline:0!important;box-shadow:none!important}.rtl .bstw-links .dashicons-before{float:left;margin:-6px -2px 0 -8px}.bstw-links .bstw-links-list{display:none}.bstw-links a{text-decoration:none}.bstw-loading{position:absolute;left:0;right:0;top:0;bottom:0;background-color:#fff;background-image:url(../../../../wp-admin/images/loading.gif);background-position:center center;background-repeat:no-repeat;z-index:100000;display:none;opacity:.5}#wp-black-studio-tinymce-widget-wrap{display:none}div[id*=black-studio-tinymce] .wp-editor-wrap{margin-bottom:1em}#available-widgets [class*=black-studio-tinymce] .widget-title:before{content:"\f116"}.wp-admin #mce-modal-block,.wp-customizer #mce-modal-block{z-index:500000!important}.wp-admin .mce-menu,.wp-admin .mce-popover,.wp-admin .mce-window,.wp-customizer .mce-menu,.wp-customizer .mce-popover,.wp-customizer .mce-window{z-index:500010!important}div[id*=black-studio-tinymce] .mce-wp-fullscreen{display:none}.ui-dialog.panels-admin-dialog{z-index:100002!important}#TB_overlay,#TB_window{z-index:999999!important}.media-modal{z-index:1000100!important}.wp-customizer #wp-link-backdrop{z-index:500010}.wp-customizer #wp-link-wrap{z-index:500020}.wp-customizer .ui-autocomplete.wplink-autocomplete,.wp-customizer div.mce-inline-toolbar-grp{z-index:500025}.open.widget[id*=black-studio-tinymce]{z-index:100000!important}@media (min-width:1666px){.customize-control-widget_form.wide-widget-control .widget-inside{left:18%}}body.wait,body.wait *{cursor:wait!important}#zedity_content_overlay{z-index:100000!important}.mce-menubar{border-color:#e5e5e5!important;background:#fff!important;border-width:0 0 1px!important}.mce-rtl .mce-colorbutton button{padding-right:3px!important;padding-left:3px!important}.mce-rtl .mce-colorbutton .mce-preview{margin:0!important;padding:0!important}
 
includes/class-admin.php CHANGED
@@ -60,6 +60,9 @@ if ( ! class_exists( 'Black_Studio_TinyMCE_Admin' ) ) {
60
  // Register action and filter hooks
61
  add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
62
  add_action( 'admin_init', array( $this, 'admin_init' ), 20 );
 
 
 
63
  }
64
 
65
  /**
@@ -133,6 +136,22 @@ if ( ! class_exists( 'Black_Studio_TinyMCE_Admin' ) ) {
133
  }
134
  }
135
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  /**
137
  * Instantiate tinyMCE editor
138
  *
@@ -239,7 +258,7 @@ if ( ! class_exists( 'Black_Studio_TinyMCE_Admin' ) ) {
239
  * @since 2.0.0
240
  */
241
  public function localize_script() {
242
- $container_selectors = apply_filters( 'black_studio_tinymce_container_selectors', array( 'div.widget', 'div.widget-inside' ) );
243
  $activate_events = apply_filters( 'black_studio_tinymce_activate_events', array() );
244
  $deactivate_events = apply_filters( 'black_studio_tinymce_deactivate_events', array() );
245
  $data = array(
@@ -342,16 +361,14 @@ if ( ! class_exists( 'Black_Studio_TinyMCE_Admin' ) ) {
342
  */
343
  public function init_links() {
344
  $this->links = array(
345
- /* translators: text used for plugin home link */
346
- 'https://wordpress.org/plugins/black-studio-tinymce-widget/' => __( 'Home', 'black-studio-tinymce-widget' ),
347
  /* translators: text used for support faq link */
348
  'https://wordpress.org/plugins/black-studio-tinymce-widget/faq/' => __( 'FAQ', 'black-studio-tinymce-widget' ),
349
  /* translators: text used for support forum link */
350
  'https://wordpress.org/support/plugin/black-studio-tinymce-widget' => __( 'Support', 'black-studio-tinymce-widget' ),
351
  /* translators: text used for reviews link */
352
  'https://wordpress.org/support/view/plugin-reviews/black-studio-tinymce-widget' => __( 'Rate', 'black-studio-tinymce-widget' ),
353
- /* translators: text used for follow on twitter link */
354
- 'https://twitter.com/blackstudioita' => __( 'Follow', 'black-studio-tinymce-widget' ),
355
  /* translators: text used for donation link */
356
  'https://www.blackstudio.it/en/wordpress-plugins/black-studio-tinymce-widget/' => __( 'Donate', 'black-studio-tinymce-widget' ),
357
  );
@@ -373,7 +390,8 @@ if ( ! class_exists( 'Black_Studio_TinyMCE_Admin' ) ) {
373
  }
374
  echo "\t\t</span>\n";
375
  /* translators: text used for the icon that shows the plugin links */
376
- echo "\t\t<a class='bstw-links-icon icon16 icon-plugins' href='#' title='" . esc_attr( __( 'About Black Studio TinyMCE Widget plugin', 'black-studio-tinymce-widget' ) ) . "'></a>\n";
 
377
  echo "\t</div>\n";
378
  }
379
 
60
  // Register action and filter hooks
61
  add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
62
  add_action( 'admin_init', array( $this, 'admin_init' ), 20 );
63
+ if ( strstr( $_SERVER['REQUEST_URI'], 'widget-types/black-studio-tinymce/encode' ) ) {
64
+ add_action( 'rest_api_init', array( $this, 'rest_api_init' ) );
65
+ }
66
  }
67
 
68
  /**
136
  }
137
  }
138
 
139
+ /**
140
+ * Add actions and filters for block editor widgets
141
+ *
142
+ * @uses add_action()
143
+ * @uses add_filter()
144
+ *
145
+ * @return void
146
+ * @since 2.7.0
147
+ */
148
+ public function rest_api_init() {
149
+ $this->init_links();
150
+ add_action( 'black_studio_tinymce_before_editor', array( $this, 'display_links' ) ); // consider donating if you remove links
151
+ add_action( 'black_studio_tinymce_editor', array( $this, 'editor' ), 10, 4 );
152
+ add_action( 'black_studio_tinymce_after_editor', array( $this, 'fix_the_editor_content_filter' ) );
153
+ }
154
+
155
  /**
156
  * Instantiate tinyMCE editor
157
  *
258
  * @since 2.0.0
259
  */
260
  public function localize_script() {
261
+ $container_selectors = apply_filters( 'black_studio_tinymce_container_selectors', array( 'div.widget', 'div.widget-inside', 'div.wp-block-legacy-widget' ) );
262
  $activate_events = apply_filters( 'black_studio_tinymce_activate_events', array() );
263
  $deactivate_events = apply_filters( 'black_studio_tinymce_deactivate_events', array() );
264
  $data = array(
361
  */
362
  public function init_links() {
363
  $this->links = array(
364
+ /* translators: text used for plugin page link */
365
+ 'https://wordpress.org/plugins/black-studio-tinymce-widget/' => __( 'Plugin page', 'black-studio-tinymce-widget' ),
366
  /* translators: text used for support faq link */
367
  'https://wordpress.org/plugins/black-studio-tinymce-widget/faq/' => __( 'FAQ', 'black-studio-tinymce-widget' ),
368
  /* translators: text used for support forum link */
369
  'https://wordpress.org/support/plugin/black-studio-tinymce-widget' => __( 'Support', 'black-studio-tinymce-widget' ),
370
  /* translators: text used for reviews link */
371
  'https://wordpress.org/support/view/plugin-reviews/black-studio-tinymce-widget' => __( 'Rate', 'black-studio-tinymce-widget' ),
 
 
372
  /* translators: text used for donation link */
373
  'https://www.blackstudio.it/en/wordpress-plugins/black-studio-tinymce-widget/' => __( 'Donate', 'black-studio-tinymce-widget' ),
374
  );
390
  }
391
  echo "\t\t</span>\n";
392
  /* translators: text used for the icon that shows the plugin links */
393
+ $link_title = esc_attr( __( 'About Black Studio TinyMCE Widget plugin', 'black-studio-tinymce-widget' ) );
394
+ echo "\t\t<a class='bstw-links-icon dashicons-before dashicons-admin-plugins' href='#' title='" . $link_title . "' aria-label='" . $link_title . "'></a>\n";
395
  echo "\t</div>\n";
396
  }
397
 
js/black-studio-tinymce-widget-pointer.min.js CHANGED
@@ -1,2 +1,3 @@
1
  /* Black Studio TinyMCE Widget */
2
- jQuery(document).ready(function(a){function b(b){var c=bstw_pointers.pointers[b],d=a.extend(c.options,{close:function(){a.post(ajaxurl,{pointer:c.pointer_id,action:"dismiss-wp-pointer"})}});a(c.target).pointer(d).pointer("open")}b(0)});
 
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")});
js/black-studio-tinymce-widget-pre33.min.js CHANGED
@@ -1,2 +1,3 @@
1
  /* Black Studio TinyMCE Widget */
2
- !function(a){function b(c){var d=null;return"string"==typeof c?d=c:"object"==typeof c&&c instanceof jQuery&&(d=a("textarea[id^=widget-black-studio-tinymce]",c.closest(bstw_data.container_selectors)).attr("id")),{activate:function(){if(a("#"+d).addClass("mceEditor"),"object"==typeof tinymce&&"function"==typeof tinymce.execCommand){this.deactivate();try{tinymce.execCommand("mceAddControl",!1,d)}catch(b){window.alert(b)}}return this},deactivate:function(){if("object"==typeof tinymce&&"function"==typeof tinymce.execCommand&&this.is_tinymce_active()){var b=tinymce.get(d).getContent();tinymce.get(d).remove(),a("#"+d).val(b)}return this},activate_after_open:function(){return"visual"===this.get_mode()&&(0===a("div.widget:has(#"+d+") :animated").size()&&!this.is_tinymce_active()&&this.is_textearea_visible()?this.set_mode("visual"):this.is_tinymce_active()?this.set_mode("visual"):setTimeout(function(){b(d).activate_after_open()},100)),this},activate_after_ajax:function(){return"visual"===this.get_mode()&&(0===a.active&&!this.is_tinymce_active()&&this.is_textearea_visible()?this.set_mode("visual"):this.is_widget_inside_visible()&&!this.is_tinymce_active()&&setTimeout(function(){b(d).activate_after_ajax()},100)),this},get_widget:function(){return a("#"+d).closest("div.widget")},get_widget_inside:function(){return a("#"+d).closest("div.widget-inside")},get_editor_wrap:function(){return a("#"+d).closest("div.wp-editor-wrap")},get_textarea:function(){return a("#"+d)},get_id:function(){return d},get_tinymce:function(){return tinymce.get(d)},get_mode:function(){return a("input[id^=widget-black-studio-tinymce][id$=type]",this.get_widget_inside()).val()},set_mode:function(b){return"visual"===b&&(this.get_editor_wrap().removeClass("html-active").addClass("tmce-active"),this.activate()),"html"===b&&(this.get_editor_wrap().removeClass("tmce-active").addClass("html-active"),this.deactivate()),a("input[id^=widget-black-studio-tinymce][id$=type]",this.get_widget_inside()).val(b),this},is_tinymce_active:function(){return"object"==typeof tinymce&&"object"==typeof tinymce.get(d)&&null!==tinymce.get(d)},is_textearea_visible:function(){return a("#"+d).is(":visible")},is_widget_inside_visible:function(){return a(" div.widget-inside:has(#"+d+")").is(":visible")},check_duplicates:function(){return a('[name="'+this.get_textarea().attr("name")+'"]').size()>1&&0===a("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"),a("#wpbody-content").css("overflow","visible"),this},set_media_target:function(){return a(".insert-media",this.get_widget()).data("editor",d),this}}}a(document).ready(function(){a("div.widget[id*=black-studio-tinymce] .widget-title, div.widget[id*=black-studio-tinymce] a.widget-action").live("click",function(){b(a(this)).check_duplicates().fix_css().set_media_target().activate_after_open(),a("input[name=savewidget]",b(a(this)).get_widget()).click(function(){b(a(this)).is_tinymce_active()&&b(a(this)).deactivate(),a(this).unbind("ajaxSuccess").ajaxSuccess(function(){b(a(this)).activate_after_ajax()})})}),a("div.widget[id*=black-studio-tinymce] input[name=savewidget]").live("click",function(){b(a(this)).is_tinymce_active()&&b(a(this)).deactivate(),a(this).unbind("ajaxSuccess").ajaxSuccess(function(){b(a(this)).activate_after_ajax()})}),a("a[id^=widget-black-studio-tinymce][id$=tmce]").live("click",function(){b(a(this)).set_mode("visual")}),a("a[id^=widget-black-studio-tinymce][id$=html]").live("click",function(){b(a(this)).set_mode("html")}),a(".wp-media-buttons a").live("click",function(){edCanvas=b(a(this)).get_textarea().get(),wpActiveEditor=b(a(this)).get_id()}),a("body.widgets_access").size()>0&&b(a("textarea[id^=widget-black-studio-tinymce]").attr("id")).activate_after_open(),a(".bstw-links-icon").live("click",function(b){b.preventDefault(),a(this).closest(".bstw-links").children(".bstw-links-list").toggle()})})}(jQuery);
 
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);
js/black-studio-tinymce-widget-pre39.min.js CHANGED
@@ -1,2 +1,3 @@
1
  /* Black Studio TinyMCE Widget */
2
- !function(a){function b(c){var d=null;return"string"==typeof c?d=c:"object"==typeof c&&c instanceof jQuery&&(d=a("textarea[id^=widget-black-studio-tinymce]",c.closest(bstw_data.container_selectors)).attr("id")),{activate:function(){if(a("#"+d).addClass("mceEditor"),"object"==typeof tinymce&&"function"==typeof tinymce.execCommand){this.deactivate(),tinyMCEPreInit.mceInit[d]=tinyMCEPreInit.mceInit["black-studio-tinymce-widget"],tinyMCEPreInit.mceInit[d].selector="#"+d;try{tinymce.init(tinymce.extend({},tinyMCEPreInit.mceInit["black-studio-tinymce-widget"],tinyMCEPreInit.mceInit[d])),tinymce.execCommand("mceAddControl",!1,d)}catch(b){window.alert(b)}this.is_tinymce_active()&&"function"==typeof tinymce.get(d).on&&tinymce.get(d).on("keyup change",function(){var b=tinymce.get(d).getContent();a("#"+d).val(b).change()})}return this},deactivate:function(){if("object"==typeof tinymce&&"function"==typeof tinymce.execCommand&&this.is_tinymce_active()){var b=tinymce.get(d).getContent();tinymce.get(d).remove(),a("#"+d).val(b)}return this},activate_after_open:function(){return"visual"===this.get_mode()&&(0===a("div.widget:has(#"+d+") :animated").size()&&!this.is_tinymce_active()&&this.is_textearea_visible()?this.set_mode("visual"):this.is_tinymce_active()?this.set_mode("visual"):setTimeout(function(){b(d).activate_after_open()},100)),this},activate_after_ajax:function(){return"visual"===this.get_mode()&&(0===a.active&&!this.is_tinymce_active()&&this.is_textearea_visible()?this.set_mode("visual"):this.is_widget_inside_visible()&&!this.is_tinymce_active()&&setTimeout(function(){b(d).activate_after_ajax()},100)),this},get_widget:function(){return a("#"+d).closest("div.widget")},get_widget_inside:function(){return a("#"+d).closest("div.widget-inside")},get_editor_wrap:function(){return a("#"+d).closest("div.wp-editor-wrap")},get_textarea:function(){return a("#"+d)},get_id:function(){return d},get_tinymce:function(){return tinymce.get(d)},get_mode:function(){return a("input[id^=widget-black-studio-tinymce][id$=type]",this.get_widget_inside()).val()},set_mode:function(b){return"visual"===b&&(this.get_editor_wrap().removeClass("html-active").addClass("tmce-active"),this.activate()),"html"===b&&(this.get_editor_wrap().removeClass("tmce-active").addClass("html-active"),this.deactivate()),a("input[id^=widget-black-studio-tinymce][id$=type]",this.get_widget_inside()).val(b),this},is_tinymce_active:function(){return"object"==typeof tinymce&&"object"==typeof tinymce.get(d)&&null!==tinymce.get(d)},is_textearea_visible:function(){return a("#"+d).is(":visible")},is_widget_inside_visible:function(){return a(" div.widget-inside:has(#"+d+")").is(":visible")},check_duplicates:function(){return a('[name="'+this.get_textarea().attr("name")+'"]').size()>1&&0===a("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"),a("#wpbody-content").css("overflow","visible"),this},set_media_target:function(){return a(".insert-media",this.get_widget()).data("editor",d),this}}}a(document).ready(function(){a(document).on("click","div.widget[id*=black-studio-tinymce] .widget-title, div.widget[id*=black-studio-tinymce] a.widget-action",function(){if(b(a(this)).check_duplicates().fix_css().set_media_target().activate_after_open(),a("input[name=savewidget]",b(a(this)).get_widget()).on("click",function(){b(a(this)).is_tinymce_active()&&b(a(this)).deactivate(),a(this).unbind("ajaxSuccess").ajaxSuccess(function(){b(a(this)).activate_after_ajax()})}),!a(this).parents("#available-widgets").length){var c,d=parseInt(a("input[name=widget-width]",b(a(this)).get_widget()).val(),10),e=a(window).width(),f=b(a(this)).get_widget().parent().width(),g=parseInt(a("#wpcontent").css("margin-left"),10),h=!("undefined"==typeof isRtl||!isRtl);d+g+30>e&&(c=b(a(this)).get_widget().closest("div.widget-liquid-right").length?h?"margin-right":"margin-left":h?"margin-left":"margin-right",a(b(a(this)).get_widget()).css(c,f-(e-30-g)+"px"))}}),a("div.widget[id*=black-studio-tinymce] input[name=savewidget]").on("click",function(){b(a(this)).is_tinymce_active()&&b(a(this)).deactivate(),a(this).unbind("ajaxSuccess").ajaxSuccess(function(){b(a(this)).activate_after_ajax()})}),a(document).on("click","a[id^=widget-black-studio-tinymce][id$=tmce]",function(){b(a(this)).set_mode("visual")}),a(document).on("click","a[id^=widget-black-studio-tinymce][id$=html]",function(){b(a(this)).set_mode("html")}),a(document).on("widget-added",function(a,c){c.is("[id*=black-studio-tinymce]")&&(a.preventDefault(),b(c).activate_after_open())}),a(document).on("click",".wp-media-buttons a",function(){window.wpActiveEditor=b(a(this)).get_id()}),a("body.widgets_access").size()>0&&b(a("textarea[id^=widget-black-studio-tinymce]").attr("id")).activate_after_open(),a(document).on("click",".bstw-links-icon",function(b){b.preventDefault(),a(this).closest(".bstw-links").children(".bstw-links-list").toggle()})})}(jQuery);
 
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);
js/black-studio-tinymce-widget-setup.min.js CHANGED
@@ -1,2 +1,3 @@
1
  /* Black Studio TinyMCE Widget */
2
- !function(a){function b(b){b.on("keyup change",function(){"visual"===bstw(b.id).get_mode()&&bstw(b.id).update_content(),a("#"+b.id).change()}),a("#"+b.id).addClass("active").removeClass("activating")}var c;for(c in tinyMCEPreInit.mceInit)c.search("black-studio-tinymce")>=0&&(tinyMCEPreInit.mceInit[c].setup=b)}(jQuery);
 
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);
js/black-studio-tinymce-widget.js CHANGED
@@ -51,7 +51,7 @@ var bstw;
51
  }
52
  }
53
  if ( this.is_tinymce_configured() ) {
54
- if ( ! this.is_tinymce_active() && this.get_mode() === 'visual' && $( '#' + id ).is( ':visible' ) ) {
55
  tinyMCEPreInit.mceInit[ id ].setup = function( ed ) {
56
  // Real time preview (Theme customizer)
57
  ed.on( 'keyup change', function() {
@@ -240,7 +240,7 @@ var bstw;
240
 
241
  // Event handler for widget added
242
  $( document ).on( 'widget-added', function( event, $widget ) {
243
- if ( $widget.is( '[id*=black-studio-tinymce]' ) ) {
244
  event.preventDefault();
245
  bstw( $widget ).activate();
246
  }
51
  }
52
  }
53
  if ( this.is_tinymce_configured() ) {
54
+ if ( ! this.is_tinymce_active() && this.get_mode() === 'visual' && ( $( '#' + id ).is( ':visible' ) || typeof wp.blockEditor !== 'undefined' ) ) {
55
  tinyMCEPreInit.mceInit[ id ].setup = function( ed ) {
56
  // Real time preview (Theme customizer)
57
  ed.on( 'keyup change', function() {
240
 
241
  // Event handler for widget added
242
  $( document ).on( 'widget-added', function( event, $widget ) {
243
+ if ( $widget.is( '[id*=black-studio-tinymce]' ) || $widget.has( '[id*=black-studio-tinymce]' ) ) {
244
  event.preventDefault();
245
  bstw( $widget ).activate();
246
  }
js/black-studio-tinymce-widget.min.js CHANGED
@@ -1,2 +1,3 @@
1
  /* Black Studio TinyMCE Widget */
2
- var bstw;!function(a){bstw=function(b){var c=null;return"string"==typeof b?c=b:"object"==typeof b&&b instanceof jQuery&&(c=a("textarea[id^=widget-black-studio-tinymce][id$=text]",b.closest(bstw_data.container_selectors)).attr("id")),{activate:function(b){if(b="undefined"!=typeof b?b:!0,!a("#"+c).hasClass("active")){if(a("#"+c).hasClass("activating")||a("#"+c).addClass("activating"),this.is_quicktags_configured()||(tinyMCEPreInit.qtInit[c]=tinyMCEPreInit.qtInit["black-studio-tinymce-widget"],tinyMCEPreInit.qtInit[c].id=c),!this.is_quicktags_active()){var d,e;d=QTags.instances,QTags.instances=[],quicktags(tinyMCEPreInit.qtInit[c]),QTags._buttonsInit(),e=QTags.instances[c],QTags.instances=d,QTags.instances[c]=e}this.is_tinymce_configured()||"undefined"!=typeof tinyMCEPreInit.mceInit["black-studio-tinymce-widget"]&&(tinyMCEPreInit.mceInit[c]=tinyMCEPreInit.mceInit["black-studio-tinymce-widget"],tinyMCEPreInit.mceInit[c].selector="#"+c),this.is_tinymce_configured()&&(!this.is_tinymce_active()&&"visual"===this.get_mode()&&a("#"+c).is(":visible")?(tinyMCEPreInit.mceInit[c].setup=function(b){b.on("keyup change",function(){"visual"===bstw(c).get_mode()&&bstw(c).update_content(),a("#"+c).change()}),a("#"+c).addClass("active").removeClass("activating")},b?tinymce.init(tinyMCEPreInit.mceInit[c]):this.go()):this.is_tinymce_active()||"visual"!==this.get_mode()?a("#"+c).addClass("active").removeClass("activating"):setTimeout(function(){bstw(c).activate(b)},500))}return this},deactivate:function(){return a("#"+c).hasClass("activating")||(this.is_tinymce_active()&&tinymce.get(c).remove(),this.is_tinymce_configured()&&delete tinyMCEPreInit.mceInit[c],this.is_quicktags_active()&&(a(".quicktags-toolbar",this.get_widget_inside()).remove(),delete QTags.instances[c]),this.is_quicktags_configured()&&delete tinyMCEPreInit.qtInit[c],a("#"+c).removeClass("active")),this},update_content:function(){var a;return this.is_tinymce_configured()&&("visual"===this.get_mode()?(a=tinymce.get(c).save(),tinyMCEPreInit.mceInit[c].wpautop&&(a=window.switchEditors.pre_wpautop(a)),this.get_textarea().val(a)):this.is_tinymce_active()&&(a=this.get_textarea().val(),tinyMCEPreInit.mceInit[c].wpautop&&(a=window.switchEditors.wpautop(a)),tinymce.get(c).setContent(a))),this},go:function(a){return"undefined"==typeof a&&(a=this.get_mode()),window.switchEditors.go(c,"visual"===a?"tmce":"html"),this},get_mode:function(){return a("input[id^=widget-black-studio-tinymce][id$=type]",this.get_container()).val()},set_mode:function(b){return a("input[id^=widget-black-studio-tinymce][id$=type]",this.get_container()).val(b),this},get_container:function(){return a("#"+c).closest(bstw_data.container_selectors)},get_widget:function(){return a("#"+c).closest("div.widget")},get_widget_inside:function(){return a("#"+c).closest("div.widget-inside")},get_textarea:function(){return a("#"+c)},is_tinymce_active:function(){return"object"==typeof tinymce&&"object"==typeof tinymce.get(c)&&null!==tinymce.get(c)},is_tinymce_configured:function(){return"undefined"!=typeof tinyMCEPreInit.mceInit[c]},is_quicktags_active:function(){return"object"==typeof QTags.instances[c]},is_quicktags_configured:function(){return"object"==typeof tinyMCEPreInit.qtInit[c]},prepare:function(){return a('[name="'+this.get_textarea().attr("name")+'"]').size()>1&&0===a("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"),a("#wpbody-content").css("overflow","visible"),this},responsive:function(){if(this.get_widget_inside().is(":visible")){var b,c=parseInt(a("input[name=widget-width]",this.get_widget()).val(),10),d=a(window).width(),e=this.get_widget().parent().width(),f=parseInt(a("#wpcontent").css("margin-left"),10),g=!("undefined"==typeof isRtl||!isRtl);c+f+30>d&&(b=this.get_widget().closest("div.widget-liquid-right").length?g?"margin-right":"margin-left":g?"margin-left":"margin-right",this.get_widget().css(b,e-(d-30-f)+"px"))}return this}}},a(document).ready(function(){a(document).on("click","div.widget[id*=black-studio-tinymce] .widget-title, div.widget[id*=black-studio-tinymce] .widget-title-action",function(){a(this).parents("#available-widgets").length||(bstw(a(this)).prepare().responsive().activate(!1),a("input[name=savewidget]",bstw(a(this)).get_widget()).on("click",function(){var b=a(this).closest(".widget").find(".wp-editor-wrap").height();a(this).closest(".widget").find(".wp-editor-wrap").height(b).append('<div class="bstw-loading"></div>'),a(this).closest(".widget").find(".bstw-loading").height(b).show(),bstw(a(this)).update_content()}))}),a(document).on("widget-added",function(a,b){b.is("[id*=black-studio-tinymce]")&&(a.preventDefault(),bstw(b).activate())}),a(document).on("widget-updated",function(a,b){b.is("[id*=black-studio-tinymce]")&&(a.preventDefault(),bstw(b).deactivate().activate())}),a(document).on("widget-synced",function(a,b){b.is("[id*=black-studio-tinymce]")&&(a.preventDefault(),"visual"===bstw(b).get_mode()&&bstw(b).update_content())}),a(document).on("click","[id^=widget-black-studio-tinymce][id$=tmce]",function(){bstw(a(this)).set_mode("visual")}),a(document).on("click","[id^=widget-black-studio-tinymce][id$=html]",function(){bstw(a(this)).set_mode("html")}),a(document).on("click.wp-editor",".wp-editor-wrap",function(){this.id&&(window.wpActiveEditor=this.id.slice(3,-5))}),a(document).on("sortstart",function(b,c){if((a(c.item).is(".widget")||a(c.item).is(".customize-control"))&&!a(c.item).is(".ui-draggable")){var d=["body.wp-customizer .expanded > div[id*=black-studio-tinymce].widget",".widget-liquid-right div[id*=black-studio-tinymce].widget.open"];a(d.join(", ")).filter(":has(.widget-inside:visible)").each(function(){a(".widget-title",this).trigger("click"),bstw(a(this)).deactivate()}),c.item.is("[id*=black-studio-tinymce]")&&bstw(c.item.find("textarea[id^=widget-black-studio-tinymce]")).deactivate()}}),a(document).on("sortupdate",function(b,c){(null===b||a(c.item).is(".widget")&&!a(c.item).is(".ui-draggable"))&&(a("body").addClass("wait"),setTimeout(function(){a("textarea[id^=widget-black-studio-tinymce].active").each(function(){bstw(a(this)).deactivate()}),a("body").removeClass("wait")},1e3))}),a(document).on("click","body.wp-customizer div[id*=black-studio-tinymce].widget .move-widget-btn",function(){a("body").addClass("wait");var b=a(this);setTimeout(function(){a("textarea[id^=widget-black-studio-tinymce].active").each(function(){bstw(a(this)).deactivate()}),bstw(b).activate(),a("body").removeClass("wait")},1e3)}),"object"==typeof bstw_data.activate_events&&bstw_data.activate_events.length>0&&a(document).on(bstw_data.activate_events.join(" "),function(b){bstw(a(b.target)).activate()}),"object"==typeof bstw_data.deactivate_events&&bstw_data.deactivate_events.length>0&&a(document).on(bstw_data.deactivate_events.join(" "),function(b){bstw(a(b.target)).deactivate()}),a(window).resize(function(){a("textarea[id^=widget-black-studio-tinymce]").each(function(){bstw(a(this)).responsive()})}),a(document).on("click",".bstw-visual-editor-disabled-notice .notice-dismiss",function(){a.ajax({url:ajaxurl,data:{action:"bstw_visual_editor_disabled_dismiss_notice"}})}),a("#qt_widget-black-studio-tinymce-__i__-text_toolbar").remove(),a(document).on("click",".bstw-links-icon",function(b){b.preventDefault(),a(this).closest(".bstw-links").children(".bstw-links-list").toggle()})})}(jQuery);
 
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);
js/wp-page-widget.min.js CHANGED
@@ -1,2 +1,3 @@
1
  /* Black Studio TinyMCE Widget */
2
- !function(a){a(document).ready(function(){a(document).on("click","#pw-sidebars-customize div[id*=black-studio-tinymce].widget input.widget-control-save",function(){a(this).unbind("ajaxSuccess").ajaxSuccess(function(){a(this).trigger("widget-updated",[bstw(a(this)).get_widget()]).unbind("ajaxSuccess")})}),a(document).on("click","#pw-sidebars-customize div[id*=black-studio-tinymce].widget .widget-title",function(){var b=bstw(a(this)).get_textarea();b.hasClass("active")&&(bstw(a(this)).deactivate(),a(this).trigger("widget-added",[bstw(a(this)).get_widget()]))})})}(jQuery);
 
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);
languages/black-studio-tinymce-widget.pot CHANGED
@@ -1,18 +1,18 @@
1
- # Copyright (C) 2017 Black Studio
2
  # This file is distributed under the GPLv3.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Black Studio TinyMCE Widget 2.6.0\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://github.com/black-studio/black-studio-tinymce-widget/issues\n"
8
- "POT-Creation-Date: 2017-11-17 00:53:22+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "PO-Revision-Date: 2017-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: Black Studio <info@blackstudio.it>\n"
14
  "Language-Team: Black Studio <info@blackstudio.it>\n"
15
- "X-Generator: grunt-wp-i18n 0.4.9\n"
16
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
17
  "X-Poedit-Basepath: .\n"
18
  "X-Poedit-Language: English\n"
@@ -25,7 +25,7 @@ msgstr ""
25
  "X-Poedit-SearchPath-0: .\n"
26
  "X-Textdomain-Support: yes\n"
27
 
28
- #: black-studio-tinymce-widget.php:279
29
  #. translators: error message shown when multiple instance of the plugin are
30
  #. detected
31
  msgid ""
@@ -40,49 +40,44 @@ msgid ""
40
  "in your sidebars"
41
  msgstr ""
42
 
43
- #: includes/class-admin.php:250
44
  #. translators: error message shown when a duplicated widget ID is detected
45
  msgid ""
46
  "ERROR: Duplicate widget ID detected. To avoid content loss, please create a "
47
  "new widget with the same content and then delete this one."
48
  msgstr ""
49
 
50
- #: includes/class-admin.php:338
51
- #. translators: text used for plugin home link
52
- msgid "Home"
53
  msgstr ""
54
 
55
- #: includes/class-admin.php:340
56
  #. translators: text used for support faq link
57
  msgid "FAQ"
58
  msgstr ""
59
 
60
- #: includes/class-admin.php:342
61
  #. translators: text used for support forum link
62
  msgid "Support"
63
  msgstr ""
64
 
65
- #: includes/class-admin.php:344
66
  #. translators: text used for reviews link
67
  msgid "Rate"
68
  msgstr ""
69
 
70
- #: includes/class-admin.php:346
71
- #. translators: text used for follow on twitter link
72
- msgid "Follow"
73
- msgstr ""
74
-
75
- #: includes/class-admin.php:348
76
  #. translators: text used for donation link
77
  msgid "Donate"
78
  msgstr ""
79
 
80
- #: includes/class-admin.php:368
81
  #. translators: text used for the icon that shows the plugin links
82
  msgid "About Black Studio TinyMCE Widget plugin"
83
  msgstr ""
84
 
85
- #: includes/class-admin.php:460
86
  #. translators: warning message shown when when visual editor is disabled in
87
  #. current user's profile settings
88
  msgid ""
@@ -90,7 +85,7 @@ msgid ""
90
  "in order to use the Visual Editor widget at its full potential."
91
  msgstr ""
92
 
93
- #: includes/class-compatibility-plugins.php:241
94
  #. translators: Warning displayed when deprecated translations of the current
95
  #. widget are detected
96
  msgid ""
1
+ # Copyright (C) 2021 Black Studio
2
  # This file is distributed under the GPLv3.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Black Studio TinyMCE Widget 2.7.0\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://github.com/black-studio/black-studio-tinymce-widget/issues\n"
8
+ "POT-Creation-Date: 2021-10-27 17:56:02+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "PO-Revision-Date: 2021-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: Black Studio <info@blackstudio.it>\n"
14
  "Language-Team: Black Studio <info@blackstudio.it>\n"
15
+ "X-Generator: grunt-wp-i18n 1.0.3\n"
16
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
17
  "X-Poedit-Basepath: .\n"
18
  "X-Poedit-Language: English\n"
25
  "X-Poedit-SearchPath-0: .\n"
26
  "X-Textdomain-Support: yes\n"
27
 
28
+ #: black-studio-tinymce-widget.php:282
29
  #. translators: error message shown when multiple instance of the plugin are
30
  #. detected
31
  msgid ""
40
  "in your sidebars"
41
  msgstr ""
42
 
43
+ #: includes/class-admin.php:269
44
  #. translators: error message shown when a duplicated widget ID is detected
45
  msgid ""
46
  "ERROR: Duplicate widget ID detected. To avoid content loss, please create a "
47
  "new widget with the same content and then delete this one."
48
  msgstr ""
49
 
50
+ #: includes/class-admin.php:365
51
+ #. translators: text used for plugin page link
52
+ msgid "Plugin page"
53
  msgstr ""
54
 
55
+ #: includes/class-admin.php:367
56
  #. translators: text used for support faq link
57
  msgid "FAQ"
58
  msgstr ""
59
 
60
+ #: includes/class-admin.php:369
61
  #. translators: text used for support forum link
62
  msgid "Support"
63
  msgstr ""
64
 
65
+ #: includes/class-admin.php:371
66
  #. translators: text used for reviews link
67
  msgid "Rate"
68
  msgstr ""
69
 
70
+ #: includes/class-admin.php:373
 
 
 
 
 
71
  #. translators: text used for donation link
72
  msgid "Donate"
73
  msgstr ""
74
 
75
+ #: includes/class-admin.php:393
76
  #. translators: text used for the icon that shows the plugin links
77
  msgid "About Black Studio TinyMCE Widget plugin"
78
  msgstr ""
79
 
80
+ #: includes/class-admin.php:486
81
  #. translators: warning message shown when when visual editor is disabled in
82
  #. current user's profile settings
83
  msgid ""
85
  "in order to use the Visual Editor widget at its full potential."
86
  msgstr ""
87
 
88
+ #: includes/class-compatibility-plugins.php:267
89
  #. translators: Warning displayed when deprecated translations of the current
90
  #. widget are detected
91
  msgid ""
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.2
7
  Requires PHP: 5.2
8
- Stable tag: 2.6.9
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl.html
11
 
@@ -24,6 +24,7 @@ For years the default WordPress text widget has been very basic and it required
24
  * Insert images, videos, and other media from WordPress Media Library
25
  * Insert links to existing WordPress pages/posts or external resources
26
  * Support for shortcodes, smilies and embed in widget text (including preview)
 
27
  * Support for Customizer with live preview and quick edit
28
  * Support for widgets accessibility mode
29
  * Compatible with multi-site (WordPress networks)
@@ -212,6 +213,9 @@ DELETE FROM wp_usermeta WHERE meta_key LIKE '_bstw%';
212
 
213
  == Changelog ==
214
 
 
 
 
215
  = 2.6.9 (2019-07-10) =
216
  * Fixed compatibility issue with WP Page Widget plugin
217
 
@@ -545,6 +549,5 @@ DELETE FROM wp_usermeta WHERE meta_key LIKE '_bstw%';
545
 
546
  == Upgrade Notice ==
547
 
548
- = 2.6.9 =
549
- If you're using WPML, double check our FAQ, as version 2.6 introduced some changes regarding widgets translations.
550
  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: 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
 
24
  * Insert images, videos, and other media from WordPress Media Library
25
  * Insert links to existing WordPress pages/posts or external resources
26
  * Support for shortcodes, smilies and embed in widget text (including preview)
27
+ * Support for the Block-based Widgets Editor introduced with WordPress 5.8
28
  * Support for Customizer with live preview and quick edit
29
  * Support for widgets accessibility mode
30
  * Compatible with multi-site (WordPress networks)
213
 
214
  == Changelog ==
215
 
216
+ = 2.7.0 (2021-10-27) =
217
+ * Added compatibility with Block-based Widgets Editor (WordPress 5.8)
218
+
219
  = 2.6.9 (2019-07-10) =
220
  * Fixed compatibility issue with WP Page Widget plugin
221
 
549
 
550
  == Upgrade Notice ==
551
 
552
+ = 2.7.0 =
 
553
  Important: Always ensure to backup your database before upgrading.