Feature: Tooltip 'Continue reading' button label customizable in Settongs; Stable release 2.1.0

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2414862 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
pewgeuges 2020-11-08 21:21:24 +00:00
parent 9f732e0b38
commit 2e85b40bc0
10 changed files with 78 additions and 75 deletions

View file

@ -6,7 +6,9 @@
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 14.09.14 14:47 * @since 1.5.0 14.09.14 14:47
* *
* Edited for v2.0.4 2020-11-01T0509+0100 * Edited for:
* v2.0.4 2020-11-01T0509+0100
* v2.1.0 2020-11-08T2148+0100
*/ */
/** /**
@ -119,6 +121,9 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
// replace all placeholders // replace all placeholders
$l_obj_Template->replace( $l_obj_Template->replace(
array( array(
"label-readon" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL, __("Read on button label", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"readon" => $this->addTextBox(MCI_Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL),
"label-name" => $this->addLabel(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_NAME, __("References label", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)), "label-name" => $this->addLabel(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_NAME, __("References label", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"name" => $this->addTextBox(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_NAME), "name" => $this->addTextBox(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_NAME),
@ -465,10 +470,6 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"label-widget-text" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT, "widget_text"), "label-widget-text" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT, "widget_text"),
"widget-text" => $this->addCheckbox(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT), "widget-text" => $this->addCheckbox(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT),
"url-widget-text" => "http://codex.wordpress.org/Plugin_API/Filter_Reference/widget_text", "url-widget-text" => "http://codex.wordpress.org/Plugin_API/Filter_Reference/widget_text",
"label-post-object" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_POST, "the_post"),
"post-object" => $this->addCheckbox(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_POST),
"url-post-object" => "http://codex.wordpress.org/Plugin_API/Filter_Reference/the_post"
) )
); );
// display template with replaced placeholders // display template with replaced placeholders

View file

@ -122,28 +122,29 @@ class MCI_Footnotes {
// add the jQuery plugin registered by WordPress // add the jQuery plugin registered by WordPress
wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'jquery' );
// // Add jQuery Tools: // Add jQuery Tools:
// wp_enqueue_script('mci-footnotes-js-jquery-tools', plugins_url('../js/jquery.tools.min.js', __FILE__)); wp_enqueue_script('mci-footnotes-js-jquery-tools', plugins_url('../js/jquery.tools.min.js', __FILE__));
//
// // Add the jQuery UI libraries registered by WordPress: // Add the jQuery UI libraries registered by WordPress:
// // 'no need to enqueue -core, because dependencies are set' // 'no need to enqueue -core, because dependencies are set'
// // Source: <https://wordpress.stackexchange.com/questions/273986/correct-way-to-enqueue-jquery-ui> // Source: <https://wordpress.stackexchange.com/questions/273986/correct-way-to-enqueue-jquery-ui>
// wp_enqueue_script( 'jquery-ui-widget' ); wp_enqueue_script( 'jquery-ui-widget' );
// wp_enqueue_script( 'jquery-ui-mouse' ); wp_enqueue_script( 'jquery-ui-mouse' );
// wp_enqueue_script( 'jquery-ui-accordion' ); wp_enqueue_script( 'jquery-ui-accordion' );
// wp_enqueue_script( 'jquery-ui-autocomplete' ); wp_enqueue_script( 'jquery-ui-autocomplete' );
// wp_enqueue_script( 'jquery-ui-slider' ); wp_enqueue_script( 'jquery-ui-slider' );
// Should that not work, fetch jQuery UI from cdnjs.cloudflare.com: // Should that not work, fetch jQuery UI from cdnjs.cloudflare.com:
// Add jQuery UI following @vonpiernik: // Add jQuery UI following @vonpiernik:
// <https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13456762>: // <https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13456762>:
// This was enabled in Footnotes v2.0.0 through v2.0.3. // This was enabled in Footnotes v2.0.0 through v2.0.3.
// Re-added for 2.0.9d1 to look whether it can fix a broken tooltip display. 2020-11-07T1601+0100 // Re-added for 2.0.9d1 to look whether it can fix a broken tooltip display. 2020-11-07T1601+0100
wp_register_script( 'jQueryUI', 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js', null, null, true ); //wp_register_script( 'jQueryUI', 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js', null, null, true );
wp_enqueue_script( 'jQueryUI' ); //wp_enqueue_script( 'jQueryUI' );
// Add jQuery Tools and finish adding jQueryUI: 2020-11-08T1638+0100 // Add jQuery Tools and finish adding jQueryUI: 2020-11-08T1638+0100
wp_enqueue_script('mci-footnotes-js-jquery-tools', plugins_url('../js/jquery.tools.min.js', __FILE__), ['jQueryUI']); //wp_enqueue_script('mci-footnotes-js-jquery-tools', plugins_url('../js/jquery.tools.min.js', __FILE__), ['jQueryUI']);
### STYLES ### STYLES
@ -153,7 +154,7 @@ class MCI_Footnotes {
'mci-footnotes-css-public', 'mci-footnotes-css-public',
plugins_url('../css/public.css', __FILE__), plugins_url('../css/public.css', __FILE__),
'', '',
'2.0.9d3' '2.1.0'
); );
} }

View file

@ -9,6 +9,7 @@
* Edited for: * Edited for:
* v2.0.4 2020-11-02T2115+0100 * v2.0.4 2020-11-02T2115+0100
* v2.0.7 2020-11-06T1342+0100 * v2.0.7 2020-11-06T1342+0100
* v2.1.0 2020-11-08T2149+0100
*/ */
@ -22,6 +23,16 @@
*/ */
class MCI_Footnotes_Settings { class MCI_Footnotes_Settings {
/**
* Settings Container Key for the label of the 'Read on' button in truncated tooltips
*
* @since 2.0.9
* @var string
*
* 2020-11-08T2106+0100
*/
const C_STR_FOOTNOTES_TOOLTIP_READON_LABEL = "footnote_inputfield_readon_label";
/** /**
* Settings Container Key for the label of the reference container. * Settings Container Key for the label of the reference container.
* *
@ -337,15 +348,6 @@ class MCI_Footnotes_Settings {
*/ */
const C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT = "footnote_inputfield_expert_lookup_widget_text"; const C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT = "footnote_inputfield_expert_lookup_widget_text";
/**
* Settings Container Key the activation of the_post hook.
*
* @author Stefan Herndler
* @since 1.5.5
* @var string
*/
const C_BOOL_EXPERT_LOOKUP_THE_POST = "footnote_inputfield_expert_lookup_the_post";
/** /**
* Stores a singleton reference of this class. * Stores a singleton reference of this class.
* *
@ -373,6 +375,7 @@ class MCI_Footnotes_Settings {
*/ */
private $a_arr_Default = array( private $a_arr_Default = array(
"footnotes_storage" => array( "footnotes_storage" => array(
self::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL => 'Continue reading',
self::C_STR_REFERENCE_CONTAINER_NAME => 'References', self::C_STR_REFERENCE_CONTAINER_NAME => 'References',
self::C_BOOL_REFERENCE_CONTAINER_COLLAPSE => '', self::C_BOOL_REFERENCE_CONTAINER_COLLAPSE => '',
self::C_STR_REFERENCE_CONTAINER_POSITION => 'post_end', self::C_STR_REFERENCE_CONTAINER_POSITION => 'post_end',
@ -447,7 +450,6 @@ class MCI_Footnotes_Settings {
self::C_BOOL_EXPERT_LOOKUP_THE_EXCERPT => 'yes', self::C_BOOL_EXPERT_LOOKUP_THE_EXCERPT => 'yes',
self::C_BOOL_EXPERT_LOOKUP_WIDGET_TITLE => 'yes', self::C_BOOL_EXPERT_LOOKUP_WIDGET_TITLE => 'yes',
self::C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT => 'yes', self::C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT => 'yes',
self::C_BOOL_EXPERT_LOOKUP_THE_POST => ''//NEVER ENABLE THIS HOOK!!!!!
) )
); );

View file

@ -12,8 +12,9 @@
* @docteurfitness <https://wordpress.org/support/topic/auto-load-post-compatibility-update/> * @docteurfitness <https://wordpress.org/support/topic/auto-load-post-compatibility-update/>
* *
* Edited for v2.0.9: DISABLED the_post HOOK 2020-11-08T1839+0100 * Edited for v2.0.9: DISABLED the_post HOOK 2020-11-08T1839+0100
* Edited for v2.1.0: Promoted the 'Continue reading' button from localization to customization 2020-11-08T2146+0100
* *
* Last modified 2020-11-08T1850+0100 * Last modified 2020-11-08T2146+0100
*/ */
// If called directly, abort: // If called directly, abort:
@ -257,17 +258,17 @@ class MCI_Footnotes_Task {
* @since 1.5.4 * @since 1.5.4
* @param array|WP_Post $p_mixed_Posts * @param array|WP_Post $p_mixed_Posts
*/ */
public function the_post(&$p_mixed_Posts) { // public function the_post(&$p_mixed_Posts) {
// single WP_Post object received // // single WP_Post object received
if (!is_array($p_mixed_Posts)) { // if (!is_array($p_mixed_Posts)) {
$p_mixed_Posts = $this->replacePostObject($p_mixed_Posts); // $p_mixed_Posts = $this->replacePostObject($p_mixed_Posts);
return; // return;
} // }
// array of WP_Post objects received // // array of WP_Post objects received
for($l_int_Index = 0; $l_int_Index < count($p_mixed_Posts); $l_int_Index++) { // for($l_int_Index = 0; $l_int_Index < count($p_mixed_Posts); $l_int_Index++) {
$p_mixed_Posts[$l_int_Index] = $this->replacePostObject($p_mixed_Posts[$l_int_Index]); // $p_mixed_Posts[$l_int_Index] = $this->replacePostObject($p_mixed_Posts[$l_int_Index]);
} // }
} // }
/** /**
* Replace all Footnotes in a WP_Post object. * Replace all Footnotes in a WP_Post object.
@ -395,7 +396,7 @@ class MCI_Footnotes_Task {
$l_str_ExcerptText = substr($l_str_DummyText, 0, $l_int_MaxLength); $l_str_ExcerptText = substr($l_str_DummyText, 0, $l_int_MaxLength);
$l_str_ExcerptText = substr($l_str_ExcerptText, 0, strrpos($l_str_ExcerptText, ' ')); $l_str_ExcerptText = substr($l_str_ExcerptText, 0, strrpos($l_str_ExcerptText, ' '));
// Removed hyperlink navigation on user request, but left <a> element for style. // Removed hyperlink navigation on user request, but left <a> element for style.
$l_str_ExcerptText .= '&nbsp;&#x2026; ' . sprintf(__("%scontinue%s", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), '<a class="continue" onclick="footnote_moveToAnchor_' . $l_int_PostID . '(\'footnote_plugin_reference_' . $l_int_PostID . '_' . $l_str_Index . '\');">', '</a>'); $l_str_ExcerptText .= '&nbsp;&#x2026; ' . '<a class="continue" onclick="footnote_moveToAnchor_' . $l_int_PostID . '(\'footnote_plugin_reference_' . $l_int_PostID . '_' . $l_str_Index . '\');">' . MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL) . '</a>';
} }
} }

View file

@ -4,9 +4,9 @@
* Created-Date: 15.05.14 * Created-Date: 15.05.14
* Created-Time: 16:21 * Created-Time: 16:21
* Since: 1.0 * Since: 1.0
* Version: 2.0.9d3 * Version: 2.1.0
* *
* Last modified: 2020-11-08T1852+0100 * Last modified: 2020-11-08T2150+0100
*/ */

View file

@ -4,9 +4,9 @@
* Created-Date: 15.05.14 * Created-Date: 15.05.14
* Created-Time: 16:21 * Created-Time: 16:21
* Since: 1.0 * Since: 1.0
* Version: 2.0.9d1 * Version: 2.1.0
* *
* Last modified: 2020-11-07T1608+0100 * Last modified: 2020-11-08T2150+0100
*/ */
@ -39,9 +39,15 @@
} }
input[type=text], input[type=password], textarea, select { #footnote_inputfield_placeholder_start_user_defined,
#footnote_inputfield_placeholder_end_user_defined,
#footnote_inputfield_readon_label,
#footnote_inputfield_references_label,
#footnote_inputfield_custom_css
/*input[type=text], input[type=password], textarea, select*/ {
padding-left: 8px !important; padding-left: 8px !important;
padding-right: 8px !important; padding-right: 8px !important;
width: 80% !important;
} }
textarea { textarea {

View file

@ -4,7 +4,7 @@
Plugin URI: https://wordpress.org/plugins/footnotes/ Plugin URI: https://wordpress.org/plugins/footnotes/
Description: time to bring footnotes to your website! footnotes are known from offline publishing and everybody takes them for granted when reading a magazine. Description: time to bring footnotes to your website! footnotes are known from offline publishing and everybody takes them for granted when reading a magazine.
Author: Mark Cheret Author: Mark Cheret
Version: 2.0.9d3 Version: 2.1.0
Author URI: http://cheret.de/plugins/footnotes-2/ Author URI: http://cheret.de/plugins/footnotes-2/
Text Domain: footnotes Text Domain: footnotes
Domain Path: /languages Domain Path: /languages

View file

@ -4,7 +4,7 @@ Tags: footnote, footnotes, bibliography, formatting, notes, Post, posts, referen
Requires at least: 3.9 Requires at least: 3.9
Tested up to: 5.5 Tested up to: 5.5
Requires PHP: 5.6 Requires PHP: 5.6
Stable Tag: 2.0.8 Stable Tag: 2.1.0
License: GPLv3 or later License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html License URI: http://www.gnu.org/licenses/gpl-3.0.html
@ -80,20 +80,12 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
== Changelog == == Changelog ==
= 2.0.9d3 = = 2.1.0 =
- BUGFIX: DISABLED the_post HOOK 2020-11-08T1839+0100 - Add: UI: Tooltip: made 'Continue reading' button label customizable
- Bugfix: Layout: Footnote referrers: disabled bottom border for theme compatibility
= 2.0.9d2 = - Update: Accessibility: added 'speaker-mute' class to reference container
- Bugfix: Layout: Footnote referrers: disabled bottom border 2020-11-08T1632+0100 - Bugfix: Settings layout: added named selectors to limit applicability of styles
- Bugfix: Libraries: Correct jQuery UI from third party, disabled from WordPress 2020-11-08T1641+0100 - UPDATE: DISABLED the_post hook, the plugin stopped supporting this hook
- Update: Accessibility: added 'speaker-mute' class to reference container, to meet user needs
= 2.0.9d1 =
- Bugfix: Libraries: Re-added jQuery UI from third party to look whether it can fix a broken tooltip display 2020-11-07T1604+0100
- Bugfix: Settings layout: removed 80% width rule for input, text areas, select boxes, on user request
= 2.0.9d0 =
- Bugfix: Layout: Footnote referrers: more efficiently disable underline unless hovered
= 2.0.8 = = 2.0.8 =
- BUGFIX: Priority level back to PHP_INT_MAX (need to get in touch with other plugins) - BUGFIX: Priority level back to PHP_INT_MAX (need to get in touch with other plugins)

View file

@ -31,11 +31,6 @@
<td style="width: 260px !important;">[[label-widget-text]]</td> <td style="width: 260px !important;">[[label-widget-text]]</td>
<td style="width: 65px !important;">[[widget-text]]</td> <td style="width: 65px !important;">[[widget-text]]</td>
<td style="white-space: nowrap;"><a href="[[url-widget-text]]" target="_blank">[[url-widget-text]]</a></td> <td style="white-space: nowrap;"><a href="[[url-widget-text]]" target="_blank">[[url-widget-text]]</a></td>
</tr>
<tr>
<td style="width: 260px !important;">[[label-post-object]]</td>
<td style="width: 65px !important;">[[post-object]]</td>
<td style="white-space: nowrap;"><a href="[[url-post-object]]" target="_blank">[[url-post-object]]</a></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -1,5 +1,10 @@
<table class="widefat fixed"> <table class="widefat fixed">
<tbody> <tbody>
<tr>
<td>[[label-readon]]</td>
<td>[[readon]]</td>
<td>(Quick fix, will be moved to its place.)</td>
</tr>
<tr> <tr>
<td>[[label-name]]</td> <td>[[label-name]]</td>
<td>[[name]]</td> <td>[[name]]</td>