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:
parent
9f732e0b38
commit
2e85b40bc0
10 changed files with 78 additions and 75 deletions
|
@ -6,7 +6,9 @@
|
|||
* @author Stefan Herndler
|
||||
* @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
|
||||
$l_obj_Template->replace(
|
||||
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)),
|
||||
"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"),
|
||||
"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",
|
||||
|
||||
"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
|
||||
|
|
|
@ -116,34 +116,35 @@ class MCI_Footnotes {
|
|||
* jQueryUI re-enables the tooltip infobox disabled when WPv5.5 was released.
|
||||
*/
|
||||
public function registerPublic() {
|
||||
|
||||
|
||||
### SCRIPTS
|
||||
|
||||
|
||||
// add the jQuery plugin registered by WordPress
|
||||
wp_enqueue_script( 'jquery' );
|
||||
|
||||
// // Add jQuery Tools:
|
||||
// wp_enqueue_script('mci-footnotes-js-jquery-tools', plugins_url('../js/jquery.tools.min.js', __FILE__));
|
||||
//
|
||||
// // Add the jQuery UI libraries registered by WordPress:
|
||||
// // 'no need to enqueue -core, because dependencies are set'
|
||||
// // Source: <https://wordpress.stackexchange.com/questions/273986/correct-way-to-enqueue-jquery-ui>
|
||||
// wp_enqueue_script( 'jquery-ui-widget' );
|
||||
// wp_enqueue_script( 'jquery-ui-mouse' );
|
||||
// wp_enqueue_script( 'jquery-ui-accordion' );
|
||||
// wp_enqueue_script( 'jquery-ui-autocomplete' );
|
||||
// wp_enqueue_script( 'jquery-ui-slider' );
|
||||
|
||||
|
||||
// Add jQuery Tools:
|
||||
wp_enqueue_script('mci-footnotes-js-jquery-tools', plugins_url('../js/jquery.tools.min.js', __FILE__));
|
||||
|
||||
// Add the jQuery UI libraries registered by WordPress:
|
||||
// 'no need to enqueue -core, because dependencies are set'
|
||||
// Source: <https://wordpress.stackexchange.com/questions/273986/correct-way-to-enqueue-jquery-ui>
|
||||
wp_enqueue_script( 'jquery-ui-widget' );
|
||||
wp_enqueue_script( 'jquery-ui-mouse' );
|
||||
wp_enqueue_script( 'jquery-ui-accordion' );
|
||||
wp_enqueue_script( 'jquery-ui-autocomplete' );
|
||||
wp_enqueue_script( 'jquery-ui-slider' );
|
||||
|
||||
|
||||
// Should that not work, fetch jQuery UI from cdnjs.cloudflare.com:
|
||||
// Add jQuery UI following @vonpiernik:
|
||||
// <https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13456762>:
|
||||
// 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
|
||||
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_register_script( 'jQueryUI', 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js', null, null, true );
|
||||
//wp_enqueue_script( 'jQueryUI' );
|
||||
|
||||
// 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
|
||||
|
@ -153,7 +154,7 @@ class MCI_Footnotes {
|
|||
'mci-footnotes-css-public',
|
||||
plugins_url('../css/public.css', __FILE__),
|
||||
'',
|
||||
'2.0.9d3'
|
||||
'2.1.0'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
* Edited for:
|
||||
* v2.0.4 2020-11-02T2115+0100
|
||||
* v2.0.7 2020-11-06T1342+0100
|
||||
* v2.1.0 2020-11-08T2149+0100
|
||||
*/
|
||||
|
||||
|
||||
|
@ -22,6 +23,16 @@
|
|||
*/
|
||||
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.
|
||||
*
|
||||
|
@ -337,15 +348,6 @@ class MCI_Footnotes_Settings {
|
|||
*/
|
||||
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.
|
||||
*
|
||||
|
@ -373,6 +375,7 @@ class MCI_Footnotes_Settings {
|
|||
*/
|
||||
private $a_arr_Default = array(
|
||||
"footnotes_storage" => array(
|
||||
self::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL => 'Continue reading',
|
||||
self::C_STR_REFERENCE_CONTAINER_NAME => 'References',
|
||||
self::C_BOOL_REFERENCE_CONTAINER_COLLAPSE => '',
|
||||
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_WIDGET_TITLE => 'yes',
|
||||
self::C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT => 'yes',
|
||||
self::C_BOOL_EXPERT_LOOKUP_THE_POST => ''//NEVER ENABLE THIS HOOK!!!!!
|
||||
)
|
||||
);
|
||||
|
||||
|
|
|
@ -12,8 +12,9 @@
|
|||
* @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.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:
|
||||
|
@ -257,17 +258,17 @@ class MCI_Footnotes_Task {
|
|||
* @since 1.5.4
|
||||
* @param array|WP_Post $p_mixed_Posts
|
||||
*/
|
||||
public function the_post(&$p_mixed_Posts) {
|
||||
// single WP_Post object received
|
||||
if (!is_array($p_mixed_Posts)) {
|
||||
$p_mixed_Posts = $this->replacePostObject($p_mixed_Posts);
|
||||
return;
|
||||
}
|
||||
// array of WP_Post objects received
|
||||
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]);
|
||||
}
|
||||
}
|
||||
// public function the_post(&$p_mixed_Posts) {
|
||||
// // single WP_Post object received
|
||||
// if (!is_array($p_mixed_Posts)) {
|
||||
// $p_mixed_Posts = $this->replacePostObject($p_mixed_Posts);
|
||||
// return;
|
||||
// }
|
||||
// // array of WP_Post objects received
|
||||
// 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]);
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* 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_ExcerptText, 0, strrpos($l_str_ExcerptText, ' '));
|
||||
// Removed hyperlink navigation on user request, but left <a> element for style.
|
||||
$l_str_ExcerptText .= ' … ' . 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 .= ' … ' . '<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>';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
* Created-Date: 15.05.14
|
||||
* Created-Time: 16:21
|
||||
* Since: 1.0
|
||||
* Version: 2.0.9d3
|
||||
* Version: 2.1.0
|
||||
*
|
||||
* Last modified: 2020-11-08T1852+0100
|
||||
* Last modified: 2020-11-08T2150+0100
|
||||
*/
|
||||
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
* Created-Date: 15.05.14
|
||||
* Created-Time: 16:21
|
||||
* 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-right: 8px !important;
|
||||
width: 80% !important;
|
||||
}
|
||||
|
||||
textarea {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
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.
|
||||
Author: Mark Cheret
|
||||
Version: 2.0.9d3
|
||||
Version: 2.1.0
|
||||
Author URI: http://cheret.de/plugins/footnotes-2/
|
||||
Text Domain: footnotes
|
||||
Domain Path: /languages
|
||||
|
|
22
readme.txt
22
readme.txt
|
@ -4,7 +4,7 @@ Tags: footnote, footnotes, bibliography, formatting, notes, Post, posts, referen
|
|||
Requires at least: 3.9
|
||||
Tested up to: 5.5
|
||||
Requires PHP: 5.6
|
||||
Stable Tag: 2.0.8
|
||||
Stable Tag: 2.1.0
|
||||
License: GPLv3 or later
|
||||
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 ==
|
||||
|
||||
= 2.0.9d3 =
|
||||
- BUGFIX: DISABLED the_post HOOK 2020-11-08T1839+0100
|
||||
|
||||
= 2.0.9d2 =
|
||||
- Bugfix: Layout: Footnote referrers: disabled bottom border 2020-11-08T1632+0100
|
||||
- Bugfix: Libraries: Correct jQuery UI from third party, disabled from WordPress 2020-11-08T1641+0100
|
||||
- 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.1.0 =
|
||||
- Add: UI: Tooltip: made 'Continue reading' button label customizable
|
||||
- Bugfix: Layout: Footnote referrers: disabled bottom border for theme compatibility
|
||||
- Update: Accessibility: added 'speaker-mute' class to reference container
|
||||
- Bugfix: Settings layout: added named selectors to limit applicability of styles
|
||||
- UPDATE: DISABLED the_post hook, the plugin stopped supporting this hook
|
||||
|
||||
= 2.0.8 =
|
||||
- BUGFIX: Priority level back to PHP_INT_MAX (need to get in touch with other plugins)
|
||||
|
|
|
@ -31,11 +31,6 @@
|
|||
<td style="width: 260px !important;">[[label-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>
|
||||
</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>
|
||||
</tbody>
|
||||
</table>
|
||||
</table>
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
<table class="widefat fixed">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>[[label-readon]]</td>
|
||||
<td>[[readon]]</td>
|
||||
<td>(Quick fix, will be moved to its place.)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>[[label-name]]</td>
|
||||
<td>[[name]]</td>
|
||||
|
@ -13,4 +18,4 @@
|
|||
<td>[[position]]</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</table>
|
||||
|
|
Reference in a new issue