- Add: Buttons next to the reference label to expand/collapse the reference container if set to "collapse by default"

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@921840 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
Aricura 2014-05-27 19:22:47 +00:00
parent c908a92b38
commit 673ce6b18c
3 changed files with 16 additions and 2 deletions

View file

@ -47,7 +47,7 @@
text-align: left !important;
}
.footnote_container_prepare > p > span {
.footnote_container_prepare > p > span:first-child {
padding-left: 20px !important;
text-align: left !important;
cursor: pointer;

View file

@ -317,8 +317,18 @@ function footnotes_OutputReferenceContainer()
/*get footnote counter style */
$l_str_CounterStyle = $g_arr_FootnotesSettings[FOOTNOTE_INPUTFIELD_COUNTER_STYLE];
/*
* add expand/collapse buttons to the reference label if collapsed by default
* @since 1.2.2
*/
$l_str_CollapseButtons = "";
if ($l_bool_CollapseReference) {
$l_str_CollapseButtons = '&nbsp;&nbsp;&nbsp;[ <a style="cursor:pointer;" onclick="footnote_expand_reference_container();">+</a> ] ' .
' [ <a style="cursor:pointer;" onclick="footnote_collapse_reference_container();">-</a> ]';
}
/* output string, prepare it with the reference label as headline */
$l_str_Output = '<div class="footnote_container_prepare"><p><span onclick="footnote_expand_reference_container(\"\");">' . $l_str_ReferencesLabel . '</span></p></div>';
$l_str_Output = '<div class="footnote_container_prepare"><p><span onclick="footnote_expand_reference_container();">' . $l_str_ReferencesLabel . '</span>' .$l_str_CollapseButtons . '</p></div>';
/* add a box around the footnotes */
$l_str_Output .= '<div id="' . FOOTNOTE_REFERENCES_CONTAINER_ID . '"';
/* add class to hide the references by default, if the user wants it */
@ -378,6 +388,9 @@ function footnotes_OutputReferenceContainer()
jQuery(p_str_ID).focus();
}
}
function footnote_collapse_reference_container() {
jQuery("#' . FOOTNOTE_REFERENCES_CONTAINER_ID . '").hide();
}
</script>
';

View file

@ -64,6 +64,7 @@ No, this Plugin has been written from scratch. Of course some inspirations on ho
= 1.2.2 =
- Bugfix: WYSIWYG editor and plain text editor buttons insert footnote short code correctly (also if defined like html tag)
- 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"
= 1.2.1 =
- Bugfix: HowTo example will be displayed correctly if a user defined short code is set