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:
parent
c432dde37b
commit
3e8d312969
12 changed files with 124 additions and 171 deletions
|
@ -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');
|
||||
|
@ -385,7 +381,7 @@ abstract class MCI_Footnotes_LayoutEngine {
|
|||
* @param string $p_str_SettingName Name of the Settings key to connect the Label with the input/select field.
|
||||
* @param string $p_str_Caption Label caption.
|
||||
* @return string
|
||||
*
|
||||
*
|
||||
* Edited 2020-12-01T0159+0100
|
||||
* @since #################### no colon
|
||||
*/
|
||||
|
@ -402,8 +398,8 @@ abstract class MCI_Footnotes_LayoutEngine {
|
|||
// Eventually add colon to label strings for inclusion in localization.
|
||||
// Else drop colons after labels.
|
||||
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
|
||||
// ^ here deleted colon 2020-12-01T0156+0100
|
||||
// ########## this fix reverted for now; restore when updating strings and translations
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -509,16 +505,21 @@ abstract class MCI_Footnotes_LayoutEngine {
|
|||
* @param int $p_in_Min Minimum value.
|
||||
* @param int $p_int_Max Maximum value.
|
||||
* @return string
|
||||
*
|
||||
* Edited:
|
||||
* @since 2.1.4 step argument and %f to allow decimals 2020-12-03T0631+0100
|
||||
*
|
||||
* Edited:
|
||||
* @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);
|
||||
$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);
|
||||
} 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
|
||||
|
|
|
@ -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" => __("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),
|
||||
"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 = " ";
|
||||
// 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
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -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
|
||||
*
|
||||
* Last modified: 2020-12-04T2232+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-05T0541+0100
|
||||
*/
|
||||
|
||||
|
||||
|
@ -133,9 +133,9 @@ class MCI_Footnotes {
|
|||
wp_enqueue_script( 'jquery-ui-position' );
|
||||
wp_enqueue_script( 'jquery-ui-tooltip' );
|
||||
|
||||
// enqueue jQuery Tools:
|
||||
// redacted jQuery.browser, completed minification; added versioning 2020-11-18T2150+0100
|
||||
// not use '-js' in the handle, is appended automatically
|
||||
// enqueue jQuery Tools:
|
||||
// redacted jQuery.browser, completed minification; added versioning 2020-11-18T2150+0100
|
||||
// not use '-js' in the handle, is appended automatically
|
||||
wp_enqueue_script('mci-footnotes-jquery-tools', plugins_url('footnotes/js/jquery.tools.min.js'), array(), '1.2.7redacted');
|
||||
|
||||
|
||||
|
@ -155,16 +155,16 @@ class MCI_Footnotes {
|
|||
|
||||
//### STYLES
|
||||
|
||||
// up-to-date plugin version number needed for cache busting:
|
||||
// not use '-css' in the handle, is appended automatically;
|
||||
// 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.1.4 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' );
|
||||
}
|
||||
}
|
||||
// up-to-date plugin version number needed for cache busting:
|
||||
// not use '-css' in the handle, is appended automatically;
|
||||
// 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
|
||||
$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' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
@ -436,7 +438,10 @@ class MCI_Footnotes_Settings {
|
|||
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";
|
||||
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";
|
||||
|
||||
|
||||
/**
|
||||
|
@ -473,7 +478,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_STR_REFERENCE_CONTAINER_NAME => 'References',
|
||||
self::C_BOOL_REFERENCE_CONTAINER_COLLAPSE => 'no',
|
||||
self::C_STR_REFERENCE_CONTAINER_POSITION => 'post_end',
|
||||
|
@ -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',
|
||||
|
|
|
@ -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,15 +966,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);
|
||||
|
||||
// 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;' : '',
|
||||
"content" => $l_str_Body,
|
||||
"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;' : '',
|
||||
"content" => $l_str_Body,
|
||||
"scroll-offset" => ($l_int_ScrollOffset / 100),
|
||||
"scroll-duration" => $l_int_ScrollDuration,
|
||||
)
|
||||
);
|
||||
|
||||
|
|
Reference in a new issue