development 2.2.0d2 tooltip durations settings
git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2432531 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
parent
3e8d312969
commit
ec116d10a2
17 changed files with 284 additions and 94 deletions
|
@ -13,9 +13,9 @@
|
|||
*
|
||||
*
|
||||
* ########## fix punctuation-related localization issue in dashboard labels 2020-12-01T0211+0100
|
||||
* ########## this fix reverted for now; restore when updating strings and translations
|
||||
* ########## this fix reverted for now; restore when updating strings and translations, line 400
|
||||
*
|
||||
* Last modified: 2020-12-05T0540+0100
|
||||
* Last modified: 2020-12-05T2008+0100
|
||||
*/
|
||||
|
||||
|
||||
|
@ -395,8 +395,8 @@ abstract class MCI_Footnotes_LayoutEngine {
|
|||
// e.g. Greek using a raised dot.
|
||||
// In French, colon is preceded by a space, forcibly non-breaking,
|
||||
// and narrow per new school.
|
||||
// Eventually add colon to label strings for inclusion in localization.
|
||||
// Else drop colons after labels.
|
||||
// Add colon to label strings for inclusion in localization.
|
||||
// Colon after label is widely preferred best practice, mandatory per style guides.
|
||||
return sprintf('<label for="%s">%s:</label>', $p_str_SettingName, $p_str_Caption);
|
||||
// ^ here deleted colon 2020-12-01T0156+0100
|
||||
// ########## this fix reverted for now; restore when updating strings and translations
|
||||
|
@ -502,20 +502,22 @@ abstract class MCI_Footnotes_LayoutEngine {
|
|||
* @author Stefan Herndler
|
||||
* @since 1.5.0
|
||||
* @param string $p_str_SettingName Name of the Settings key to pre load the input field.
|
||||
* @param int $p_in_Min Minimum value.
|
||||
* @param int $p_int_Max Maximum value.
|
||||
* @param int $p_in_Min Minimum value.
|
||||
* @param int $p_int_Max Maximum value.
|
||||
* @param bool $p_bool_Deci true if 0.1 steps and floating to string, false if integer (default)
|
||||
* @return string
|
||||
*
|
||||
* Edited:
|
||||
* @since 2.2.0 step argument and %f to allow decimals 2020-12-03T0631+0100..2020-12-05T0506+0100
|
||||
* @since 2.2.0 step argument and number_format() to allow decimals 2020-12-03T0631+0100..2020-12-05T2006+0100
|
||||
*/
|
||||
protected function addNumBox($p_str_SettingName, $p_in_Min, $p_int_Max, $p_bool_Deci = false ) {
|
||||
// collect data for given settings field
|
||||
$l_arr_Data = $this->LoadSetting($p_str_SettingName);
|
||||
|
||||
if ($p_bool_Deci) {
|
||||
return sprintf('<input type="number" name="%s" id="%s" value="%f" step="0.1" min="%d" max="%d"/>',
|
||||
$l_arr_Data["name"], $l_arr_Data["id"], $l_arr_Data["value"], $p_in_Min, $p_int_Max);
|
||||
$l_str_Value = number_format($l_arr_Data["value"], 1);
|
||||
return sprintf('<input type="number" name="%s" id="%s" value="%s" step="0.1" min="%d" max="%d"/>',
|
||||
$l_arr_Data["name"], $l_arr_Data["id"], $l_str_Value, $p_in_Min, $p_int_Max);
|
||||
} else {
|
||||
return sprintf('<input type="number" name="%s" id="%s" value="%d" min="%d" max="%d"/>',
|
||||
$l_arr_Data["name"], $l_arr_Data["id"], $l_arr_Data["value"], $p_in_Min, $p_int_Max);
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
* 2.1.1 options for ref container and alternative tooltips 2020-11-16T2152+0100
|
||||
* 2.2.0 settings for ref container, tooltips and scrolling 2020-12-03T0950+0100
|
||||
*
|
||||
* Last modified: 2020-12-05T0535+0100
|
||||
* Last modified: 2020-12-06T1321+0100
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -126,8 +126,9 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
|
|||
// basic responsive page layout options:
|
||||
$l_arr_PageLayoutOptions = array(
|
||||
"none" => __("Don’t fix the layout", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"container" => __("to the references container", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"main" => __("from the post title to the references container", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"reference-container" => __("to the reference container", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"page-content" => __("to everything after the post title until the reference container", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"main-content" => __("to everything from the post title to the reference container", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
);
|
||||
// options for the separating punctuation between backlinks:
|
||||
// Unicode names are conventionally uppercase.
|
||||
|
@ -148,8 +149,9 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
|
|||
$l_arr_WidthUnits = array(
|
||||
"%" => __("per cent", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"px" => __("pixels", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"rem" => __("root em", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"em" => __("em", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"rem" => __("rem", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"vw" => __("viewport width", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
);
|
||||
// options for Yes/No select box:
|
||||
$l_arr_Enabled = array(
|
||||
|
@ -173,7 +175,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
|
|||
|
||||
"label-page-layout" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT, __("Apply basic responsive page layout", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
|
||||
"page-layout" => $this->addSelectBox(MCI_Footnotes_Settings::C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT, $l_arr_PageLayoutOptions),
|
||||
"page-layout-comment" => __("Most themes don’t need this fix.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"notice-page-layout" => __("Most themes don’t need this fix.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
|
||||
"label-startpage" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_START_PAGE_ENABLE, __("Display on start page too", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
|
||||
"startpage" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_START_PAGE_ENABLE, $l_arr_Enabled),
|
||||
|
@ -182,36 +184,38 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
|
|||
"symbol-enable" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE, $l_arr_Enabled),
|
||||
"symbol-options" => $this->addSelectBox(MCI_Footnotes_Settings::C_STR_HYPERLINK_ARROW, MCI_Footnotes_Convert::getArrow()),
|
||||
"symbol-custom" => $this->addTextBox(MCI_Footnotes_Settings::C_STR_HYPERLINK_ARROW_USER_DEFINED),
|
||||
"symbol-comment" => __("Your input overrides the selection.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"notice-symbol" => __("Your input overrides the selection.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
|
||||
"label-switch" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH, __("Symbol appended, not prepended", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
|
||||
"switch" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_SWITCH, $l_arr_Enabled),
|
||||
|
||||
"label-3column" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE, __("Backlink symbol in an extra column", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
|
||||
"3column" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE, $l_arr_Enabled),
|
||||
"3column-comment" => __("This legacy layout is available if identical footnotes are not combined.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"notice-3column" => __("This legacy layout is available if identical footnotes are not combined.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
|
||||
"label-separator" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_BACKLINKS_SEPARATOR_ENABLED, __("Add a separator when enumerating backlinks", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
|
||||
"separator-enable" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_BACKLINKS_SEPARATOR_ENABLED, $l_arr_Enabled),
|
||||
"separator-options" => $this->addSelectBox(MCI_Footnotes_Settings::C_STR_BACKLINKS_SEPARATOR_OPTION, $l_arr_Separators),
|
||||
"separator-custom" => $this->addTextBox(MCI_Footnotes_Settings::C_STR_BACKLINKS_SEPARATOR_CUSTOM),
|
||||
"separator-comment" => __("Your input overrides the selection.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"notice-separator" => __("Your input overrides the selection.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
|
||||
"label-terminator" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_BACKLINKS_TERMINATOR_ENABLED, __("Add a terminal punctuation to backlinks", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
|
||||
"terminator-enable" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_BACKLINKS_TERMINATOR_ENABLED, $l_arr_Enabled),
|
||||
"terminator-options" => $this->addSelectBox(MCI_Footnotes_Settings::C_STR_BACKLINKS_TERMINATOR_OPTION, $l_arr_Terminators),
|
||||
"terminator-custom" => $this->addTextBox(MCI_Footnotes_Settings::C_STR_BACKLINKS_TERMINATOR_CUSTOM),
|
||||
"terminator-comment" => __("Your input overrides the selection.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"notice-terminator" => __("Your input overrides the selection.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
|
||||
"label-width" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_BACKLINKS_COLUMN_WIDTH_ENABLED, __("Set backlinks column width", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
|
||||
"width-enable" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_BACKLINKS_COLUMN_WIDTH_ENABLED, $l_arr_Enabled),
|
||||
"width-scalar" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_BACKLINKS_COLUMN_WIDTH_SCALAR, 0, 500, true),
|
||||
"width-unit" => $this->addSelectBox(MCI_Footnotes_Settings::C_STR_BACKLINKS_COLUMN_WIDTH_UNIT, $l_arr_WidthUnits),
|
||||
"notice-width" => __("Absolute width in pixels doesn’t need to be accurate to the tenth, but relative width in rem or em may.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
|
||||
"label-max-width" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_BACKLINKS_COLUMN_MAX_WIDTH_ENABLED, __("Set backlinks column maximum width", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
|
||||
"max-width-enable" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_BACKLINKS_COLUMN_MAX_WIDTH_ENABLED, $l_arr_Enabled),
|
||||
"max-width-scalar" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_BACKLINKS_COLUMN_MAX_WIDTH_SCALAR, 0, 500, true),
|
||||
"max-width-unit" => $this->addSelectBox(MCI_Footnotes_Settings::C_STR_BACKLINKS_COLUMN_MAX_WIDTH_UNIT, $l_arr_WidthUnits),
|
||||
"notice-max-width" => __("Absolute width in pixels doesn’t need to be accurate to the tenth, but relative width in rem or em may.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
|
||||
"label-line-break" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_BACKLINKS_LINE_BREAKS_ENABLED, __("Stack backlinks when enumerating", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
|
||||
"line-break" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_BACKLINKS_LINE_BREAKS_ENABLED, $l_arr_Enabled),
|
||||
|
@ -353,9 +357,9 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
|
|||
|
||||
"label-excerpt" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_IN_EXCERPT, __("Allow footnotes on Summarized Posts", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
|
||||
"excerpt" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_IN_EXCERPT, $l_arr_Enabled),
|
||||
"excerpt-comment1" => __("This should be disabled.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"excerpt-comment2" => __("In some themes, the Advanced Excerpt plugin is indispensable to display footnotes in excerpts.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"excerpt-comment3" => __("Footnotes cannot be disabled in excerpts. A workaround is to avoid footnotes in the first 55 words.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"notice1-excerpt" => __("This should be disabled.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"notice2-excerpt" => __("In some themes, the Advanced Excerpt plugin is indispensable to display footnotes in excerpts.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"notice3-excerpt" => __("Footnotes cannot be disabled in excerpts. A workaround is to avoid footnotes in the first 55 words.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
|
||||
"label-expert-mode" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_EXPERT_MODE, __("Enable the Expert mode", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
|
||||
"expert-mode" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_EXPERT_MODE, $l_arr_Enabled)
|
||||
|
@ -448,7 +452,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
|
|||
"activate-excerpt" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED, $l_arr_Enabled),
|
||||
|
||||
"label-excerpt-length" => $this->addLabel(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH, __("Maximum characters for the excerpt", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
|
||||
"excerpt-length" => $this->addTextBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH),
|
||||
"excerpt-length" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH, 3, 10000),
|
||||
|
||||
"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),
|
||||
|
@ -468,13 +472,31 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
|
|||
"max-width" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH, 0, 1280),
|
||||
"notice-max-width" => __("Set the max-width to 0px to disable this setting.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
|
||||
// display durations:
|
||||
|
||||
"label-fade-in-delay" => $this->addLabel(MCI_Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY, __("Fade-in delay", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
|
||||
"fade-in-delay" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY, 0, 20000),
|
||||
"notice-fade-in-delay" => __("milliseconds", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
|
||||
"label-fade-in-duration" => $this->addLabel(MCI_Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION, __("Fade-in duration", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
|
||||
"fade-in-duration" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION, 0, 20000),
|
||||
"notice-fade-in-duration" => __("milliseconds", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
|
||||
"label-fade-out-delay" => $this->addLabel(MCI_Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY, __("Fade-out delay", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
|
||||
"fade-out-delay" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY, 0, 20000),
|
||||
"notice-fade-out-delay" => __("milliseconds", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
|
||||
"label-fade-out-duration" => $this->addLabel(MCI_Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DURATION, __("Fade-out duration", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
|
||||
"fade-out-duration" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_MOUSE_OVER_BOX_FADE_OUT_DURATION, 0, 20000),
|
||||
"notice-fade-out-duration" => __("milliseconds", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
|
||||
// tooltip styling:
|
||||
|
||||
"label-font-size" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_MOUSE_OVER_BOX_FONT_SIZE_ENABLED, __("Set font size", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
|
||||
"font-size-enable" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_MOUSE_OVER_BOX_FONT_SIZE_ENABLED, $l_arr_Enabled),
|
||||
"font-size-scalar" => $this->addNumBox(MCI_Footnotes_Settings::C_FLO_MOUSE_OVER_BOX_FONT_SIZE_SCALAR, 0, 50, true),
|
||||
"font-size-unit" => $this->addSelectBox(MCI_Footnotes_Settings::C_STR_MOUSE_OVER_BOX_FONT_SIZE_UNIT, $l_arr_FontSizeUnits),
|
||||
"font-size-comment" => __("By default, the font size is set to equal the surrounding text.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
"notice-font-size" => __("By default, the font size is set to equal the surrounding text.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
|
||||
|
||||
"label-color" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR, __("Color", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
|
||||
"color" => $this->addColorSelection(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR),
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* 2.2.0 automate passing version number for cache busting 2020-11-30T0646+0100
|
||||
* 2.2.0 optionally enqueue an extra style sheet 2020-12-04T2231+0100
|
||||
*
|
||||
* Last modified: 2020-12-05T0541+0100
|
||||
* Last modified: 2020-12-05T1418+0100
|
||||
*/
|
||||
|
||||
|
||||
|
@ -160,11 +160,11 @@ class MCI_Footnotes {
|
|||
// constant FOOTNOTES_VERSION defined in footnotes.php, media all is default
|
||||
wp_enqueue_style( 'mci-footnotes-public', plugins_url('footnotes/css/public.css'), array(), FOOTNOTES_VERSION, 'all' );
|
||||
|
||||
// optional layout fix for unsupportive themes:
|
||||
// since 2.2.0 2020-12-04T2231+0100
|
||||
// optional layout fix by lack of layout support:
|
||||
// since 2.2.0 2020-12-05T1417+0100
|
||||
$l_str_LayoutOption = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT);
|
||||
if ($l_str_LayoutOption != 'none') {
|
||||
wp_enqueue_style( 'mci-footnotes-public-' . $l_str_LayoutOption, plugins_url('footnotes/css/public-' . $l_str_LayoutOption . '.css'), array(), FOOTNOTES_VERSION, 'all' );
|
||||
wp_enqueue_style( 'mci-footnotes-layout-' . $l_str_LayoutOption, plugins_url('footnotes/css/layout-' . $l_str_LayoutOption . '.css'), array(), FOOTNOTES_VERSION, 'all' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
* 2.1.3 fix ref container positioning by priority level 2020-11-17T0205+0100
|
||||
* 2.2.0 more settings container keys 2020-12-03T0955+0100
|
||||
*
|
||||
* Last modified: 2020-12-05T0405+0100
|
||||
* Last modified: 2020-12-06T1321+0100
|
||||
*/
|
||||
|
||||
|
||||
|
@ -407,7 +407,9 @@ class MCI_Footnotes_Settings {
|
|||
* Settings Container Keys for the link element option
|
||||
* Settings Container Keys for backlink typography and layout
|
||||
* Settings Container Keys for tooltip font size
|
||||
* Settings Container Keys for page layout support
|
||||
* Settings Container Keys for scroll offset and duration
|
||||
* Settings Container Keys for tooltip display durations
|
||||
*
|
||||
* @since 2.2.0
|
||||
* @var string|bool|int
|
||||
|
@ -415,16 +417,21 @@ class MCI_Footnotes_Settings {
|
|||
* 2020-11-26T1002+0100
|
||||
* 2020-11-30T0427+0100
|
||||
* 2020-12-03T0501+0100
|
||||
* 2020-12-05T0425+0100
|
||||
* 2020-12-05T0425+0100
|
||||
*/
|
||||
|
||||
// link element option:
|
||||
const C_BOOL_LINK_ELEMENT_ENABLED = "footnote_inputfield_link_element_enabled";
|
||||
|
||||
// backlink typography:
|
||||
const C_BOOL_BACKLINKS_SEPARATOR_ENABLED = "footnotes_inputfield_backlinks_separator_enabled";
|
||||
const C_STR_BACKLINKS_SEPARATOR_OPTION = "footnotes_inputfield_backlinks_separator_option";
|
||||
const C_STR_BACKLINKS_SEPARATOR_CUSTOM = "footnotes_inputfield_backlinks_separator_custom";
|
||||
const C_BOOL_BACKLINKS_TERMINATOR_ENABLED = "footnotes_inputfield_backlinks_terminator_enabled";
|
||||
const C_STR_BACKLINKS_TERMINATOR_OPTION = "footnotes_inputfield_backlinks_terminator_option";
|
||||
const C_STR_BACKLINKS_TERMINATOR_CUSTOM = "footnotes_inputfield_backlinks_terminator_custom";
|
||||
|
||||
// backlink layout:
|
||||
const C_BOOL_BACKLINKS_COLUMN_WIDTH_ENABLED = "footnotes_inputfield_backlinks_column_width_enabled";
|
||||
const C_INT_BACKLINKS_COLUMN_WIDTH_SCALAR = "footnotes_inputfield_backlinks_column_width_scalar";
|
||||
const C_STR_BACKLINKS_COLUMN_WIDTH_UNIT = "footnotes_inputfield_backlinks_column_width_unit";
|
||||
|
@ -433,16 +440,26 @@ class MCI_Footnotes_Settings {
|
|||
const C_STR_BACKLINKS_COLUMN_MAX_WIDTH_UNIT = "footnotes_inputfield_backlinks_column_max_width_unit";
|
||||
const C_BOOL_BACKLINKS_LINE_BREAKS_ENABLED = "footnotes_inputfield_backlinks_line_breaks_enabled";
|
||||
|
||||
// called mouse over box not tooltip for consistency:
|
||||
// tooltip font size:
|
||||
// called mouse over box not tooltip for consistency
|
||||
const C_BOOL_MOUSE_OVER_BOX_FONT_SIZE_ENABLED = "footnotes_inputfield_mouse_over_box_font_size_enabled";
|
||||
const C_FLO_MOUSE_OVER_BOX_FONT_SIZE_SCALAR = "footnotes_inputfield_mouse_over_box_font_size_scalar";
|
||||
const C_STR_MOUSE_OVER_BOX_FONT_SIZE_UNIT = "footnotes_inputfield_mouse_over_box_font_size_unit";
|
||||
|
||||
const C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT = "footnotes_inputfield_page_layout_support";
|
||||
|
||||
// page layout support:
|
||||
const C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT = "footnotes_inputfield_page_layout_support";
|
||||
|
||||
// scroll offset and duration:
|
||||
const C_INT_FOOTNOTES_SCROLL_OFFSET = "footnotes_inputfield_scroll_offset";
|
||||
const C_INT_FOOTNOTES_SCROLL_DURATION = "footnotes_inputfield_scroll_duration";
|
||||
|
||||
// tooltip display durations:
|
||||
// called mouse over box not tooltip for consistency
|
||||
const C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY = "footnotes_inputfield_mouse_over_box_fade_in_delay";
|
||||
const C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION = "footnotes_inputfield_mouse_over_box_fade_in_duration";
|
||||
const C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY = "footnotes_inputfield_mouse_over_box_fade_out_delay";
|
||||
const C_INT_MOUSE_OVER_BOX_FADE_OUT_DURATION = "footnotes_inputfield_mouse_over_box_fade_out_duration";
|
||||
|
||||
|
||||
/**
|
||||
* Stores a singleton reference of this class.
|
||||
|
@ -478,9 +495,9 @@ class MCI_Footnotes_Settings {
|
|||
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_INT_FOOTNOTES_SCROLL_OFFSET => 20,
|
||||
self::C_INT_FOOTNOTES_SCROLL_DURATION => 380,
|
||||
|
||||
self::C_STR_REFERENCE_CONTAINER_NAME => 'References',
|
||||
self::C_BOOL_REFERENCE_CONTAINER_COLLAPSE => 'no',
|
||||
self::C_STR_REFERENCE_CONTAINER_POSITION => 'post_end',
|
||||
|
@ -569,11 +586,18 @@ 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,
|
||||
|
||||
// tooltip display durations:
|
||||
// called mouse over box not tooltip for consistency
|
||||
self::C_INT_MOUSE_OVER_BOX_FADE_IN_DELAY => 0,
|
||||
self::C_INT_MOUSE_OVER_BOX_FADE_IN_DURATION => 200,
|
||||
self::C_INT_MOUSE_OVER_BOX_FADE_OUT_DELAY => 400,
|
||||
self::C_INT_MOUSE_OVER_BOX_FADE_OUT_DURATION => 200,
|
||||
|
||||
// tooltip font size reset to legacy by default since 2.2.0;
|
||||
// was set to inherit since 2.1.1 as it overrode custom CSS,
|
||||
// is moved to settings since 2.2.0 2020-12-04T1023+0100
|
||||
self::C_BOOL_MOUSE_OVER_BOX_FONT_SIZE_ENABLED => 'yes',
|
||||
self::C_FLO_MOUSE_OVER_BOX_FONT_SIZE_SCALAR => '13',
|
||||
self::C_FLO_MOUSE_OVER_BOX_FONT_SIZE_SCALAR => 13,
|
||||
self::C_STR_MOUSE_OVER_BOX_FONT_SIZE_UNIT => 'px',
|
||||
|
||||
self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR => '',
|
||||
|
|
|
@ -24,8 +24,9 @@
|
|||
* 2.2.0 optional line breaks to stack enumerated backlinks 2020-11-28T1049+0100
|
||||
* 2.2.0 ref container column width and tooltip font size settings 2020-12-03T0954+0100
|
||||
* 2.2.0 scroll offset and duration settings 2020-12-05T0538+0100
|
||||
* 2.2.0 tooltip display duration settings 2020-12-06T1320+0100
|
||||
*
|
||||
* Last modified: 2020-12-05T0538+0100
|
||||
* Last modified: 2020-12-06T1321+0100
|
||||
*/
|
||||
|
||||
// If called directly, abort:
|
||||
|
@ -576,23 +577,32 @@ class MCI_Footnotes_Task {
|
|||
|
||||
// reset the template
|
||||
$l_obj_Template->reload();
|
||||
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED))) {
|
||||
if (
|
||||
MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED)) &&
|
||||
!MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE))
|
||||
) {
|
||||
$l_int_OffsetY = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y));
|
||||
$l_int_OffsetX = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X));
|
||||
$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_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));
|
||||
|
||||
// fill in 'templates/public/tooltip.html':
|
||||
$l_obj_TemplateTooltip->replace(
|
||||
array(
|
||||
"post_id" => $l_int_PostId,
|
||||
"id" => $l_int_Index,
|
||||
"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-x" => !empty($l_int_OffsetX) ? $l_int_OffsetX : 0,
|
||||
"post_id" => $l_int_PostId,
|
||||
"id" => $l_int_Index,
|
||||
"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-x" => !empty($l_int_OffsetX) ? $l_int_OffsetX : 0,
|
||||
"fade-in-delay" => !empty($l_int_FadeInDelay ) ? $l_int_FadeInDelay : 0,
|
||||
"fade-in-duration" => !empty($l_int_FadeInDuration ) ? $l_int_FadeInDuration : 0,
|
||||
"fade-out-delay" => !empty($l_int_FadeOutDelay ) ? $l_int_FadeOutDelay : 0,
|
||||
"fade-out-duration" => !empty($l_int_FadeOutDuration) ? $l_int_FadeOutDuration : 0,
|
||||
)
|
||||
);
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@ -969,7 +979,7 @@ 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);
|
||||
|
||||
|
||||
// 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(
|
||||
|
|
Reference in a new issue