From 592c663342ae7e05d66d7263d76c578fc2eb1109 Mon Sep 17 00:00:00 2001 From: pewgeuges <73141620+pewgeuges@users.noreply.github.com> Date: Wed, 25 Nov 2020 07:47:45 +0000 Subject: [PATCH] development 2.1.4d0 needed for bugfix: wrapping long URLs in ref container and tooltips to prevent layout issues; to be posted on Forum git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2425397 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- class/dashboard/layout.php | 2 +- class/init.php | 2 +- class/task.php | 12 ++++- css/public.css | 48 +++++++++++++------ css/settings.css | 4 +- footnotes.php | 2 +- readme.txt | 3 ++ .../reference-container-body-combi.html | 2 +- 8 files changed, 53 insertions(+), 22 deletions(-) diff --git a/class/dashboard/layout.php b/class/dashboard/layout.php index ccc57eb..3737952 100644 --- a/class/dashboard/layout.php +++ b/class/dashboard/layout.php @@ -207,7 +207,7 @@ abstract class MCI_Footnotes_LayoutEngine { 'mci-footnotes-admin-styles', plugins_url('../../css/settings.css', __FILE__), '', - '2.1.3' + '2.1.4d0' ); // UPDATE version # when making changes to settings.css, FOR CACHE BUSTING diff --git a/class/init.php b/class/init.php index 989ebc5..6d3489d 100644 --- a/class/init.php +++ b/class/init.php @@ -160,7 +160,7 @@ class MCI_Footnotes { 'mci-footnotes-css-public', plugins_url('../css/public.css', __FILE__), '', - '2.1.3' + '2.1.4d0' ); } diff --git a/class/task.php b/class/task.php index 0807493..5b900d0 100644 --- a/class/task.php +++ b/class/task.php @@ -17,8 +17,9 @@ * 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 * 2.1.2: options for the other hooks 2020-11-19T1849+0100 + * 2.1.4: fix line wrapping of URLs based on pattern, not link element 2020-11-25T0837+0100 * - * Last modified: 2020-11-24T0957+0100 + * Last modified: 2020-11-25T0837+0100 */ // If called directly, abort: @@ -443,6 +444,12 @@ class MCI_Footnotes_Task { // get footnote text $l_str_FootnoteText = substr($p_str_Content, $l_int_PosStart + strlen($l_str_StartingTag), $l_int_Length - strlen($l_str_StartingTag)); + // fix line wrapping of URLs (hyperlinked or not) based on pattern, not link element, + // to prevent them from hanging out of the tooltip in non-Unicode-compliant user agents + // spare however values of the href argument! + // see public.css + $l_str_FootnoteText = preg_replace( '#(?$1', $l_str_FootnoteText ); + // Text to be displayed instead of the footnote $l_str_FootnoteReplaceText = ""; @@ -715,6 +722,9 @@ class MCI_Footnotes_Task { } } + // line wrapping of URLs already fixed, see: + // $l_str_FootnoteText = preg_replace( '#(?$1', $l_str_FootnoteText ); + // replace all placeholders in 'templates/public/reference-container-body.html' // or in 'templates/public/reference-container-body-combi.html' // or in 'templates/public/reference-container-body-3column.html' diff --git a/css/public.css b/css/public.css index 8c8e215..ff9bf20 100755 --- a/css/public.css +++ b/css/public.css @@ -4,9 +4,9 @@ * Created-Date: 15.05.14 * Created-Time: 16:21 * Since: 1.0 - * Version: 2.1.3 + * Version: 2.1.4d0 * - * Last modified: 2020-11-24T0958+0100 + * Last modified: 2020-11-25T0836+0100 */ @@ -33,6 +33,26 @@ css/settings.css color: #545f5a; } +/***************************************************** +Long URLs in Unicode-non-compliant user agents + +prevent URLs from expanding the reference container +in mobile view, or from hanging out of the tooltip + +based on pattern, not link element +class/task.php + +not cross-browser compatible: +word-break: break-word; +word-break: break-all; +overflow-wrap: anywhere; +word-wrap: anywhere; +*/ + +.footnote_url_wrap { + word-wrap: break-word; +} + /***************************************************** Footnote referrers and tooltips @@ -76,9 +96,6 @@ templates/public/footnote-alternative.html font-weight: normal; font-style: normal; } -.footnote_tooltip a { - word-wrap: anywhere; -} /* alternative tooltip implementation @@ -192,6 +209,7 @@ footnotes reference-container-body.html */ .footnote_plugin_index, +.footnote_plugin_index_combi, .footnote_plugin_link, .footnote_plugin_text { border:none !important; @@ -214,7 +232,9 @@ reference-container-body.html These rules when enabled cause the backlink to take an overline when hovered in some themes, not in others: .footnote_plugin_index:hover, +.footnote_plugin_index_combi:hover, .footnote_plugin_index.pointer:hover, +.footnote_plugin_index_combi.pointer:hover, */ .footnote_backlink:hover, .footnote_plugin_link:hover, @@ -222,7 +242,8 @@ when hovered in some themes, not in others: text-decoration: unset; text-decoration: underline !important; } -.footnote_plugin_index { +.footnote_plugin_index, +.footnote_plugin_index_combi { max-width: 140px; width: 2em; /*auto-expanding column to fit widest*/ } @@ -233,25 +254,21 @@ when hovered in some themes, not in others: .footnote_index, .footnote_backlink, -.footnote_plugin_index.pointer { +.footnote_plugin_index.pointer, +.footnote_plugin_index_combi.pointer { cursor: pointer; } .footnote_plugin_text { width: unset; /*unset width of text column to fix site issues*/ } -/* -prevent long URLs from expanding the reference container in mobile view: -*/ -.footnote_plugin_text a { - word-wrap: anywhere; -} /* Responsive */ @media only screen and (max-width: 768px) { - .footnote_plugin_index { + .footnote_plugin_index, + .footnote_plugin_index_combi { max-width: 100px; } } @@ -279,7 +296,8 @@ link styling is reverted so as to not gray out referrers/numbers. .footnote_plugin_tooltip_text { color: inherit; } - .footnote_plugin_index a { + .footnote_plugin_index a, + .footnote_plugin_index_combi a { color: inherit; text-decoration: none !important; } diff --git a/css/settings.css b/css/settings.css index cc18444..c7dd877 100755 --- a/css/settings.css +++ b/css/settings.css @@ -4,9 +4,9 @@ * Created-Date: 15.05.14 * Created-Time: 16:21 * Since: 1.0 - * Version: 2.1.3 + * Version: 2.1.4d0 * - * Last modified: 2020-11-24T0957+0100 + * Last modified: 2020-11-25T0837+0100 */ diff --git a/footnotes.php b/footnotes.php index 90d4e32..50a7876 100755 --- a/footnotes.php +++ b/footnotes.php @@ -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.3 + Version: 2.1.4d0 Author URI: http://cheret.de/plugins/footnotes-2/ Text Domain: footnotes Domain Path: /languages diff --git a/readme.txt b/readme.txt index e4a9158..40b2c09 100755 --- a/readme.txt +++ b/readme.txt @@ -80,6 +80,9 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest** == Changelog == += 2.1.4d0 = +- Bugfix: Reference container, tooltips: fix line wrapping of URLs based on pattern, not link element + = 2.1.3 = - Bugfix: disable widget_text hook by default to fix accordions declaring headings as widgets - Bugfix: Reference container: fix column width when combining turned on by reverting new CSS class to legacy diff --git a/templates/public/reference-container-body-combi.html b/templates/public/reference-container-body-combi.html index f3484f1..57cd36d 100644 --- a/templates/public/reference-container-body-combi.html +++ b/templates/public/reference-container-body-combi.html @@ -1,6 +1,6 @@ [[backlinks]]