stable tag remains 2.0.4, this update as RC0 for user support and testing

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2412893 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
pewgeuges 2020-11-05 02:34:35 +00:00
parent 8eeb6b7c35
commit 75885b77cf
14 changed files with 599 additions and 510 deletions

View file

@ -10,8 +10,9 @@
* *
* Edited for v2.0.0: Added jQueryUI from CDN 2020-10-26T1907+0100 * Edited for v2.0.0: Added jQueryUI from CDN 2020-10-26T1907+0100
* Edited for v2.0.3: Added style sheet versioning 2020-10-29T1413+0100 * Edited for v2.0.3: Added style sheet versioning 2020-10-29T1413+0100
* Edited for v2.0.4: Enqueuing settings.css 2020-11-01T0317+0100
* Edited for v2.0.4: Added jQuery UI from WordPress 2020-11-01T1902+0100 * Edited for v2.0.4: Added jQuery UI from WordPress 2020-11-01T1902+0100
*
* Last modified: 2020-11-05T0239+0100
*/ */
@ -64,6 +65,14 @@ class MCI_Footnotes {
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
*
* Edited for 1.6.5: replaced deprecated function create_function()
*
* Contributed by Felipe Lavín Z. Thankfully acknowledged.
*
* create_function() was deprecated in PHP 7.2:
* <https://wordpress.org/support/topic/deprecated-in-php-7-2-function-create_function-is-deprecated/>
* See also: <https://wordpress.org/support/topic/deprecated-function-create_function-14/>
*/ */
public function initializeWidgets() { public function initializeWidgets() {
register_widget("MCI_Footnotes_Widget_ReferenceContainer"); register_widget("MCI_Footnotes_Widget_ReferenceContainer");
@ -97,28 +106,26 @@ class MCI_Footnotes {
* @since 1.5.0 * @since 1.5.0
* *
* Updated for v2.0.4 by adding jQueryUI from WordPress following @check2020de: * Updated for v2.0.4 by adding jQueryUI from WordPress following @check2020de:
* <https://wordpress.org/support/topic/gdpr-issue-with-jquery/> * <https://wordpress.org/support/topic/gdpr-issue-with-jquery/>
* See <https://wordpress.stackexchange.com/questions/273986/correct-way-to-enqueue-jquery-ui> * See <https://wordpress.stackexchange.com/questions/273986/correct-way-to-enqueue-jquery-ui>
* *
* jQueryUI re-enables the tooltip infobox disabled when WPv5.5 was released. * jQueryUI re-enables the tooltip infobox disabled when WPv5.5 was released.
*/ */
public function registerPublic() { public function registerPublic() {
// add the jQuery plugin (already registered by WordPress) // add the jQuery plugin (already registered by WordPress)
wp_enqueue_script('jquery'); wp_enqueue_script( 'jquery' );
// Add jQueryUI: 'no need to enqueue -core, because dependencies are set'
// Add jQueryUI: 'no need to enqueue -core, because dependancies are set' wp_enqueue_script( 'jquery-ui-widget' );
wp_enqueue_script( 'jquery-ui-widget' ); wp_enqueue_script( 'jquery-ui-mouse' );
wp_enqueue_script( 'jquery-ui-mouse' ); wp_enqueue_script( 'jquery-ui-accordion' );
wp_enqueue_script( 'jquery-ui-accordion' ); wp_enqueue_script( 'jquery-ui-autocomplete' );
wp_enqueue_script( 'jquery-ui-autocomplete' ); wp_enqueue_script( 'jquery-ui-slider' );
wp_enqueue_script( 'jquery-ui-slider' );
// Add jQuery tools: // Add jQuery tools:
wp_enqueue_script('mci-footnotes-js-jquery-tools', plugins_url('../js/jquery.tools.min.js', __FILE__)); wp_enqueue_script('mci-footnotes-js-jquery-tools', plugins_url('../js/jquery.tools.min.js', __FILE__));
// IMPORTANT: up-to-date plugin version number for cache busting. // IMPORTANT: up-to-date plugin version number for cache busting.
wp_enqueue_style('mci-footnotes-css-public', plugins_url('../css/public.css', __FILE__), '', '2.0.4'); wp_enqueue_style('mci-footnotes-css-public', plugins_url('../css/public.css', __FILE__), '', '2.0.5rc0');
wp_enqueue_style('mci-footnotes-css-settings', plugins_url('../css/settings.css', __FILE__), '', '2.0.4');
} }
} }

View file

@ -6,7 +6,7 @@
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 14.09.14 10:43 * @since 1.5.0 14.09.14 10:43
* *
* Edited for v2.0.4 2020-11-01T0333+0100 * Edited for v2.0.4 2020-11-02T2115+0100
*/ */
@ -20,104 +20,104 @@
*/ */
class MCI_Footnotes_Settings { class MCI_Footnotes_Settings {
/** /**
* Settings Container Key for the label of the reference container. * Settings Container Key for the label of the reference container.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @var string * @var string
*/ */
const C_STR_REFERENCE_CONTAINER_NAME = "footnote_inputfield_references_label"; const C_STR_REFERENCE_CONTAINER_NAME = "footnote_inputfield_references_label";
/** /**
* Settings Container Key to collapse the reference container by default. * Settings Container Key to collapse the reference container by default.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @var bool * @var bool
*/ */
const C_BOOL_REFERENCE_CONTAINER_COLLAPSE = "footnote_inputfield_collapse_references"; const C_BOOL_REFERENCE_CONTAINER_COLLAPSE = "footnote_inputfield_collapse_references";
/** /**
* Settings Container Key for the positioning of the reference container. * Settings Container Key for the positioning of the reference container.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @var string * @var string
*/ */
const C_STR_REFERENCE_CONTAINER_POSITION = "footnote_inputfield_reference_container_place"; const C_STR_REFERENCE_CONTAINER_POSITION = "footnote_inputfield_reference_container_place";
/** /**
* Settings Container Key to combine identical footnotes. * Settings Container Key to combine identical footnotes.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @var bool * @var bool
*/ */
const C_BOOL_COMBINE_IDENTICAL_FOOTNOTES = "footnote_inputfield_combine_identical"; const C_BOOL_COMBINE_IDENTICAL_FOOTNOTES = "footnote_inputfield_combine_identical";
/** /**
* Settings Container Key for the start of the footnotes short code. * Settings Container Key for the start of the footnotes short code.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @var string * @var string
*/ */
const C_STR_FOOTNOTES_SHORT_CODE_START = "footnote_inputfield_placeholder_start"; const C_STR_FOOTNOTES_SHORT_CODE_START = "footnote_inputfield_placeholder_start";
/** /**
* Settings Container Key for the end of the footnotes short code. * Settings Container Key for the end of the footnotes short code.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @var string * @var string
*/ */
const C_STR_FOOTNOTES_SHORT_CODE_END = "footnote_inputfield_placeholder_end"; const C_STR_FOOTNOTES_SHORT_CODE_END = "footnote_inputfield_placeholder_end";
/** /**
* Settings Container Key for the user defined start of the footnotes short code. * Settings Container Key for the user defined start of the footnotes short code.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @var string * @var string
*/ */
const C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED = "footnote_inputfield_placeholder_start_user_defined"; const C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED = "footnote_inputfield_placeholder_start_user_defined";
/** /**
* Settings Container Key for the user defined end of the footnotes short code. * Settings Container Key for the user defined end of the footnotes short code.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @var string * @var string
*/ */
const C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED = "footnote_inputfield_placeholder_end_user_defined"; const C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED = "footnote_inputfield_placeholder_end_user_defined";
/** /**
* Settings Container Key for the counter style of the footnotes. * Settings Container Key for the counter style of the footnotes.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @var string * @var string
*/ */
const C_STR_FOOTNOTES_COUNTER_STYLE = "footnote_inputfield_counter_style"; const C_STR_FOOTNOTES_COUNTER_STYLE = "footnote_inputfield_counter_style";
/** /**
* Settings Container Key for the 'I love footnotes' text. * Settings Container Key for the 'I love footnotes' text.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @var string * @var string
*/ */
const C_STR_FOOTNOTES_LOVE = "footnote_inputfield_love"; const C_STR_FOOTNOTES_LOVE = "footnote_inputfield_love";
/** /**
* Settings Container Key to look for footnotes in post excerpts. * Settings Container Key to look for footnotes in post excerpts.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @var string * @var string
*/ */
const C_BOOL_FOOTNOTES_IN_EXCERPT = "footnote_inputfield_search_in_excerpt"; const C_BOOL_FOOTNOTES_IN_EXCERPT = "footnote_inputfield_search_in_excerpt";
/** /**
* Settings Container Key for the Expert mode. * Settings Container Key for the Expert mode.
@ -128,32 +128,32 @@ class MCI_Footnotes_Settings {
*/ */
const C_BOOL_FOOTNOTES_EXPERT_MODE = "footnote_inputfield_enable_expert_mode"; const C_BOOL_FOOTNOTES_EXPERT_MODE = "footnote_inputfield_enable_expert_mode";
/** /**
* Settings Container Key for the styling before the footnotes index. * Settings Container Key for the styling before the footnotes index.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @var string * @var string
*/ */
const C_STR_FOOTNOTES_STYLING_BEFORE = "footnote_inputfield_custom_styling_before"; const C_STR_FOOTNOTES_STYLING_BEFORE = "footnote_inputfield_custom_styling_before";
/** /**
* Settings Container Key for the styling after the footnotes index. * Settings Container Key for the styling after the footnotes index.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @var string * @var string
*/ */
const C_STR_FOOTNOTES_STYLING_AFTER = "footnote_inputfield_custom_styling_after"; const C_STR_FOOTNOTES_STYLING_AFTER = "footnote_inputfield_custom_styling_after";
/** /**
* Settings Container Key for the mouse-over box to be enabled. * Settings Container Key for the mouse-over box to be enabled.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.2 * @since 1.5.2
* @var string * @var string
*/ */
const C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED = "footnote_inputfield_custom_mouse_over_box_enabled"; const C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED = "footnote_inputfield_custom_mouse_over_box_enabled";
/** /**
* Settings Container Key for the mouse-over box to display only an excerpt. * Settings Container Key for the mouse-over box to display only an excerpt.
@ -173,32 +173,32 @@ class MCI_Footnotes_Settings {
*/ */
const C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH = "footnote_inputfield_custom_mouse_over_box_excerpt_length"; const C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH = "footnote_inputfield_custom_mouse_over_box_excerpt_length";
/** /**
* Settings Container Key for the mouse-over box to define the positioning. * Settings Container Key for the mouse-over box to define the positioning.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.7 * @since 1.5.7
* @var string * @var string
*/ */
const C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION = "footnote_inputfield_custom_mouse_over_box_position"; const C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION = "footnote_inputfield_custom_mouse_over_box_position";
/** /**
* Settings Container Key for the mouse-over box to define the offset (x). * Settings Container Key for the mouse-over box to define the offset (x).
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.7 * @since 1.5.7
* @var string * @var string
*/ */
const C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X = "footnote_inputfield_custom_mouse_over_box_offset_x"; const C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X = "footnote_inputfield_custom_mouse_over_box_offset_x";
/** /**
* Settings Container Key for the mouse-over box to define the offset (y). * Settings Container Key for the mouse-over box to define the offset (y).
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.7 * @since 1.5.7
* @var string * @var string
*/ */
const C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y = "footnote_inputfield_custom_mouse_over_box_offset_y"; const C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y = "footnote_inputfield_custom_mouse_over_box_offset_y";
/** /**
* Settings Container Key for the mouse-over box to define the color. * Settings Container Key for the mouse-over box to define the color.
@ -254,41 +254,41 @@ class MCI_Footnotes_Settings {
*/ */
const C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH = "footnote_inputfield_custom_mouse_over_box_max_width"; const C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH = "footnote_inputfield_custom_mouse_over_box_max_width";
/** /**
* Settings Container Key for the mouse-over box to define the box-shadow color. * Settings Container Key for the mouse-over box to define the box-shadow color.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.8 * @since 1.5.8
* @var string * @var string
*/ */
const C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR = "footnote_inputfield_custom_mouse_over_box_shadow_color"; const C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR = "footnote_inputfield_custom_mouse_over_box_shadow_color";
/** /**
* Settings Container Key for the Hyperlink arrow. * Settings Container Key for the Hyperlink arrow.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @var string * @var string
*/ */
const C_STR_HYPERLINK_ARROW = "footnote_inputfield_custom_hyperlink_symbol"; const C_STR_HYPERLINK_ARROW = "footnote_inputfield_custom_hyperlink_symbol";
/** /**
* Settings Container Key for the user defined Hyperlink arrow. * Settings Container Key for the user defined Hyperlink arrow.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @var string * @var string
*/ */
const C_STR_HYPERLINK_ARROW_USER_DEFINED = "footnote_inputfield_custom_hyperlink_symbol_user"; const C_STR_HYPERLINK_ARROW_USER_DEFINED = "footnote_inputfield_custom_hyperlink_symbol_user";
/** /**
* Settings Container Key for the user defined styling. * Settings Container Key for the user defined styling.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @var string * @var string
*/ */
const C_STR_CUSTOM_CSS = "footnote_inputfield_custom_css"; const C_STR_CUSTOM_CSS = "footnote_inputfield_custom_css";
/** /**
* Settings Container Key the activation of the_title hook. * Settings Container Key the activation of the_title hook.
@ -344,125 +344,127 @@ class MCI_Footnotes_Settings {
*/ */
const C_BOOL_EXPERT_LOOKUP_THE_POST = "footnote_inputfield_expert_lookup_the_post"; const C_BOOL_EXPERT_LOOKUP_THE_POST = "footnote_inputfield_expert_lookup_the_post";
/** /**
* Stores a singleton reference of this class. * Stores a singleton reference of this class.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @var MCI_Footnotes_Settings * @var MCI_Footnotes_Settings
*/ */
private static $a_obj_Instance = null; private static $a_obj_Instance = null;
/** /**
* Contains all Settings Container names. * Contains all Settings Container names.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @var array * @var array
*/ */
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");
/** /**
* Contains all Default Settings for each Settings Container. * Contains all Default Settings for each Settings Container.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @var array * @var array
*/ */
private $a_arr_Default = array( private $a_arr_Default = array(
"footnotes_storage" => array( "footnotes_storage" => array(
self::C_STR_REFERENCE_CONTAINER_NAME => 'References', self::C_STR_REFERENCE_CONTAINER_NAME => 'References',
self::C_BOOL_REFERENCE_CONTAINER_COLLAPSE => '', self::C_BOOL_REFERENCE_CONTAINER_COLLAPSE => '',
self::C_STR_REFERENCE_CONTAINER_POSITION => 'post_end', self::C_STR_REFERENCE_CONTAINER_POSITION => 'post_end',
// Identical footnotes should not be combined by default // Identical footnotes should not be combined by default
// as long as the feature raises criticism for malfunctioning: // as long as the feature raises criticism for malfunctioning:
// <https://wordpress.org/support/topic/too-many-errors-18/> // <https://wordpress.org/support/topic/too-many-errors-18/>
self::C_BOOL_COMBINE_IDENTICAL_FOOTNOTES => '', self::C_BOOL_COMBINE_IDENTICAL_FOOTNOTES => '',
self::C_STR_FOOTNOTES_SHORT_CODE_START => '((', self::C_STR_FOOTNOTES_SHORT_CODE_START => '((',
self::C_STR_FOOTNOTES_SHORT_CODE_END => '))', self::C_STR_FOOTNOTES_SHORT_CODE_END => '))',
self::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED => '', self::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED => '',
self::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED => '', self::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED => '',
self::C_STR_FOOTNOTES_COUNTER_STYLE => 'arabic_plain', self::C_STR_FOOTNOTES_COUNTER_STYLE => 'arabic_plain',
self::C_STR_FOOTNOTES_LOVE => 'no', self::C_STR_FOOTNOTES_LOVE => 'no',
self::C_BOOL_FOOTNOTES_IN_EXCERPT => 'yes', self::C_BOOL_FOOTNOTES_IN_EXCERPT => 'yes',
self::C_BOOL_FOOTNOTES_EXPERT_MODE => 'no' self::C_BOOL_FOOTNOTES_EXPERT_MODE => 'no'
), ),
"footnotes_storage_custom" => array( "footnotes_storage_custom" => array(
self::C_STR_FOOTNOTES_STYLING_BEFORE => '', self::C_STR_FOOTNOTES_STYLING_BEFORE => '',
self::C_STR_FOOTNOTES_STYLING_AFTER => ')', self::C_STR_FOOTNOTES_STYLING_AFTER => ')',
self::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED => 'yes', self::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED => 'yes',
self::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED => 'no', self::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED => 'no',
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH => 150, self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH => 150,
self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION => 'top right', self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION => 'top right',
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X => 10, self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X => 10,
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y => 10, self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y => 10,
self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR => '', self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR => '',
self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND => '#fff7a7', self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND => '#fff7a7',
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH => 1, self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH => 1,
self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR => '#cccc99', self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR => '#cccc99',
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS => 3, self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS => 3,
self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH => 0, self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH => 0,
self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR => '#666666', self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR => '#666666',
self::C_STR_HYPERLINK_ARROW => '&#8593;', self::C_STR_HYPERLINK_ARROW => '&#8593;',
self::C_STR_HYPERLINK_ARROW_USER_DEFINED => '', self::C_STR_HYPERLINK_ARROW_USER_DEFINED => '',
self::C_STR_CUSTOM_CSS => '' self::C_STR_CUSTOM_CSS => ''
), ),
// These should all be enabled by default.
// See <https://wordpress.org/support/topic/more-feature-ideas/>
"footnotes_storage_expert" => array( "footnotes_storage_expert" => array(
self::C_BOOL_EXPERT_LOOKUP_THE_TITLE => '', self::C_BOOL_EXPERT_LOOKUP_THE_TITLE => 'yes',
self::C_BOOL_EXPERT_LOOKUP_THE_CONTENT => 'yes', self::C_BOOL_EXPERT_LOOKUP_THE_CONTENT => 'yes',
self::C_BOOL_EXPERT_LOOKUP_THE_EXCERPT => 'yes', self::C_BOOL_EXPERT_LOOKUP_THE_EXCERPT => 'yes',
self::C_BOOL_EXPERT_LOOKUP_WIDGET_TITLE => '', self::C_BOOL_EXPERT_LOOKUP_WIDGET_TITLE => 'yes',
self::C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT => 'yes', self::C_BOOL_EXPERT_LOOKUP_WIDGET_TEXT => 'yes',
self::C_BOOL_EXPERT_LOOKUP_THE_POST => '' self::C_BOOL_EXPERT_LOOKUP_THE_POST => 'yes'
) )
); );
/** /**
* Contains all Settings from each Settings container as soon as this class is initialized. * Contains all Settings from each Settings container as soon as this class is initialized.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @var array * @var array
*/ */
private $a_arr_Settings = array(); private $a_arr_Settings = array();
/** /**
* Class Constructor. Loads all Settings from each WordPress Settings container. * Class Constructor. Loads all Settings from each WordPress Settings container.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
*/ */
private function __construct() { private function __construct() {
$this->loadAll(); $this->loadAll();
} }
/** /**
* Returns a singleton of this class. * Returns a singleton of this class.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @return MCI_Footnotes_Settings * @return MCI_Footnotes_Settings
*/ */
public static function instance() { public static function instance() {
// no instance defined yet, load it // no instance defined yet, load it
if (self::$a_obj_Instance === null) { if (self::$a_obj_Instance === null) {
self::$a_obj_Instance = new self(); self::$a_obj_Instance = new self();
} }
// return a singleton of this class // return a singleton of this class
return self::$a_obj_Instance; return self::$a_obj_Instance;
} }
/** /**
* Returns the name of a specified Settings Container. * Returns the name of a specified Settings Container.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @param int $p_int_Index Settings Container Array Key Index. * @param int $p_int_Index Settings Container Array Key Index.
* @return string Settings Container name. * @return string Settings Container name.
*/ */
public function getContainer($p_int_Index) { public function getContainer($p_int_Index) {
return $this->a_arr_Container[$p_int_Index]; return $this->a_arr_Container[$p_int_Index];
} }
/** /**
* Returns the default values of a specific Settings Container. * Returns the default values of a specific Settings Container.
@ -476,114 +478,114 @@ class MCI_Footnotes_Settings {
return $this->a_arr_Default[$this->a_arr_Container[$p_int_Index]]; return $this->a_arr_Default[$this->a_arr_Container[$p_int_Index]];
} }
/** /**
* Loads all Settings from each Settings container. * Loads all Settings from each Settings container.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
*/ */
private function loadAll() { private function loadAll() {
// clear current settings // clear current settings
$this->a_arr_Settings = array(); $this->a_arr_Settings = array();
for ($i = 0; $i < count($this->a_arr_Container); $i++) { for ($i = 0; $i < count($this->a_arr_Container); $i++) {
// load settings // load settings
$this->a_arr_Settings = array_merge($this->a_arr_Settings, $this->Load($i)); $this->a_arr_Settings = array_merge($this->a_arr_Settings, $this->Load($i));
} }
} }
/** /**
* Loads all Settings from specified Settings Container. * Loads all Settings from specified Settings Container.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @param int $p_int_Index Settings Container Array Key Index. * @param int $p_int_Index Settings Container Array Key Index.
* @return array Settings loaded from Container of Default Settings if Settings Container is empty (first usage). * @return array Settings loaded from Container of Default Settings if Settings Container is empty (first usage).
*/ */
private function Load($p_int_Index) { private function Load($p_int_Index) {
// load all settings from container // load all settings from container
$l_arr_Options = get_option($this->getContainer($p_int_Index)); $l_arr_Options = get_option($this->getContainer($p_int_Index));
// load all default settings // load all default settings
$l_arr_Default = $this->a_arr_Default[$this->getContainer($p_int_Index)]; $l_arr_Default = $this->a_arr_Default[$this->getContainer($p_int_Index)];
// no settings found, set them to their default value // no settings found, set them to their default value
if (empty($l_arr_Options)) { if (empty($l_arr_Options)) {
return $l_arr_Default; return $l_arr_Default;
} }
// iterate through all available settings ( = default values) // iterate through all available settings ( = default values)
foreach($l_arr_Default as $l_str_Key => $l_str_Value) { foreach($l_arr_Default as $l_str_Key => $l_str_Value) {
// available setting not found in the container // available setting not found in the container
if (!array_key_exists($l_str_Key, $l_arr_Options)) { if (!array_key_exists($l_str_Key, $l_arr_Options)) {
// define the setting with its default value // define the setting with its default value
$l_arr_Options[$l_str_Key] = $l_str_Value; $l_arr_Options[$l_str_Key] = $l_str_Value;
} }
} }
// iterate through each setting in the container // iterate through each setting in the container
foreach($l_arr_Options as $l_str_Key => $l_str_Value) { foreach($l_arr_Options as $l_str_Key => $l_str_Value) {
// remove all whitespace at the beginning and end of a setting // remove all whitespace at the beginning and end of a setting
//$l_str_Value = trim($l_str_Value); //$l_str_Value = trim($l_str_Value);
// write the sanitized value back to the setting container // write the sanitized value back to the setting container
$l_arr_Options[$l_str_Key] = $l_str_Value; $l_arr_Options[$l_str_Key] = $l_str_Value;
} }
// return settings loaded from Container // return settings loaded from Container
return $l_arr_Options; return $l_arr_Options;
} }
/** /**
* Updates a whole Settings container. * Updates a whole Settings container.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @param int $p_int_Index Index of the Settings container. * @param int $p_int_Index Index of the Settings container.
* @param array $p_arr_newValues new Settings. * @param array $p_arr_newValues new Settings.
* @return bool * @return bool
*/ */
public function saveOptions($p_int_Index, $p_arr_newValues) { public function saveOptions($p_int_Index, $p_arr_newValues) {
if (update_option($this->getContainer($p_int_Index), $p_arr_newValues)) { if (update_option($this->getContainer($p_int_Index), $p_arr_newValues)) {
$this->loadAll(); $this->loadAll();
return true; return true;
} }
return false; return false;
} }
/** /**
* Returns the value of specified Settings name. * Returns the value of specified Settings name.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @param string $p_str_Key Settings Array Key name. * @param string $p_str_Key Settings Array Key name.
* @return mixed Value of the Setting on Success or Null in Settings name is invalid. * @return mixed Value of the Setting on Success or Null in Settings name is invalid.
*/ */
public function get($p_str_Key) { public function get($p_str_Key) {
return array_key_exists($p_str_Key, $this->a_arr_Settings) ? $this->a_arr_Settings[$p_str_Key] : null; return array_key_exists($p_str_Key, $this->a_arr_Settings) ? $this->a_arr_Settings[$p_str_Key] : null;
} }
/** /**
* Deletes each Settings Container and loads the default values for each Settings Container. * Deletes each Settings Container and loads the default values for each Settings Container.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
*/ */
public function ClearAll() { public function ClearAll() {
// iterate through each Settings Container // iterate through each Settings Container
for ($i = 0; $i < count($this->a_arr_Container); $i++) { for ($i = 0; $i < count($this->a_arr_Container); $i++) {
// delete the settings container // delete the settings container
delete_option($this->getContainer($i)); delete_option($this->getContainer($i));
} }
// set settings back to the default values // set settings back to the default values
$this->a_arr_Settings = $this->a_arr_Default; $this->a_arr_Settings = $this->a_arr_Default;
} }
/** /**
* Register all Settings Container for the Plugin Settings Page in the Dashboard. * Register all Settings Container for the Plugin Settings Page in the Dashboard.
* Settings Container Label will be the same as the Settings Container Name. * Settings Container Label will be the same as the Settings Container Name.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
*/ */
public function RegisterSettings() { public function RegisterSettings() {
// register all settings // register all settings
for ($i = 0; $i < count($this->a_arr_Container); $i++) { for ($i = 0; $i < count($this->a_arr_Container); $i++) {
register_setting($this->getContainer($i), $this->getContainer($i)); register_setting($this->getContainer($i), $this->getContainer($i));
} }
} }
} }

View file

@ -7,7 +7,11 @@
* @since 1.5.0 * @since 1.5.0
* *
* Edited for v2.0.0 and following. * Edited for v2.0.0 and following.
* Last modified 2020-11-01T0342+0100 *
* Edited for v2.0.5: Autoload / infinite scroll support added thanks to code from
* @docteurfitness <https://wordpress.org/support/topic/auto-load-post-compatibility-update/>
*
* Last modified 2020-11-05T0232+0100
*/ */
// If called directly, abort: // If called directly, abort:
@ -53,6 +57,18 @@ class MCI_Footnotes_Task {
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
*
* Edited for v2.0.5 2020-11-02T0330+0100 2020-11-04T2006+0100
*
* 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: <https://wordpress.org/support/topic/change-the-position-5/>
* Documentation: <https://codex.wordpress.org/Plugin_API/#Hook_in_your_Filter>
*
* But then, the blog engine calls this plugin in the editor, as reported in:
* <https://wordpress.org/support/topic/blogs-all-messed-up/>
* <https://wordpress.org/support/topic/change-the-position-5/#post-13612697>
*/ */
public function registerHooks() { public function registerHooks() {
// append custom css to the header // append custom css to the header
@ -309,8 +325,9 @@ class MCI_Footnotes_Task {
* @return string * @return string
*/ */
public function search($p_str_Content, $p_bool_ConvertHtmlChars, $p_bool_HideFootnotesText) { public function search($p_str_Content, $p_bool_ConvertHtmlChars, $p_bool_HideFootnotesText) {
// prepare prepending post ID to make footnote IDs unique wrt archive view: // post ID to make everything unique wrt archive view and infinite scroll
self::$a_str_Prefix = get_the_id() . '_'; global $l_int_PostID;
$l_int_PostID = get_the_id();
// contains the index for the next footnote on this page // contains the index for the next footnote on this page
$l_int_FootnoteIndex = count(self::$a_arr_Footnotes) + 1; $l_int_FootnoteIndex = count(self::$a_arr_Footnotes) + 1;
// contains the starting position for the lookup of a footnote // contains the starting position for the lookup of a footnote
@ -376,29 +393,35 @@ class MCI_Footnotes_Task {
if (is_int($l_int_MaxLength) && strlen($l_str_DummyText) > $l_int_MaxLength) { if (is_int($l_int_MaxLength) && strlen($l_str_DummyText) > $l_int_MaxLength) {
$l_str_ExcerptText = substr($l_str_DummyText, 0, $l_int_MaxLength); $l_str_ExcerptText = substr($l_str_DummyText, 0, $l_int_MaxLength);
$l_str_ExcerptText = substr($l_str_ExcerptText, 0, strrpos($l_str_ExcerptText, ' ')); $l_str_ExcerptText = substr($l_str_ExcerptText, 0, strrpos($l_str_ExcerptText, ' '));
$l_str_ExcerptText .= '&nbsp;&#x2026; ' . sprintf(__("%scontinue%s", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), '<a class="continue" href="#footnote_plugin_reference_' . self::$a_str_Prefix.$l_str_Index . '" onclick="footnote_moveToAnchor(\'footnote_plugin_reference_' . self::$a_str_Prefix . $l_str_Index . '\');">', '</a>'); // Removed hyperlink navigation on user request, but left <a> element for style.
$l_str_ExcerptText .= '&nbsp;&#x2026; ' . sprintf(__("%scontinue%s", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), '<a class="continue" onclick="footnote_moveToAnchor_' . $l_int_PostID . '(\'footnote_plugin_reference_' . $l_int_PostID . '_' . $l_str_Index . '\');">', '</a>');
} }
} }
// fill the footnotes template // fill the footnotes template templates/public/footnote.html
$l_obj_Template->replace( $l_obj_Template->replace(
array( array(
"id" => self::$a_str_Prefix . $l_str_Index, "post_id" => $l_int_PostID,
"index" => $l_str_Index, "id" => $l_str_Index,
"text" => MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED)) ? $l_str_ExcerptText : "", "before" => MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_STYLING_BEFORE),
"before" => MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_STYLING_BEFORE), "index" => $l_str_Index,
"after" => MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_STYLING_AFTER) "after" => MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_STYLING_AFTER),
"text" => MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED)) ? $l_str_ExcerptText : "",
) )
); );
$l_str_FootnoteReplaceText = $l_obj_Template->getContent(); $l_str_FootnoteReplaceText = $l_obj_Template->getContent();
// reset the template // reset the template
$l_obj_Template->reload(); $l_obj_Template->reload();
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED))) { if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED))) {
$l_int_OffsetY = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y)); $l_int_OffsetY = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y));
$l_int_OffsetX = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X)); $l_int_OffsetX = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X));
// fill in the tooltip template templates/public/tooltip.html
$l_obj_TemplateTooltip->replace( $l_obj_TemplateTooltip->replace(
array( array(
"id" => self::$a_str_Prefix . $l_str_Index, "post_id" => $l_int_PostID,
"id" => $l_str_Index,
"position" => MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION), "position" => MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION),
"offset-y" => !empty($l_int_OffsetY) ? $l_int_OffsetY : 0, "offset-y" => !empty($l_int_OffsetY) ? $l_int_OffsetY : 0,
"offset-x" => !empty($l_int_OffsetX) ? $l_int_OffsetX : 0 "offset-x" => !empty($l_int_OffsetX) ? $l_int_OffsetX : 0
@ -479,13 +502,14 @@ class MCI_Footnotes_Task {
} }
} }
} }
// replace all placeholders in the template // replace all placeholders in the template templates/public/reference-container-body.html
$l_obj_Template->replace( $l_obj_Template->replace(
array( array(
"index" => $l_str_FootnoteIndex, "post_id" => $l_int_PostID,
"id" => self::$a_str_Prefix . MCI_Footnotes_Convert::Index($l_str_FirstFootnoteIndex, MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE)), "id" => MCI_Footnotes_Convert::Index($l_str_FirstFootnoteIndex, MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE)),
"arrow" => $l_str_Arrow, "arrow" => $l_str_Arrow,
"text" => $l_str_FootnoteText "index" => $l_str_FootnoteIndex,
"text" => $l_str_FootnoteText
) )
); );
// extra line breaks for page source legibility: // extra line breaks for page source legibility:
@ -495,15 +519,15 @@ class MCI_Footnotes_Task {
$l_obj_Template->reload(); $l_obj_Template->reload();
} }
// load template file // load template file templates/public/reference-container.html
$l_obj_TemplateContainer = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_PUBLIC, "reference-container"); $l_obj_TemplateContainer = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_PUBLIC, "reference-container");
$l_obj_TemplateContainer->replace( $l_obj_TemplateContainer->replace(
array( array(
"label" => MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_NAME), "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;' : '', "button-style" => !MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_REFERENCE_CONTAINER_COLLAPSE)) ? 'display: none;' : '',
"id" => "footnote_references_container", "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
"content" => $l_str_Body
) )
); );

View file

@ -4,8 +4,9 @@
* Created-Date: 15.05.14 * Created-Date: 15.05.14
* Created-Time: 16:21 * Created-Time: 16:21
* Since: 1.0 * Since: 1.0
* Version: 2.0.4 * Version: 2.0.6
* Last modified: 2020-11-01T0536+0100 *
* Last modified: 2020-11-04T2131+0100
*/ */
@ -37,9 +38,6 @@
*/ */
.footnote_plugin_tooltip_text { .footnote_plugin_tooltip_text {
vertical-align: top !important;
position: relative !important;
top: 0.6em !important;
cursor: pointer; cursor: pointer;
z-index: 1; z-index: 1;
} }
@ -63,6 +61,7 @@ span.footnote_tooltip {
font-style: italic; font-style: italic;
color: green; color: green;
text-decoration: none !important; text-decoration: none !important;
cursor: pointer;
} }
.continue:hover { .continue:hover {
color: blue; color: blue;
@ -72,11 +71,6 @@ span.footnote_tooltip {
/* Footnotes reference container /* Footnotes reference container
*/ */
.footnote-reference-container {
width: 100%;
border: none;
}
/* label */ /* label */
.footnote_container_prepare { .footnote_container_prepare {
display: block !important; display: block !important;
@ -105,30 +99,41 @@ span.footnote_tooltip {
} }
/* collapse button */ /* collapse button */
#footnote_reference_container_collapse_button { /* fully clickable, not sign only */
.footnote_reference_container_collapse_button {
cursor: pointer; cursor: pointer;
} }
.footnote_container_prepare > p > span:last-child a { .footnote_container_prepare > p > span:last-child a {
text-decoration: none; text-decoration: none !important;
} }
.footnote_container_prepare > p > span:last-child a:hover { .footnote_container_prepare > p > span:last-child a:hover {
text-decoration: underline; text-decoration: underline;
color: #008800; color: #008800;
} }
/* footnotes */ /* Table starts here */
.footnote-reference-container {
width: 100%;
border: none;
}
/* footnotes
* class footnote_plugin_link is for backcompat.
* Used in reference-container-body.html
* See <https://wordpress.org/support/topic/change-the-position-5/#post-13617988>
.footnote_plugin_link, */
.footnote_plugin_index, .footnote_plugin_index,
.footnote_plugin_text { .footnote_plugin_text {
border:none !important; border:none !important;
text-align: left; text-align: left !important;
vertical-align: top; vertical-align: top !important;
padding: 10px 3px 5px 0; padding: 10px 5px 5px 0 !important;
} }
.footnote_plugin_index a, .footnote_plugin_index a,
.footnote_plugin_text a { .footnote_plugin_text a {
text-decoration: none; text-decoration: none !important;
} }
.footnote_plugin_index a:hover, .footnote_plugin_index:hover,
.footnote_plugin_text a:hover { .footnote_plugin_text a:hover {
text-decoration: underline !important; text-decoration: underline !important;
} }
@ -139,10 +144,16 @@ span.footnote_tooltip {
word-wrap: normal !important; word-wrap: normal !important;
word-break: unset; word-break: unset;
word-break: keep-all !important; word-break: keep-all !important;
white-space: nowrap;
max-width: 140px; max-width: 140px;
width: 1px; /*auto-extending column to fit widest*/
white-space: nowrap;
overflow: hidden; overflow: hidden;
} }
.footnote_plugin_text {
width: unset; /*unset width of text column to fix site issues*/
}
/* Responsive*/
@media only screen and (max-width: 768px) { @media only screen and (max-width: 768px) {
.footnote_plugin_index { .footnote_plugin_index {
max-width: 100px; max-width: 100px;
@ -152,28 +163,18 @@ span.footnote_tooltip {
/* Footnotes printing style rules /* Footnotes printing style rules
* *
* Printing a table, browsers tend to avoid page breaks, * Printing a table, browsers tend to avoid page breaks,
* but it takes a wrapper to avoid a page break before the table * but it takes a wrapper to avoid a page break before the table.
*
* UI elements (button, arrows) and link styling are removed.
*/ */
.footnote_container_overall_wrapper { .footnote_container_overall_wrapper {
page-break-inside: avoid; page-break-inside: avoid;
} }
.footnote_container_prepare {
page-break-after: avoid;
}
table.footnote_reference_container td {
display: block;
}
table.footnote_reference_container {
page-break-before: avoid;
page-break-inside: auto;
}
table.footnote_reference_container tr {
page-break-before: auto;
}
@media print { @media print {
.footnote_tooltip, .footnote_tooltip,
.footnote_reference_container_collapse_button_outfit, .footnote_reference_container_collapse_button,
.footnote_plugin_index_arrow { .footnote_plugin_index_arrow {
display: none; display: none;
} }
@ -184,7 +185,7 @@ table.footnote_reference_container tr {
color: inherit; color: inherit;
text-decoration: none !important; text-decoration: none !important;
} }
div.post-meta-edit-link-wrapper { /*hides the Edit button in WP2020*/ div.post-meta-edit-link-wrapper { /* Edit button in WP2020*/
display: none; /*(added as a service)*/ display: none; /*(added as a service)*/
} }
} }

View file

@ -1,29 +1,29 @@
<?php <?php
/* /*
Plugin Name: footnotes Plugin Name: footnotes
Plugin URI: https://wordpress.org/plugins/footnotes/ 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. 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 Author: Mark Cheret
Version: 2.0.4 Version: 2.0.4
Author URI: http://cheret.de/plugins/footnotes-2/ Author URI: http://cheret.de/plugins/footnotes-2/
Text Domain: footnotes Text Domain: footnotes
Domain Path: /languages Domain Path: /languages
*/ */
/* /*
Copyright 2020 Mark Cheret (email: mark@cheret.de) Copyright 2020 Mark Cheret (email: mark@cheret.de)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 3, as it under the terms of the GNU General Public License, version 3, as
published by the Free Software Foundation. published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
/** /**

Binary file not shown.

View file

@ -5,7 +5,7 @@ msgstr ""
"Project-Id-Version: footnotes\n" "Project-Id-Version: footnotes\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/footnotes\n" "Report-Msgid-Bugs-To: http://wordpress.org/tag/footnotes\n"
"POT-Creation-Date: 2014-10-18 20:58+0100\n" "POT-Creation-Date: 2014-10-18 20:58+0100\n"
"PO-Revision-Date: 2020-11-01T1640+0100\n" "PO-Revision-Date: 2020-11-04T2152+0100\n"
"Last-Translator: @pewgeuges\n" "Last-Translator: @pewgeuges\n"
"Language-Team: SHE <s.herndler@methis.at>\n" "Language-Team: SHE <s.herndler@methis.at>\n"
"Language: en_GB\n" "Language: en_GB\n"
@ -348,7 +348,7 @@ msgstr "Vertical offset downwards"
#: class/dashboard/subpage-main.php:335 #: class/dashboard/subpage-main.php:335
msgid "Offset (Y axis) in px (may be negative)" msgid "Offset (Y axis) in px (may be negative)"
msgstr "pixels; negative value for a upwards offset" msgstr "pixels; negative value for an upwards offset"
#: class/dashboard/subpage-main.php:337 #: class/dashboard/subpage-main.php:337
msgid "Color" msgid "Color"

Binary file not shown.

View file

@ -5,7 +5,7 @@ msgstr ""
"Project-Id-Version: footnotes\n" "Project-Id-Version: footnotes\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/footnotes\n" "Report-Msgid-Bugs-To: http://wordpress.org/tag/footnotes\n"
"POT-Creation-Date: 2014-10-18 20:59+0100\n" "POT-Creation-Date: 2014-10-18 20:59+0100\n"
"PO-Revision-Date: 2020-11-01T1641+0100\n" "PO-Revision-Date: 2020-11-04T2153+0100\n"
"Last-Translator: @pewgeuges\n" "Last-Translator: @pewgeuges\n"
"Language-Team: SHE <s.herndler@methis.at>\n" "Language-Team: SHE <s.herndler@methis.at>\n"
"Language: en_US\n" "Language: en_US\n"
@ -348,7 +348,7 @@ msgstr "Vertical offset downwards"
#: class/dashboard/subpage-main.php:335 #: class/dashboard/subpage-main.php:335
msgid "Offset (Y axis) in px (may be negative)" msgid "Offset (Y axis) in px (may be negative)"
msgstr "pixels; negative value for a upwards offset" msgstr "pixels; negative value for an upwards offset"
#: class/dashboard/subpage-main.php:337 #: class/dashboard/subpage-main.php:337
msgid "Color" msgid "Color"

View file

@ -80,11 +80,28 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
== Changelog == == Changelog ==
= 2.0.5rc0 =
- Update: Autoload / infinite scroll support added thanks to @docteurfitness <https://wordpress.org/support/topic/auto-load-post-compatibility-update/>
- Bugfix: Settings style sheet unenqueued to fix input boxes on public pages (enqueued for 2.0.4)
- Bugfix: Public style sheet: Footnote referrers: deleted vertical align tweaks for cross-theme and user agent compatibility
- Bugfix: Public style sheet: Reference container: auto-extending column to fit widest, to fix display with short note texts
- Bugfix: Public style sheet: Reference container: IDs: slightly increased left padding
- Bugfix: Public style sheet: Reference container: unset width of text column to fix site issues
- Update: Enable all hooks by default to prevent footnotes from seeming broken in post titles
- Bugfix: Restore cursor shape pointer over 'Continue reading' button after hyperlink removal
- Update: Tooltip infobox: set display predelay to 0 for responsiveness (was 800 since 2.0.0, 400 before)
- Bugfix: Reference container: collapse button fully clickable, not sign only
- Bugfix: Reference container: collapse button 'collapse' with minus sign not hyphen-minus
- Bugfix: Translations: Spelling error in en_GB and en_US
= 2.0.4 = = 2.0.4 =
- Update: Restored arrow settings to customize or disable the now prepended arrow symbol - Update: Restored arrow settings to customize or disable the now prepended arrow symbol
- Update: GDPR: Added jQuery UI from WordPress instead of third party
- Bugfix: UX: Removed hyperlink addresses from referrers and backlinks wrt browsing history
- Bugfix: Reference container: layout: removed inconvenient left/right cellpadding - Bugfix: Reference container: layout: removed inconvenient left/right cellpadding
- Bugfix: Tooltip infobox: improved layout with inherited font size by lower line height - Bugfix: Tooltip infobox: improved layout with inherited font size by lower line height
- Bugfix: Tooltip infobox: 'Continue reading' button: disabled default underline - Bugfix: Tooltip infobox: 'Continue reading' button: disabled default underline
- Bugfix: Translations: reviewed all locales (en, de, es, fr), synced ref line # with edited code
- Bugfix: Fixed display of 2 dashboard headings - Bugfix: Fixed display of 2 dashboard headings
= 2.0.3 = = 2.0.3 =

View file

@ -1,2 +1,13 @@
<a href="#footnote_plugin_reference_[[id]]"><sup id="footnote_plugin_tooltip_[[id]]" class="footnote_plugin_tooltip_text" onclick="footnote_moveToAnchor('footnote_plugin_reference_[[id]]');">[[before]][[index]][[after]]</sup></a> <a
<span class="footnote_tooltip" id="footnote_plugin_tooltip_text_[[id]]">[[text]]</span> ><sup
id="footnote_plugin_tooltip_[[post_id]]_[[id]]"
class="footnote_plugin_tooltip_text"
onclick="footnote_moveToAnchor_[[post_id]]('footnote_plugin_reference_[[post_id]]_[[id]]');"
>[[before]][[index]][[after]]</sup
></a
>
<span
class="footnote_tooltip"
id="footnote_plugin_tooltip_text_[[post_id]]_[[id]]"
>[[text]]</span
>

View file

@ -1,4 +1,15 @@
<tr> <tr>
<td class="footnote_plugin_index" id="footnote_plugin_reference_[[id]]" onclick="footnote_moveToAnchor('footnote_plugin_tooltip_[[id]]');"><a href="#footnote_plugin_tooltip_[[id]]"><span class="footnote_plugin_index_arrow">[[arrow]]&#x200A;</span>[[index]].</a></td> <td
<td class="footnote_plugin_text">[[text]]</td> class="footnote_plugin_index footnote_plugin_link"
id="footnote_plugin_reference_[[post_id]]_[[id]]"
onclick="footnote_moveToAnchor_[[post_id]]('footnote_plugin_tooltip_[[post_id]]_[[id]]');"
><a
><span
class="footnote_plugin_index_arrow"
>[[arrow]]&#x200A;</span
>[[index]].</a
></td>
<td
class="footnote_plugin_text"
>[[text]]</td>
</tr> </tr>

View file

@ -1,47 +1,51 @@
<div class="footnote_container_overall_wrapper"> <div class="footnote_container_overall_wrapper">
<div class="footnote_container_prepare"> <div class="footnote_container_prepare">
<p><span <p><span
onclick="footnote_expand_reference_container();" onclick="footnote_expand_reference_container_[[post_id]]();"
>[[label]]</span><span >[[label]]</span
class="footnote_reference_container_collapse_button_outfit" ><span
style="[[button-style]]" class="footnote_reference_container_collapse_button"
>&nbsp;&nbsp;&nbsp;[ <a style="[[button-style]]"
id="footnote_reference_container_collapse_button" onclick="footnote_expand_collapse_reference_container_[[post_id]]();"
onclick="footnote_expand_collapse_reference_container();" >&nbsp;&nbsp;&nbsp;[<a
>+</a> ]</span></p> id="footnote_reference_container_collapse_button_[[post_id]]"
</div> > + </a
<div id="[[id]]" style="[[style]]"> >]</span
<table class="footnote-reference-container"> ></p
<tbody> >
[[content]] </div>
</tbody> <div id="footnote_references_container_[[post_id]]" style="[[style]]">
</table> <table class="footnote-reference-container">
</div> <tbody>
[[content]]
</tbody>
</table>
</div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
function footnote_expand_reference_container() { function footnote_expand_reference_container_[[post_id]]() {
jQuery('#[[id]]').show(); jQuery('#footnote_references_container_[[post_id]]').show();
jQuery('#footnote_reference_container_collapse_button').text('-'); jQuery('#footnote_reference_container_collapse_button_[[post_id]]').text(' ');
} }
function footnote_collapse_reference_container() { function footnote_collapse_reference_container_[[post_id]]() {
jQuery('#[[id]]').hide(); jQuery('#footnote_references_container_[[post_id]]').hide();
jQuery('#footnote_reference_container_collapse_button').text('+'); jQuery('#footnote_reference_container_collapse_button_[[post_id]]').text(' + ');
} }
function footnote_expand_collapse_reference_container() { function footnote_expand_collapse_reference_container_[[post_id]]() {
if (jQuery('#[[id]]').is(':hidden')) { if (jQuery('#footnote_references_container_[[post_id]]').is(':hidden')) {
footnote_expand_reference_container(); footnote_expand_reference_container_[[post_id]]();
} else { } else {
footnote_collapse_reference_container(); footnote_collapse_reference_container_[[post_id]]();
} }
} }
function footnote_moveToAnchor(p_str_TargetID) { function footnote_moveToAnchor_[[post_id]](p_str_TargetID) {
footnote_expand_reference_container(); footnote_expand_reference_container_[[post_id]]();
var l_obj_Target = jQuery('#' + p_str_TargetID); var l_obj_Target = jQuery('#' + p_str_TargetID);
if (l_obj_Target.length) { if (l_obj_Target.length) {
jQuery('html, body').animate({ jQuery('html, body').animate({
scrollTop: l_obj_Target.offset().top - window.innerHeight * 0.12 scrollTop: l_obj_Target.offset().top - window.innerHeight * 0.50
}, },
80); 870);/*speed*/
} }
} }
</script> </script>

View file

@ -1 +1,13 @@
<script type="text/javascript"> jQuery("#footnote_plugin_tooltip_[[id]]").tooltip({ tip: "#footnote_plugin_tooltip_text_[[id]]", tipClass: "footnote_tooltip", effect: "fade", predelay: 800, fadeInSpeed: 200, fadeOutSpeed: 2000, position: "[[position]]", relative: true, offset: [[[offset-y]], [[offset-x]]] }); </script> <script type="text/javascript">
jQuery('#footnote_plugin_tooltip_[[post_id]]_[[id]]').tooltip({
tip: '#footnote_plugin_tooltip_text_[[post_id]]_[[id]]',
tipClass: 'footnote_tooltip',
effect: 'fade',
predelay: 0,
fadeInSpeed: 200,
fadeOutSpeed: 200,
position: '[[position]]',
relative: true,
offset: [[[offset-y]], [[offset-x]]],
});
</script>