Release version 1.6.0
- **IMPORTANT**: Improved performance. You need to Activate the Plugin again. (Settings won't change!) - Add: Setting to customize the mouse-over box shadow - Add: Translation: United States - Add: Translation: Austria - Add: Translation: Spanish (many thanks to Pablo L.) - Update: Translations (de_DE and en_GB) - Update: Changed Plugins init file name to improve performance (Re-activation of the Plugin is required) - Update: ManFisher note styling - Update: Tested with latest nightly build of WordPress 4.1 - Bugfix: Avoid multiple IDs for footnotes when multiple reference containers are displayed git-svn-id: https://plugins.svn.wordpress.org/footnotes/tags/1.6.0@1009660 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
parent
b183563518
commit
a462db714e
28 changed files with 2191 additions and 200 deletions
|
@ -34,6 +34,15 @@ class MCI_Footnotes_Task {
|
|||
*/
|
||||
public static $a_bool_AllowLoveMe = true;
|
||||
|
||||
/**
|
||||
* Prefix for the Footnote html element ID.
|
||||
*
|
||||
* @author Stefan Herndler
|
||||
* @since 1.5.8
|
||||
* @var string
|
||||
*/
|
||||
public static $a_str_Prefix = "";
|
||||
|
||||
/**
|
||||
* Register WordPress Hooks to replace Footnotes in the content of a public page.
|
||||
*
|
||||
|
@ -83,29 +92,34 @@ class MCI_Footnotes_Task {
|
|||
$l_str_BorderColor = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BORDER_COLOR);
|
||||
$l_int_BorderRadius = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_RADIUS);
|
||||
$l_int_MaxWidth = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_MAX_WIDTH);
|
||||
$l_str_BoxShadowColor = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_SHADOW_COLOR);
|
||||
?>
|
||||
<style type="text/css" media="screen">
|
||||
<?php
|
||||
echo MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_CUSTOM_CSS);
|
||||
echo '.footnote_tooltip { display: none; padding: 12px; font-size: 13px; -moz-box-shadow: 2px 2px 11px #666; -webkit-box-shadow: 2px 2px 11px #666;';
|
||||
echo '.footnote_tooltip { display: none; padding: 12px; font-size: 13px;';
|
||||
if (!empty($l_str_Color)) {
|
||||
echo ' color: ' . $l_str_Color . ';';
|
||||
printf(" color: %s;", $l_str_Color);
|
||||
}
|
||||
if (!empty($l_str_Background)) {
|
||||
echo ' background-color: ' . $l_str_Background . ';';
|
||||
printf(" background-color: %s;", $l_str_Background);
|
||||
}
|
||||
if (!empty($l_int_BorderWidth) && intval($l_int_BorderWidth) > 0) {
|
||||
echo ' border-width: ' . $l_int_BorderWidth . 'px;';
|
||||
echo ' border-style: solid;';
|
||||
printf(" border-width: %dpx; border-style: solid;", $l_int_BorderWidth);
|
||||
}
|
||||
if (!empty($l_str_BorderColor)) {
|
||||
echo ' border-color: ' . $l_str_BorderColor . ';';
|
||||
printf(" border-color: %s;", $l_str_BorderColor);
|
||||
}
|
||||
if (!empty($l_int_BorderRadius) && intval($l_int_BorderRadius) > 0) {
|
||||
echo ' border-radius: ' . $l_int_BorderRadius . 'px;';
|
||||
printf(" border-radius: %dpx;", $l_int_BorderRadius);
|
||||
}
|
||||
if (!empty($l_int_MaxWidth) && intval($l_int_MaxWidth) > 0) {
|
||||
echo ' max-width: ' . $l_int_MaxWidth . 'px;';
|
||||
printf(" max-width: %dpx;", $l_int_MaxWidth);
|
||||
}
|
||||
if (!empty($l_str_BoxShadowColor)) {
|
||||
printf(" -webkit-box-shadow: 2px 2px 11px %s;", $l_str_BoxShadowColor);
|
||||
printf(" -moz-box-shadow: 2px 2px 11px %s;", $l_str_BoxShadowColor);
|
||||
printf(" box-shadow: 2px 2px 11px %s;", $l_str_BoxShadowColor);
|
||||
}
|
||||
echo '}';
|
||||
?>
|
||||
|
@ -360,6 +374,7 @@ class MCI_Footnotes_Task {
|
|||
// fill the footnotes template
|
||||
$l_obj_Template->replace(
|
||||
array(
|
||||
"id" => self::$a_str_Prefix . $l_str_Index,
|
||||
"index" => $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),
|
||||
|
@ -370,7 +385,16 @@ class MCI_Footnotes_Task {
|
|||
// reset the template
|
||||
$l_obj_Template->reload();
|
||||
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED))) {
|
||||
$l_obj_TemplateTooltip->replace(array("index" => $l_str_Index));
|
||||
$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_obj_TemplateTooltip->replace(
|
||||
array(
|
||||
"id" => self::$a_str_Prefix . $l_str_Index,
|
||||
"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-x" => !empty($l_int_OffsetX) ? $l_int_OffsetX : 0
|
||||
)
|
||||
);
|
||||
$l_str_FootnoteReplaceText .= $l_obj_TemplateTooltip->getContent();
|
||||
$l_obj_TemplateTooltip->reload();
|
||||
}
|
||||
|
@ -449,7 +473,7 @@ class MCI_Footnotes_Task {
|
|||
$l_obj_Template->replace(
|
||||
array(
|
||||
"index" => $l_str_FootnoteIndex,
|
||||
"index-int" => MCI_Footnotes_Convert::Index($l_str_FirstFootnoteIndex, MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE)),
|
||||
"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)),
|
||||
"arrow" => $l_str_Arrow,
|
||||
"text" => $l_str_FootnoteText
|
||||
)
|
||||
|
@ -472,6 +496,7 @@ class MCI_Footnotes_Task {
|
|||
|
||||
// free all found footnotes if reference container will be displayed
|
||||
self::$a_arr_Footnotes = array();
|
||||
self::$a_str_Prefix = rand(1000, 9999) . "_";
|
||||
return $l_obj_TemplateContainer->getContent();
|
||||
}
|
||||
}
|
Reference in a new issue