diff --git a/common/css/publishpress-admin.css b/common/css/publishpress-admin.css index dc496b2c..119e96d5 100644 --- a/common/css/publishpress-admin.css +++ b/common/css/publishpress-admin.css @@ -41,6 +41,38 @@ font-style: normal; } +.pp-title-tooltip { + cursor: help; + position: relative; +} + +.pp-title-tooltip-text { + display: none; + position: absolute; + background-color: #3c434a; + color: #fff; + padding: 5px; + border-radius: 5px; + font-size: 12px; + white-space: nowrap; + z-index: 1000; + pointer-events: none; + box-shadow: 0px 4px 8px rgb(255, 255, 255); +} + +.pp-title-tooltip-text::after { + content: ""; + position: absolute; + top: 100%; + left: 50%; + transform: translateX(-50%); + border-width: 5px; + border-style: solid; + border-color: #333 transparent transparent transparent; + box-shadow: -1px -1px 3px rgba(0, 0, 0, 0.1); +} + + [class^="pp-icon-"]:before, [class*=" pp-icon-"]:before { font-family: "publishpress" !important; diff --git a/common/js/publishpress-admin.js b/common/js/publishpress-admin.js new file mode 100644 index 00000000..6d763dcc --- /dev/null +++ b/common/js/publishpress-admin.js @@ -0,0 +1,44 @@ +(function ($) { + 'use strict'; + + /** + * All of the code for admin-facing JavaScript source + * should reside in this file. + */ + + $(document).ready(function () { + + initToolTips(); + function initToolTips() { + $('.pp-title-tooltip').each(function() { + var $this = $(this); + var titleText = $this.attr('title'); + + if (titleText && titleText !== '') { + $this.removeAttr('title'); + + var $tooltip = $('
').text(titleText); + $('body').append($tooltip); + + $this.hover(function() { + $tooltip.show(); + + // Adjust the tooltip position to account for the arrow + var tooltipTop = $this.offset().top - $tooltip.outerHeight() - 10; // Position 10px above the element + var tooltipLeft = $this.offset().left + ($this.outerWidth() / 2) - ($tooltip.outerWidth() / 2); + + $tooltip.css({ + top: tooltipTop + 'px', + left: tooltipLeft + 'px', + position: 'absolute' + }); + }, function() { + $tooltip.hide(); + }); + } + }); + } + + }); + + })(jQuery); \ No newline at end of file diff --git a/common/php/class-module.php b/common/php/class-module.php index dfd888eb..162e1418 100644 --- a/common/php/class-module.php +++ b/common/php/class-module.php @@ -1050,6 +1050,7 @@ public function localize_post_data($localized_post_data, $post, $can_edit_post) 'post_id' => $post->ID, 'post_title' => $post_title, 'raw_title' => $post->post_title, + 'filtered_title' => isset($post->filtered_title) ? $post->filtered_title : $post->post_title, 'post_status' => $post->post_status, 'status_label' => $this->get_post_status_friendly_name($post->post_status), 'can_edit_post' => $can_edit_post ? 1 : 0, diff --git a/modules/calendar/calendar.php b/modules/calendar/calendar.php index 9a816496..207775f0 100644 --- a/modules/calendar/calendar.php +++ b/modules/calendar/calendar.php @@ -623,6 +623,14 @@ public function enqueue_admin_scripts() PUBLISHPRESS_VERSION, true ); + + wp_enqueue_script( + 'publishpress-admin', + PUBLISHPRESS_URL . 'common/js/publishpress-admin.js', + ['jquery'], + PUBLISHPRESS_VERSION + ); + wp_enqueue_script( 'publishpress-calendar-js', $this->module_url . 'lib/calendar.js', @@ -1215,6 +1223,7 @@ public function update_user_filters($request_filter = []) 'weeks' => '', 'start_date' => '', 'me_mode' => '', + 'show_revision' => '', 's' => '', 'post_status' => '', ]; @@ -1247,6 +1256,7 @@ public function update_user_filters($request_filter = []) 'weeks' => __('Weeks', 'publishpress'), 'start_date' => __('Start Date', 'publishpress'), 'me_mode' => __('Me Mode', 'publishpress'), + 'show_revision' => __('Show Revision', 'publishpress'), 's' => __('Search', 'publishpress'), ], $this->filters); @@ -1804,6 +1814,7 @@ public function get_calendar_filters() { data-label=""> + user_filters); ?>