development 2.1.1d10 priority level setting as fix for ref container relative position, for evaluation project-side / user-side

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2419731 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
pewgeuges 2020-11-17 02:14:21 +00:00
parent 3e4453929a
commit 1e0c8a3a89
9 changed files with 124 additions and 86 deletions

View file

@ -135,17 +135,17 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"label-collapse" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_COLLAPSE, __("Collapse references by default", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"collapse" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_COLLAPSE, $l_arr_Enabled),
"label-symbol" => $this->addLabel(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE, __("Display a backlink symbol", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"symbol" => $this->addSelectBox(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE, $l_arr_Enabled),
"label-symbol" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE, __("Display a backlink symbol", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"symbol" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE, $l_arr_Enabled),
"label-startpage" => $this->addLabel(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_START_PAGE_ENABLE, __("Display on start page too", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"startpage" => $this->addSelectBox(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_START_PAGE_ENABLE, $l_arr_Enabled),
"label-startpage" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_START_PAGE_ENABLE, __("Display on start page too", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"startpage" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_START_PAGE_ENABLE, $l_arr_Enabled),
"label-3column" => $this->addLabel(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE, __("Three-column layout", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"3column" => $this->addSelectBox(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE, $l_arr_Enabled),
"label-3column" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE, __("Three-column layout", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"3column" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE, $l_arr_Enabled),
"label-switch" => $this->addLabel(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH, __("Symbol appended, not prepended", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"switch" => $this->addSelectBox(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH, $l_arr_Enabled),
"label-switch" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH, __("Symbol appended, not prepended", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"switch" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH, $l_arr_Enabled),
"label-position" => $this->addLabel(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION, __("Where shall the reference container appear", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"position" => $this->addSelectBox(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION, $l_arr_Positions)
@ -302,8 +302,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
// replace all placeholders
$l_obj_Template->replace(
array(
"label-superscript" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS, __("Enable superscript footnote referrers", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"superscript" => $this->addSelectBox(MCI_Footnotes_Settings::C_STR_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS, $l_arr_Enabled),
"label-superscript" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS, __("Enable superscript footnote referrers", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"superscript" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS, $l_arr_Enabled),
"label-before" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_STYLING_BEFORE, __("Before Footnotes index", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"before" => $this->addTextBox(MCI_Footnotes_Settings::C_STR_FOOTNOTES_STYLING_BEFORE),
@ -490,6 +490,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"label-the-content" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_CONTENT, "the_content"),
"the-content" => $this->addCheckbox(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_CONTENT),
"priority-the-content" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL, 0, PHP_INT_MAX),
"url-the-content" => "http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content",
"label-the-excerpt" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_EXCERPT, "the_excerpt"),

View file

@ -159,7 +159,7 @@ class MCI_Footnotes {
'mci-footnotes-css-public',
plugins_url('../css/public.css', __FILE__),
'',
'2.1.1d9'
'2.1.1d10'
);
}

View file

@ -16,8 +16,9 @@
* 2.1.1 fix start pages by option to hide ref container
* 2.1.1 fix ref container by option restoring 3-column layout
* 2.1.1 fix ref container by option to switch index/symbol 2020-11-16T2022+0100
* 2.1.1 fix ref container positioning by priority level 2020-11-17T0205+0100
*
* Last modified: 2020-11-16T2153+0100
* Last modified: 2020-11-17T0311+0100
*/
@ -31,29 +32,10 @@
*/
class MCI_Footnotes_Settings {
/**
* Settings Container Key for the label of the 'Read on' button in truncated tooltips
*
* @since 2.1.0
* @var string
*
* 2020-11-08T2106+0100
*/
const C_STR_FOOTNOTES_TOOLTIP_READON_LABEL = "footnote_inputfield_readon_label";
/**
* Settings Container Keys of 5 options fixing default layout
*
* @since 2.1.1
* @var string
*
* 2020-11-16T0859+0100
* SETTINGS CONTAINER KEY DEFINITIONS
*/
const C_STR_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS = "footnotes_inputfield_referrer_superscript_tags";
const C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE = "footnotes_inputfield_reference_container_backlink_symbol_enable";
const C_STR_REFERENCE_CONTAINER_START_PAGE_ENABLE = "footnotes_inputfield_reference_container_start_page_enable";
const C_STR_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE = "footnotes_inputfield_reference_container_3column_layout_enable";
const C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH = "footnotes_inputfield_reference_container_backlink_symbol_switch";
/**
* Settings Container Key for the label of the reference container.
@ -380,6 +362,39 @@ class MCI_Footnotes_Settings {
*/
const C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT = "footnote_inputfield_expert_lookup_widget_text";
/**
* Settings Container Key for the label of the 'Read on' button in truncated tooltips
*
* @since 2.1.0
* @var string
*
* 2020-11-08T2106+0100
*/
const C_STR_FOOTNOTES_TOOLTIP_READON_LABEL = "footnote_inputfield_readon_label";
/**
* Settings Container Keys of options fixing default layout
*
* @since 2.1.1
* @var string
*
* 2020-11-16T0859+0100
*/
const C_BOOL_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS = "footnotes_inputfield_referrer_superscript_tags";
const C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE = "footnotes_inputfield_reference_container_backlink_symbol_enable";
const C_BOOL_REFERENCE_CONTAINER_START_PAGE_ENABLE = "footnotes_inputfield_reference_container_start_page_enable";
const C_BOOL_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE = "footnotes_inputfield_reference_container_3column_layout_enable";
const C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH = "footnotes_inputfield_reference_container_backlink_symbol_switch";
const C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL = "footnote_inputfield_expert_lookup_the_title_priority_level";
const C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL = "footnote_inputfield_expert_lookup_the_content_priority_level";
const C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL = "footnote_inputfield_expert_lookup_the_excerpt_priority_level";
const C_INT_EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL = "footnote_inputfield_expert_lookup_widget_title_priority_level";
const C_INT_EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL = "footnote_inputfield_expert_lookup_widget_text_priority_level";
/**
* Stores a singleton reference of this class.
*
@ -417,10 +432,10 @@ class MCI_Footnotes_Settings {
// <https://wordpress.org/support/topic/too-many-errors-18/>
self::C_BOOL_COMBINE_IDENTICAL_FOOTNOTES => '',
self::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE => 'yes',
self::C_STR_REFERENCE_CONTAINER_START_PAGE_ENABLE => 'yes',
self::C_STR_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE => '',
self::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH => '',
self::C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE => 'yes',
self::C_BOOL_REFERENCE_CONTAINER_START_PAGE_ENABLE => 'yes',
self::C_BOOL_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE => '',
self::C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH => '',
self::C_STR_FOOTNOTES_SHORT_CODE_START => '((',
self::C_STR_FOOTNOTES_SHORT_CODE_END => '))',
@ -430,13 +445,14 @@ class MCI_Footnotes_Settings {
self::C_STR_FOOTNOTES_LOVE => 'no',
self::C_BOOL_FOOTNOTES_IN_EXCERPT => 'yes',
self::C_BOOL_FOOTNOTES_EXPERT_MODE => 'no'
),
"footnotes_storage_custom" => array(
self::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL => 'Continue reading',
self::C_STR_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS => 'yes',
self::C_BOOL_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS => 'yes',
// The default footnote referrer surroundings should be square brackets:
// * as in English typesetting;
@ -484,6 +500,7 @@ class MCI_Footnotes_Settings {
self::C_STR_HYPERLINK_ARROW => '&#8593;',
self::C_STR_HYPERLINK_ARROW_USER_DEFINED => '',
self::C_STR_CUSTOM_CSS => ''
),
"footnotes_storage_expert" => array(
@ -497,7 +514,15 @@ class MCI_Footnotes_Settings {
self::C_BOOL_EXPERT_LOOKUP_THE_EXCERPT => 'yes',
self::C_BOOL_EXPERT_LOOKUP_WIDGET_TITLE => '',
self::C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT => 'yes',
self::C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL => PHP_INT_MAX,
self::C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL => PHP_INT_MAX,
self::C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL => PHP_INT_MAX,
self::C_INT_EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL => PHP_INT_MAX,
self::C_INT_EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL => PHP_INT_MAX,
)
);
/**

View file

@ -15,8 +15,9 @@
* 2.1.0: promoted the 'Continue reading' button from localization to customization 2020-11-08T2146+0100
* 2.1.1: combining identical footnotes: fixed dead links 2020-11-14T2233+0100
* 2.1.1: options fixing ref container layout and referrer vertical alignment 2020-11-16T2024+0100
* 2.1.1: option fixing ref container relative position 2020-11-17T0254+0100
*
* Last modified 2020-11-16T2151+0100
* Last modified 2020-11-17T0255+0100
*/
// If called directly, abort:
@ -84,8 +85,10 @@ class MCI_Footnotes_Task {
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_TITLE))) {
add_filter('the_title', array($this, "the_title"), PHP_INT_MAX);
}
// SET PRIORITY LEVEL TO CUSTOM FOR PAGE LAYOUT; DEFAULT PHP_INT_MAX:
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_CONTENT))) {
add_filter('the_content', array($this, "the_content"), PHP_INT_MAX);
add_filter('the_content', array($this, "the_content"), MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL));
}
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_EXCERPT))) {
add_filter('the_excerpt', array($this, "the_excerpt"), PHP_INT_MAX);
@ -123,7 +126,7 @@ class MCI_Footnotes_Task {
<?php
echo MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_CUSTOM_CSS);
if (!MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_START_PAGE_ENABLE))) {
if (!MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_START_PAGE_ENABLE))) {
echo "\r\n.home .footnotes_reference_container { display: none; }\r\n";
}
@ -437,7 +440,7 @@ class MCI_Footnotes_Task {
}
// define the HTML element to use for the referrers:
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS))) {
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS))) {
$l_str_Element = 'sup';
} else {
$l_str_Element = 'span';
@ -523,7 +526,7 @@ class MCI_Footnotes_Task {
// FOOTNOTE INDEX BACKLINK SYMBOL
// check if arrow is not disabled:
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE))) {
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE))) {
// get html arrow
$l_str_Arrow = MCI_Footnotes_Convert::getArrow(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_HYPERLINK_ARROW));
@ -563,13 +566,13 @@ class MCI_Footnotes_Task {
} else {
// when 3-column layout is turned on (only valid if combining is turned off):
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE))) {
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE))) {
$l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_PUBLIC, "reference-container-body-3column");
} else {
// when switch symbol and index is turned on (only valid if 3-column is disabled):
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH))) {
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH))) {
$l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_PUBLIC, "reference-container-body-switch");
} else {

View file

@ -4,9 +4,9 @@
* Created-Date: 15.05.14
* Created-Time: 16:21
* Since: 1.0
* Version: 2.1.1d9
* Version: 2.1.1d10
*
* Last modified: 2020-11-16T2150+0100
* Last modified: 2020-11-17T0256+0100
*/

View file

@ -4,9 +4,9 @@
* Created-Date: 15.05.14
* Created-Time: 16:21
* Since: 1.0
* Version: 2.1.1d9
* Version: 2.1.1d10
*
* Last modified: 2020-11-16T2050+0100
* Last modified: 2020-11-17T0256+0100
*/

View file

@ -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.1.1d9
Version: 2.1.1d10
Author URI: http://cheret.de/plugins/footnotes-2/
Text Domain: footnotes
Domain Path: /languages

View file

@ -80,6 +80,9 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
== Changelog ==
= 2.1.1d10 =
- Bugfix: Layout: Reference container: fix relative positioning by priority level setting
= 2.1.1d9 =
- Bugfix: Layout: Footnote referrers: select box to make superscript optional wrt themes w/o support
- Bugfix: Layout: Footnote referrers: new fix for line height

View file

@ -3,6 +3,7 @@
<tr>
<th style="width: 260px !important;">[[head-hook]]</th>
<th style="width: 65px !important;">[[head-checkbox]]</th>
<th style="">Priority</th>
<th style="white-space: nowrap;">[[head-url]]</th>
</tr>
</thead>
@ -10,26 +11,31 @@
<tr>
<td style="width: 260px !important;">[[label-the-title]]</td>
<td style="width: 65px !important;">[[the-title]]</td>
<td style=""></td>
<td style="white-space: nowrap;"><a href="[[url-the-title]]" target="_blank">[[url-the-title]]</a></td>
</tr>
<tr>
<td style="width: 260px !important;">[[label-the-content]]</td>
<td style="width: 65px !important;">[[the-content]]</td>
<td style="">[[priority-the-content]]</td>
<td style="white-space: nowrap;"><a href="[[url-the-content]]" target="_blank">[[url-the-content]]</a></td>
</tr>
<tr>
<td style="width: 260px !important;">[[label-the-excerpt]]</td>
<td style="width: 65px !important;">[[the-excerpt]]</td>
<td style=""></td>
<td style="white-space: nowrap;"><a href="[[url-the-excerpt]]" target="_blank">[[url-the-excerpt]]</a></td>
</tr>
<tr>
<td style="width: 260px !important;">[[label-widget-title]]</td>
<td style="width: 65px !important;">[[widget-title]]</td>
<td style=""></td>
<td style="white-space: nowrap;"><a href="[[url-widget-title]]" target="_blank">[[url-widget-title]]</a></td>
</tr>
<tr>
<td style="width: 260px !important;">[[label-widget-text]]</td>
<td style="width: 65px !important;">[[widget-text]]</td>
<td style=""></td>
<td style="white-space: nowrap;"><a href="[[url-widget-text]]" target="_blank">[[url-widget-text]]</a></td>
</tr>
</tbody>