From 3ad7787a33ff7653dc6de484afabbf6ece867dd8 Mon Sep 17 00:00:00 2001 From: Aricura Date: Mon, 13 Oct 2014 17:06:54 +0000 Subject: [PATCH] Prepare for release version 1.5.7 - Add: Setting to define the positioning of the mouse-over box - Add: Setting to define an offset for the mouse-over box (precise positioning) - Bugfix: Target element to move down to the reference container is the footnote index instead of the arrow (possibility to hide the arrow) - Bugfix: Rating calculation for the 'other plugins' list git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@1006768 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- class/dashboard/init.php | 10 +++---- class/dashboard/layout.php | 2 -- class/dashboard/subpage-main.php | 26 +++++++++++++++- class/settings.php | 30 +++++++++++++++++++ class/task.php | 11 ++++++- features.txt | 16 ++-------- index.php | 2 +- readme.txt | 8 ++++- .../dashboard/customize-mouse-over-box.html | 12 ++++++++ .../public/reference-container-body.html | 4 +-- templates/public/tooltip.html | 4 +-- 11 files changed, 96 insertions(+), 29 deletions(-) diff --git a/class/dashboard/init.php b/class/dashboard/init.php index 5c8678e..7b6016a 100644 --- a/class/dashboard/init.php +++ b/class/dashboard/init.php @@ -247,11 +247,11 @@ class MCI_Footnotes_Layout_Init { "PluginDescription" => array_key_exists("short_description", $l_arr_Plugin) ? html_entity_decode($l_arr_Plugin["short_description"]) : "Error reading Plugin information", "PluginAuthor" => array_key_exists("author", $l_arr_Plugin) ? html_entity_decode($l_arr_Plugin["author"]) : "unknown", "PluginRatingText" => $l_int_Stars . " " . __("rating based on", MCI_Footnotes_Config::C_STR_PLUGIN_NAME) . " " . $l_int_NumRatings . " " . __("ratings", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), - "PluginRating1" => $l_int_NumRatings >= 0.5 ? "star-full" : "star-empty", - "PluginRating2" => $l_int_NumRatings >= 1.5 ? "star-full" : "star-empty", - "PluginRating3" => $l_int_NumRatings >= 2.5 ? "star-full" : "star-empty", - "PluginRating4" => $l_int_NumRatings >= 3.5 ? "star-full" : "star-empty", - "PluginRating5" => $l_int_NumRatings >= 4.5 ? "star-full" : "star-empty", + "PluginRating1" => $l_int_Stars >= 0.5 ? "star-full" : "star-empty", + "PluginRating2" => $l_int_Stars >= 1.5 ? "star-full" : "star-empty", + "PluginRating3" => $l_int_Stars >= 2.5 ? "star-full" : "star-empty", + "PluginRating4" => $l_int_Stars >= 3.5 ? "star-full" : "star-empty", + "PluginRating5" => $l_int_Stars >= 4.5 ? "star-full" : "star-empty", "PluginRating" => $l_int_NumRatings, "PluginLastUpdated" => array_key_exists("last_updated", $l_arr_Plugin) ? $l_arr_Plugin["last_updated"] : "unknown", "PluginDownloads" => array_key_exists("downloaded", $l_arr_Plugin) ? $l_arr_Plugin["downloaded"] : "---" diff --git a/class/dashboard/layout.php b/class/dashboard/layout.php index ce9aaf7..4c925c2 100644 --- a/class/dashboard/layout.php +++ b/class/dashboard/layout.php @@ -189,8 +189,6 @@ abstract class MCI_Footnotes_LayoutEngine { * @since 1.5.0 */ private function appendScripts() { - // add jQuery to the sub menu page - wp_enqueue_script('jquery'); // enable meta boxes layout and close functionality wp_enqueue_script('postbox'); // add WordPress color picker layout diff --git a/class/dashboard/subpage-main.php b/class/dashboard/subpage-main.php index e6e9305..5291d24 100644 --- a/class/dashboard/subpage-main.php +++ b/class/dashboard/subpage-main.php @@ -290,6 +290,17 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { "yes" => __("Yes", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), "no" => __("No", MCI_Footnotes_Config::C_STR_PLUGIN_NAME) ); + // options for the Mouse-over box position + $l_arr_Position = array( + "top left" => __("top left", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + "top center" => __("top center", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + "top right" => __("top right", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + "center right" => __("center right", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + "bottom right" => __("bottom right", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + "bottom center" => __("bottom center", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + "bottom left" => __("bottom left", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + "center left" => __("center left", MCI_Footnotes_Config::C_STR_PLUGIN_NAME) + ); // load template file $l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "customize-mouse-over-box"); // replace all placeholders @@ -304,7 +315,18 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { "label-excerpt-length" => $this->addLabel(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH, __("Maximum characters for the excerpt", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)), "excerpt-length" => $this->addTextBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH), - "label-color" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR, __("Color", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)), + "label-position" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION, __("Position", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)), + "position" => $this->addSelectBox(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION, $l_arr_Position), + + "label-offset-x" => $this->addLabel(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X, __("Offset X (px)", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)), + "offset-x" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X, -50, 50), + "notice-offset-x" => __("Offset (X axis) in px (may be negative)", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + + "label-offset-y" => $this->addLabel(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y, __("Offset Y (px)", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)), + "offset-y" => $this->addNumBox(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_Y, -50, 50), + "notice-offset-y" => __("Offset (Y axis) in px (may be negative)", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), + + "label-color" => $this->addLabel(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR, __("Color", MCI_Footnotes_Config::C_STR_PLUGIN_NAME)), "color" => $this->addColorSelection(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR), "notice-color" => __("Empty color will use the default color defined by your current theme.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), @@ -476,6 +498,8 @@ class MCI_Footnotes_Layout_Settings extends MCI_Footnotes_LayoutEngine { "information" => sprintf(__("For further information please check out our %ssupport forum%s on WordPress.org.", MCI_Footnotes_Config::C_STR_PLUGIN_NAME), '', '') ) ); + // call wp_head function to get the Styling of the mouse-over box + $g_obj_MCI_Footnotes->a_obj_Task->wp_head(); // display template with replaced placeholders echo $l_obj_Template->getContent(); } diff --git a/class/settings.php b/class/settings.php index 7a61524..706d589 100644 --- a/class/settings.php +++ b/class/settings.php @@ -171,6 +171,33 @@ class MCI_Footnotes_Settings { */ 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. + * + * @author Stefan Herndler + * @since 1.5.7 + * @var string + */ + 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). + * + * @author Stefan Herndler + * @since 1.5.7 + * @var string + */ + 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). + * + * @author Stefan Herndler + * @since 1.5.7 + * @var string + */ + 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. * @@ -352,6 +379,9 @@ class MCI_Footnotes_Settings { self::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED => 'yes', self::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_ENABLED => 'no', self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_EXCERPT_LENGTH => 150, + 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_Y => 10, self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_COLOR => '', self::C_STR_FOOTNOTES_MOUSE_OVER_BOX_BACKGROUND => '#fff7a7', self::C_INT_FOOTNOTES_MOUSE_OVER_BOX_BORDER_WIDTH => 1, diff --git a/class/task.php b/class/task.php index c9ad80b..e5e6920 100644 --- a/class/task.php +++ b/class/task.php @@ -370,7 +370,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( + "index" => $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(); } diff --git a/features.txt b/features.txt index ee311c4..968cd4c 100644 --- a/features.txt +++ b/features.txt @@ -1,7 +1,7 @@ == Footnotes Features == -- Performance of the task so PHP won't throw an error when there are more than 120? Footnotes +- Performance of the task so PHP won't throw an error when there are more than 120? Footnotes on a single page - Maybe increase PHP max execution time while processing the Footnotes task - different background for every odd table row @@ -11,16 +11,4 @@ the currently used one should be one of those templates and pre-defined styles o == Footnotes Bugs == -- Excerpt No doesn't work - - -== edit mouse-over box (placeholders in .html file and replace before echo == -- background color (css) -- border width (css) -- border color (css) -- border radius (css) -- box shadow (css) -- max width (css) (majhul) -- font size (css) -- position (js) -- right to left (js?) \ No newline at end of file +- Setting "Excerpt No" doesn't work \ No newline at end of file diff --git a/index.php b/index.php index 96bb9c1..1fd2666 100755 --- a/index.php +++ b/index.php @@ -4,7 +4,7 @@ Plugin URI: http://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. Author: ManFisher Medien ManuFaktur - Version: 1.5.6 + Version: 1.5.7 Author URI: http://manfisher.net/plugins/footnotes/ Text Domain: footnotes Domain Path: /languages diff --git a/readme.txt b/readme.txt index cabc0ae..f2474b1 100755 --- a/readme.txt +++ b/readme.txt @@ -6,7 +6,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i Tested up to: 4.0 License: GPLv3 or later License URI: http://www.gnu.org/licenses/gpl-3.0.html -Stable Tag: 1.5.6 +Stable Tag: 1.5.7 == Description == @@ -84,6 +84,12 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest** == Changelog == += 1.5.7 = +- Add: Setting to define the positioning of the mouse-over box +- Add: Setting to define an offset for the mouse-over box (precise positioning) +- Bugfix: Target element to move down to the reference container is the footnote index instead of the arrow (possibility to hide the arrow) +- Bugfix: Rating calculation for the 'other plugins' list + = 1.5.6 = - **IMPORTANT**: We have changed the html tag for the superscript. Please check and update your custom CSS. - Add: .pot file to enable Translations for everybody diff --git a/templates/dashboard/customize-mouse-over-box.html b/templates/dashboard/customize-mouse-over-box.html index d7757e2..ca9fd6a 100644 --- a/templates/dashboard/customize-mouse-over-box.html +++ b/templates/dashboard/customize-mouse-over-box.html @@ -12,6 +12,18 @@ [[label-excerpt-length]] [[excerpt-length]] + + [[label-position]] + [[position]] + + + [[label-offset-x]] + [[offset-x]] [[notice-offset-x]] + + + [[label-offset-y]] + [[offset-y]] [[notice-offset-y]] + [[label-color]] [[color]] [[notice-color]] diff --git a/templates/public/reference-container-body.html b/templates/public/reference-container-body.html index 4ffb59a..2312110 100755 --- a/templates/public/reference-container-body.html +++ b/templates/public/reference-container-body.html @@ -1,5 +1,5 @@ - [[index]]. - [[arrow]] + [[index]]. + [[arrow]] [[text]] \ No newline at end of file diff --git a/templates/public/tooltip.html b/templates/public/tooltip.html index a5a4466..b7640c2 100644 --- a/templates/public/tooltip.html +++ b/templates/public/tooltip.html @@ -5,8 +5,8 @@ effect: "fade", fadeOutSpeed: 100, predelay: 400, - position: "top right", + position: "[[position]]", relative: true, - offset: [10, 10] + offset: [[[offset-y]], [[offset-x]]] }); \ No newline at end of file