diff --git a/README.md b/README.md index 2e8936f..5fa9396 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ Tags: wiki, wikipedia, mediawiki, tooltip, tooltipster, shortcode Requires at least: 3.0 -Tested up to: 4.8 +Tested up to: 4.9.4 -Stable tag: 1.7.4 +Stable tag: 1.8.0 Donate link: https://n1da.net/specials/wp-wiki-tooltip/spenden/ @@ -64,6 +64,14 @@ Since version 1.7.0 you can define a minimum screen width that is necessary to s # Changelog Here the last three major releases are listed, only. Find complete log of all changes in the [extra changelog file](https://github.com/nida78/wp-wiki-tooltip/blob/master/CHANGELOG.md)! +## [1.8.0 - C6H9N3O2 | Histidine] +*Release Date - February 23rd, 2018* + +* if tooltip trigger 'hover' is selected you can set explicitly how the link has to work +* special options for handling errors are available +* a new version of Tooltipster plugin was released that leads to some programmatic and design changes +* a preview for every tooltip designs is available at options page now + ## [1.7.0 - C2H5NO2 | Glycine] *Release Date - October 22nd, 2016* @@ -76,12 +84,6 @@ Here the last three major releases are listed, only. Find complete log of all ch * the plugin comes with a [TinyMCE](https://codex.wordpress.org/TinyMCE) plugin that helps users creating the shortcodes * some new graphical assets have been added to support high-DPI displays (aka ‘retina’) and Right-to-Left languages -## [1.5.0 - C5H10N2O3 | Glutamine] -*Release Date - December 29th, 2015* - -* New feature: thumbnail pictures can be enabled and styled - both, globally and by shortcode -* Minor bug-fix that uses the complete right Wiki URL when requesting the tooltip content - # Upgrade Notice ## Upgrade to 1.4.0 @@ -90,6 +92,6 @@ The former Wiki URL is not transferred into this version. Review the settings pa ## Elder Upgrades Nothing special to consider. +[1.8.0 - C6H9N3O2 | Histidine]: https://github.com/nida78/wp-wiki-tooltip/releases/tag/1.8.0 [1.7.0 - C2H5NO2 | Glycine]: https://github.com/nida78/wp-wiki-tooltip/releases/tag/1.7.0 [1.6.0 - C5H9NO4 | Glutamic Acid]: https://github.com/nida78/wp-wiki-tooltip/releases/tag/1.6.0 -[1.5.0 - C5H10N2O3 | Glutamine]: https://github.com/nida78/wp-wiki-tooltip/releases/tag/1.5.0 diff --git a/assets/screenshot-2.jpg b/assets/screenshot-2.jpg index 786c43c..b7943c1 100644 Binary files a/assets/screenshot-2.jpg and b/assets/screenshot-2.jpg differ diff --git a/assets/screenshot-3.jpg b/assets/screenshot-3.jpg index ed301eb..98615d5 100644 Binary files a/assets/screenshot-3.jpg and b/assets/screenshot-3.jpg differ diff --git a/class.wp-wiki-tooltip-admin.php b/class.wp-wiki-tooltip-admin.php index 46c7a8b..ab1e6ec 100644 --- a/class.wp-wiki-tooltip-admin.php +++ b/class.wp-wiki-tooltip-admin.php @@ -21,9 +21,17 @@ public function __construct( $name='' ) { } public function init() { + wp_enqueue_style( 'tooltipster-css', plugins_url( 'static/external/tooltipster/dist/css/tooltipster.bundle.min.css', __FILE__ ), array(), '4.2.5', 'all' ); + wp_enqueue_style( 'tooltipster-light-css', plugins_url( 'static/external/tooltipster/dist/css/plugins/tooltipster/sideTip/themes/tooltipster-sideTip-light.min.css', __FILE__ ), array(), '4.2.5', 'all' ); + wp_enqueue_style( 'tooltipster-noir-css', plugins_url( 'static/external/tooltipster/dist/css/plugins/tooltipster/sideTip/themes/tooltipster-sideTip-noir.min.css', __FILE__ ), array(), '4.2.5', 'all' ); + wp_enqueue_style( 'tooltipster-punk-css', plugins_url( 'static/external/tooltipster/dist/css/plugins/tooltipster/sideTip/themes/tooltipster-sideTip-punk.min.css', __FILE__ ), array(), '4.2.5', 'all' ); + wp_enqueue_style( 'tooltipster-shadow-css', plugins_url( 'static/external/tooltipster/dist/css/plugins/tooltipster/sideTip/themes/tooltipster-sideTip-shadow.min.css', __FILE__ ), array(), '4.2.5', 'all' ); + wp_enqueue_style( 'wp-wiki-tooltip-admin-css', plugins_url( 'static/css/wp-wiki-tooltip-admin.css', __FILE__ ), array(), $this->version, 'all' ); wp_enqueue_style( 'wp-wiki-tooltip-mce-css', plugins_url( 'static/css/wp-wiki-tooltip-mce.css', __FILE__ ), array(), $this->version, 'all' ); + wp_enqueue_script( 'tooltipster-js', plugins_url( 'static/external/tooltipster/dist/js/tooltipster.bundle.min.js', __FILE__ ), array( 'jquery' ), '3.0', false ); + wp_register_script( 'wp-wiki-tooltip-admin-js', plugins_url( 'static/js/wp-wiki-tooltip-admin.js', __FILE__ ), array( 'jquery' ), $this->version, false ); wp_localize_script( 'wp-wiki-tooltip-admin-js', 'wp_wiki_tooltip_admin', array( 'alert_remove' => __( 'Rows that is marked as "Standard" could not be deleted!', 'wp-wiki-tooltip' ), @@ -112,22 +120,31 @@ public function register_settings() { add_settings_field( 'trigger', __( 'Tooltips are triggered on', 'wp-wiki-tooltip' ), - array( $this, 'print_trigger_field' ), - 'wp-wiki-tooltip-settings-base', - 'wp-wiki-tooltip-settings-base', - $wp_wiki_tooltip_default_options - ); - - add_settings_field( - 'min-screen-width', - __( 'Minimum screen width', 'wp-wiki-tooltip' ), - array( $this, 'print_min_screen_width_field' ), + array( $this, 'print_trigger_fields' ), 'wp-wiki-tooltip-settings-base', 'wp-wiki-tooltip-settings-base', $wp_wiki_tooltip_default_options ); - /*** Design Settings ***/ + add_settings_field( + 'min-screen-width', + __( 'Minimum screen width', 'wp-wiki-tooltip' ), + array( $this, 'print_min_screen_width_field' ), + 'wp-wiki-tooltip-settings-base', + 'wp-wiki-tooltip-settings-base', + $wp_wiki_tooltip_default_options + ); + + add_settings_field( + 'error-handling', + __( 'Error handling', 'wp-wiki-tooltip' ), + array( $this, 'print_error_handling_fields' ), + 'wp-wiki-tooltip-settings-base', + 'wp-wiki-tooltip-settings-base', + $wp_wiki_tooltip_default_options + ); + + /*** Design Settings ***/ add_settings_section( 'wp-wiki-tooltip-settings-design', __( 'Design Settings', 'wp-wiki-tooltip' ), @@ -292,11 +309,19 @@ public function print_a_target_field( $args ) { echo '

'; } - public function print_trigger_field( $args ) { - $used_trigger = isset( $this->options[ 'trigger' ] ) ? $this->options[ 'trigger' ] : $args[ 'trigger' ]; - - echo '

'; - echo '

'; + public function print_trigger_fields( $args ) { + $used_trigger = isset( $this->options[ 'trigger' ] ) ? $this->options[ 'trigger' ] : $args[ 'trigger' ]; + $used_action = isset( $this->options[ 'trigger-hover-action' ] ) ? $this->options[ 'trigger-hover-action' ] : $args[ 'trigger-hover-action' ]; + + echo '

'; + echo '

'; +?> +

+ +' . __( 'Enable tooltips only if the width of the used display is greater than this defined number of pixel.', 'wp-wiki-tooltip' ) . '

'; } + public function print_error_handling_fields( $args ) { + $used_error_handling = isset( $this->options[ 'error-handling' ] ) ? $this->options[ 'error-handling' ] : $args[ 'error-handling' ]; + $not_used_show_own = ( $used_error_handling === 'show-own' ) ? false : true; + $not_used_show_page = ( $used_error_handling === 'show-page' ) ? false : true; + + echo '

' . __( 'What should happen if the linked Wiki page is not available, e.g. if the Wiki is under construction?', 'wp-wiki-tooltip' ) . '

'; + echo '

'; + echo '

'; + echo ''; + echo '

'; + } + public function print_theme_field( $args ) { $used_theme = isset( $this->options[ 'theme' ] ) ? $this->options[ 'theme' ] : $args[ 'theme' ]; echo '