diff --git a/css/footnote.css b/css/footnote.css index 0da2aa8..d451bdf 100755 --- a/css/footnote.css +++ b/css/footnote.css @@ -31,11 +31,10 @@ } .footnote_container_prepare > p { - font-size: 1.5em !important; + line-height: 1.3 !important; margin-top: 1em !important; margin-bottom: 0.25em !important; padding: 0 !important; - line-height: 1.3 !important; font-weight: normal !important; overflow: hidden !important; border-bottom: 1px solid #aaaaaa !important; @@ -45,12 +44,17 @@ -webkit-margin-start: 0px !important; -webkit-margin-end: 0px !important; text-align: left !important; + vertical-align: middle; } .footnote_container_prepare > p > span:first-child { padding-left: 20px !important; text-align: left !important; cursor: pointer; + font-size: 1.5em !important; +} + +.footnote_container_prepare > p > span:last-child { } .footnote_hide_box { diff --git a/includes/replacer.php b/includes/replacer.php index ba0d961..731d7e5 100644 --- a/includes/replacer.php +++ b/includes/replacer.php @@ -64,7 +64,7 @@ function footnotes_Replacer_Content($p_str_Content) /* get setting for 'display reference container position' */ $l_str_ReferenceContainerPosition = $g_arr_FootnotesSettings[FOOTNOTE_INPUTFIELD_REFERENCE_CONTAINER_PLACE]; /* returns content */ - return footnotes_replaceFootnotes($p_str_Content, $l_str_ReferenceContainerPosition == "post_end" ? true : false); + return footnotes_replaceFootnotes($p_str_Content, $l_str_ReferenceContainerPosition == "post_end" ? true : false, false, true); } /** @@ -81,7 +81,7 @@ function footnotes_Replacer_Excerpt($p_str_Content) $l_bool_SearchExcerpt = footnotes_ConvertToBool($g_arr_FootnotesSettings[FOOTNOTE_INPUTFIELD_SEARCH_IN_EXCERPT]); /* search in the excerpt only if activated */ if ($l_bool_SearchExcerpt) { - return footnotes_replaceFootnotes($p_str_Content, false); + return footnotes_replaceFootnotes($p_str_Content, false, false, true); } /* returns content */ return $p_str_Content; @@ -112,7 +112,7 @@ function footnotes_Replacer_WidgetText($p_str_Content) /* get setting for 'display reference container position' */ $l_str_ReferenceContainerPosition = $g_arr_FootnotesSettings[FOOTNOTE_INPUTFIELD_REFERENCE_CONTAINER_PLACE]; /* returns content */ - return footnotes_replaceFootnotes($p_str_Content, $l_str_ReferenceContainerPosition == "post_end" ? true : false); + return footnotes_replaceFootnotes($p_str_Content, $l_str_ReferenceContainerPosition == "post_end" ? true : false, false, false); } /** @@ -181,18 +181,19 @@ function footnotes_LoveAndShareMe() * @since 1.0 * @param string $p_str_Content * @param bool $p_bool_OutputReferences [default: true] - * @param bool $p_bool_ReplaceHtmlChars [ default: false] + * @param bool $p_bool_ReplaceHtmlCharsSettings [ default: false] + * @param bool $p_bool_ReplaceHtmlCharsContent [ default: false] * @return string */ -function footnotes_replaceFootnotes($p_str_Content, $p_bool_OutputReferences = true, $p_bool_ReplaceHtmlChars = false) +function footnotes_replaceFootnotes($p_str_Content, $p_bool_OutputReferences = true, $p_bool_ReplaceHtmlCharsSettings = false, $p_bool_ReplaceHtmlCharsContent = false) { /* access to the global settings collection */ global $g_arr_FootnotesSettings; /* load footnote settings */ - $g_arr_FootnotesSettings = footnotes_filter_options(FOOTNOTE_SETTINGS_CONTAINER, Class_FootnotesSettings::$a_arr_Default_Settings, $p_bool_ReplaceHtmlChars); + $g_arr_FootnotesSettings = footnotes_filter_options(FOOTNOTE_SETTINGS_CONTAINER, Class_FootnotesSettings::$a_arr_Default_Settings, $p_bool_ReplaceHtmlCharsSettings); /* replace all footnotes in the content */ - $p_str_Content = footnotes_getFromString($p_str_Content); + $p_str_Content = footnotes_getFromString($p_str_Content, $p_bool_ReplaceHtmlCharsContent); /* add the reference list if set */ if ($p_bool_OutputReferences) { @@ -217,9 +218,10 @@ function footnotes_replaceFootnotes($p_str_Content, $p_bool_OutputReferences = t * using a personal starting and ending tag for the footnotes since 1.0-gamma * @since 1.0 * @param string $p_str_Content + * @param bool $p_bool_ConvertHtmlChars * @return string */ -function footnotes_getFromString($p_str_Content) +function footnotes_getFromString($p_str_Content, $p_bool_ConvertHtmlChars = true) { /* get access to the global array to store footnotes */ global $g_arr_Footnotes; @@ -246,8 +248,10 @@ function footnotes_getFromString($p_str_Content) } /* decode html special chars */ - $l_str_StartingTag = htmlspecialchars($l_str_StartingTag); - $l_str_EndingTag = htmlspecialchars($l_str_EndingTag); + if ($p_bool_ConvertHtmlChars) { + $l_str_StartingTag = htmlspecialchars($l_str_StartingTag); + $l_str_EndingTag = htmlspecialchars($l_str_EndingTag); + } /* check for a footnote placeholder in the current page */ do { @@ -324,12 +328,11 @@ function footnotes_OutputReferenceContainer() */ $l_str_CollapseButtons = ""; if ($l_bool_CollapseReference) { - $l_str_CollapseButtons = '   [ + ] ' . - ' [ - ]'; + $l_str_CollapseButtons = '   [ + ]'; } /* output string, prepare it with the reference label as headline */ - $l_str_Output = '

' . $l_str_ReferencesLabel . '' .$l_str_CollapseButtons . '

'; + $l_str_Output = '

' . $l_str_ReferencesLabel . '' .$l_str_CollapseButtons . '

'; /* add a box around the footnotes */ $l_str_Output .= '
'; diff --git a/readme.txt b/readme.txt index 1653312..821fb8d 100755 --- a/readme.txt +++ b/readme.txt @@ -66,6 +66,7 @@ No, this Plugin has been written from scratch. Of course some inspirations on ho - Feature: The admin can decide which "I love footnotes" text (or not text) will be displayed in the footer - Add: Buttons next to the reference label to expand/collapse the reference container if set to "collapse by default" - Bugfix: Replace footnote short code +- Update: Combined buttons for the "collapse/expand" reference container = 1.2.1 = - Bugfix: HowTo example will be displayed correctly if a user defined short code is set