From 9d4768f0406775eb7511f3589c1e68b066f792bc Mon Sep 17 00:00:00 2001 From: pewgeuges <73141620+pewgeuges@users.noreply.github.com> Date: Thu, 29 Oct 2020 13:17:36 +0000 Subject: [PATCH] for bugfix release 2.0.3 git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2409068 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- class/init.php | 7 +- class/task.php | 26 ++--- class/template.php | 6 +- css/public.css | 102 +++++++++++------- footnotes.php | 4 +- readme.txt | 34 +++--- .../public/reference-container-body.html | 2 +- templates/public/reference-container.html | 56 ++++++++-- 8 files changed, 149 insertions(+), 88 deletions(-) diff --git a/class/init.php b/class/init.php index e3cccf2..b249557 100644 --- a/class/init.php +++ b/class/init.php @@ -6,6 +6,9 @@ * @author Stefan Herndler * @since 1.5.0 12.09.14 10:56 */ + +// Versioning: update plugin version # for style sheet cache busting on line 103 + // Added jQueryUI on 2020-10-26T1907+0100 // Following @vonpiernik @@ -96,8 +99,8 @@ class MCI_Footnotes { 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_style('mci-footnotes-css-public', plugins_url('../css/public.css', __FILE__)); + // IMPORTANT: current version number for cache busting: + wp_enqueue_style('mci-footnotes-css-public', plugins_url('../css/public.css', __FILE__), '', '2.0.3'); // add the jQuery plugin (already registered by WordPress) wp_enqueue_script('jquery'); diff --git a/class/task.php b/class/task.php index 2834743..736d8cb 100644 --- a/class/task.php +++ b/class/task.php @@ -5,17 +5,10 @@ * @filesource * @author Stefan Herndler * @since 1.5.0 + * */ /* -Customization: 2020-06-23T0613+0200 custom styles, fixed print output [now in public.css] -Customization: 2020-09-09T2140+0200 raised scroll level, shorter scroll time [reference-container.html] -Customization: 2020-09-09T2140+0200 changed parameters off dashboard [tooltip.html] -Debugging: 2020-09-09T2140+0200 fixed missing or wrong links #0# -Usability: 2020-09-09T2140+0200 voided $a_str_Prefix #1# -Usability: 2020-09-09T2140+0200 added line breaks #2# -Translation: 2020-09-10T2104+0200 fix infobox text and missing setting #0# -Upgrade v1.6.5: 2020-10-23T0252+0200 #3# -Last modified: 2020-10-23T0611+0200 +Last modified: 2020-10-29T1402+0100 */ // If called directly, abort: defined( 'ABSPATH' ) or die; @@ -316,6 +309,10 @@ class MCI_Footnotes_Task { * @return string */ public function search($p_str_Content, $p_bool_ConvertHtmlChars, $p_bool_HideFootnotesText) { + // prepare prepending post ID to make footnote IDs unique wrt archive view: + $id_underscore = get_the_id(); + $id_underscore .= '_'; + self::$a_str_Prefix = $id_underscore; // contains the index for the next footnote on this page $l_int_FootnoteIndex = count(self::$a_arr_Footnotes) + 1; // contains the starting position for the lookup of a footnote @@ -350,7 +347,6 @@ class MCI_Footnotes_Task { do { // get first occurrence of the footnote short code [start] $i_int_len_Content = strlen($p_str_Content); - // #3# upgrade v1.6.5: if ($l_int_PosStart > $i_int_len_Content) $l_int_PosStart = $i_int_len_Content; $l_int_PosStart = strpos($p_str_Content, $l_str_StartingTag, $l_int_PosStart); // no short code found, stop here @@ -382,12 +378,6 @@ class MCI_Footnotes_Task { if (is_int($l_int_MaxLength) && strlen($l_str_DummyText) > $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, ' ')); - // #0# - // col 48: replaced space with no-break space. - // col 54: replaced three dots with horizontal ellipsis (…): “use the single Unicode …, and not three dots” - // col 139: added class. - // col 162: added fragment id, or the footnote won’t work if JS is disabled. - // col 294: added the random prefix for consistency, even if disabled. $l_str_ExcerptText .= ' … ' . sprintf(__("%scontinue%s", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), '', ''); } } @@ -500,7 +490,7 @@ class MCI_Footnotes_Task { "text" => $l_str_FootnoteText ) ); - // #2# added line breaks for source code legibility: + // extra line breaks for page source legibility: $footnote_item_temp = $l_obj_Template->getContent(); $footnote_item_temp .= "\r\n\r\n"; $l_str_Body .= $footnote_item_temp; @@ -522,8 +512,6 @@ class MCI_Footnotes_Task { // free all found footnotes if reference container will be displayed self::$a_arr_Footnotes = array(); - // #1# Disabled the random prefix preventing fn refs from being shared. - //self::$a_str_Prefix = rand(1000, 9999) . "_"; return $l_obj_TemplateContainer->getContent(); } } diff --git a/class/template.php b/class/template.php index 4efc952..a8366cc 100644 --- a/class/template.php +++ b/class/template.php @@ -6,7 +6,7 @@ * @author Stefan Herndler * @since 1.5.0 14.09.14 10:58 */ - +// Last modified: 2020-10-29T0805+0100 /** * Handles each Template file for the Plugin Frontend (e.g. Settings Dashboard, Public pages, ...). @@ -76,6 +76,8 @@ class MCI_Footnotes_Template { // get Template file content $this->a_str_OriginalContent = str_replace("\n", "", file_get_contents($l_str_TemplateFile)); $this->a_str_OriginalContent = str_replace("\r", "", $this->a_str_OriginalContent); + $this->a_str_OriginalContent = str_replace("\t", " ", $this->a_str_OriginalContent); + $this->a_str_OriginalContent = str_replace(" ", " ", $this->a_str_OriginalContent); $this->reload(); } @@ -125,4 +127,4 @@ class MCI_Footnotes_Template { return $this->a_str_ReplacedContent; } -} // end of class \ No newline at end of file +} // end of class diff --git a/css/public.css b/css/public.css index 3c6bd34..c6a34df 100755 --- a/css/public.css +++ b/css/public.css @@ -1,17 +1,14 @@ /** * Created by Stefan Herndler. * User: Stefan - * Date: 15.05.14 - * Time: 16:21 - * Version: 1.0.7 + * Created-Date: 15.05.14 + * Created-Time: 16:21 * Since: 1.0 + * Version: 2.0.3 + * Last modified: 2020-10-29T1343+0100 */ -/* - * Last modified: 2020-10-28T1452+0100 - */ - -/* footnotes */ +/* footnote tags */ .footnote_tag_styling, .footnote_tag_styling:hover { @@ -42,7 +39,7 @@ text-decoration: underline; } -/* tooltip infobox content */ +/* tooltip infobox */ span.footnote_tooltip { font-size: inherit; @@ -58,13 +55,21 @@ span.footnote_tooltip { text-decoration: underline; } -/* reference container label */ +/* reference container */ +.footnote-reference-container { + width: 100%; + border: none; +} .footnote_container_prepare { display: block !important; padding-top: 24px !important; } +#footnote_references_container td { + padding: none; +} +/* label */ .footnote_container_prepare > p { line-height: 1.3 !important; margin-top: 1em !important; @@ -81,12 +86,15 @@ span.footnote_tooltip { text-align: left !important; vertical-align: middle; } - .footnote_container_prepare > p > span:first-child { - padding-left: 20px !important; text-align: left !important; font-size: 1.5em !important; } + +/* collapse button */ +#footnote_reference_container_collapse_button { + cursor: pointer; +} .footnote_container_prepare > p > span:last-child a { text-decoration: none; } @@ -95,48 +103,60 @@ span.footnote_tooltip { color: #008800; } -/* reference container */ - -.footnote-reference-container { - width: 100%; - border: none; -} - +/* footnotes */ .footnote_plugin_index, .footnote_plugin_text { border:none !important; text-align: left; vertical-align: top; } - -/* index */ -.footnote_plugin_index { - padding-right: 5px; - min-width: 50px; - cursor: pointer; -} -.footnote_plugin_index a { - text-decoration: none; -} -.footnote_plugin_index a:hover { - text-decoration: underline; -} - -/* text */ -.footnote_plugin_text { - width: 90%; -} +.footnote_plugin_index a, .footnote_plugin_text a { text-decoration: none; } +.footnote_plugin_index a:hover, .footnote_plugin_text a:hover { - text-decoration: underline; + text-decoration: underline !important; +} +.footnote_plugin_index { + cursor: pointer; + overflow-wrap: unset; + word-wrap: unset; + word-wrap: normal !important; + word-break: unset; + word-break: keep-all !important; + white-space: nowrap; + max-width: 140px; + overflow: hidden; +} +@media only screen and (max-width: 768px) { + .footnote_plugin_index { + max-width: 100px; + } } /* printing style */ +.footnote_container_overall_wrapper { + page-break-inside: avoid; +} +.footnote_container_prepare { + page-break-after: avoid; +} +table.footnote_reference_container td { + display: block; +} +table.footnote_reference_container { + page-break-before: avoid; + page-break-inside: auto; +} +table.footnote_reference_container tr { + page-break-before: auto; +} @media print { - .footnote_tooltip { + .footnote_tooltip, + .footnote_reference_container_collapse_button_outfit, + .footnote_plugin_index_arrow { display: none; } .footnote_plugin_tooltip_text { @@ -144,5 +164,9 @@ span.footnote_tooltip { } .footnote_plugin_index a { color: inherit; + text-decoration: none !important; + } + div.post-meta-edit-link-wrapper { /*hides the Edit button in WP2020*/ + display: none; /*(added as a service)*/ } } diff --git a/footnotes.php b/footnotes.php index ade9f73..2207b02 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.0.2 + Version: 2.0.3 Author URI: http://cheret.de/plugins/footnotes-2/ Text Domain: footnotes Domain Path: /languages @@ -25,7 +25,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -// Last modified: 2020-10-28T1643+0100 +// Last modified: 2020-10-29T1405+0100 /** * @filesource * @author Stefan Herndler diff --git a/readme.txt b/readme.txt index 2b87ab2..86fc07f 100755 --- a/readme.txt +++ b/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.2 +Stable Tag: 2.0.3 License: GPLv3 or later License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -80,29 +80,37 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest** == Changelog == += 2.0.3 = +- Bugfix: Layout: Self-adjusting width of ID column but hidden overflow +- Update: Prepended transitional up arrow to backlinking footnote numbers +- Bugfix: Fragment IDs: Prepended post ID to footnote number +- Bugfix: Feed plugin version in style sheet query string for cache busting +- Bugfix: Print style: Hide reference collapse button when printing +- Update: Layout: Removed padding before reference container label + = 2.0.2 = +- Bugfix: Restored expand/collapse button of reference container - Bugfix: Dashboard: Available CSS selectors, last item display - Bugfix: Footnote anchor and ID color to default on screen, to inherit in print - Bugfix: Disabled underline in footnote anchors, underline only on hover = 2.0.1 = -- Bugfix: Restored expand/collapse button of reference container - Bugfix: Fixed public.css - Update: Language fr_FR along with es_ES, de_AT, de_DE, en_GB, en_US for 2.0 = 2.0.0 = - Major contributions taken from WordPress user pewgeuges, all details here https://github.com/media-competence-institute/footnotes/blob/master/README.md: -- Update: **symbol for backlinks** removed -- Update: hyperlink moved to the reference number -- Update: Upgrade jQuery library -- Update: Account for disruptive PHP change -- Bugfix: footnote links script independent -- Bugfix: Get the “Continue reading” link to work in the mouse-over box -- Bugfix: Debug printed posts and pages -- Bugfix: Display of combined identical notes -- Update: Adjusted scrolling time and offset -- Bugfix: No margins around footnotes -- Bugfix: Mouse-over box display timing +- **symbol for backlinks** removed +- hyperlink moved to the reference number +- Upgrade jQuery library +- Account for disruptive PHP change +- footnote links script independent +- Get the “Continue reading” link to work in the mouse-over box +- Debug printed posts and pages +- Fix display of combined identical notes +- Adjusted scrolling time and offset +- No borders around footnotes in the container +- Mouse-over box display timing = 1.6.6 = - Beginning of translation to French diff --git a/templates/public/reference-container-body.html b/templates/public/reference-container-body.html index 52d3e5e..cd6a7d7 100755 --- a/templates/public/reference-container-body.html +++ b/templates/public/reference-container-body.html @@ -1,4 +1,4 @@ - [[index]]. + ↑ [[index]]. [[text]] diff --git a/templates/public/reference-container.html b/templates/public/reference-container.html index 367abb4..d0f21b0 100644 --- a/templates/public/reference-container.html +++ b/templates/public/reference-container.html @@ -1,11 +1,47 @@ -
-

[[label]]   [ + ]

+
+
+

[[label]]   [ + ]

+
+
+ + + [[content]] + +
+
-
- - - [[content]] - -
-
- +