for bugfix release 2.0.3
git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2409068 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
parent
45e85af501
commit
9d4768f040
8 changed files with 149 additions and 88 deletions
|
@ -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 <https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13456762>
|
||||
|
||||
|
@ -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');
|
||||
|
||||
|
|
|
@ -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” <https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_content_best_practices>
|
||||
// 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), '<a class="continue" href="#footnote_plugin_reference_' . self::$a_str_Prefix.$l_str_Index . '" onclick="footnote_moveToAnchor(\'footnote_plugin_reference_' . self::$a_str_Prefix . $l_str_Index . '\');">', '</a>');
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
} // end of class
|
||||
|
|
102
css/public.css
102
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)*/
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
34
readme.txt
34
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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<tr>
|
||||
<td class="footnote_plugin_index" id="footnote_plugin_reference_[[id]]" onclick="footnote_moveToAnchor('footnote_plugin_tooltip_[[id]]');"><a href="#footnote_plugin_tooltip_[[id]]">[[index]].</a></td>
|
||||
<td class="footnote_plugin_index" id="footnote_plugin_reference_[[id]]" onclick="footnote_moveToAnchor('footnote_plugin_tooltip_[[id]]');"><a href="#footnote_plugin_tooltip_[[id]]"><span class="footnote_plugin_index_arrow">↑ </span>[[index]].</a></td>
|
||||
<td class="footnote_plugin_text">[[text]]</td>
|
||||
</tr>
|
||||
|
|
|
@ -1,11 +1,47 @@
|
|||
<div class="footnote_container_prepare">
|
||||
<p><span onclick="footnote_expand_reference_container();">[[label]]</span><span style="[[button-style]]"> [ <a id="footnote_reference_container_collapse_button" style="cursor:pointer;" onclick="footnote_expand_collapse_reference_container();">+</a> ]</span></p>
|
||||
<div class="footnote_container_overall_wrapper">
|
||||
<div class="footnote_container_prepare">
|
||||
<p><span
|
||||
onclick="footnote_expand_reference_container();"
|
||||
>[[label]]</span><span
|
||||
class="footnote_reference_container_collapse_button_outfit"
|
||||
style="[[button-style]]"
|
||||
> [ <a
|
||||
id="footnote_reference_container_collapse_button"
|
||||
onclick="footnote_expand_collapse_reference_container();"
|
||||
>+</a> ]</span></p>
|
||||
</div>
|
||||
<div id="[[id]]" style="[[style]]">
|
||||
<table class="footnote-reference-container">
|
||||
<tbody>
|
||||
[[content]]
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div id="[[id]]" style="[[style]]">
|
||||
<table class="footnote-reference-container">
|
||||
<tbody>
|
||||
[[content]]
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<script type="text/javascript"> function footnote_expand_reference_container() { jQuery("#[[id]]").show(); jQuery("#footnote_reference_container_collapse_button").text("-"); } function footnote_collapse_reference_container() { jQuery("#[[id]]").hide(); jQuery("#footnote_reference_container_collapse_button").text("+"); } function footnote_expand_collapse_reference_container() { if (jQuery("#[[id]]").is(":hidden")) { footnote_expand_reference_container(); } else { footnote_collapse_reference_container(); } } function footnote_moveToAnchor(p_str_TargetID) { footnote_expand_reference_container(); var l_obj_Target = jQuery("#" + p_str_TargetID); if(l_obj_Target.length) { jQuery('html, body').animate({ scrollTop: l_obj_Target.offset().top - window.innerHeight * .05 }, 80); } } </script>
|
||||
<script type="text/javascript">
|
||||
function footnote_expand_reference_container() {
|
||||
jQuery('#[[id]]').show();
|
||||
jQuery('#footnote_reference_container_collapse_button').text('-');
|
||||
}
|
||||
function footnote_collapse_reference_container() {
|
||||
jQuery('#[[id]]').hide();
|
||||
jQuery('#footnote_reference_container_collapse_button').text('+');
|
||||
}
|
||||
function footnote_expand_collapse_reference_container() {
|
||||
if (jQuery('#[[id]]').is(':hidden')) {
|
||||
footnote_expand_reference_container();
|
||||
} else {
|
||||
footnote_collapse_reference_container();
|
||||
}
|
||||
}
|
||||
function footnote_moveToAnchor(p_str_TargetID) {
|
||||
footnote_expand_reference_container();
|
||||
var l_obj_Target = jQuery('#' + p_str_TargetID);
|
||||
if (l_obj_Target.length) {
|
||||
jQuery('html, body').animate({
|
||||
scrollTop: l_obj_Target.offset().top - window.innerHeight * 0.12
|
||||
},
|
||||
80);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Reference in a new issue