bugfix release 2.2.5

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2442448 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
pewgeuges 2020-12-18 16:31:09 +00:00
parent e5831a42b3
commit 4ff90450d6
12 changed files with 410 additions and 197 deletions

View file

@ -13,13 +13,17 @@
* 2.1.4 settings for ref container, tooltips and scrolling 2020-12-03T0950+0100
* 2.1.6 slight UI reordering 2020-12-09T1114+0100
* 2.1.6 option to disable URL line wrapping 2020-12-09T1604+0100
* 2.1.6 remove expert mode setting as irrelevant 2020-12-09T2105+0100
* 2.1.6 remove expert mode setting as outdated 2020-12-09T2105+0100
* 2.2.0 add options, redistribute, update strings 2020-12-12T2135+0100
* 2.2.0 shortcode for reference container custom position 2020-12-13T2055+0100
* 2.2.2 Custom CSS settings container migration 2020-12-15T0709+0100
* 2.2.4 move backlink symbol selection under previous tab 2020-12-16T1244+0100
* 2.2.5 support for Ibid. notation thanks to @meglio 2020-12-17T2021+0100
* @see <https://wordpress.org/support/topic/add-support-for-ibid-notation/>
* 2.2.5 options for label element and label bottom border, thanks to @markhillyer 2020-12-18T1447+0100
* @see <https://wordpress.org/support/topic/how-do-i-eliminate-the-horizontal-line-beneath-the-reference-container-heading/>
*
* Last modified: 2020-12-16T1256+0100
* Last modified: 2020-12-18T1631+0100
*/
/**
@ -122,9 +126,10 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
$l_arr_MetaBoxes[] = $this->addMetaBox("customize", "hyperlink-arrow", __("Backlink symbol", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "HyperlinkArrow");
$l_arr_MetaBoxes[] = $this->addMetaBox("customize", "superscript", __("Referrer typesetting and formatting", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "Superscript");
$l_arr_MetaBoxes[] = $this->addMetaBox("customize", "mouse-over-box", __("Tooltips", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "MouseOverBox");
$l_arr_MetaBoxes[] = $this->addMetaBox("customize", "mouse-over-box-truncation", __("Tooltip truncation", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "MouseOverBoxTruncation");
$l_arr_MetaBoxes[] = $this->addMetaBox("customize", "mouse-over-box-position", __("Tooltip position", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "MouseOverBoxPosition");
$l_arr_MetaBoxes[] = $this->addMetaBox("customize", "mouse-over-box-timing", __("Tooltip timing", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "MouseOverBoxTiming");
$l_arr_MetaBoxes[] = $this->addMetaBox("customize", "mouse-over-box-truncation", __("Tooltip truncation", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "MouseOverBoxTruncation");
$l_arr_MetaBoxes[] = $this->addMetaBox("customize", "mouse-over-box-appearance", __("Tooltip appearance", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "MouseOverBoxAppearance");
if (!MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_CUSTOM_CSS_MIGRATED))) {
$l_arr_MetaBoxes[] = $this->addMetaBox("customize", "custom-css", __("Your existing Custom CSS code", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "CustomCSS");
@ -151,13 +156,25 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
*
* Completed:
* @since 2.1.4: layout and typography options 2020-11-30T0548+0100
* 2.2.5 options for label element and label bottom border, thanks to @markhillyer 2020-12-18T1447+0100
* @see <https://wordpress.org/support/topic/how-do-i-eliminate-the-horizontal-line-beneath-the-reference-container-heading/>
*/
public function ReferenceContainer() {
// options for the label element:
$l_arr_LabelElement = array(
"p" => __("paragraph", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"h2" => __("heading 2", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"h3" => __("heading 3", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"h4" => __("heading 4", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"h5" => __("heading 5", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"h6" => __("heading 6", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
);
// options for the positioning of the reference container
$l_arr_Positions = array(
"footer" => __("in the footer", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"post_end" => __("at the end of the post", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"widget" => __("in the widget area", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)
"widget" => __("in the widget area", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"footer" => __("in the footer", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
);
// basic responsive page layout options:
$l_arr_PageLayoutOptions = array(
@ -205,6 +222,12 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"label-name" => $this->addLabel(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_NAME, __("Heading:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"name" => $this->addTextBox(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_NAME),
"label-element" => $this->addLabel(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT, __("Headings HTML element:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"element" => $this->addSelectBox(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT, $l_arr_LabelElement),
"label-border" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_LABEL_BOTTOM_BORDER, __("Border under the heading:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"border" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_LABEL_BOTTOM_BORDER, $l_arr_Enabled),
"label-collapse" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_COLLAPSE, __("Collapse by default:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"collapse" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_COLLAPSE, $l_arr_Enabled),
@ -287,6 +310,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
* Edited heading 2020-12-12T1412+0100
* @since 2.2.0 more short code options 2020-12-12T1412+0100
* @since 2.2.0 3 boxes for clarity 2020-12-12T1422+0100
* @since 2.2.5 support for Ibid. notation thanks to @meglio 2020-12-17T2019+0100
* @see <https://wordpress.org/support/topic/add-support-for-ibid-notation/>
*/
public function StartEnd() {
// footnotes start tag short code options:
@ -375,7 +400,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"label-identical" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_COMBINE_IDENTICAL_FOOTNOTES, __("Combine identical footnotes:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"identical" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_COMBINE_IDENTICAL_FOOTNOTES, $l_arr_Enable),
"notice-identical" => __("This option may require copy-pasting footnotes in multiple instances.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"description-identical" => __("Even when footnotes are combined, footnote numbers keep incrementing. This avoids suboptimal referrer and backlink disambiguation using a secondary numbering system. Repeating the content is an opportunity to add details.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
// Support for Ibid. notation added thanks to @meglio in <https://wordpress.org/support/topic/add-support-for-ibid-notation/>.
"description-identical" => __("Even when footnotes are combined, footnote numbers keep incrementing. This avoids suboptimal referrer and backlink disambiguation using a secondary numbering system. The Ibid. notation followed by the current page number avoids repeating the footnote content. For changing sources, shortened citations may be used. Repeating full citations is also an opportunity to add details.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
)
);
// display template with replaced placeholders
@ -531,6 +557,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
*
* Edited:
* @since 2.2.0 5 parts to address increased settings number
* @since 2.2.5 added position settings container for the alternative tooltips
*/
public function MouseOverBox() {
// options for Yes/No select box:
@ -552,37 +579,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"label-alternative" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE, __("Display alternative tooltips:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"alternative" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE, $l_arr_Enabled),
"notice-alternative" => __("Intended to work around a configuration-related tooltip outage.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"description-alternative" => sprintf(__("Some themes inhibit jQuery tooltips. For alternative tooltips, animated by CSS, %s does not load any external scripts.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), '<span style="font-style: normal;">' . MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME . '</span>'),
)
);
// display template with replaced placeholders
echo $l_obj_Template->getContent();
}
public function MouseOverBoxTruncation() {
// options for Yes/No select box:
$l_arr_Enabled = array(
"yes" => __("Yes", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"no" => __("No", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)
);
// load template file
$l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "mouse-over-box-truncation");
// replace all placeholders
$l_obj_Template->replace(
array(
"label-truncation" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED, __("Truncate the note in the tooltip:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"truncation" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED, $l_arr_Enabled),
"label-max-length" => $this->addLabel(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH, __("Maximum number of characters in the tooltip:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"max-length" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH, 3, 10000),
// The feature trims back until the last full word.
"notice-max-length" => __("No weird cuts.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"label-readon" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL, __("Read on button label:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"readon" => $this->addTextBox(MCI_Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL),
// The placeholder is the name of the plugin as logogram “footnotes”.
"description-alternative" => sprintf(__("Some themes inhibit jQuery tooltips. Some may disable CSS transitions as well. Alternative tooltips are triggered by inline JavaScript and animated with CSS transitions. If this option is enabled, %s does not load any external scripts.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), '<span style="font-style: normal;">' . MCI_Footnotes_Config::C_STR_PLUGIN_PUBLIC_NAME . '</span>'),
)
);
@ -603,6 +601,13 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"bottom left" => __("bottom left", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"center left" => __("center left", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
);
// options for the alternative Mouse-over box position
$l_arr_AlternativePosition = array(
"top left" => __("top left", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"top right" => __("top right", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"bottom right" => __("bottom right", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"bottom left" => __("bottom left", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
);
// load template file
$l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "mouse-over-box-position");
@ -612,18 +617,23 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"label-position" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION, __("Position:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"position" => $this->addSelectBox(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION, $l_arr_Position),
"position-alternative" => $this->addSelectBox(MCI_Footnotes_Settings::C_STR_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_POSITION, $l_arr_AlternativePosition),
"notice-position" => __("The second column of settings boxes is for the alternative tooltips.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"label-offset-x" => $this->addLabel(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X, __("Horizontal offset rightwards:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"offset-x" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X, -150, 150),
"notice-offset-x" => __("pixels; negative value for a leftwards offset", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"label-offset-x" => $this->addLabel (MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X, __("Horizontal offset:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"offset-x" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X, -500, 500),
"offset-x-alternative" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_X, -500, 500),
"notice-offset-x" => __("pixels; negative value for a leftwards offset; alternative tooltips: direction depends on position", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"label-offset-y" => $this->addLabel(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y, __("Vertical offset downwards:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"offset-y" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y, -150, 150),
"notice-offset-y" => __("pixels; negative value for an upwards offset", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"label-offset-y" => $this->addLabel(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y, __("Vertical offset:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"offset-y" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y, -500, 500),
"offset-y-alternative" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_Y, -500, 500),
"notice-offset-y" => __("pixels; negative value for an upwards offset; alternative tooltips: direction depends on position", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"label-max-width" => $this->addLabel(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH, __("Maximum width:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"max-width" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH, 0, 1280),
"notice-max-width" => __("pixels; 0 to disable this setting", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"width" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_WIDTH, 0, 1280),
"notice-max-width" => __("pixels; set to 0 for jQuery tooltips without max width; alternative tooltips are given the value in the second box as fixed width.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
)
);
@ -661,6 +671,36 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
echo $l_obj_Template->getContent();
}
public function MouseOverBoxTruncation() {
// options for Yes/No select box:
$l_arr_Enabled = array(
"yes" => __("Yes", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"no" => __("No", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)
);
// load template file
$l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "mouse-over-box-truncation");
// replace all placeholders
$l_obj_Template->replace(
array(
"label-truncation" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED, __("Truncate the note in the tooltip:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"truncation" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED, $l_arr_Enabled),
"label-max-length" => $this->addLabel(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH, __("Maximum number of characters in the tooltip:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"max-length" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH, 3, 10000),
// The feature trims back until the last full word.
"notice-max-length" => __("No weird cuts.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"label-readon" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL, __("Read on button label:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"readon" => $this->addTextBox(MCI_Footnotes_Settings::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL),
)
);
// display template with replaced placeholders
echo $l_obj_Template->getContent();
}
public function MouseOverBoxAppearance() {
// options for Yes/No select box:
$l_arr_Enabled = array(
@ -807,7 +847,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
array(
"label-css" => $this->addLabel(MCI_Footnotes_Settings::C_STR_CUSTOM_CSS, __("Your existing Custom CSS code:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"css" => $this->addTextArea(MCI_Footnotes_Settings::C_STR_CUSTOM_CSS),
"description-css" => __('Custom CSS migrates to a dedicated tab. This text area is intended to keep your data safe. Please cut and paste the content into the new text area under the new tab.', MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"description-css" => __('Custom CSS migrates to a dedicated tab. This text area is intended to keep your data safe. Please copy and paste the content into the new text area below.', MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"label-migrated" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_CUSTOM_CSS_MIGRATED, "Custom CSS migration complete:"),
"migrated" => $this->addCheckbox(MCI_Footnotes_Settings::C_BOOL_CUSTOM_CSS_MIGRATED),

View file

@ -13,18 +13,23 @@
* 2.1.1 fix tooltips on site by alternative 2020-11-11T1819+0100
* 2.1.1 fix disabling backlink symbol 2020-11-16T2021+0100
* 2.1.1 fix superscript by making it optional
* 2.1.1 fix start pages by option to hide ref container
* 2.1.1 fix start pages by option to hide ref container, thanks to @dragon013
* @see <https://wordpress.org/support/topic/possible-to-hide-it-from-start-page/>
* 2.1.1 fix ref container by option restoring 3-column layout
* 2.1.1 fix ref container by option to switch index/symbol 2020-11-16T2022+0100
* 2.1.3 fix ref container positioning by priority level 2020-11-17T0205+0100
* 2.1.4 more settings container keys 2020-12-03T0955+0100
* 2.1.6 option to disable URL line wrapping 2020-12-09T1606+0100
* 2.1.6 set default priority level of the_content to 98 2020-12-10T0447+0100
* 2.2.0 reference container custom position shortcode 2020-12-13T2056+0100
* 2.2.0 reference container custom position shortcode, thanks to @hamshe 2020-12-13T2056+0100
* @see <https://wordpress.org/support/topic/reference-container-in-elementor/>
* 2.2.2 Custom CSS settings container migration 2020-12-15T0709+0100
* 2.2.4 move backlink symbol selection under previous tab 2020-12-16T1256+0100
* 2.2.5 alternative tooltip position settings 2020-12-17T0907+0100
* 2.2.5 options for reference container label element, thanks to @markhillyer 2020-12-18T1455+0100
* @see <https://wordpress.org/support/topic/how-do-i-eliminate-the-horizontal-line-beneath-the-reference-container-heading/>
*
* Last modified: 2020-12-16T1256+0100
* Last modified: 2020-12-18T1632+0100
*/
@ -424,7 +429,7 @@ class MCI_Footnotes_Settings {
* Settings Container Keys for tooltip display durations
*
* @since 2.1.4
* @var string|bool|int
* @var string|bool|int|flo
*
* 2020-11-26T1002+0100
* 2020-11-30T0427+0100
@ -495,6 +500,24 @@ class MCI_Footnotes_Settings {
*/
const C_STR_REFERENCE_CONTAINER_POSITION_SHORTCODE = "footnote_inputfield_reference_container_position_shortcode";
/**
* Settings Container Keys for alternative tooltip position
* Settings Container Keys for reference container label element, thanks to @markhillyer
* @see <https://wordpress.org/support/topic/how-do-i-eliminate-the-horizontal-line-beneath-the-reference-container-heading/>
*
* @since 2.2.5
* @var int
*
* 2020-12-17T0746+0100
* 2020-12-18T1509+0100
*/
const C_STR_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_POSITION = "footnotes_inputfield_alternative_mouse_over_box_position";
const C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_X = "footnotes_inputfield_alternative_mouse_over_box_offset_x";
const C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_Y = "footnotes_inputfield_alternative_mouse_over_box_offset_y";
const C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_WIDTH = "footnotes_inputfield_alternative_mouse_over_box_width";
const C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT = "footnotes_inputfield_reference_container_label_element";
const C_BOOL_REFERENCE_CONTAINER_LABEL_BOTTOM_BORDER = "footnotes_inputfield_reference_container_label_bottom_border";
/**
* Stores a singleton reference of this class.
@ -535,25 +558,29 @@ class MCI_Footnotes_Settings {
"footnotes_storage" => array(
self::C_STR_FOOTNOTES_SHORT_CODE_START => '((',
self::C_STR_FOOTNOTES_SHORT_CODE_END => '))',
self::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED => '',
self::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED => '',
self::C_STR_FOOTNOTES_COUNTER_STYLE => 'arabic_plain',
self::C_INT_FOOTNOTES_SCROLL_OFFSET => 20,
self::C_INT_FOOTNOTES_SCROLL_DURATION => 380,
self::C_STR_FOOTNOTES_SHORT_CODE_START => '((',
self::C_STR_FOOTNOTES_SHORT_CODE_END => '))',
self::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED => '',
self::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED => '',
self::C_STR_REFERENCE_CONTAINER_NAME => 'References',
self::C_BOOL_REFERENCE_CONTAINER_COLLAPSE => 'no',
self::C_STR_REFERENCE_CONTAINER_POSITION => 'post_end',
self::C_BOOL_COMBINE_IDENTICAL_FOOTNOTES => 'yes',
self::C_STR_FOOTNOTES_COUNTER_STYLE => 'arabic_plain',
self::C_BOOL_COMBINE_IDENTICAL_FOOTNOTES => 'yes',
// whether to enqueue additional style sheet:
self::C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT => 'none',
self::C_INT_FOOTNOTES_SCROLL_OFFSET => 20,
self::C_INT_FOOTNOTES_SCROLL_DURATION => 380,
self::C_STR_REFERENCE_CONTAINER_NAME => 'References',
self::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT => 'p',
self::C_BOOL_REFERENCE_CONTAINER_LABEL_BOTTOM_BORDER => 'yes',
self::C_BOOL_REFERENCE_CONTAINER_COLLAPSE => 'no',
self::C_STR_REFERENCE_CONTAINER_POSITION => 'post_end',
self::C_STR_REFERENCE_CONTAINER_POSITION_SHORTCODE => '[[references]]',
self::C_BOOL_REFERENCE_CONTAINER_START_PAGE_ENABLE => 'yes',
// whether to enqueue additional style sheet:
self::C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT => 'none',
// backlink symbol:
self::C_BOOL_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE => 'no',
self::C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE => 'yes',
@ -601,7 +628,7 @@ class MCI_Footnotes_Settings {
"footnotes_storage_custom" => array(
self::C_STR_HYPERLINK_ARROW => '&#8593;',
self::C_STR_HYPERLINK_ARROW => '&#8593;',
self::C_STR_HYPERLINK_ARROW_USER_DEFINED => '',
self::C_STR_FOOTNOTES_TOOLTIP_READON_LABEL => 'Continue reading',
@ -640,6 +667,15 @@ class MCI_Footnotes_Settings {
// the current line of text (web coordinates origin is top left):
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y => -7,
// The width should be limited to start with, for the box to have shape:
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH => 450,
// fixed width is for alternative tooltips, cannot reuse max-width nor offsets:
self::C_STR_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_POSITION => 'top right',
self::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_X => -50,
self::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_Y => 24,
self::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_WIDTH => 400,
// tooltip display durations:
// called mouse over box not tooltip for consistency
self::C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY => 0,
@ -665,9 +701,6 @@ class MCI_Footnotes_Settings {
// 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',
// Custom CSS migrates to a dedicated tab:

View file

@ -8,12 +8,16 @@
*
* Edited for v2.0.0 and following.
*
* 2.0.5 Autoload / infinite scroll support added thanks to code from
* @docteurfitness <https://wordpress.org/support/topic/auto-load-post-compatibility-update/>
* 2.0.5 Autoload / infinite scroll support added thanks to code from @docteurfitness
* @see <https://wordpress.org/support/topic/auto-load-post-compatibility-update/>
*
* 2.0.9 DISABLED the_post HOOK 2020-11-08T1839+0100
*
* 2.1.0 promoted the 'Continue reading' button from localization to customization 2020-11-08T2146+0100
* 2.1.1 combining identical footnotes: fixed dead links 2020-11-14T2233+0100
* 2.1.1 combining identical footnotes: fixed dead links, thanks to @happyches 2020-11-14T2233+0100
* @see <https://wordpress.org/support/topic/custom-css-for-jumbled-references/>
* 2.1.1 fix start pages by option to hide ref container, thanks to @dragon013
* @see <https://wordpress.org/support/topic/possible-to-hide-it-from-start-page/>
* 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
@ -27,10 +31,16 @@
* 2.1.4 tooltip display duration settings 2020-12-06T1320+0100
* 2.1.6 option to disable URL line wrapping 2020-12-09T1606+0100
* 2.1.6 add catch-all exclusion to fix URL line wrapping 2020-12-09T1921+0100
* 2.2.0 support for custom position shortcode for reference container 2020-12-13T2058+0100
* 2.2.0 support for custom position shortcode for reference container, thanks to @hamshe 2020-12-13T2058+0100
* @see <https://wordpress.org/support/topic/reference-container-in-elementor/>
* 2.2.3 custom CSS from new setting in header after legacy 2020-12-15T1128+0100
* 2.2.5 connected alternative tooltips to position and timing settings 2020-12-18T1113+0100
* 2.2.5 delete unused position shortcode when ref container in widget or footer, thanks to @hamshe 2020-12-18T1437+0100
* @see <https://wordpress.org/support/topic/reference-container-in-elementor/#post-13784126>
* 2.2.5 options for label element and label bottom border, thanks to @markhillyer 2020-12-18T1447+0100
* @see <https://wordpress.org/support/topic/how-do-i-eliminate-the-horizontal-line-beneath-the-reference-container-heading/>
*
* Last modified: 2020-12-15T1140+0100
* Last modified: 2020-12-18T1627+0100
*/
// If called directly, abort:
@ -152,133 +162,219 @@ class MCI_Footnotes_Task {
*
* @author Stefan Herndler
* @since 1.5.0
*
* Edited:
* 2.1.1 option to hide ref container from start page
* 2.1.1 script for alternative tooltips
* 2.1.3 raise settings priority to override theme style sheets
* 2.1.4 tootip font size and backlink column width settings
* 2.2.5 options for label element and label bottom border, thanks to @markhillyer 2020-12-18T1447+0100
* @see <https://wordpress.org/support/topic/how-do-i-eliminate-the-horizontal-line-beneath-the-reference-container-heading/>
*/
public function wp_head() {
// tooltip:
$l_str_FontSizeEnabled = MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_MOUSE_OVER_BOX_FONT_SIZE_ENABLED));
$l_str_FontSizeScalar = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_FLO_MOUSE_OVER_BOX_FONT_SIZE_SCALAR);
$l_str_FontSizeUnit = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_MOUSE_OVER_BOX_FONT_SIZE_UNIT);
// no switch out to insert start tag:
echo "\r\n<style type=\"text/css\" media=\"all\">\r\n";
$l_str_Color = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR);
$l_str_Background = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND);
// display ref container on home page:
if (!MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_START_PAGE_ENABLE))) {
echo ".home .footnotes_reference_container { display: none; }\r\n";
}
// ref container label bottom border:
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_LABEL_BOTTOM_BORDER))) {
echo ".footnote_container_prepare > ";
echo MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT);
echo " {border-bottom: 1px solid #aaaaaa !important;}\r\n";
}
$l_int_BorderWidth = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH);
$l_str_BorderColor = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR);
$l_int_BorderRadius = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS);
$l_int_MaxWidth = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH);
$l_str_BoxShadowColor = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR);
// ref container first column width:
// ref container first column width and max-width:
$l_bool_ColumnWidthEnabled = MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_BACKLINKS_COLUMN_WIDTH_ENABLED));
$l_int_ColumnWidthScalar = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_BACKLINKS_COLUMN_WIDTH_SCALAR);
$l_str_ColumnWidthUnit = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_BACKLINKS_COLUMN_WIDTH_UNIT);
$l_bool_ColumnMaxWidthEnabled = MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_BACKLINKS_COLUMN_MAX_WIDTH_ENABLED));
$l_int_ColumnMaxWidthScalar = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_BACKLINKS_COLUMN_MAX_WIDTH_SCALAR);
$l_str_ColumnMaxWidthUnit = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_UNIT);
if (!empty($l_int_ColumnWidthScalar)) {
if ($l_str_ColumnWidthUnit == '%') {
if ($l_int_ColumnWidthScalar > 100) {
$l_int_ColumnWidthScalar = 100;
if ( $l_bool_ColumnWidthEnabled || $l_bool_ColumnMaxWidthEnabled ) {
echo ".footnote-reference-container { table-layout: fixed; }";
echo ".footnote_plugin_index, .footnote_plugin_index_combi {";
if ( $l_bool_ColumnWidthEnabled ) {
$l_int_ColumnWidthScalar = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_BACKLINKS_COLUMN_WIDTH_SCALAR);
$l_str_ColumnWidthUnit = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_BACKLINKS_COLUMN_WIDTH_UNIT);
if (!empty($l_int_ColumnWidthScalar)) {
if ($l_str_ColumnWidthUnit == '%') {
if ($l_int_ColumnWidthScalar > 100) {
$l_int_ColumnWidthScalar = 100;
}
}
} else {
$l_int_ColumnWidthScalar = 0;
}
echo " width: $l_int_ColumnWidthScalar$l_str_ColumnWidthUnit !important;";
}
} else {
$l_int_ColumnWidthScalar = 0;
if ( $l_bool_ColumnMaxWidthEnabled ) {
$l_int_ColumnMaxWidthScalar = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_BACKLINKS_COLUMN_MAX_WIDTH_SCALAR);
$l_str_ColumnMaxWidthUnit = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_UNIT);
if (!empty($l_int_ColumnMaxWidthScalar)) {
if ($l_str_ColumnMaxWidthUnit == '%') {
if ($l_int_ColumnMaxWidthScalar > 100) {
$l_int_ColumnMaxWidthScalar = 100;
}
}
} else {
$l_int_ColumnMaxWidthScalar = 0;
}
echo " max-width: $l_int_ColumnMaxWidthScalar$l_str_ColumnMaxWidthUnit !important;";
}
echo "}\r\n";
}
if (!empty($l_int_ColumnMaxWidthScalar)) {
if ($l_str_ColumnMaxWidthUnit == '%') {
if ($l_int_ColumnMaxWidthScalar > 100) {
$l_int_ColumnMaxWidthScalar = 100;
}
}
} else {
$l_int_ColumnMaxWidthScalar = 0;
}
// tooltips:
$l_bool_TooltipsEnabled = MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED));
$l_bool_AlternativeTooltipsEnabled = MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE));
?>
<style type="text/css" media="all">
<?php
if ($l_bool_TooltipsEnabled) {
// display ref container on home page:
if (!MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_START_PAGE_ENABLE))) {
echo ".home .footnotes_reference_container { display: none; }\r\n";
}
// ref container first column width:
if ( $l_bool_ColumnWidthEnabled || $l_bool_ColumnMaxWidthEnabled ) {
echo ".footnote-reference-container { table-layout: fixed; }";
echo ".footnote_plugin_index, .footnote_plugin_index_combi {";
if ( $l_bool_ColumnWidthEnabled ) {
echo " width: $l_int_ColumnWidthScalar$l_str_ColumnWidthUnit !important;";
}
if ( $l_bool_ColumnMaxWidthEnabled ) {
echo " max-width: $l_int_ColumnMaxWidthScalar$l_str_ColumnMaxWidthUnit !important;";
}
echo '}';
}
// tooltip:
echo '.footnote_tooltip {';
// tooltip appearance:
// font size:
echo ' font-size: ';
if($l_str_FontSizeEnabled) {
echo $l_str_FontSizeScalar . $l_str_FontSizeUnit;
if(MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_MOUSE_OVER_BOX_FONT_SIZE_ENABLED))) {
echo MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_FLO_MOUSE_OVER_BOX_FONT_SIZE_SCALAR);
echo MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_MOUSE_OVER_BOX_FONT_SIZE_UNIT);
} else {
echo 'inherit';
}
echo ' !important;';
// text color:
$l_str_Color = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR);
if (!empty($l_str_Color)) {
printf(" color: %s !important;", $l_str_Color);
}
// background color:
$l_str_Background = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND);
if (!empty($l_str_Background)) {
printf(" background-color: %s !important;", $l_str_Background);
}
// border width:
$l_int_BorderWidth = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH);
if (!empty($l_int_BorderWidth) && intval($l_int_BorderWidth) > 0) {
printf(" border-width: %dpx !important; border-style: solid !important;", $l_int_BorderWidth);
}
// border color:
$l_str_BorderColor = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR);
if (!empty($l_str_BorderColor)) {
printf(" border-color: %s !important;", $l_str_BorderColor);
}
// corner radius:
$l_int_BorderRadius = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS);
if (!empty($l_int_BorderRadius) && intval($l_int_BorderRadius) > 0) {
printf(" border-radius: %dpx !important;", $l_int_BorderRadius);
}
if (!empty($l_int_MaxWidth) && intval($l_int_MaxWidth) > 0) {
printf(" max-width: %dpx !important;", $l_int_MaxWidth);
}
// shadow color:
$l_str_BoxShadowColor = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR);
if (!empty($l_str_BoxShadowColor)) {
printf(" -webkit-box-shadow: 2px 2px 11px %s;", $l_str_BoxShadowColor);
printf(" -moz-box-shadow: 2px 2px 11px %s;", $l_str_BoxShadowColor);
printf(" box-shadow: 2px 2px 11px %s;", $l_str_BoxShadowColor);
}
echo "}\r\n";
// set custom CSS to override settings, not conversely:
// if dashboard tab migration acknowledged, disable legacy in case it was not cut:
if (!MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_CUSTOM_CSS_MIGRATED))) {
echo MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_CUSTOM_CSS);
// alternative tooltips:
if ( ! $l_bool_AlternativeTooltipsEnabled) {
// tooltip position:
$l_int_MaxWidth = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH);
if (!empty($l_int_MaxWidth) && intval($l_int_MaxWidth) > 0) {
printf(" max-width: %dpx !important;", $l_int_MaxWidth);
}
echo "}\r\n";
} else {
echo "}\r\n";
// position:
echo ".footnote_tooltip.position {";
echo " width: " . intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_WIDTH)) . 'px;';
$l_str_AlternativePosition = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_POSITION);
$l_int_OffsetX = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_X));
if ($l_str_AlternativePosition == 'top left' || $l_str_AlternativePosition == 'bottom left') {
echo ' right: ' . ( !empty($l_int_OffsetX) ? $l_int_OffsetX : 0) . 'px;';
} else {
echo ' left: ' . ( !empty($l_int_OffsetX) ? $l_int_OffsetX : 0) . 'px;';
}
$l_int_OffsetY = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_ALTERNATIVE_MOUSE_OVER_BOX_OFFSET_Y));
if ($l_str_AlternativePosition == 'top left' || $l_str_AlternativePosition == 'top right') {
echo ' bottom: ' . ( !empty($l_int_OffsetY) ? $l_int_OffsetY : 0) . 'px;';
} else {
echo ' top: ' . ( !empty($l_int_OffsetY) ? $l_int_OffsetY : 0) . 'px;';
}
echo "}\r\n";
// timing:
// jQuery tooltip timing is in templates/public/tooltip.html, filled in after line 690 below.
echo ' .footnote_tooltip.shown {';
$l_int_FadeInDelay = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY ));
$l_int_FadeInDuration = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION ));
$l_int_FadeInDelay = !empty($l_int_FadeInDelay ) ? $l_int_FadeInDelay : '0';
$l_int_FadeInDuration = !empty($l_int_FadeInDuration ) ? $l_int_FadeInDuration : '0';
echo " transition-delay: $l_int_FadeInDelay" . 'ms;';
echo " transition-duration: $l_int_FadeInDuration" . 'ms;';
echo '} .footnote_tooltip.hidden {';
$l_int_FadeOutDelay = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY ));
$l_int_FadeOutDuration = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DURATION));
$l_int_FadeOutDelay = !empty($l_int_FadeOutDelay ) ? $l_int_FadeOutDelay : '0';
$l_int_FadeOutDuration = !empty($l_int_FadeOutDuration ) ? $l_int_FadeOutDuration : '0';
echo " transition-delay: $l_int_FadeOutDelay" . 'ms;';
echo " transition-duration: $l_int_FadeOutDuration" . 'ms;';
echo "}\r\n";
}
echo MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_CUSTOM_CSS_NEW);
?>
</style>
<?php
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 "\tfunction footnoteTooltipShow(footnoteTooltipId) {\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";
}
// set custom CSS to override settings, not conversely:
// if dashboard tab migration acknowledged, disable legacy in case it was not cut:
if (!MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_CUSTOM_CSS_MIGRATED))) {
echo MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_CUSTOM_CSS);
}
echo MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_CUSTOM_CSS_NEW);
// no switch out to insert end tag:
echo "\r\n</style>\r\n";
// alternative tooltip script printed formatted not minified:
if ($l_bool_AlternativeTooltipsEnabled) {
?>
<script content="text/javascript">
function footnoteTooltipShow(footnoteTooltipId) {
document.getElementById(footnoteTooltipId).classList.remove('hidden');
document.getElementById(footnoteTooltipId).classList.add('shown');
}
function footnoteTooltipHide(footnoteTooltipId) {
document.getElementById(footnoteTooltipId).classList.remove('shown');
document.getElementById(footnoteTooltipId).classList.add('hidden');
}
</script>
<?php
};
}
@ -428,6 +524,13 @@ class MCI_Footnotes_Task {
* @param bool $p_bool_OutputReferences Appends the Reference Container to the output if set to true, default true.
* @param bool $p_bool_HideFootnotesText Hide footnotes found in the string.
* @return string
*
* Edited:
* @since 2.2.0 insert reference container at shortcode, thanks to @hamshe 2020-12-13T2057+0100
* @see <https://wordpress.org/support/topic/reference-container-in-elementor/>
*
* @since 2.2.5 delete unused position shortcode, when position is widget or footer, thanks to @hamshe 2020-12-18T1434+0100
* @see <https://wordpress.org/support/topic/reference-container-in-elementor/#post-13784126>
*/
public function exec($p_str_Content, $p_bool_OutputReferences = false, $p_bool_HideFootnotesText = false) {
// replace all footnotes in the content, settings are converted to html characters
@ -436,11 +539,11 @@ class MCI_Footnotes_Task {
$p_str_Content = $this->search($p_str_Content, false, $p_bool_HideFootnotesText);
// append the reference container
// or insert at shortcode: (2.2.0 2020-12-13T2057+0100)
// or insert at shortcode: added for 2.2.0, thanks to @hamshe
$l_str_ReferenceContainerPositionShortcode = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION_SHORTCODE);
if ($p_bool_OutputReferences) {
if (strpos( $p_str_Content, $l_str_ReferenceContainerPositionShortcode ) !== false ) {
$p_str_Content = str_replace( $l_str_ReferenceContainerPositionShortcode, $this->ReferenceContainer(), $p_str_Content );
@ -452,6 +555,9 @@ class MCI_Footnotes_Task {
}
}
// delete position shortcode should any remain e.g. when ref container is in footer, thanks to @hamshe:
$p_str_Content = str_replace( $l_str_ReferenceContainerPositionShortcode, '', $p_str_Content );
// take a look if the LOVE ME slug should NOT be displayed on this page/post, remove the short code if found
if (strpos($p_str_Content, MCI_Footnotes_Config::C_STR_NO_LOVE_SLUG) !== false) {
self::$a_bool_AllowLoveMe = false;
@ -998,21 +1104,21 @@ class MCI_Footnotes_Task {
}
// get scroll offset and duration settings:
$l_int_ScrollOffset = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_OFFSET);
$l_int_ScrollDuration = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DURATION);
// streamline:
$l_bool_CollapseDefault = MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_COLLAPSE));
// load 'templates/public/reference-container.html':
$l_obj_TemplateContainer = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_PUBLIC, "reference-container");
$l_obj_TemplateContainer->replace(
array(
"post_id" => $l_int_PostId,
"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;' : '',
"style" => MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_COLLAPSE)) ? 'display: none;' : '',
"element" => MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_LABEL_ELEMENT),
"name" => MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_NAME),
"button-style" => !$l_bool_CollapseDefault ? 'display: none;' : '',
"style" => $l_bool_CollapseDefault ? 'display: none;' : '',
"content" => $l_str_Body,
"scroll-offset" => ($l_int_ScrollOffset / 100),
"scroll-duration" => $l_int_ScrollDuration,
"scroll-offset" => (intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_OFFSET)) / 100),
"scroll-duration" => intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DURATION)),
)
);

View file

@ -9,6 +9,7 @@
* Since v2.1.4 of Footnotes
*
* Last modified for v2.2.2 2020-12-15T1004+0100
* Last modified for v2.2.5 2020-12-16T1321+0100
*
* The enqueuing of this style sheet is optional and can be
* enabled in the Reference container settings.
@ -29,8 +30,9 @@ This style sheet lets Footnotes reference containers come
into the benefit of the basic responsive layout style rules
that would apply if the page were not built with Elementor.
This is mainly useful with Hello Elementor but it helps fix
also other themes like Twenty Twenty-One.
This is mainly useful with Hello Elementor, but it may help
fix also other themes like Twenty Twenty-One for display in
older browsers not yet supporting CSS variables.
*/
div.page-content,

View file

@ -43,8 +43,8 @@ main div.footnotes_reference_container {
@media (max-width: 575px) {
.entry-content div.footnotes_reference_container,
.entry-content > .footnotes_reference_container,
main div.footnotes_reference_container {
.entry-content > .footnotes_reference_container,
main div.footnotes_reference_container {
padding: 0 10px;
}
}
@ -52,7 +52,7 @@ main div.footnotes_reference_container {
@media (min-width: 576px) {
.entry-content div.footnotes_reference_container,
.entry-content > .footnotes_reference_container,
.entry-content > .footnotes_reference_container,
main div.footnotes_reference_container {
max-width: 500px;
}
@ -61,7 +61,7 @@ main div.footnotes_reference_container {
@media (min-width: 768px) {
.entry-content div.footnotes_reference_container,
.entry-content > .footnotes_reference_container,
.entry-content > .footnotes_reference_container,
main div.footnotes_reference_container {
max-width: 600px;
}
@ -70,7 +70,7 @@ main div.footnotes_reference_container {
@media (min-width: 992px) {
.entry-content div.footnotes_reference_container,
.entry-content > .footnotes_reference_container,
.entry-content > .footnotes_reference_container,
main div.footnotes_reference_container {
max-width: 800px;
}
@ -79,7 +79,7 @@ main div.footnotes_reference_container {
@media (min-width: 1200px) {
.entry-content div.footnotes_reference_container,
.entry-content > .footnotes_reference_container,
.entry-content > .footnotes_reference_container,
main div.footnotes_reference_container {
max-width: 960px;
}

View file

@ -5,14 +5,14 @@
* Created-Time: 16:21
* Since: 1.0
*
* Version: 2.2.4
* Version: 2.2.5
*
* Classes added to public.css may be added to the
* list documenting CSS classes for Custom CSS if
* recommended for general use.
* List in templates/dashboard/customize-css.html
* List in templates/dashboard/customize-css-new.html
*
* Last modified: 2020-12-16T1302+0100
* Last modified: 2020-12-18T1701+0100
*/
@ -133,9 +133,12 @@ fade-in parameters
visibility: visible;
opacity: 1;
transition-property: visibility opacity;
transition-duration: 200ms;
transition-timing-function: linear;
/*
property values of settings are inline CSS
transition-delay: 0ms;
transition-duration: 200ms;
*/
}
/*
fade-out parameters
@ -144,9 +147,12 @@ fade-out parameters
visibility: hidden;
opacity: 0;
transition-property: visibility opacity;
transition-duration: 200ms;
transition-timing-function: linear;
/*
property values of settings are inline CSS
transition-delay: 400ms;
transition-duration: 200ms;
*/
}
/*
@ -210,7 +216,7 @@ label
margin-bottom: 0.25em !important;
padding: 0 !important;
font-weight: normal !important;
border-bottom: 1px solid #aaaaaa !important;
/* bottom border optional since 2.2.5 */
display: block !important;
-webkit-margin-before: 0.83em !important;
-webkit-margin-after: 0.83em !important;
@ -233,8 +239,17 @@ fully clickable, not sign only
padding: 0 0.5em;
font-size: 1.3em !important;
vertical-align: 2px;
text-decoration: none !important;
}
.footnote_container_prepare > p > span:last-child a {
h2 > .footnote_reference_container_collapse_button,
h3 > .footnote_reference_container_collapse_button,
h4 > .footnote_reference_container_collapse_button,
h5 > .footnote_reference_container_collapse_button,
h6 > .footnote_reference_container_collapse_button {
font-size: inherit !important;
}
.footnote_container_prepare > p > span:last-child a,
.footnote_reference_container_collapse_button a {
text-decoration: none !important;
}

View file

@ -5,9 +5,9 @@
* Created-Time: 16:21
* Since: 1.0
*
* Version: 2.2.4
* Version: 2.2.5
*
* Last modified: 2020-12-16T1302+0100
* Last modified: 2020-12-18T1629+0100
*/
@ -67,8 +67,7 @@ Limited to a number of IDs to not affect all dashboards
#footnote_inputfield_placeholder_start,
#footnote_inputfield_placeholder_end,
#footnote_inputfield_custom_mouse_over_box_excerpt_length,
#footnote_inputfield_custom_mouse_over_box_position {
#footnote_inputfield_custom_mouse_over_box_excerpt_length {
width: 180px;
}
#footnote_inputfield_placeholder_start_user_defined,
@ -83,6 +82,9 @@ Limited to a number of IDs to not affect all dashboards
#footnote_inputfield_custom_mouse_over_box_offset_x,
#footnote_inputfield_custom_mouse_over_box_offset_y,
#footnote_inputfield_custom_mouse_over_box_max_width,
#footnotes_inputfield_alternative_mouse_over_box_offset_x,
#footnotes_inputfield_alternative_mouse_over_box_offset_y,
#footnotes_inputfield_alternative_mouse_over_box_width,
#footnotes_inputfield_mouse_over_box_fade_in_delay,
#footnotes_inputfield_mouse_over_box_fade_in_duration,
#footnotes_inputfield_mouse_over_box_fade_out_delay,

View file

@ -4,12 +4,12 @@
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.2.4
Version: 2.2.5
Author URI: http://cheret.de/plugins/footnotes-2/
Text Domain: footnotes
Domain Path: /languages
*/
define( 'FOOTNOTES_VERSION', '2.2.4' );
define( 'FOOTNOTES_VERSION', '2.2.5' );
/*
Copyright 2020 Mark Cheret (email: mark@cheret.de)

View file

@ -4,7 +4,7 @@ Tags: footnote, footnotes, bibliography, formatting, notes, Post, posts, referen
Requires at least: 3.9
Tested up to: 5.6
Requires PHP: 5.6
Stable Tag: 2.2.4
Stable Tag: 2.2.5
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
@ -80,6 +80,13 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
== Changelog ==
= 2.2.5 =
- Add: Dashboard: Footnotes numbering: add support for Ibid. notation in suggestions for guidance, thanks to @meglio
- Add: Reference container: support options for label element and label bottom border, thanks to @markhillyer
- Bugfix: Referernce container: delete position shortcode if unused because position may be widget or footer, thanks to @hamshe
- Bugfix: Dashboard: Tooltip position/timing settings: include alternative tooltips (for themes not supporting jQuery tooltips)
- Bugfix: Dashboard: Tooltip position/timing settings: raise above tooltip truncation settings for better consistency
= 2.2.4 =
- Bugfix: Reference container: Backlink symbol selection: moved back to previous tab “Referrers and tooltips”
- Bugfix: Custom CSS: make inserting existing in header depend on migration complete checkbox status
@ -96,7 +103,7 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
- Bugfix: Dashboard: duplicate moved settings under their legacy tab to account for data structure
= 2.2.0 =
- Add: Reference container: support for custom position shortcode
- Add: Reference container: support for custom position shortcode, thanks to @hamshe
- Update: Priority levels: update the notice in the dashboard Priority tab
- Bugfix: Tooltips: add 'important' property to z-index to fix display overlay issue
- Add: Start/end short codes: more predefined options
@ -165,7 +172,7 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
- Update: Dashboard: feature description for the hooks priority level settings (not yet localized)
= 2.1.1 =
- Bugfix: Combining identical footnotes: fix dead links, ensure referrer-backlink bijectivity
- Bugfix: Combining identical footnotes: fix dead links, ensure referrer-backlink bijectivity, thanks to @happyches
- Update: Libraries: jQuery Tools: redact jQuery.browser function use in js/jquery.tools.min.js
- Update: Libraries: jQuery Tools: complete minification
- Bugfix: Libraries: made script loads depend on tooltip implementation option

View file

@ -2,19 +2,19 @@
<tbody>
<tr>
<td>[[label-position]]</td>
<td>[[position]]</td>
<td>[[position]] [[position-alternative]] <span class="footnotes_notice">[[notice-position]]</span></td>
</tr>
<tr>
<td>[[label-offset-x]]</td>
<td>[[offset-x]] <span class="footnotes_notice">[[notice-offset-x]]</span></td>
<td>[[offset-x]] [[offset-x-alternative]] <span class="footnotes_notice">[[notice-offset-x]]</span></td>
</tr>
<tr>
<td>[[label-offset-y]]</td>
<td>[[offset-y]] <span class="footnotes_notice">[[notice-offset-y]]</span></td>
<td>[[offset-y]] [[offset-y-alternative]] <span class="footnotes_notice">[[notice-offset-y]]</span></td>
</tr>
<tr>
<td>[[label-max-width]]</td>
<td>[[max-width]] <span class="footnotes_notice">[[notice-max-width]]</span></td>
<td>[[max-width]] [[width]] <span class="footnotes_notice">[[notice-max-width]]</span></td>
</tr>
</tbody>
</table>

View file

@ -4,6 +4,14 @@
<td>[[label-name]]</td>
<td>[[name]]</td>
</tr>
<tr>
<td>[[label-element]]</td>
<td>[[element]]</td>
</tr>
<tr>
<td>[[label-border]]</td>
<td>[[border]]</td>
</tr>
<tr>
<td>[[label-collapse]]</td>
<td>[[collapse]]</td>

View file

@ -3,11 +3,11 @@
>
<div
class="footnote_container_prepare"
><p
><[[element]]
><span
class="footnote_reference_container_label"
onclick="footnote_expand_reference_container_[[post_id]]();"
>[[label]]</span
>[[name]]</span
><span
class="footnote_reference_container_collapse_button"
style="[[button-style]]"
@ -16,7 +16,7 @@
id="footnote_reference_container_collapse_button_[[post_id]]"
>+</a
>]</span
></p
></[[element]]
></div
>
<div