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/tags/1.5.7@1006769 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
parent
b183563518
commit
f40de329d2
11 changed files with 96 additions and 29 deletions
|
@ -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"] : "---"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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), '<a href="http://wordpress.org/support/plugin/footnotes" target="_blank" class="footnote_plugin">', '</a>')
|
||||
)
|
||||
);
|
||||
// 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();
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Reference in a new issue