From 4461aaaf270dfa5f56d350bce7f771206c211f55 Mon Sep 17 00:00:00 2001 From: Aricura Date: Thu, 12 Jun 2014 19:12:14 +0000 Subject: [PATCH] - Bugfix: Styling of the reference container when the footnote text was too long (thanks to Willem Braak, ???) - Bugfix: Added a Link to the footnote text in the reference container back to the footnote index in the page content (thanks to Willem Braak, ???) git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@931384 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- classes/footnotes_settings.php | 32 +++++++++++++------------------- css/footnote.css | 12 +++++++----- includes/replacer.php | 2 +- readme.txt | 2 ++ templates/footnote.html | 5 ++--- 5 files changed, 25 insertions(+), 28 deletions(-) diff --git a/classes/footnotes_settings.php b/classes/footnotes_settings.php index d341ab2..a156dde 100644 --- a/classes/footnotes_settings.php +++ b/classes/footnotes_settings.php @@ -57,13 +57,8 @@ class Class_FootnotesSettings /* loads and filters the settings for this plugin */ $this->a_arr_Options = footnotes_filter_options(FOOTNOTE_SETTINGS_CONTAINER, self::$a_arr_Default_Settings, true); - /* register public stylesheet */ - wp_register_style('footnote_public_style', plugins_url('../css/footnote.css', __FILE__)); - /* add public stylesheet */ - wp_enqueue_style('footnote_public_style'); - /* execute class includes on action-even: init, admin_init and admin_menu */ - //add_action('init', array($this, 'LoadScriptsAndStylesheets')); + add_action('init', array($this, 'LoadScriptsAndStylesheets')); add_action('admin_init', array($this, 'RegisterSettings')); add_action('admin_init', array($this, 'RegisterTab_General')); @@ -79,18 +74,10 @@ class Class_FootnotesSettings */ function LoadScriptsAndStylesheets() { - /* add the jQuery plugin (already registered by WP) */ - wp_enqueue_script('jquery'); - /* register public stylesheet */ - //wp_register_style('footnote_public_style', plugins_url('../css/footnote.css', __FILE__)); - /* add public stylesheet */ - //wp_enqueue_style('footnote_public_style'); - /* register settings stylesheet */ - wp_register_style('footnote_settings_style', plugins_url('../css/settings.css', __FILE__)); - /* add settings stylesheet */ - wp_enqueue_style('footnote_settings_style'); - /* Needed to allow metabox layout and close functionality */ - wp_enqueue_script('postbox'); + /* register public stylesheet */ + wp_register_style('footnote_public_style', plugins_url('../css/footnote.css', __FILE__)); + /* add public stylesheet */ + wp_enqueue_style('footnote_public_style'); } /** @@ -131,7 +118,14 @@ class Class_FootnotesSettings */ function OutputSettingsPage() { - $this->LoadScriptsAndStylesheets(); + /* add the jQuery plugin (already registered by WP) */ + wp_enqueue_script('jquery'); + /* register settings stylesheet */ + wp_register_style('footnote_settings_style', plugins_url('../css/settings.css', __FILE__)); + /* add settings stylesheet */ + wp_enqueue_style('footnote_settings_style'); + /* Needed to allow metabox layout and close functionality */ + wp_enqueue_script('postbox'); /* gets active tag, or if nothing set the "general" tab will be set to active */ $l_str_tab = isset($_GET['tab']) ? $_GET['tab'] : FOOTNOTE_SETTINGS_LABEL_GENERAL; /* outputs all tabs */ diff --git a/css/footnote.css b/css/footnote.css index d29187e..d92030b 100755 --- a/css/footnote.css +++ b/css/footnote.css @@ -70,16 +70,18 @@ /* footnote (bottom) index */ .footnote_plugin_index { - float: left !important; + /*float: left !important;*/ min-width: 40px !important; white-space: nowrap !important; text-align: right !important; + display: inline-block; } /* footnote (bottom) text */ .footnote_plugin_text { - float: left !important; + /*float: left !important;*/ padding-left: 16px !important; + display: inline-block; } /* footnote (bottom) link to the footnote implementation */ @@ -96,12 +98,12 @@ /* footnote (bottom) styling end tag */ .footnote_plugin_end { - clear: left !important; + /*clear: left !important;*/ } /* tooltip */ -.footnote_plugin_tooltip { - outline: none !important; +.footnote_plugin_tooltip, .footnote_plugin_tooltip a { + /*outline: none !important;*/ /*color: #4777ff !important;*/ text-decoration: none !important; cursor: pointer !important; diff --git a/includes/replacer.php b/includes/replacer.php index 49568b9..be4f400 100644 --- a/includes/replacer.php +++ b/includes/replacer.php @@ -361,7 +361,7 @@ function footnotes_OutputReferenceContainer() /* get all footnotes that I haven't passed yet */ for ($l_str_CheckIndex = $l_str_FirstFootnoteIndex; $l_str_CheckIndex < count($g_arr_Footnotes); $l_str_CheckIndex++) { /* check if a further footnote is the same as the actual one */ - if ($l_str_FootnoteText == $g_arr_Footnotes[$l_str_CheckIndex]) { + if ($l_str_FootnoteText == $g_arr_Footnotes[$l_str_CheckIndex] && !empty($g_arr_Footnotes[$l_str_CheckIndex])) { /* set the further footnote as empty so it won't be displayed later */ $g_arr_Footnotes[$l_str_CheckIndex] = ""; /* add the footnote index to the actual index */ diff --git a/readme.txt b/readme.txt index 3ff4e6c..fc4f79f 100755 --- a/readme.txt +++ b/readme.txt @@ -66,6 +66,8 @@ No, this Plugin has been written from scratch. Of course some inspirations on ho = 1.2.4 = - Bugfix: CSS stylesheets will only be added in FootNotes settings page, nowhere else (thanks to Piet Bos, China) +- Bugfix: Styling of the reference container when the footnote text was too long (thanks to Willem Braak, ???) +- Bugfix: Added a Link to the footnote text in the reference container back to the footnote index in the page content (thanks to Willem Braak, ???) = 1.2.3 = - Bugfix: Removed 'Warning output' of Plugins activation and deactivation function (thanks to Piet Bos, China) diff --git a/templates/footnote.html b/templates/footnote.html index 63da890..e6ccc02 100755 --- a/templates/footnote.html +++ b/templates/footnote.html @@ -1,6 +1,5 @@ - - [[FOOTNOTE INDEX]]) + + [[FOOTNOTE INDEX]]) [[FOOTNOTE TEXT]]