Skip to content

Commit

Permalink
Merge branch 'feature/new-compatibility-code'
Browse files Browse the repository at this point in the history
# Conflicts:
#	Gruntfile.js
#	README.md
#	black-studio-tinymce-widget.php
#	compat/class-compatibility.php
#	compat/deprecated.php
#	compat/wordpress/css/black-studio-tinymce-widget-pre33.css
#	compat/wordpress/js/black-studio-tinymce-widget-pre33.js
#	compat/wordpress/js/black-studio-tinymce-widget-pre33.min.js
#	css/black-studio-tinymce-widget.css
#	css/black-studio-tinymce-widget.min.css
#	includes/class-black-studio-tinymce-admin.php
#	includes/class-black-studio-tinymce-compatibility.php
#	includes/class-black-studio-tinymce-text-filters.php
#	includes/class-compatibility.php
#	includes/class-wp-widget-black-studio-tinymce.php
#	js/black-studio-tinymce-widget.js
#	js/black-studio-tinymce-widget.min.js
#	languages/black-studio-tinymce-widget-de_DE.mo
#	languages/black-studio-tinymce-widget-de_DE.po
#	languages/black-studio-tinymce-widget-es_ES.mo
#	languages/black-studio-tinymce-widget-es_ES.po
#	languages/black-studio-tinymce-widget-fi.mo
#	languages/black-studio-tinymce-widget-fi.po
#	languages/black-studio-tinymce-widget-fr_FR.mo
#	languages/black-studio-tinymce-widget-fr_FR.po
#	languages/black-studio-tinymce-widget-it_IT.mo
#	languages/black-studio-tinymce-widget-it_IT.po
#	languages/black-studio-tinymce-widget-nl_NL.mo
#	languages/black-studio-tinymce-widget-nl_NL.po
#	languages/black-studio-tinymce-widget-pl_PL.mo
#	languages/black-studio-tinymce-widget-pl_PL.po
#	languages/black-studio-tinymce-widget-sv_SE.mo
#	languages/black-studio-tinymce-widget-sv_SE.po
#	languages/black-studio-tinymce-widget.pot
#	readme.txt
  • Loading branch information
marcochiesi committed Mar 8, 2018
2 parents 44129e5 + 0fc4f1e commit 8921e8d
Show file tree
Hide file tree
Showing 30 changed files with 2,087 additions and 294 deletions.
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Expand Up @@ -2,7 +2,7 @@
# Profile: Black-Studio-plugin

filter:
excluded_paths: [css/*.min.css, js/*.min.js]
excluded_paths: [ css/*.min.css, js/*.min.js, compat/plugin/js/*.min.js, compat/wordpress/js/*.min.js, compat/wordpress/css/*.min.css ]

tools:
# Runs the JSHint static analysis tool (https://scrutinizer-ci.com/docs/tools/javascript/jshint/)
Expand Down
8 changes: 0 additions & 8 deletions .tx/config

This file was deleted.

39 changes: 16 additions & 23 deletions Gruntfile.js
Expand Up @@ -11,6 +11,9 @@ module.exports = function( grunt ) {
dirs: {
css: 'css',
js: 'js',
compat_wordpress_css: 'compat/wordpress/css',
compat_wordpress_js: 'compat/wordpress/js',
compat_plugin_js: 'compat/plugin/js',
languages: 'languages'
},

Expand All @@ -22,7 +25,9 @@ module.exports = function( grunt ) {
all: [
'Gruntfile.js',
'<%= dirs.js %>/*.js',
'!<%= dirs.js %>/*.min.js'
'<%= dirs.compat_plugin_js %>/*.js',
'<%= dirs.compat_wordpress_js %>/*.js',
'!**/*.min.js'
]
},

Expand All @@ -35,13 +40,13 @@ module.exports = function( grunt ) {
admin: {
files: [{
expand: true,
cwd: '<%= dirs.js %>/',
cwd: './',
src: [
'*.js',
'!*.min.js',
'!Gruntfile.js'
'<%= dirs.js %>/*.js',
'<%= dirs.compat_plugin_js %>/*.js',
'<%= dirs.compat_wordpress_js %>/*.js',
'!**/*.min.js'
],
dest: '<%= dirs.js %>/',
ext: '.min.js'
}]
}
Expand All @@ -55,12 +60,12 @@ module.exports = function( grunt ) {
},
files: [{
expand: true,
cwd: '<%= dirs.css %>/',
cwd: './',
src: [
'*.css',
'!*.min.css'
'<%= dirs.css %>/*.css',
'<%= dirs.compat_wordpress_css %>/*.css',
'!**/*.min.css'
],
dest: '<%= dirs.css %>/',
ext: '.min.css'
}]
}
Expand Down Expand Up @@ -298,17 +303,7 @@ module.exports = function( grunt ) {
version2: grunt.file.read('includes/class-black-studio-tinymce-plugin.php').match( /version = '(.*)'/ )[1],
compare: '=='
}
},

// Transifex integration
exec: {
txpull: { // Pull Transifex translation - grunt exec:txpull
cmd: 'tx pull -a --minimum-perc=50'
},
txpush: { // Push pot to Transifex - grunt exec:txpush
cmd: 'tx push -s'
}
},
}

});

Expand All @@ -325,8 +320,6 @@ module.exports = function( grunt ) {
grunt.registerTask( 'languages', [
'checktextdomain',
'makepot',
'exec:txpush',
'exec:txpull',
'potomo'
]);

Expand Down
144 changes: 102 additions & 42 deletions README.md

Large diffs are not rendered by default.

274 changes: 274 additions & 0 deletions compat/class-compatibility-plugins.php
@@ -0,0 +1,274 @@
<?php

// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Class that provides compatibility code with other plugins
* Starting from version 3.0.0 this class is no longer used, and it will be removed in future version
*
* @package Black_Studio_TinyMCE_Widget
* @since 2.0.0
* @deprecated 3.0.0
*/

if ( ! class_exists( 'Black_Studio_TinyMCE_Compatibility_Plugins' ) ) {

final class Black_Studio_TinyMCE_Compatibility_Plugins {

/**
* The single instance of the class
*
* @var object
* @since 2.0.0
* @deprecated 3.0.0
*/
protected static $_instance = null;

/**
* Return the single class instance
*
* @return object
* @since 2.0.0
* @deprecated 3.0.0
*/
public static function instance() {
_deprecated_function( __FUNCTION__, '3.0.0' );
if ( is_null( self::$_instance ) ) {
self::$_instance = new self();
}
return self::$_instance;
}

/**
* Class constructor
*
* @since 2.0.0
* @deprecated 3.0.0
*/
protected function __construct() {
_deprecated_function( __FUNCTION__, '3.0.0' );
}

/**
* Prevent the class from being cloned
*
* @return void
* @since 2.0.0
* @deprecated 3.0.0
*/
protected function __clone() {
_deprecated_function( __FUNCTION__, '3.0.0' );
_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; uh?' ), '2.0' );
}

/**
* Compatibility with WPML
*
* @return void
* @since 2.0.0
* @deprecated 3.0.0
*/
public function wpml() {
_deprecated_function( __FUNCTION__, '3.0.0' );
}

/**
* Add widget text to WPML String translation
*
* @param mixed[] $instance
* @return mixed[]
* @since 2.0.0
* @deprecated 3.0.0
*/
public function wpml_widget_update( $instance ) {
_deprecated_function( __FUNCTION__, '3.0.0' );
return $instance;
}

/**
* Translate widget text
*
* @param string $text
* @param mixed[]|null $instance
* @param object|null $widget
* @return string
* @since 2.0.0
* @deprecated 3.0.0
*/
public function wpml_widget_text( $text, $instance = null, $widget = null ) {
_deprecated_function( __FUNCTION__, '3.0.0', 'bstw()->compatibility()->module( \'wpml\' )->widget_text( $text, $instance, $widget )' );
return bstw()->compatibility()->module( 'wpml' )->widget_text( $text, $instance, $widget );
}

/**
* Compatibility for WP Page Widget plugin
*
* @return void
* @since 2.0.0
* @deprecated 3.0.0
*/
public function wp_page_widget() {
_deprecated_function( __FUNCTION__, '3.0.0' );
}

/**
* Initialize compatibility for WP Page Widget plugin (only for WordPress 3.3+)
*
* @return void
* @since 2.0.0
* @deprecated 3.0.0
*/
public function wp_page_widget_admin_init() {
_deprecated_function( __FUNCTION__, '3.0.0' );
}

/**
* Enable filter for WP Page Widget plugin
*
* @param string[] $pages
* @return string[]
* @since 2.0.0
* @deprecated 3.0.0
*/
public function wp_page_widget_enable_pages( $pages ) {
_deprecated_function( __FUNCTION__, '3.0.0' );
return $pages;
}

/**
* Enqueue script for WP Page Widget plugin
*
* @return void
* @since 2.0.0
* @deprecated 3.0.0
*/
public function wp_page_widget_enqueue_script() {
_deprecated_function( __FUNCTION__, '3.0.0' );
}

/**
* Compatibility with Page Builder (SiteOrigin Panels)
*
* @return void
* @since 2.0.0
* @deprecated 3.0.0
*/
public function siteorigin_panels() {
_deprecated_function( __FUNCTION__, '3.0.0' );
}

/**
* Initialize compatibility for Page Builder (SiteOrigin Panels)
*
* @return void
* @since 2.0.0
* @deprecated 3.0.0
*/
public function siteorigin_panels_admin_init() {
_deprecated_function( __FUNCTION__, '3.0.0' );
}

/**
* Remove widget number to prevent translation when using Page Builder (SiteOrigin Panels) + WPML String Translation
*
* @param object $the_widget
* @return object
* @since 2.0.0
* @deprecated 3.0.0
*/
public function siteorigin_panels_widget_object( $the_widget ) {
_deprecated_function( __FUNCTION__, '3.0.0' );
return $the_widget;
}

/**
* Add selector for widget detection for Page Builder (SiteOrigin Panels)
*
* @param string[] $selectors
* @return string[]
* @since 2.0.0
* @deprecated 3.0.0
*/
public function siteorigin_panels_container_selectors( $selectors ) {
_deprecated_function( __FUNCTION__, '3.0.0' );
return $selectors;
}

/**
* Add activate events for Page Builder (SiteOrigin Panels)
*
* @param string[] $events
* @return string[]
* @since 2.0.0
* @deprecated 3.0.0
*/
public function siteorigin_panels_activate_events( $events ) {
_deprecated_function( __FUNCTION__, '3.0.0' );
return $events;
}

/**
* Add deactivate events for Page Builder (SiteOrigin Panels)
*
* @param string[] $events
* @return string[]
* @since 2.0.0
* @deprecated 3.0.0
*/
public function siteorigin_panels_deactivate_events( $events ) {
_deprecated_function( __FUNCTION__, '3.0.0' );
return $events;
}

/**
* Add pages filter to enable editor for Page Builder (SiteOrigin Panels)
*
* @param string[] $pages
* @return string[]
* @since 2.0.0
* @deprecated 3.0.0
*/
public function siteorigin_panels_enable_pages( $pages ) {
_deprecated_function( __FUNCTION__, '3.0.0' );
return $pages;
}

/**
* Disable old compatibility code provided by Page Builder (SiteOrigin Panels)
*
* @return void
* @since 2.0.0
* @deprecated 3.0.0
*/
public function siteorigin_panels_disable_compat( ) {
_deprecated_function( __FUNCTION__, '3.0.0' );
}

/**
* Compatibility with Jetpack After the deadline
*
* @return void
* @since 2.0.0
* @deprecated 3.0.0
*/
public function jetpack_after_the_deadline() {
_deprecated_function( __FUNCTION__, '3.0.0' );
}

/**
* Load Jetpack After the deadline scripts
*
* @return void
* @since 2.0.0
* @deprecated 3.0.0
*/
public function jetpack_after_the_deadline_load() {
_deprecated_function( __FUNCTION__, '3.0.0' );
}

} // END class Black_Studio_TinyMCE_Compatibility_Plugins

} // END class_exists check

0 comments on commit 8921e8d

Please sign in to comment.