delta 0 for next release: v2.0.7d0 commit as dev version needed to respond on forum. (v2.0.6 has been diffed against 2.0.4 and assessed, could be kept in production as well given 2.0.4 is okay.) Hooks default status reset to previous, in case that matters (doesn’t on my WordPress). PROBLEM WITH UNRESPONSIVE POSITION SETTING UNRESOLVED

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2413678 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
pewgeuges 2020-11-06 04:04:30 +00:00
parent 4f2e8ed5c9
commit 0fb5e205c3
7 changed files with 113 additions and 39 deletions

View file

@ -12,7 +12,7 @@
* Edited for v2.0.3: Added style sheet versioning 2020-10-29T1413+0100
* Edited for v2.0.4: Added jQuery UI from WordPress 2020-11-01T1902+0100
*
* Last modified: 2020-11-05T1824+0100
* Last modified: 2020-11-06T0324+0100
*/
@ -125,7 +125,13 @@ class MCI_Footnotes {
// Add jQuery tools:
wp_enqueue_script('mci-footnotes-js-jquery-tools', plugins_url('../js/jquery.tools.min.js', __FILE__));
// IMPORTANT: up-to-date plugin version number for cache busting.
wp_enqueue_style('mci-footnotes-css-public', plugins_url('../css/public.css', __FILE__), '', '2.0.6');
// IMPORTANT: up-to-date plugin version number for cache busting:
wp_enqueue_style(
'mci-footnotes-css-public',
plugins_url('../css/public.css', __FILE__),
'',
'2.0.7d0'
);
}
}

View file

@ -6,13 +6,15 @@
* @author Stefan Herndler
* @since 1.5.0 14.09.14 10:43
*
* Edited for v2.0.4 2020-11-02T2115+0100
* Edited for:
* v2.0.4 2020-11-02T2115+0100
* v2.0.7 2020-11-06T0321+0100
*/
/**
* The class loads all Settings from each WordPress Settings container.
* It a Setting is not defined yet the default value will be used.
* It a Setting is not defined yet, the default value will be used.
* Each Setting will be validated and sanitized when loaded from the container.
*
* @author Stefan Herndler
@ -165,7 +167,7 @@ class MCI_Footnotes_Settings {
const C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED = "footnote_inputfield_custom_mouse_over_box_excerpt_enabled";
/**
* Settings Container Key for the mouse-over box to define the max. length of the enabled expert.
* Settings Container Key for the mouse-over box to define the max. length of the enabled excerpt.
*
* @author Stefan Herndler
* @since 1.5.4
@ -388,34 +390,63 @@ class MCI_Footnotes_Settings {
self::C_BOOL_FOOTNOTES_EXPERT_MODE => 'no'
),
"footnotes_storage_custom" => array(
self::C_STR_FOOTNOTES_STYLING_BEFORE => '',
self::C_STR_FOOTNOTES_STYLING_AFTER => ')',
// The default footnote referrer surroundings should be square brackets:
// * as in English typesetting;
// * for better UX thanks to a more button-like appearance;
// * for stylistic consistency with the expand-collapse button
self::C_STR_FOOTNOTES_STYLING_BEFORE => '[',
self::C_STR_FOOTNOTES_STYLING_AFTER => ']',
self::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED => 'yes',
self::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED => 'no',
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH => 150,
self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION => 'top right',
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X => 10,
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y => 10,
// The mouse over content truncation should be enabled by default
// to raise awareness of the functionality and to prevent the screen
// from being filled at mouse-over, and to allow the Continue reading:
self::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED => 'yes',
// The truncation length is raised from 150 to 200 chars:
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH => 200,
// The default position should not be lateral because of the risk
// the box gets squeezed between note anchor at line end and window edge,
// and top because reading at the bottom of the window is more likely:
self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION => 'top center',
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X => 0,
// The vertical offset must be negative for the box not to cover
// the current line of text (web coordinates origin is top left):
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y => -7,
self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR => '',
self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND => '#fff7a7',
// The mouse over box shouldnt feature a colored background
// by default, due to diverging user preferences. White is neutral:
self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND => '#ffffff',
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH => 1,
self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR => '#cccc99',
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS => 3,
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH => 0,
// The mouse over box corners mustnt be rounded as that is outdated:
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS => 0,
// The width should be limited to start with, for the box to have shape:
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH => 450,
self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR => '#666666',
self::C_STR_HYPERLINK_ARROW => '↑',
self::C_STR_HYPERLINK_ARROW_USER_DEFINED => '',
self::C_STR_CUSTOM_CSS => ''
),
// These should all be enabled by default.
// We might wish to enable all these by default, but
// in titles, footnotes are functionally pointless in WordPress.
// See <https://wordpress.org/support/topic/more-feature-ideas/>
"footnotes_storage_expert" => array(
self::C_BOOL_EXPERT_LOOKUP_THE_TITLE => 'yes',
self::C_BOOL_EXPERT_LOOKUP_THE_TITLE => '',
self::C_BOOL_EXPERT_LOOKUP_THE_CONTENT => 'yes',
self::C_BOOL_EXPERT_LOOKUP_THE_EXCERPT => 'yes',
self::C_BOOL_EXPERT_LOOKUP_WIDGET_TITLE => 'yes',
self::C_BOOL_EXPERT_LOOKUP_WIDGET_TITLE => '',
self::C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT => 'yes',
self::C_BOOL_EXPERT_LOOKUP_THE_POST => 'yes'
self::C_BOOL_EXPERT_LOOKUP_THE_POST => ''
)
);

View file

@ -11,7 +11,7 @@
* Edited for v2.0.5: Autoload / infinite scroll support added thanks to code from
* @docteurfitness <https://wordpress.org/support/topic/auto-load-post-compatibility-update/>
*
* Last modified 2020-11-05T0524+0100
* Last modified 2020-11-06T0425+0100
*/
// If called directly, abort:
@ -491,11 +491,12 @@ class MCI_Footnotes_Task {
// generate content of footnote index cell
$l_str_FirstFootnoteIndex = ($l_str_Index + 1);
// wrap each index # in a white-space:nowrap span
$l_str_FootnoteIndex = '<span class="footnote_index_item">';
$l_str_FootnoteArrowIndex = '<span class="footnote_index_item">';
// wrap the arrow in a @media print { display:hidden } span
$l_str_FootnoteIndex .= '<span class="footnote_index_arrow">' . $l_str_Arrow . '&#x200A;</span>';
// get the index
$l_str_FootnoteIndex .= MCI_Footnotes_Convert::Index(($l_str_Index + 1), MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE));
$l_str_FootnoteArrowIndex .= '<span class="footnote_index_arrow">' . $l_str_Arrow . '&#x200A;</span>';
// get the index; add support for legacy index placeholder:
$l_str_FootnoteArrowIndex .= MCI_Footnotes_Convert::Index(($l_str_Index + 1), MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE));
$l_str_FootnoteIndex = MCI_Footnotes_Convert::Index(($l_str_Index + 1), MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE));
// check if it isn't the last footnote in the array
if ($l_str_FirstFootnoteIndex < count(self::$a_arr_Footnotes) && MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_COMBINE_IDENTICAL_FOOTNOTES))) {
@ -506,19 +507,23 @@ class MCI_Footnotes_Task {
// set the further footnote as empty so it won't be displayed later
self::$a_arr_Footnotes[$l_str_CheckIndex] = "";
// add the footnote index to the actual index
$l_str_FootnoteIndex .= ',</span> <span class="footnote_index_item">' . MCI_Footnotes_Convert::Index(($l_str_CheckIndex + 1), MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE));
$l_str_FootnoteArrowIndex .= ',</span> <span class="footnote_index_item">' . MCI_Footnotes_Convert::Index(($l_str_CheckIndex + 1), MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE));
$l_str_FootnoteIndex .= ', ' . MCI_Footnotes_Convert::Index(($l_str_CheckIndex + 1), MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE));
}
}
}
$l_str_FootnoteIndex .= '</span>';
$l_str_FootnoteArrowIndex .= '</span>';
// replace all placeholders in the template templates/public/reference-container-body.html
// The individual arrow and index placeholders are for backcompat
$l_obj_Template->replace(
array(
"post_id" => $l_int_PostID,
"id" => MCI_Footnotes_Convert::Index($l_str_FirstFootnoteIndex, MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE)),
"arrow" => $l_str_Arrow,
"index" => $l_str_FootnoteIndex,
"arrow-index" => $l_str_FootnoteArrowIndex,
"text" => $l_str_FootnoteText
)
);

View file

@ -4,9 +4,9 @@
* Created-Date: 15.05.14
* Created-Time: 16:21
* Since: 1.0
* Version: 2.0.6
* Version: 2.0.7d0
*
* Last modified: 2020-11-05T1826+0100
* Last modified: 2020-11-06T0325+0100
*/

View file

@ -80,6 +80,10 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
== Changelog ==
= 2.0.7d0 =
- Update: Added backwards compatible support for legacy arrow and index placeholders in template
- Update: Set all hooks defaults back to legacy as in titles, footnotes are functionally pointless
= 2.0.6 =
- Update: Autoload / infinite scroll support thanks to @docteurfitness <https://wordpress.org/support/topic/auto-load-post-compatibility-update/>
- Bugfix: Layout: Footnote referrers: deleted vertical align tweaks for cross-theme and user agent compatibility

View file

@ -0,0 +1,28 @@
MCI Footnotes WordPress plugin
NOTE FOR WEBMASTERS
Added: 2020-11-06T0424+0100
Last modified: 2020-11-06T0431+0100
About the public templates
Template "reference-container-body.html"
class/task.php(481)
css/public.css
Supported placeholders:
[[post_id]] makes the footnote ID unique for infinite scroll
[[id]] footnote number (1-based integer)
[[arrow]] symbol alone, for backwards compatibility
[[index]] footnote index alone (or comma-separated enumeration) for backwards compatibility
[[arrow-index]] new compound string starting with the arrow hidden in print
wrapping each index in a no-break span, example:
<span class="footnote_index_item"><span class="footnote_index_arrow">&#8593;&#x200A;</span>4,</span> <span class="footnote_index_item">5,</span> <span class="footnote_index_item">6,</span> <span class="footnote_index_item">7,</span> <span class="footnote_index_item">8,</span> <span class="footnote_index_item">9,</span> <span class="footnote_index_item">10,</span>
[[text]]

View file

@ -4,7 +4,7 @@
class="footnote_plugin_index footnote_plugin_link"
onclick="footnote_moveToAnchor_[[post_id]]('footnote_plugin_tooltip_[[post_id]]_[[id]]');"
><a
>[[index]]</a
>[[arrow-index]]</a
></td>
<td
class="footnote_plugin_text"