From 6c7854352b0d2f47a63e721e4a4b224a17c43e59 Mon Sep 17 00:00:00 2001 From: pewgeuges <73141620+pewgeuges@users.noreply.github.com> Date: Tue, 15 Dec 2020 10:01:17 +0000 Subject: [PATCH] prerelease 2.2.2 because 2.2.1 is a quick patch and cannot be kept git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2439670 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- class/dashboard/subpage-main.php | 135 ++++++++++++------ class/settings.php | 37 ++++- css/layout-main-content.css | 42 +++--- css/layout-page-content.css | 36 ++--- css/layout-reference-container.css | 36 ++--- css/public.css | 4 +- css/settings.css | 17 ++- footnotes.php | 4 +- readme.txt | 5 + .../dashboard/customize-css-migration.html | 15 ++ templates/dashboard/customize-css-new.html | 30 ++++ templates/dashboard/customize-css.html | 27 +--- .../dashboard/customize-superscript.html | 5 +- .../settings-reference-container.html | 11 +- 14 files changed, 265 insertions(+), 139 deletions(-) create mode 100644 templates/dashboard/customize-css-migration.html create mode 100644 templates/dashboard/customize-css-new.html diff --git a/class/dashboard/subpage-main.php b/class/dashboard/subpage-main.php index 2d09a7d..b559334 100644 --- a/class/dashboard/subpage-main.php +++ b/class/dashboard/subpage-main.php @@ -16,8 +16,9 @@ * 2.1.6 remove expert mode setting as irrelevant 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 * - * Last modified: 2020-12-14T1404+0100 + * Last modified: 2020-12-15T0928+0100 */ /** @@ -79,7 +80,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { $l_arr_Tabs = array(); $l_arr_Tabs[] = $this->addSection("settings", __("General settings", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), 0, true); $l_arr_Tabs[] = $this->addSection("customize", __("Referrers and tooltips", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), 1, true); - $l_arr_Tabs[] = $this->addSection("expert", __("Priority and CSS", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), 2, true); + $l_arr_Tabs[] = $this->addSection("expert", __("Priority level", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), 2, true); + $l_arr_Tabs[] = $this->addSection("customcss", __("Custom CSS", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), 3, true); $l_arr_Tabs[] = $this->addSection("how-to", __("Quick start guide", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), null, false); return $l_arr_Tabs; } @@ -107,28 +109,36 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { * @since 2.1.6 / 2.2.0 tabs reordered and renamed */ protected function getMetaBoxes() { - return array( - $this->addMetaBox("settings", "start-end", __("Footnote start and end short codes", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "StartEnd"), - $this->addMetaBox("settings", "numbering", __("Footnotes numbering", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "Numbering"), - $this->addMetaBox("settings", "scrolling", __("Scrolling behavior", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "Scrolling"), - $this->addMetaBox("settings", "reference-container", __("Reference container", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "ReferenceContainer"), - $this->addMetaBox("settings", "excerpts", __("Footnotes in excerpts", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "Excerpts"), - $this->addMetaBox("settings", "love", MCI_Footnotes_Config::C_STR_PLUGIN_HEADING_NAME . ' ' . MCI_Footnotes_Config::C_STR_LOVE_SYMBOL_HEADING, "Love"), - - $this->addMetaBox("customize", "superscript", __("Referrer typesetting and formatting", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "Superscript"), - $this->addMetaBox("customize", "mouse-over-box", __("Tooltips", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "MouseOverBox"), - $this->addMetaBox("customize", "mouse-over-box-truncation", __("Tooltip truncation", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "MouseOverBoxTruncation"), - $this->addMetaBox("customize", "mouse-over-box-position", __("Tooltip position", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "MouseOverBoxPosition"), - $this->addMetaBox("customize", "mouse-over-box-timing", __("Tooltip timing", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "MouseOverBoxTiming"), - $this->addMetaBox("customize", "mouse-over-box-appearance", __("Tooltip appearance", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "MouseOverBoxAppearance"), - $this->addMetaBox("customize", "custom-css", __("Custom CSS", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "CustomCSS"), + $l_arr_MetaBoxes = array(); - $this->addMetaBox("expert", "lookup", __("WordPress hooks and priority levels", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "LookupHooks"), - $this->addMetaBox("expert", "custom-css", __("Custom CSS", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "CustomCSS"), + $l_arr_MetaBoxes[] = $this->addMetaBox("settings", "start-end", __("Footnote start and end short codes", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "StartEnd"); + $l_arr_MetaBoxes[] = $this->addMetaBox("settings", "numbering", __("Footnotes numbering", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "Numbering"); + $l_arr_MetaBoxes[] = $this->addMetaBox("settings", "scrolling", __("Scrolling behavior", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "Scrolling"); + $l_arr_MetaBoxes[] = $this->addMetaBox("settings", "reference-container", __("Reference container", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "ReferenceContainer"); + $l_arr_MetaBoxes[] = $this->addMetaBox("settings", "excerpts", __("Footnotes in excerpts", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "Excerpts"); + $l_arr_MetaBoxes[] = $this->addMetaBox("settings", "love", MCI_Footnotes_Config::C_STR_PLUGIN_HEADING_NAME . ' ' . MCI_Footnotes_Config::C_STR_LOVE_SYMBOL_HEADING, "Love"); - $this->addMetaBox("how-to", "help", __("Brief introduction in how to use the plugin", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "Help"), - $this->addMetaBox("how-to", "donate", __("Help us to improve our Plugin", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "Donate") - ); + $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-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"); + } + + $l_arr_MetaBoxes[] = $this->addMetaBox("expert", "lookup", __("WordPress hooks with priority level", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "LookupHooks"); + + if (!MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_CUSTOM_CSS_MIGRATED))) { + $l_arr_MetaBoxes[] = $this->addMetaBox("customcss", "custom-css-migration", __("Your existing Custom CSS code", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "CustomCSSMigration"); + } + $l_arr_MetaBoxes[] = $this->addMetaBox("customcss", "custom-css-new", __("Custom CSS", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "CustomCSSNew"); + + $l_arr_MetaBoxes[] = $this->addMetaBox("how-to", "help", __("Brief introduction in how to use the plugin", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "Help"); + $l_arr_MetaBoxes[] = $this->addMetaBox("how-to", "donate", __("Help us to improve our Plugin", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "Donate"); + + return $l_arr_MetaBoxes; } /** @@ -149,10 +159,10 @@ 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), - "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), + "none" => __("no additional external style sheet", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + "reference-container" => __("only to the reference container", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + "page-content" => __("to the div element starting below the post title", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + "main-content" => __("to the main element including the post title", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), ); // options for the separating punctuation between backlinks: // Unicode names are conventionally uppercase. @@ -194,13 +204,13 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { "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), - "label-shortcode" => $this->addLabel(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION_SHORTCODE, __("Position shortcode:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)), - "shortcode" => $this->addTextBox(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION_SHORTCODE), - "notice-shortcode" => __("If present in the content, this shortcode will be replaced with the reference container.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), - "label-position" => $this->addLabel(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION, __("Default position:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)), "position" => $this->addSelectBox(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION, $l_arr_Positions), - "notice-position" => __("Will be overridden in the presence of the shortcode.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + "notice-position" => sprintf(__("To use the position shortcode, please set the position to: %s", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), '' . __("at the end of the post", MCI_Footnotes_Config::C_STR_PLUGIN_NAME) . ''), + + "label-shortcode" => $this->addLabel(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION_SHORTCODE, __("Position shortcode:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)), + "shortcode" => $this->addTextBox(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION_SHORTCODE), + "notice-shortcode" => __("If present in the content, any shortcode in this text box will be replaced with the reference container.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "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), @@ -271,7 +281,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { * * @author Stefan Herndler * @since 1.5.0 - * + * * 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 @@ -478,7 +488,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { * * @author Stefan Herndler * @since 1.5.0 - * + * * Edited heading 2020-12-12T1513+0100 * @since 2.1.1 option for superscript (optionally baseline referrers) * @since 2.2.0 option for link element moved here 2020-12-12T1514+0100 @@ -504,9 +514,7 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { "after" => $this->addTextBox(MCI_Footnotes_Settings::C_STR_FOOTNOTES_STYLING_AFTER), "label-link" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_LINK_ELEMENT_ENABLED, __("Use the link element for referrers and backlinks:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)), - "link" => $this->addSelectBox(MCI_Footnotes_Settings::C_BOOL_LINK_ELEMENT_ENABLED, $l_arr_Enabled), - "notice-link" => __("The link element is needed to apply the theme’s link color.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), - "description-link" => __("If the link element is not desired for styling, a simple span is used instead when the above is set to No. The link addresses have been removed. Else footnote clicks are logged in the browsing history and make the back button unusable.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + "notice-link" => __("Please find this setting at the end of the reference container settings. The link element is needed to apply the theme’s link color.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), ) ); // display template with replaced placeholders @@ -682,11 +690,13 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { "label-color" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR, __("Text color:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)), "color" => $this->addColorSelection(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR), - "notice-color" => __("To use the current theme’s default text color:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME) . ' ' . __("Clear or leave empty.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + // To use default: Clear or leave empty. + "notice-color" => sprintf(__("To use the current theme’s default text color: %s", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), __("Clear or leave empty.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)), "label-background" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND, __("Background color:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)), "background" => $this->addColorSelection(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND), - "notice-background" => __("To use the current theme’s default background color:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME) . ' ' . __("Clear or leave empty.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + // To use default: Clear or leave empty. + "notice-background" => sprintf(__("To use the current theme’s default background color: %s", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), __("Clear or leave empty.", 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:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)), "border-width" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH, 0, 4, true), @@ -694,7 +704,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { "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)), "border-color" => $this->addColorSelection(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR), - "notice-border-color" => __("To use the current theme’s default border color:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME) . ' ' . __("Clear or leave empty.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + // To use default: Clear or leave empty. + "notice-border-color" => sprintf(__("To use the current theme’s default border color: %s", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), __("Clear or leave empty.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)), "label-border-radius" => $this->addLabel(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS, __("Rounded corner radius:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)), "border-radius" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS, 0, 500), @@ -702,7 +713,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { "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)), "box-shadow-color" => $this->addColorSelection(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR), - "notice-box-shadow-color" => __("To use the current theme’s default box shadow color:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME) . ' ' . __("Clear or leave empty.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + // To use default: Clear or leave empty. + "notice-box-shadow-color" => sprintf(__("To use the current theme’s default box shadow color: %s", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), __("Clear or leave empty.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)), ) ); @@ -736,6 +748,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { * list directly in the template, as CSS is in English anyway * @see templates/dashboard/customize-css.html * 2020-12-09T1113+0100 + * + * 2.2.2 migrate Custom CSS to a dedicated tab 2020-12-15T0506+0100 */ public function CustomCSS() { // load template file @@ -743,10 +757,9 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { // replace all placeholders $l_obj_Template->replace( array( - // "label-css" => $this->addLabel(MCI_Footnotes_Settings::C_STR_CUSTOM_CSS, __("Add custom CSS:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)), + "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), - - "headline" => $this->addText(__("Recommended CSS classes:", 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 cut and paste the content into the new text area under the new tab.', MCI_Footnotes_Config::C_STR_PLUGIN_NAME), // CSS classes are listed in the template. // Localized notices are dropped to ease translators’ task. @@ -768,6 +781,42 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { echo $l_obj_Template->getContent(); } + public function CustomCSSMigration() { + // load template file + $l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "customize-css-migration"); + // replace all placeholders + $l_obj_Template->replace( + 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), + + "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), + "notice-migrated" => __("Please check this box when you are done migrating. After saving while this box is checked, the legacy Custom CSS containers are going to disappear.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + + ) + ); + // display template with replaced placeholders + echo $l_obj_Template->getContent(); + } + + public function CustomCSSNew() { + // load template file + $l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "customize-css-new"); + // replace all placeholders + $l_obj_Template->replace( + array( + "css" => $this->addTextArea(MCI_Footnotes_Settings::C_STR_CUSTOM_CSS_NEW), + + "headline" => $this->addText(__("Recommended CSS classes:", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)), + + ) + ); + // display template with replaced placeholders + echo $l_obj_Template->getContent(); + } + /** * Displays available Hooks to look for Footnote short codes. * diff --git a/class/settings.php b/class/settings.php index f1b2c80..0f5f0d3 100644 --- a/class/settings.php +++ b/class/settings.php @@ -21,8 +21,9 @@ * 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.2 Custom CSS settings container migration 2020-12-15T0709+0100 * - * Last modified: 2020-12-13T2123+0100 + * Last modified: 2020-12-15T0744+0100 */ @@ -320,8 +321,13 @@ class MCI_Footnotes_Settings { * @author Stefan Herndler * @since 1.5.0 * @var string + * + * Edited: + * 2.2.2 migrate Custom CSS to a dedicated tab 2020-12-15T0520+0100 */ const C_STR_CUSTOM_CSS = "footnote_inputfield_custom_css"; + const C_STR_CUSTOM_CSS_NEW = "footnote_inputfield_custom_css_new"; + const C_BOOL_CUSTOM_CSS_MIGRATED = "footnote_inputfield_custom_css_migrated"; /** * Settings Container Key the activation of the_title hook. @@ -504,8 +510,18 @@ class MCI_Footnotes_Settings { * @author Stefan Herndler * @since 1.5.0 * @var array + * + * Edited: + * 2.2.2 added tab for Custom CSS 2020-12-15T0740+0100 + * + * These are the storage container names, one per dashboard tab. */ - private $a_arr_Container = array("footnotes_storage", "footnotes_storage_custom", "footnotes_storage_expert"); + private $a_arr_Container = array( + "footnotes_storage", + "footnotes_storage_custom", + "footnotes_storage_expert", + "footnotes_storage_custom_css", + ); /** * Contains all Default Settings for each Settings Container. @@ -649,7 +665,9 @@ class MCI_Footnotes_Settings { self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR => '#666666', self::C_STR_HYPERLINK_ARROW => '↑', self::C_STR_HYPERLINK_ARROW_USER_DEFINED => '', - self::C_STR_CUSTOM_CSS => '' + + // Custom CSS migrates to a dedicated tab: + self::C_STR_CUSTOM_CSS => '', ), @@ -694,7 +712,14 @@ class MCI_Footnotes_Settings { self::C_INT_EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL => PHP_INT_MAX, self::C_INT_EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL => PHP_INT_MAX, - ) + ), + + "footnotes_storage_custom_css" => array( + + self::C_STR_CUSTOM_CSS_NEW => '', + self::C_BOOL_CUSTOM_CSS_MIGRATED => '', + + ), ); @@ -843,9 +868,9 @@ class MCI_Footnotes_Settings { * * @author Stefan Herndler * @since 1.5.0 - * + * * Edit: This didn’t actually work. - * @since 2.2.0 this function is not called any longer when deleting the plugin, + * @since 2.2.0 this function is not called any longer when deleting the plugin, * to protect user data against loss, since manually updating a plugin is safer * done by deleting and reinstalling (see the warning about database backup). * 2020-12-13T1353+0100 diff --git a/css/layout-main-content.css b/css/layout-main-content.css index 865e95a..c5b2eca 100644 --- a/css/layout-main-content.css +++ b/css/layout-main-content.css @@ -8,7 +8,7 @@ * * Since v2.1.4 of Footnotes * - * Last modified: 2020-12-06T1722+0100 + * Last modified for v2.2.2 2020-12-15T1004+0100 * * The enqueuing of this style sheet is optional and can be * enabled in the Reference container settings. @@ -20,56 +20,66 @@ Rationale In Hello Elementor Theme, this applies to .site-header, and also to .site-main, which is a class of the
element, at the condition that the page is not built with Elementor: - body:not([class*="elementor-page-"]) + 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 +Footnotes reference containers are near the bottom of main. +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 might be -used also with another theme. +This is mainly useful with Hello Elementor but it helps fix +also other themes like Twenty Twenty-One. */ -main, .main-content, .site-main { - margin-right: auto; - margin-left: auto; +main, +.main-content, +.site-main { + margin: 0 auto; } @media (max-width: 575px) { - main, .main-content, .site-main { - padding-right: 10px; - padding-left: 10px; + main, + .main-content, + .site-main { + padding: 0 10px; } } @media (min-width: 576px) { - main, .main-content, .site-main { + main, + .main-content, + .site-main { max-width: 500px; } } @media (min-width: 768px) { - main, .main-content, .site-main { + main, + .main-content, + .site-main { max-width: 600px; } } @media (min-width: 992px) { - main, .main-content, .site-main { + main, + .main-content, + .site-main { max-width: 800px; } } @media (min-width: 1200px) { - main, .main-content, .site-main { + main, + .main-content, + .site-main { max-width: 960px; } } diff --git a/css/layout-page-content.css b/css/layout-page-content.css index 2c22cfd..228bada 100644 --- a/css/layout-page-content.css +++ b/css/layout-page-content.css @@ -8,7 +8,7 @@ * * Since v2.1.4 of Footnotes * - * Last modified: 2020-12-06T1722+0100 + * Last modified for v2.2.2 2020-12-15T1004+0100 * * The enqueuing of this style sheet is optional and can be * enabled in the Reference container settings. @@ -20,56 +20,60 @@ Rationale In Hello Elementor Theme, this applies to .site-header, and also to .site-main, which is a class of the
element, at the condition that the page is not built with Elementor: - body:not([class*="elementor-page-"]) + 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 +Footnotes reference containers are near the bottom of main. +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 might be -used also with another theme. +This is mainly useful with Hello Elementor but it helps fix +also other themes like Twenty Twenty-One. */ -div.page-content { - margin-right: auto; - margin-left: auto; +div.page-content, +div.entry-content { + margin: 0 auto; } @media (max-width: 575px) { - div.page-content { - padding-right: 10px; - padding-left: 10px; + div.page-content, + div.entry-content { + padding: 0 10px; } } @media (min-width: 576px) { - div.page-content { + div.page-content, + div.entry-content { max-width: 500px; } } @media (min-width: 768px) { - div.page-content { + div.page-content, + div.entry-content { max-width: 600px; } } @media (min-width: 992px) { - div.page-content { + div.page-content, + div.entry-content { max-width: 800px; } } @media (min-width: 1200px) { - div.page-content { + div.page-content, + div.entry-content { max-width: 960px; } } diff --git a/css/layout-reference-container.css b/css/layout-reference-container.css index 0aa7c57..3eee0ea 100644 --- a/css/layout-reference-container.css +++ b/css/layout-reference-container.css @@ -8,7 +8,7 @@ * * Since v2.1.4 of Footnotes * - * Last modified: 2020-12-06T1722+0100 + * Last modified for v2.2.2 2020-12-15T1046+0100 * * The enqueuing of this style sheet is optional and can be * enabled in the Reference container settings. @@ -20,56 +20,60 @@ Rationale In Hello Elementor Theme, this applies to .site-header, and also to .site-main, which is a class of the
element, at the condition that the page is not built with Elementor: - body:not([class*="elementor-page-"]) + 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 +Footnotes reference containers are near the bottom of main. +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 might be -used also with another theme. +This is mainly useful with Hello Elementor but it helps fix +also other themes like Twenty Twenty-One. */ -.footnotes_reference_container { - margin-right: auto; - margin-left: auto; +.entry-content div.footnotes_reference_container, +main div.footnotes_reference_container { + margin: 0 auto; } @media (max-width: 575px) { - .footnotes_reference_container { - padding-right: 10px; - padding-left: 10px; + .entry-content div.footnotes_reference_container, + main div.footnotes_reference_container { + padding: 0 10px; } } @media (min-width: 576px) { - .footnotes_reference_container { + .entry-content div.footnotes_reference_container, + main div.footnotes_reference_container { max-width: 500px; } } @media (min-width: 768px) { - .footnotes_reference_container { + .entry-content div.footnotes_reference_container, + main div.footnotes_reference_container { max-width: 600px; } } @media (min-width: 992px) { - .footnotes_reference_container { + .entry-content div.footnotes_reference_container, + main div.footnotes_reference_container { max-width: 800px; } } @media (min-width: 1200px) { - .footnotes_reference_container { + .entry-content div.footnotes_reference_container, + main div.footnotes_reference_container { max-width: 960px; } } diff --git a/css/public.css b/css/public.css index 79086b9..374defd 100755 --- a/css/public.css +++ b/css/public.css @@ -5,14 +5,14 @@ * Created-Time: 16:21 * Since: 1.0 * - * Version: 2.2.0 + * Version: 2.2.2 * * 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 * - * Last modified: 2020-12-13T2059+0100 + * Last modified: 2020-12-15T0844+0100 */ diff --git a/css/settings.css b/css/settings.css index 5761adc..e44e621 100755 --- a/css/settings.css +++ b/css/settings.css @@ -5,9 +5,9 @@ * Created-Time: 16:21 * Since: 1.0 * - * Version: 2.2.0 + * Version: 2.2.2 * - * Last modified: 2020-12-13T2127+0100 + * Last modified: 2020-12-15T1020+0100 */ @@ -195,25 +195,28 @@ maintainability and readability of the source list. The textarea has monospace font, but no other features helping edit CSS, as tab support and syntactic colors. */ -#customize_css tr td:first-child { +#customize_css_new tr td:first-child { width: 44% !important; font-weight: normal !important; } -#customize_css tr td:first-child span:first-child { +#customize_css_new tr td:first-child span:first-child { font-weight: bold !important; } -#customize_css .list { +#customize_css_new .list { padding-top: 10px; } -#customize_css .list p { +#customize_css_new .list p { font-family: monospace; padding: 0 10px; text-indent: -10px; margin: .5em 0; } -#footnote_inputfield_custom_css { +#footnote_inputfield_custom_css_new { height: 500px; +} +#footnote_inputfield_custom_css, +#footnote_inputfield_custom_css_new { width: 90%; resize: both; overflow: scroll; diff --git a/footnotes.php b/footnotes.php index 75885c7..66aef7e 100755 --- a/footnotes.php +++ b/footnotes.php @@ -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.1 + Version: 2.2.2 Author URI: http://cheret.de/plugins/footnotes-2/ Text Domain: footnotes Domain Path: /languages */ -define( 'FOOTNOTES_VERSION', '2.2.1' ); +define( 'FOOTNOTES_VERSION', '2.2.2' ); /* Copyright 2020 Mark Cheret (email: mark@cheret.de) diff --git a/readme.txt b/readme.txt index 0a40b32..4db3380 100755 --- a/readme.txt +++ b/readme.txt @@ -80,6 +80,11 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest** == Changelog == += 2.2.2 = +- Bugfix: Dashboard: Link element setting only under General settings > Reference container +- Add: Dashboard: migrate Custom CSS to dedicated new tab, keep legacy until checking a box +- Bugfix: Reference container: edits to optional basic responsive page layout style sheets + = 2.2.1 = - Bugfix: Dashboard: duplicate moved settings under their legacy tab to account for data structure diff --git a/templates/dashboard/customize-css-migration.html b/templates/dashboard/customize-css-migration.html new file mode 100644 index 0000000..4cc7a94 --- /dev/null +++ b/templates/dashboard/customize-css-migration.html @@ -0,0 +1,15 @@ +
+

[[description-css]]

+
+ + + + + + + + + + + +
[[label-css]][[css]]
[[label-migrated]][[migrated]] [[notice-migrated]]
diff --git a/templates/dashboard/customize-css-new.html b/templates/dashboard/customize-css-new.html new file mode 100644 index 0000000..cfcf858 --- /dev/null +++ b/templates/dashboard/customize-css-new.html @@ -0,0 +1,30 @@ + + + + + + + +
[[headline]]
+
+

.footnote_referrer = enclosing <span> +

.footnote_plugin_tooltip_text = inner <sup>, not tooltip +

+

.footnote_tooltip = inner <span> +

.footnote_tooltip_continue = nested <span> +

+

.footnotes_reference_container = enclosing <div> +

.footnote_container_prepare = label <div> +

.footnote_reference_container_label = <span> +

.footnote_reference_container_collapse_button = sibling <span> +

.footnotes_table = <table> +

+

.footnote_plugin_index_combi = first <td> if identical footnotes are combined +

.footnote_plugin_index = first <td> if not +

.footnote_index = <a> or <span> in first <td> in 3-column table +

.footnote_plugin_link = <a> or <span> if identical footnotes are not combined, or second <td> in 3-column table +

.footnote_backlink = <a> or <span> if identical footnotes are combined, or in second <td> in 3-column table +

.footnote_index_arrow = nested <span>, symbol only +

.footnote_plugin_text = second <td>, or third <td> in 3-column table +

+
[[css]]
diff --git a/templates/dashboard/customize-css.html b/templates/dashboard/customize-css.html index 595b938..5c2dbe0 100644 --- a/templates/dashboard/customize-css.html +++ b/templates/dashboard/customize-css.html @@ -1,29 +1,10 @@ +
+

[[description-css]]

+
- + diff --git a/templates/dashboard/customize-superscript.html b/templates/dashboard/customize-superscript.html index 464bf47..ed520aa 100644 --- a/templates/dashboard/customize-superscript.html +++ b/templates/dashboard/customize-superscript.html @@ -14,10 +14,7 @@ - +
[[headline]]
-
-

.footnote_referrer = enclosing <span> -

.footnote_plugin_tooltip_text = inner <sup>, not tooltip -

-

.footnote_tooltip = inner <span> -

.footnote_tooltip_continue = nested <span> -

-

.footnotes_reference_container = enclosing <div> -

.footnote_container_prepare = label <div> -

.footnote_reference_container_label = <span> -

.footnote_reference_container_collapse_button = sibling <span> -

.footnotes_table = <table> -

-

.footnote_plugin_index_combi = first <td> if identical footnotes are combined -

.footnote_plugin_index = first <td> if not -

.footnote_index = <a> or <span> in first <td> in 3-column table -

.footnote_plugin_link = <a> or <span> if identical footnotes are not combined, or second <td> in 3-column table -

.footnote_backlink = <a> or <span> if identical footnotes are combined, or in second <td> in 3-column table -

.footnote_index_arrow = nested <span>, symbol only -

.footnote_plugin_text = second <td>, or third <td> in 3-column table -

-
[[label-css]] [[css]]
[[label-link]][[link]] [[notice-link]][[notice-link]]
-
-

[[description-link]]

-
diff --git a/templates/dashboard/settings-reference-container.html b/templates/dashboard/settings-reference-container.html index ef983e3..9ad8ba7 100644 --- a/templates/dashboard/settings-reference-container.html +++ b/templates/dashboard/settings-reference-container.html @@ -8,14 +8,14 @@ [[label-collapse]] [[collapse]] - - [[label-shortcode]] - [[shortcode]] [[notice-shortcode]] - [[label-position]] [[position]] [[notice-position]] + + [[label-shortcode]] + [[shortcode]] [[notice-shortcode]] + [[label-page-layout]] [[page-layout]] [[notice-page-layout]] @@ -96,3 +96,6 @@ +
+

[[description-link]]

+