development 2.2.0d0 merged with 2.1.4d series. Scroll offset and duration settings

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2432050 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
pewgeuges 2020-12-05 04:48:09 +00:00
parent c432dde37b
commit 3e8d312969
12 changed files with 124 additions and 171 deletions

View file

@ -8,12 +8,14 @@
*
* Edited:
* 2.1.2 add versioning of settings.css for cache busting 2020-11-19T1456+0100
* 2.1.4 automate passing version number for cache busting 2020-11-30T0648+0100
* 2.1.4 start fixing punctuation-related localization issue in dashboard labels 2020-12-01T0211+0100
* ########## this fix reverted for now; restore when updating strings and translations
* 2.1.4 step argument and support for floating in numbox 2020-12-03T0952+0100
* 2.2.0 automate passing version number for cache busting 2020-11-30T0648+0100
* 2.2.0 optional step argument and support for floating in numbox 2020-12-05T0540+0100
*
* Last modified: 2020-12-03T0952+0100
*
* ########## fix punctuation-related localization issue in dashboard labels 2020-12-01T0211+0100
* ########## this fix reverted for now; restore when updating strings and translations
*
* Last modified: 2020-12-05T0540+0100
*/
@ -208,14 +210,8 @@ abstract class MCI_Footnotes_LayoutEngine {
// register stylesheet
// added version # after changes started to settings.css from 2.1.2 on:
wp_register_style(
'mci-footnotes-admin-styles',
plugins_url('../../css/settings.css', __FILE__),
'',
FOOTNOTES_VERSION
);
// automated update of version number for cache busting
wp_register_style( 'mci-footnotes-admin-styles', plugins_url('footnotes/css/settings.css'), array(), FOOTNOTES_VERSION );
// add stylesheet to the output
wp_enqueue_style('mci-footnotes-admin-styles');
@ -511,14 +507,19 @@ abstract class MCI_Footnotes_LayoutEngine {
* @return string
*
* Edited:
* @since 2.1.4 step argument and %f to allow decimals 2020-12-03T0631+0100
* @since 2.2.0 step argument and %f to allow decimals 2020-12-03T0631+0100..2020-12-05T0506+0100
*/
protected function addNumBox($p_str_SettingName, $p_in_Min, $p_int_Max, $p_flo_Step = 1) {
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);
return sprintf('<input type="number" name="%s" id="%s" value="%f" step="%f" min="%d" max="%d"/>',
$l_arr_Data["name"], $l_arr_Data["id"], $l_arr_Data["value"], $p_flo_Step, $p_in_Min, $p_int_Max);
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);
} 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);
}
}
} // end of class

View file

@ -10,9 +10,9 @@
* 2.0.4 restore arrow settings 2020-11-01T0509+0100
* 2.1.0 read-on button label 2020-11-08T2148+0100
* 2.1.1 options for ref container and alternative tooltips 2020-11-16T2152+0100
* 2.1.4 settings for ref container and tooltips 2020-12-03T0950+0100
* 2.2.0 settings for ref container, tooltips and scrolling 2020-12-03T0950+0100
*
* Last modified: 2020-12-04T2230+0100
* Last modified: 2020-12-05T0535+0100
*/
/**
@ -95,7 +95,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
// The HyperlinkArrow meta box ceased for 2.0.0
// The HyperlinkArrow meta box was restored for 2.0.4 to meet user demand for arrow symbol semantics
// The HyperlinkArrow meta box ceased for 2.1.4 as its content is moved to Settings > Reference container > Display a backlink symbol
// The HyperlinkArrow meta box ceased for 2.2.0 as its content is moved to Settings > Reference container > Display a backlink symbol
$this->addMetaBox("customize", "superscript", __("Superscript layout", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "Superscript"),
$this->addMetaBox("customize", "mouse-over-box", __("Mouse-over box", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "MouseOverBox"),
$this->addMetaBox("customize", "custom-css", __("Add custom CSS to the public page", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "CustomCSS"),
@ -114,7 +114,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
* @since 1.5.0
*
* Completed:
* @since 2.1.4: layout and typography options 2020-11-30T0548+0100
* @since 2.2.0: layout and typography options 2020-11-30T0548+0100
*/
public function ReferenceContainer() {
// options for the positioning of the reference container
@ -128,7 +128,6 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"none" => __("Dont 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),
"body" => __("to the whole page", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)
);
// options for the separating punctuation between backlinks:
// Unicode names are conventionally uppercase.
@ -206,12 +205,12 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"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, 0.1),
"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),
"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, 0.1),
"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),
"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)),
@ -232,7 +231,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
// define some space for the output
$l_str_Space = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
// options for the combination of identical footnotes
$l_arr_CombineIdentical = array(
$l_arr_Enable = array(
"yes" => __("Yes", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"no" => __("No", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)
);
@ -283,7 +282,15 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
// algorithmically combine identicals:
"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_CombineIdentical),
"identical" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_COMBINE_IDENTICAL_FOOTNOTES, $l_arr_Enable),
"label-scroll-offset" => $this->addLabel(MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_OFFSET, __("Scroll offset", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"scroll-offset" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_OFFSET, 0, 100),
"notice-scroll-offset" => __("per cent from the upper edge of the window", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"label-scroll-duration" => $this->addLabel(MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DURATION, __("Scroll duration", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"scroll-duration" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_SCROLL_DURATION, 0, 20000),
"notice-scroll-duration" => __("milliseconds", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
)
);
@ -450,11 +457,11 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"position" => $this->addSelectBox(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION, $l_arr_Position),
"label-offset-x" => $this->addLabel(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X, __("Offset X (px)", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"offset-x" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X, -50, 50),
"offset-x" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X, -150, 150),
"notice-offset-x" => __("Offset (X axis) in px (may be negative)", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"label-offset-y" => $this->addLabel(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y, __("Offset Y (px)", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"offset-y" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y, -50, 50),
"offset-y" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y, -150, 150),
"notice-offset-y" => __("Offset (Y axis) in px (may be negative)", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"label-max-width" => $this->addLabel(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH, __("Max. width (px)", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
@ -465,7 +472,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"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, 0.1),
"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),
@ -478,7 +485,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"notice-background" => __("Empty color will use the default background-color defined by your current theme.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"label-border-width" => $this->addLabel(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH, __("Border width (px)", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"border-width" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH, 0, 4),
"border-width" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH, 0, 4, true),
"notice-border-width" => __("Set the width to 0px to hide the border.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"label-border-color" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR, __("Border color", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
@ -486,7 +493,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
"notice-border-color" => __("Empty color will use the default border-color defined by your current theme.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"label-border-radius" => $this->addLabel(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS, __("Border radius (px)", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
"border-radius" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS, 0, 20),
"border-radius" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS, 0, 500),
"notice-border-radius" => __("Set the radius to 0px to avoid a radius.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME),
"label-box-shadow-color" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR, __("Box shadow color", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)),
@ -511,7 +518,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine {
* became 'prepended arrow' in v2.0.3 after a user complaint about missing backlinking semantics
* of the footnote number.
*
* @since 2.1.4 moved to Settings > Reference container > Display a backlink symbol
* @since 2.2.0 moved to Settings > Reference container > Display a backlink symbol
*/
/**

View file

@ -11,10 +11,10 @@
* 2.0.0 add jQueryUI from Cloudflare 2020-10-26T1907+0100
* 2.0.3 add versioning of public.css for cache busting 2020-10-29T1413+0100
* 2.0.4 add jQuery UI from WordPress 2020-11-01T1902+0100
* 2.1.4 automate passing version number for cache busting 2020-11-30T0646+0100
* 2.1.4 enqueue optionally an extra style sheet 2020-12-04T2231+0100
* 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-04T2232+0100
* Last modified: 2020-12-05T0541+0100
*/
@ -161,7 +161,7 @@ class MCI_Footnotes {
wp_enqueue_style( 'mci-footnotes-public', plugins_url('footnotes/css/public.css'), array(), FOOTNOTES_VERSION, 'all' );
// optional layout fix for unsupportive themes:
// since 2.1.4 2020-12-04T2231+0100
// since 2.2.0 2020-12-04T2231+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' );

View file

@ -17,9 +17,9 @@
* 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.2.0 more settings container keys 2020-12-03T0955+0100
*
* Last modified: 2020-12-04T2230+0100
* Last modified: 2020-12-05T0405+0100
*/
@ -407,13 +407,15 @@ 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 scroll offset and duration
*
* @since 2.1.4
* @since 2.2.0
* @var string|bool|int
*
* 2020-11-26T1002+0100
* 2020-11-30T0427+0100
* 2020-12-03T0501+0100
* 2020-12-05T0425+0100
*/
const C_BOOL_LINK_ELEMENT_ENABLED = "footnote_inputfield_link_element_enabled";
@ -438,6 +440,9 @@ class MCI_Footnotes_Settings {
const C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT = "footnotes_inputfield_page_layout_support";
const C_INT_FOOTNOTES_SCROLL_OFFSET = "footnotes_inputfield_scroll_offset";
const C_INT_FOOTNOTES_SCROLL_DURATION = "footnotes_inputfield_scroll_duration";
/**
* Stores a singleton reference of this class.
@ -473,6 +478,8 @@ 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_STR_REFERENCE_CONTAINER_NAME => 'References',
self::C_BOOL_REFERENCE_CONTAINER_COLLAPSE => 'no',
@ -562,9 +569,9 @@ 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 font size reset to legacy by default since 2.1.4;
// 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.1.4 2020-12-04T1023+0100
// 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_STR_MOUSE_OVER_BOX_FONT_SIZE_UNIT => 'px',

View file

@ -17,14 +17,15 @@
* 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
* 2.1.4 fix line wrapping of URLs based on pattern, not link element 2020-11-25T0837+0100
* 2.1.4 fix issues with link elements by making them optional 2020-11-26T1051+0100
* 2.1.4 support appending arrow when combining identicals is on 2020-11-26T1633+0100
* 2.1.4 disable or select backlink separator and terminator 2020-11-28T1048+0100
* 2.1.4 optional line breaks to stack enumerated backlinks 2020-11-28T1049+0100
* 2.1.4 ref container column width and tooltip font size settings 2020-12-03T0954+0100
* 2.2.0 fix line wrapping of URLs based on pattern, not link element 2020-11-25T0837+0100
* 2.2.0 fix issues with link elements by making them optional 2020-11-26T1051+0100
* 2.2.0 support appending arrow when combining identicals is on 2020-11-26T1633+0100
* 2.2.0 disable or select backlink separator and terminator 2020-11-28T1048+0100
* 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
*
* Last modified: 2020-12-03T1623+0100
* Last modified: 2020-12-05T0538+0100
*/
// If called directly, abort:
@ -665,7 +666,7 @@ class MCI_Footnotes_Task {
* The link elements have been added and are present @since 2.0.0.
* Then the link addresses were removed @since 2.0.4.
* Then the presence of <a> elements was made optional
* @since 2.1.4
* @since 2.2.0
* 2020-11-25T1306+0100
*/
$l_str_LinkSpan = MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_LINK_ELEMENT_ENABLED)) ? 'a' : 'span';
@ -711,7 +712,7 @@ class MCI_Footnotes_Task {
*
* Initially a comma was appended in this algorithm for enumerations.
* The comma in enumerations is not generally preferred.
* @since 2.1.4 the separator is optional, has options, and is customizable:
* @since 2.2.0 the separator is optional, has options, and is customizable:
*/
// check if it is even enabled:
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_BACKLINKS_SEPARATOR_ENABLED))) {
@ -736,7 +737,7 @@ class MCI_Footnotes_Task {
* Initially a dot was appended in the table row template.
* @since 2.0.6 a dot after footnote numbers is discarded as not localizable;
* making it optional was envisaged.
* @since 2.1.4 the terminator is optional, has options, and is customizable:
* @since 2.2.0 the terminator is optional, has options, and is customizable:
*/
// check if it is even enabled:
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_BACKLINKS_TERMINATOR_ENABLED))) {
@ -965,6 +966,10 @@ 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(
@ -974,6 +979,8 @@ class MCI_Footnotes_Task {
"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;' : '',
"content" => $l_str_Body,
"scroll-offset" => ($l_int_ScrollOffset / 100),
"scroll-duration" => $l_int_ScrollDuration,
)
);

View file

@ -1,77 +0,0 @@
/**
* Footnotes Responsive Layout for the body element
*
* Based on Hello Elementor v2.3.0 Basic responsive layout
* licensed under GNU General Public License v3 or later
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
*
* Since 2.1.4
* Version: 2.1.4d10
*
* Last modified: 2020-12-04T1858+0100
*/
/***********************************************************
Basic responsive layout
In Hello Elementor Theme, this applies to .site-header, and
also to .site-main, which is a class of the <main> element,
at the condition that the page is not built with Elementor:
body:not([class*="elementor-page-"])
Therefore, in pages built with Elementor, proper layout is
applied only to features managed by Elementor, not others.
The Footnotes references container is near the end of main.
This style sheet lets Footnotes reference container 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 might be
used also with another theme depriving the features from
other plugins of basic layout rules as applied to content.
The enqueuing of this style sheet is optional. The setting
is in the dashboard under Settings > Reference container.
*/
body, body.blog, body.page, body.page-template-default {
margin-right: auto;
margin-left: auto;
}
@media (max-width: 575px) {
body, body.blog, body.page, body.page-template-default {
padding-right: 10px;
padding-left: 10px;
}
}
@media (min-width: 576px) {
body, body.blog, body.page, body.page-template-default {
max-width: 500px;
}
}
@media (min-width: 768px) {
body, body.blog, body.page, body.page-template-default {
max-width: 600px;
}
}
@media (min-width: 992px) {
body, body.blog, body.page, body.page-template-default {
max-width: 800px;
}
}
@media (min-width: 1200px) {
body, body.blog, body.page, body.page-template-default {
max-width: 960px;
}
}

View file

@ -5,9 +5,9 @@
* Created-Time: 16:21
* Since: 1.0
*
* Version: 2.1.4d10
* Version: 2.2.0d0
*
* Last modified: 2020-12-04T2234+0100
* Last modified: 2020-12-05T0357+0100
*/
@ -159,7 +159,6 @@ templates/public/reference-container.html
Also optional responsive basic page layout support:
public-container.css
public-main.css
public-body.css
*/
/*

View file

@ -5,9 +5,9 @@
* Created-Time: 16:21
* Since: 1.0
*
* Version: 2.1.4d10
* Version: 2.2.0d0
*
* Last modified: 2020-12-04T1718+0100
* Last modified: 2020-12-05T0358+0100
*/

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.1.4d10
Version: 2.2.0d0
Author URI: http://cheret.de/plugins/footnotes-2/
Text Domain: footnotes
Domain Path: /languages
*/
define( 'FOOTNOTES_VERSION', '2.1.4d10' );
define( 'FOOTNOTES_VERSION', '2.2.0d0' );
/*
Copyright 2020 Mark Cheret (email: mark@cheret.de)

View file

@ -80,12 +80,13 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
== Changelog ==
= 2.1.4d10 =
- Bugfix: Reference container: fix theme-dependent layout issues by optionally enqueuing additional style sheet
- Bugfix: Reference container: fix layout issues by moving backlink column width to settings
- Bugfix: Reference container: separating and terminating punctuation optional and customizable
- Bugfix: Styling: Tooltips: fix font size issue by adding font size to settings with legacy as default
- Bugfix: Reference container: Backlinks: optional line breaks to stack enumerations
= 2.2.0d0 =
- Add: UX: settings for scroll offset and duration
- Add: Reference container: fix theme-dependent layout issues by optionally enqueuing additional style sheet
- Add: Reference container: fix layout issues by moving backlink column width to settings
- Add: Reference container: separating and terminating punctuation optional and customizable
- Add: Styling: Tooltips: fix font size issue by adding font size to settings with legacy as default
- Add: Reference container: Backlinks: optional line breaks to stack enumerations
- Bugfix: Dashboard: move arrow settings from Customize to Settings > Reference container to reunite and fix issue with new heading wording
- Bugfix: Dashboard: Main settings: fix layout, raise shortcodes to top
- Bugfix: Dashboard: Other settings: Excerpt: display guidance next to select box

View file

@ -22,6 +22,14 @@
<td>[[label-identical]]</td>
<td>[[identical]]</td>
</tr>
<tr>
<td>[[label-scroll-offset]]</td>
<td>[[scroll-offset]] <em>[[notice-scroll-offset]]</em></td>
</tr>
<tr>
<td>[[label-scroll-duration]]</td>
<td>[[scroll-duration]] <em>[[notice-scroll-duration]]</em></td>
</tr>
</tbody>
</table>
<script type="text/javascript">

View file

@ -53,9 +53,9 @@
var l_obj_Target = jQuery('#' + p_str_TargetID);
if (l_obj_Target.length) {
jQuery('html, body').animate({
scrollTop: l_obj_Target.offset().top - window.innerHeight * 0.20
scrollTop: l_obj_Target.offset().top - window.innerHeight * [[scroll-offset]]
},
380);/*duration*/
[[scroll-duration]]);
}
}
</script>