diff --git a/class/dashboard/init.php b/class/dashboard/init.php index 1b54b10..19dacd6 100644 --- a/class/dashboard/init.php +++ b/class/dashboard/init.php @@ -89,8 +89,7 @@ class MCI_Footnotes_Layout_Init { * Registers all sub menu pages for the new main menu. * * @author Stefan Herndler - * @since 1.5.0 - * Claimed it was added for 2.0.2 while already present since 1.5.0 2020-11-19T1201+0100 + * @since 2.0.2 * @see http://codex.wordpress.org/Function_Reference/add_menu_page */ public function registerMainMenu() { @@ -210,4 +209,4 @@ class MCI_Footnotes_Layout_Init { ); exit; } -} +} \ No newline at end of file diff --git a/class/dashboard/layout.php b/class/dashboard/layout.php index e4e89c0..4c925c2 100644 --- a/class/dashboard/layout.php +++ b/class/dashboard/layout.php @@ -5,10 +5,6 @@ * @filesource * @author Stefan Herndler * @since 1.5.0 12.09.14 10:56 - * - * Updated for 2.1.2 added version # of settings.css for cache busting - * ############ update line 200 after changes to settings.css - * Last modified 2020-11-19T1456+0100 */ @@ -198,20 +194,9 @@ abstract class MCI_Footnotes_LayoutEngine { // add WordPress color picker layout wp_enqueue_style('wp-color-picker'); // add WordPress color picker function - wp_enqueue_script('wp-color-picker'); - - + wp_enqueue_script('wp-color-picker'); // 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__), - '', - '2.1.2' - ); - // UPDATE version # when making changes to settings.css, FOR CACHE BUSTING - - + wp_register_style('mci-footnotes-admin-styles', plugins_url('../../css/settings.css', __FILE__)); // add stylesheet to the output wp_enqueue_style('mci-footnotes-admin-styles'); } @@ -499,4 +484,4 @@ abstract class MCI_Footnotes_LayoutEngine { $l_arr_Data["name"], $l_arr_Data["id"], $l_arr_Data["value"], $p_in_Min, $p_int_Max); } -} // end of class +} // end of class \ No newline at end of file diff --git a/class/dashboard/subpage-main.php b/class/dashboard/subpage-main.php index 7dcef9b..c562ad3 100644 --- a/class/dashboard/subpage-main.php +++ b/class/dashboard/subpage-main.php @@ -411,10 +411,10 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { * @since 1.5.0 * * Edited heading for v2.0.4 - * + * * The former 'hyperlink arrow', incompatible with combined identical footnotes, - * became 'prepended arrow' in v2.0.3 after a user complaint about missing backlinking semantics - * of the footnote number. + * became 'prepended arrow' in v2.0.3 after a user complaint about missing backlinking semantics + * of the footnote number. */ public function HyperlinkArrow() { // load template file @@ -473,56 +473,38 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { * * @author Stefan Herndler * @since 1.5.5 - * - * Edited for: - * 2.1.1 add priority level setting for the_content 2020-11-16T2152+0100 - * 2.2.0 add priority level settings for the other hooks 2020-11-19T1421+0100 */ public function lookupHooks() { // load template file $l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "expert-lookup"); - // replace all placeholders - // priority level was initially hard-coded default - // shows "9223372036854775807" in the numbox - // empty should be interpreted as PHP_INT_MAX, - // but a numbox cannot be set to empty: - // define -1 as PHP_INT_MAX instead - $l_obj_Template->replace( array( - - "description" => __("The priority level determines whether Footnotes is executed timely before other plugins, and how the reference container is positioned relative to other features. Default 9223372036854775807 or -1 is lowest priority, 0 is highest. For the reference container to sit above related posts, the priority level of the_content hook may need to be at most 1200. For Footnotes to work when a glossary plugin is active, a higher priority of 1000 may be needed. Another priority level for the_content with proven efficiency is 10.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), - "head-hook" => __("WordPress hook function name", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "head-checkbox" => __("Activate", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), - "head-numbox" => __("Priority level", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "head-url" => __("WordPress documentation", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "label-the-title" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_TITLE, "the_title"), "the-title" => $this->addCheckbox(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_TITLE), - "priority-the-title" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL, -1, PHP_INT_MAX), - "url-the-title" => "https://developer.wordpress.org/reference/hooks/the_title/", + "url-the-title" => "http://codex.wordpress.org/Plugin_API/Filter_Reference/the_title", "label-the-content" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_CONTENT, "the_content"), - "the-content" => $this->addCheckbox(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_CONTENT), + "the-content" => $this->addCheckbox(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_CONTENT), + // allowed for priority level are all positive integers, zero and -1 interpreted as PHP_INT_MAX: "priority-the-content" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL, -1, PHP_INT_MAX), - "url-the-content" => "https://developer.wordpress.org/reference/hooks/the_content/", - + "url-the-content" => "http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content", + "label-the-excerpt" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_EXCERPT, "the_excerpt"), "the-excerpt" => $this->addCheckbox(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_EXCERPT), - "priority-the-excerpt" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL, -1, PHP_INT_MAX), - "url-the-excerpt" => "https://developer.wordpress.org/reference/functions/the_excerpt/", - + "url-the-excerpt" => "http://codex.wordpress.org/Function_Reference/the_excerpt", + "label-widget-title" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_WIDGET_TITLE, "widget_title"), "widget-title" => $this->addCheckbox(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_WIDGET_TITLE), - "priority-widget-title" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL, -1, PHP_INT_MAX), - "url-widget-title" => "https://codex.wordpress.org/Plugin_API/Filter_Reference/widget_title", - + "url-widget-title" => "http://codex.wordpress.org/Plugin_API/Filter_Reference/widget_title", + "label-widget-text" => $this->addLabel(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT, "widget_text"), "widget-text" => $this->addCheckbox(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT), - "priority-widget-text" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL, -1, PHP_INT_MAX), - "url-widget-text" => "https://codex.wordpress.org/Plugin_API/Filter_Reference/widget_text", + "url-widget-text" => "http://codex.wordpress.org/Plugin_API/Filter_Reference/widget_text", ) ); // display template with replaced placeholders diff --git a/class/init.php b/class/init.php index d4dcb1a..ffccc15 100644 --- a/class/init.php +++ b/class/init.php @@ -134,8 +134,8 @@ 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 - wp_enqueue_script('mci-footnotes-js-jquery-tools', plugins_url('../js/jquery.tools.min.js', __FILE__), '', '2.1.1'); + // enqueue jQuery Tools: + wp_enqueue_script('mci-footnotes-js-jquery-tools', plugins_url('../js/jquery.tools.min.js', __FILE__)); // Alternatively, fetch jQuery UI from cdnjs.cloudflare.com: @@ -159,7 +159,7 @@ class MCI_Footnotes { 'mci-footnotes-css-public', plugins_url('../css/public.css', __FILE__), '', - '2.1.2' + '2.1.1' ); } diff --git a/class/settings.php b/class/settings.php index ed46e23..5e984b7 100644 --- a/class/settings.php +++ b/class/settings.php @@ -380,8 +380,8 @@ class MCI_Footnotes_Settings { * * 2020-11-16T0859+0100 */ - const C_BOOL_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS = "footnotes_inputfield_referrer_superscript_tags"; - + const C_BOOL_FOOTNOTES_REFERRER_SUPERSCRIPT_TAGS = "footnotes_inputfield_referrer_superscript_tags"; + const C_BOOL_REFERENCE_CONTAINER_BACKLINK_SYMBOL_ENABLE = "footnotes_inputfield_reference_container_backlink_symbol_enable"; const C_BOOL_REFERENCE_CONTAINER_START_PAGE_ENABLE = "footnotes_inputfield_reference_container_start_page_enable"; const C_BOOL_REFERENCE_CONTAINER_3COLUMN_LAYOUT_ENABLE = "footnotes_inputfield_reference_container_3column_layout_enable"; @@ -515,11 +515,6 @@ class MCI_Footnotes_Settings { self::C_BOOL_EXPERT_LOOKUP_WIDGET_TITLE => '', self::C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT => 'yes', - // initially hard-coded default - // shows "9223372036854775807" in the numbox - // empty should be interpreted as PHP_INT_MAX, - // but a numbox cannot be set to empty: - // define -1 as PHP_INT_MAX instead self::C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL => PHP_INT_MAX, self::C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL => PHP_INT_MAX, self::C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL => PHP_INT_MAX, diff --git a/class/task.php b/class/task.php index 5bba169..d1aee03 100644 --- a/class/task.php +++ b/class/task.php @@ -64,35 +64,27 @@ class MCI_Footnotes_Task { * @author Stefan Herndler * @since 1.5.0 * - * Edited for: - * 2.0.5 through v2.0.7 changes to priority 2020-11-02T0330+0100..2020-11-06T1344+0100 - * 2.2.0 add settings for all hooks 2020-11-19T1248+0100 + * Edited for v2.0.5 through v2.0.7 2020-11-02T0330+0100..2020-11-06T1344+0100 * - * Explicitly setting the_content priority to "10" instead of lowest "PHP_INT_MAX", - * makes the footnotes reference container display beneath the post and above other - * features added by other plugins, e.g. related post lists and social buttons. + * Explicitly setting all priority to (default) "10" instead of lowest "PHP_INT_MAX", + * especially for the_content, makes the footnotes reference container display + * beneath the content and above other features added by other plugins. * Requested by users: * Documentation: - * - * Default remains PHP_INT_MAX. - * PHP_INT_MAX can be reset by leaving the number box empty. + * + * But this change is suspected to cause issues and needs to be assessed! + * See */ public function registerHooks() { - // get values from settings: - $p_int_TheTitlePriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL)); - $p_int_TheContentPriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL)); - $p_int_TheExcerptPriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL)); - $p_int_WidgetTitlePriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL)); - $p_int_WidgetTextPriority = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL)); - - // PHP_INT_MAX can be set leaving the input field empty: - $p_int_TheTitlePriority = !empty($p_int_TheTitlePriority ) ? $p_int_TheTitlePriority : PHP_INT_MAX; - $p_int_TheContentPriority = !empty($p_int_TheContentPriority ) ? $p_int_TheContentPriority : PHP_INT_MAX; - $p_int_TheExcerptPriority = !empty($p_int_TheExcerptPriority ) ? $p_int_TheExcerptPriority : PHP_INT_MAX; - $p_int_WidgetTitlePriority = !empty($p_int_WidgetTitlePriority) ? $p_int_WidgetTitlePriority : PHP_INT_MAX; - $p_int_WidgetTextPriority = !empty($p_int_WidgetTextPriority ) ? $p_int_WidgetTextPriority : PHP_INT_MAX; + // first compute values from settings: + // for now only the_content is supported for customization: + $p_int_TheContentPriority = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL); + // PHP_INT_MAX can be set using the value -1: + if ( $p_int_TheContentPriority == -1 ) { + $p_int_TheContentPriority = PHP_INT_MAX; + } // append custom css to the header add_filter('wp_head', array($this, "wp_head"), PHP_INT_MAX); @@ -101,30 +93,25 @@ class MCI_Footnotes_Task { add_filter('wp_footer', array($this, "wp_footer"), PHP_INT_MAX); if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_TITLE))) { - add_filter('the_title', array($this, "the_title"), $p_int_TheTitlePriority); + add_filter('the_title', array($this, "the_title"), PHP_INT_MAX); } - // custom priority level for reference container relative positioning; default PHP_INT_MAX: + // SET PRIORITY LEVEL TO CUSTOM FOR PAGE LAYOUT; DEFAULT PHP_INT_MAX: if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_CONTENT))) { add_filter('the_content', array($this, "the_content"), $p_int_TheContentPriority); - } - + } if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_THE_EXCERPT))) { - add_filter('the_excerpt', array($this, "the_excerpt"), $p_int_TheExcerptPriority); + add_filter('the_excerpt', array($this, "the_excerpt"), PHP_INT_MAX); } if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_WIDGET_TITLE))) { - add_filter('widget_title', array($this, "widget_title"), $p_int_WidgetTitlePriority); + add_filter('widget_title', array($this, "widget_title"), PHP_INT_MAX); } if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT))) { - add_filter('widget_text', array($this, "widget_text"), $p_int_WidgetTextPriority); - } - - - // REMOVED the_post HOOK 2020-11-08T1839+0100 + add_filter('widget_text', array($this, "widget_text"), PHP_INT_MAX); + } + // DISABLED the_post HOOK 2020-11-08T1839+0100 + // // - // - - // reset stored footnotes when displaying the header self::$a_arr_Footnotes = array(); self::$a_bool_AllowLoveMe = true; diff --git a/css/public.css b/css/public.css index 10db703..da97741 100755 --- a/css/public.css +++ b/css/public.css @@ -4,9 +4,9 @@ * Created-Date: 15.05.14 * Created-Time: 16:21 * Since: 1.0 - * Version: 2.1.2 + * Version: 2.1.1 * - * Last modified: 2020-11-19T1444+0100 + * Last modified: 2020-11-18T0137+0100 */ diff --git a/css/settings.css b/css/settings.css index 7e0c235..6bdf62a 100755 --- a/css/settings.css +++ b/css/settings.css @@ -4,9 +4,9 @@ * Created-Date: 15.05.14 * Created-Time: 16:21 * Since: 1.0 - * Version: 2.1.2 + * Version: 2.1.1 * - * Last modified: 2020-11-19T1445+0100 + * Last modified: 2020-11-18T0136+0100 */ @@ -38,10 +38,7 @@ left: 96px; } -/* -On User Request: limited to a number of IDs to not affect all dashboards - -*/ + #footnote_inputfield_placeholder_start_user_defined, #footnote_inputfield_placeholder_end_user_defined, #footnote_inputfield_readon_label, @@ -99,34 +96,3 @@ span.footnote_highlight_placeholder { margin: 20px auto !important; text-align: center !important; } - -/* -initialized from style attributes in templates -IE doesn’t support nth child, but these are not critical -*/ -.expert-lookup tr th:first-child, -.expert-lookup tr td:first-child { - width: 170px !important; -} -.expert-lookup tr th:nth-child(2), -.expert-lookup tr td:nth-child(2) { - width: 65px !important; -} -.expert-lookup tr th:nth-child(3), -.expert-lookup tr td:nth-child(3) { - width: 200px !important; -} -.expert-lookup tr td:nth-child(3) input { - width: 190px; -} -.expert-lookup tr th:last-child, -.expert-lookup tr td:last-child { - white-space: nowrap; -} - -.footnotes-description { - padding: 0 10px; -} -.footnotes-description p { - font-size: 1.4em; -} diff --git a/footnotes.php b/footnotes.php index e7de7f1..e3225ba 100755 --- a/footnotes.php +++ b/footnotes.php @@ -4,7 +4,7 @@ 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.2 + Version: 2.1.1 Author URI: http://cheret.de/plugins/footnotes-2/ Text Domain: footnotes Domain Path: /languages diff --git a/readme.txt b/readme.txt index b79ff01..24a7c10 100755 --- a/readme.txt +++ b/readme.txt @@ -80,11 +80,6 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest** == Changelog == -= 2.1.2 = -- Bugfix: Dashboard: priority level settings for all other hooks, preventing them from being zeroed at save -- Update: Dashboard: WordPress documentation URLs of the hooks -- Update: Dashboard: feature description for the hooks priority level settings - = 2.1.1 = - Bugfix: Combining identical footnotes: fix dead links, ensure referrer-backlink bijectivity - Update: Libraries: jQuery Tools: redact jQuery.browser function use in js/jquery.tools.min.js @@ -103,13 +98,13 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest** - Bugfix: Layout: Reference container: fix start pages by an option to hide the reference container - Bugfix: Layout: Reference container: Table rows: fix top and bottom padding - Bugfix: Layout: Footnote referrers: new fix for line height -- Bugfix: Formatting: disable overline showing in some themes on hovered backlinks +- Bugfix: Formatting: disabled overline showing in some themes on hovered backlinks = 2.1.0 = - Add: UI: Tooltip: made 'Continue reading' button label customizable - Bugfix: Layout: Footnote referrers: disabled bottom border for theme compatibility - Update: Accessibility: added 'speaker-mute' class to reference container -- Bugfix: Dashboard: Layout: added named selectors to limit applicability of styles +- Bugfix: Settings layout: added named selectors to limit applicability of styles - UPDATE: REMOVED the_post hook, the plugin stopped supporting this hook = 2.0.8 = diff --git a/templates/dashboard/expert-lookup.html b/templates/dashboard/expert-lookup.html index 6a6ac93..03daf5f 100644 --- a/templates/dashboard/expert-lookup.html +++ b/templates/dashboard/expert-lookup.html @@ -1,45 +1,42 @@ -
-

[[description]]

-
- +
- - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + +
[[head-hook]][[head-checkbox]][[head-numbox]][[head-url]][[head-hook]][[head-checkbox]]Priority level
Set -1 for minimum priority
[[head-url]]
[[label-the-title]][[the-title]][[priority-the-title]][[url-the-title]][[label-the-title]][[the-title]][[url-the-title]]
[[label-the-content]][[the-content]][[priority-the-content]][[url-the-content]][[label-the-content]][[the-content]][[priority-the-content]][[url-the-content]]
[[label-the-excerpt]][[the-excerpt]][[priority-the-excerpt]][[url-the-excerpt]][[label-the-excerpt]][[the-excerpt]][[url-the-excerpt]]
[[label-widget-title]][[widget-title]][[priority-widget-title]][[url-widget-title]][[label-widget-title]][[widget-title]][[url-widget-title]]
[[label-widget-text]][[widget-text]][[priority-widget-text]][[url-widget-text]][[label-widget-text]][[widget-text]][[url-widget-text]]