development version 2.1.1d5: added CSS animation to alternative tooltip implementation IN RESPONSE TO USER ON THE SUPPORT FORUM
git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2417401 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
parent
9d0044a35a
commit
a9143a34b7
7 changed files with 81 additions and 43 deletions
|
@ -151,7 +151,7 @@ class MCI_Footnotes {
|
||||||
'mci-footnotes-css-public',
|
'mci-footnotes-css-public',
|
||||||
plugins_url('../css/public.css', __FILE__),
|
plugins_url('../css/public.css', __FILE__),
|
||||||
'',
|
'',
|
||||||
'2.1.1d4'
|
'2.1.1d5'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -146,12 +146,18 @@ class MCI_Footnotes_Task {
|
||||||
}
|
}
|
||||||
echo '}';
|
echo '}';
|
||||||
?>
|
?>
|
||||||
</style>
|
</style>
|
||||||
<?php
|
<?php
|
||||||
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE))) {
|
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE))) {
|
||||||
echo '<script content="text/javascript">' . "\r\n";
|
echo '<script content="text/javascript">' . "\r\n";
|
||||||
echo "\t" . 'function footnoteTooltipShow(footnoteTooltipId) { document.getElementById(footnoteTooltipId).style.display = "block"; };' . "\r\n";
|
echo "\tfunction footnoteTooltipShow(footnoteTooltipId) {\r\n";
|
||||||
echo "\t" . 'function footnoteTooltipHide(footnoteTooltipId) { document.getElementById(footnoteTooltipId).style.display = "none"; }' . "\r\n";
|
echo "\t\tdocument.getElementById(footnoteTooltipId).classList.remove('hidden');\r\n";
|
||||||
|
echo "\t\tdocument.getElementById(footnoteTooltipId).classList.add('shown');\r\n";
|
||||||
|
echo "\t}\r\n";
|
||||||
|
echo "\tfunction footnoteTooltipHide(footnoteTooltipId) { \r\n";
|
||||||
|
echo "\t\tdocument.getElementById(footnoteTooltipId).classList.remove('shown');\r\n";
|
||||||
|
echo "\t\tdocument.getElementById(footnoteTooltipId).classList.add('hidden');\r\n";
|
||||||
|
echo "\t}\r\n";
|
||||||
echo "</script>\r\n";
|
echo "</script>\r\n";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -435,12 +441,12 @@ class MCI_Footnotes_Task {
|
||||||
"id" => $l_str_Index,
|
"id" => $l_str_Index,
|
||||||
"position" => MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION),
|
"position" => MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION),
|
||||||
"offset-y" => !empty($l_int_OffsetY) ? $l_int_OffsetY : 0,
|
"offset-y" => !empty($l_int_OffsetY) ? $l_int_OffsetY : 0,
|
||||||
"offset-x" => !empty($l_int_OffsetX) ? $l_int_OffsetX : 0
|
"offset-x" => !empty($l_int_OffsetX) ? $l_int_OffsetX : 0,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
if (!MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE))) {
|
if (!MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE))) {
|
||||||
$l_str_FootnoteReplaceText .= $l_obj_TemplateTooltip->getContent();
|
$l_str_FootnoteReplaceText .= $l_obj_TemplateTooltip->getContent();
|
||||||
}
|
}
|
||||||
$l_obj_TemplateTooltip->reload();
|
$l_obj_TemplateTooltip->reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -507,8 +513,9 @@ class MCI_Footnotes_Task {
|
||||||
$l_str_FootnoteArrowIndex = '<span class="footnote_index_item">';
|
$l_str_FootnoteArrowIndex = '<span class="footnote_index_item">';
|
||||||
// wrap the arrow in a @media print { display:hidden } span
|
// wrap the arrow in a @media print { display:hidden } span
|
||||||
$l_str_FootnoteArrowIndex .= '<span class="footnote_index_arrow">' . $l_str_Arrow . ' </span>';
|
$l_str_FootnoteArrowIndex .= '<span class="footnote_index_arrow">' . $l_str_Arrow . ' </span>';
|
||||||
// get the index; add support for legacy index placeholder:
|
// get the index:
|
||||||
$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_FootnoteArrowIndex .= MCI_Footnotes_Convert::Index(($l_str_Index + 1), MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE));
|
||||||
|
// keep supporting legacy index placeholder:
|
||||||
$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_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
|
// check if it isn't the last footnote in the array
|
||||||
|
@ -534,10 +541,11 @@ class MCI_Footnotes_Task {
|
||||||
array(
|
array(
|
||||||
"post_id" => $l_int_PostID,
|
"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)),
|
"id" => MCI_Footnotes_Convert::Index($l_str_FirstFootnoteIndex, MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE)),
|
||||||
|
"arrow-index" => $l_str_FootnoteArrowIndex,
|
||||||
|
"text" => $l_str_FootnoteText,
|
||||||
|
// Legacy placeholders:
|
||||||
"arrow" => $l_str_Arrow,
|
"arrow" => $l_str_Arrow,
|
||||||
"index" => $l_str_FootnoteIndex,
|
"index" => $l_str_FootnoteIndex,
|
||||||
"arrow-index" => $l_str_FootnoteArrowIndex,
|
|
||||||
"text" => $l_str_FootnoteText
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
// extra line breaks for page source legibility:
|
// extra line breaks for page source legibility:
|
||||||
|
@ -555,7 +563,7 @@ class MCI_Footnotes_Task {
|
||||||
"label" => MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_NAME),
|
"label" => MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_NAME),
|
||||||
"button-style" => !MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_COLLAPSE)) ? 'display: none;' : '',
|
"button-style" => !MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_COLLAPSE)) ? 'display: none;' : '',
|
||||||
"style" => MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_COLLAPSE)) ? 'display: none;' : '',
|
"style" => MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_COLLAPSE)) ? 'display: none;' : '',
|
||||||
"content" => $l_str_Body
|
"content" => $l_str_Body,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* Created-Date: 15.05.14
|
* Created-Date: 15.05.14
|
||||||
* Created-Time: 16:21
|
* Created-Time: 16:21
|
||||||
* Since: 1.0
|
* Since: 1.0
|
||||||
* Version: 2.1.1d4
|
* Version: 2.1.1d5
|
||||||
*
|
*
|
||||||
* Last modified: 2020-11-12T0539+0100
|
* Last modified: 2020-11-12T1846+0100
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -67,6 +67,7 @@ templates/public/footnote-alternative.html
|
||||||
.footnote_tooltip {
|
.footnote_tooltip {
|
||||||
display: none;
|
display: none;
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
|
cursor: auto;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
line-height: 1.2em;
|
line-height: 1.2em;
|
||||||
|
@ -75,14 +76,40 @@ templates/public/footnote-alternative.html
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footnote_relative {
|
/*
|
||||||
position: relative;
|
alternative tooltip implementation
|
||||||
|
*/
|
||||||
|
.footnote_referrer.relative {
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
.footnote_tooltip_alternative {
|
.footnote_tooltip.position {
|
||||||
position: absolute;
|
display: unset;
|
||||||
|
position: absolute;
|
||||||
bottom: 24px;
|
bottom: 24px;
|
||||||
left: -50px;
|
left: -50px;
|
||||||
width: 400px;
|
width: 400px;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
fade-in parameters
|
||||||
|
*/
|
||||||
|
.footnote_tooltip.shown {
|
||||||
|
visibility: visible;
|
||||||
|
opacity: 1;
|
||||||
|
transition-property: visibility opacity;
|
||||||
|
transition-duration: 200ms;
|
||||||
|
transition-timing-function: linear;
|
||||||
|
transition-delay: 0ms;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
fade-out parameters
|
||||||
|
*/
|
||||||
|
.footnote_tooltip.hidden {
|
||||||
|
visibility: hidden;
|
||||||
|
opacity: 0;
|
||||||
|
transition-property: visibility opacity;
|
||||||
|
transition-duration: 200ms;
|
||||||
|
transition-timing-function: linear;
|
||||||
|
transition-delay: 400ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
* Created-Date: 15.05.14
|
* Created-Date: 15.05.14
|
||||||
* Created-Time: 16:21
|
* Created-Time: 16:21
|
||||||
* Since: 1.0
|
* Since: 1.0
|
||||||
* Version: 2.1.1d4
|
* Version: 2.1.1d5
|
||||||
*
|
*
|
||||||
* Last modified: 2020-11-12T0539+0100
|
* Last modified: 2020-11-12T1846+0100
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
Plugin URI: https://wordpress.org/plugins/footnotes/
|
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.
|
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
|
Author: Mark Cheret
|
||||||
Version: 2.1.1d4
|
Version: 2.1.1d5
|
||||||
Author URI: http://cheret.de/plugins/footnotes-2/
|
Author URI: http://cheret.de/plugins/footnotes-2/
|
||||||
Text Domain: footnotes
|
Text Domain: footnotes
|
||||||
Domain Path: /languages
|
Domain Path: /languages
|
||||||
|
|
|
@ -80,6 +80,9 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
|
||||||
|
|
||||||
== Changelog ==
|
== Changelog ==
|
||||||
|
|
||||||
|
= 2.1.1d5 =
|
||||||
|
- Add: UI: Tooltips: Alternative implementation: added CSS animation
|
||||||
|
|
||||||
= 2.1.1d4 =
|
= 2.1.1d4 =
|
||||||
- Add: UI: Tooltips: added delay (400ms) before fade-out to improve usability of links and Read-on button
|
- Add: UI: Tooltips: added delay (400ms) before fade-out to improve usability of links and Read-on button
|
||||||
- Update: Libraries: jQuery Tools: redacted jQuery.browser function use in js/jquery.tools.min.js
|
- Update: Libraries: jQuery Tools: redacted jQuery.browser function use in js/jquery.tools.min.js
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
<span
|
<span
|
||||||
class="footnote_referrer footnote_relative"
|
class="footnote_referrer relative"
|
||||||
onmouseover="footnoteTooltipShow('footnote_plugin_tooltip_text_[[post_id]]_[[id]]')"
|
onmouseover="footnoteTooltipShow('footnote_plugin_tooltip_text_[[post_id]]_[[id]]')"
|
||||||
onmouseout="footnoteTooltipHide('footnote_plugin_tooltip_text_[[post_id]]_[[id]]')"
|
onmouseout="footnoteTooltipHide('footnote_plugin_tooltip_text_[[post_id]]_[[id]]')"
|
||||||
><a><sup
|
><a><sup
|
||||||
id="footnote_plugin_tooltip_[[post_id]]_[[id]]"
|
id="footnote_plugin_tooltip_[[post_id]]_[[id]]"
|
||||||
class="footnote_plugin_tooltip_text"
|
class="footnote_plugin_tooltip_text"
|
||||||
onclick="footnote_moveToAnchor_[[post_id]]('footnote_plugin_reference_[[post_id]]_[[id]]');"
|
onclick="footnote_moveToAnchor_[[post_id]]('footnote_plugin_reference_[[post_id]]_[[id]]');"
|
||||||
>[[before]][[index]][[after]]</sup
|
>[[before]][[index]][[after]]</sup
|
||||||
></a><span
|
></a><span
|
||||||
id="footnote_plugin_tooltip_text_[[post_id]]_[[id]]"
|
id="footnote_plugin_tooltip_text_[[post_id]]_[[id]]"
|
||||||
class="footnote_tooltip_alternative footnote_tooltip"
|
class="footnote_tooltip position hidden"
|
||||||
onmouseout="footnoteTooltipHide('footnote_plugin_tooltip_text_[[post_id]]_[[id]]')"
|
onmouseout="footnoteTooltipHide('footnote_plugin_tooltip_text_[[post_id]]_[[id]]')"
|
||||||
>[[text]]</span
|
>[[text]]</span
|
||||||
></span
|
></span
|
||||||
|
|
Reference in a new issue