From f4f9ccc3b234eaadf29b3f5c8bec6e19de0aa761 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 18 Jun 2021 08:55:49 +0000 Subject: css fixes --- Zotlabs/Widget/Hq_controls.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Hq_controls.php b/Zotlabs/Widget/Hq_controls.php index 8b532defe..9504b8f9e 100644 --- a/Zotlabs/Widget/Hq_controls.php +++ b/Zotlabs/Widget/Hq_controls.php @@ -17,7 +17,7 @@ class Hq_controls { 'label' => t('Toggle post editor'), 'id' => 'jot-toggle', 'href' => '#', - 'class' => 'btn btn-outline-primary', + 'class' => 'btn', 'type' => 'button', 'icon' => 'pencil', 'extra' => 'data-toggle="button"' @@ -29,7 +29,7 @@ class Hq_controls { 'label' => t('Toggle personal notes'), 'id' => 'notes-toggle', 'href' => '#', - 'class' => 'btn btn-outline-primary', + 'class' => 'btn', 'type' => 'button', 'icon' => 'sticky-note-o', 'extra' => 'data-toggle="button"' @@ -39,7 +39,8 @@ class Hq_controls { return replace_macros(get_markup_template('hq_controls.tpl'), [ '$entries' => $entries, - '$wrapper_class' => $options['class'] + '$wrapper_class' => $options['wrapper_class'], + '$entry_class' => $options['entry_class'] ] ); } -- cgit v1.2.3 From c42d8a81c729ff8441195371106e96d398210067 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 18 Jun 2021 09:51:20 +0000 Subject: bbcode: add option to drop media content --- Zotlabs/Widget/Messages.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Messages.php b/Zotlabs/Widget/Messages.php index a03238c9a..95f3d4eb6 100644 --- a/Zotlabs/Widget/Messages.php +++ b/Zotlabs/Widget/Messages.php @@ -95,7 +95,7 @@ class Messages { $summary = $item['summary']; } if (!$summary) { - $summary = htmlentities(html2plain(bbcode($item['body']), 75, true), ENT_QUOTES, 'UTF-8', false); + $summary = htmlentities(html2plain(bbcode($item['body'], ['drop_media' => true]), 75, true), ENT_QUOTES, 'UTF-8', false); } if (!$summary) { $summary = '...'; -- cgit v1.2.3 From 97d9764f015990b1df01463c45090c4cbc2192fa Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 23 Jun 2021 22:14:01 +0200 Subject: if there are no messages display that there are no messages --- Zotlabs/Widget/Messages.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Messages.php b/Zotlabs/Widget/Messages.php index 95f3d4eb6..9679631c6 100644 --- a/Zotlabs/Widget/Messages.php +++ b/Zotlabs/Widget/Messages.php @@ -11,14 +11,10 @@ class Messages { if (!local_channel()) return EMPTY_STR; - $o = ''; $page = self::get_messages_page($options); - if (!$page['entries']) - return $o; - $tpl = get_markup_template('messages_widget.tpl'); - $o .= replace_macros($tpl, [ + $o = replace_macros($tpl, [ '$entries' => $page['entries'], '$offset' => $page['offset'], '$feature_star' => feature_enabled(local_channel(), 'star_posts'), @@ -26,7 +22,8 @@ class Messages { 'messages_title' => t('Public and restricted messages'), 'direct_messages_title' => t('Direct messages'), 'starred_messages_title' => t('Starred messages'), - 'loading' => t('Loading') + 'loading' => t('Loading'), + 'empty' => t('No messages') ] ]); -- cgit v1.2.3 From 167db22e15c72c32cd67ce1a2b242dc4527e0b64 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 24 Jun 2021 19:31:19 +0000 Subject: slightly refactor for desktop notifications and fix minor issues --- Zotlabs/Widget/Hq_controls.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Hq_controls.php b/Zotlabs/Widget/Hq_controls.php index 9504b8f9e..91335fd76 100644 --- a/Zotlabs/Widget/Hq_controls.php +++ b/Zotlabs/Widget/Hq_controls.php @@ -15,9 +15,8 @@ class Hq_controls { $entries = [ 'toggle_editor' => [ 'label' => t('Toggle post editor'), - 'id' => 'jot-toggle', 'href' => '#', - 'class' => 'btn', + 'class' => 'btn jot-toggle', 'type' => 'button', 'icon' => 'pencil', 'extra' => 'data-toggle="button"' @@ -27,9 +26,8 @@ class Hq_controls { if(Apps::system_app_installed(local_channel(), 'Notes')) { $entries['toggle_notes'] = [ 'label' => t('Toggle personal notes'), - 'id' => 'notes-toggle', 'href' => '#', - 'class' => 'btn', + 'class' => 'btn notes-toggle', 'type' => 'button', 'icon' => 'sticky-note-o', 'extra' => 'data-toggle="button"' -- cgit v1.2.3 From bed81d785c50a1a056a409b8113eceb0c1d47bba Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 29 Jun 2021 09:22:38 +0000 Subject: an attempt to improve the query for direct messages on some systems with hopefully no bad side-effect for others --- Zotlabs/Widget/Messages.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Messages.php b/Zotlabs/Widget/Messages.php index 9679631c6..ed666bfaa 100644 --- a/Zotlabs/Widget/Messages.php +++ b/Zotlabs/Widget/Messages.php @@ -42,6 +42,7 @@ class Messages { $item_normal = item_normal(); $entries = []; $limit = 30; + $dummy_sql = ''; $offset = 0; if ($options['offset']) { @@ -53,6 +54,9 @@ class Messages { switch($options['type']) { case 'direct': $type_sql = ' AND item_private = 2 '; + // $dummy_order_sql has no other meaning but trick + // some mysql backends into using the right index. + $dummy_order_sql = ', received DESC '; break; case 'starred': $type_sql = ' AND item_starred = 1 '; @@ -66,7 +70,7 @@ class Messages { $type_sql AND item_thread_top = 1 $item_normal - ORDER BY created DESC + ORDER BY created DESC $dummy_order_sql LIMIT $limit OFFSET $offset", intval(local_channel()), dbescdate($loadtime) -- cgit v1.2.3 From e8c6121b4e40e16b291b38158dd3a1639641c56a Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 29 Jun 2021 09:24:13 +0000 Subject: version --- Zotlabs/Widget/Messages.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Messages.php b/Zotlabs/Widget/Messages.php index ed666bfaa..9dda33d71 100644 --- a/Zotlabs/Widget/Messages.php +++ b/Zotlabs/Widget/Messages.php @@ -54,7 +54,7 @@ class Messages { switch($options['type']) { case 'direct': $type_sql = ' AND item_private = 2 '; - // $dummy_order_sql has no other meaning but trick + // $dummy_order_sql has no other meaning but to trick // some mysql backends into using the right index. $dummy_order_sql = ', received DESC '; break; -- cgit v1.2.3 From 6a4727e3eb8d00c5927644b43bd6ba69fcd3c247 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 29 Jun 2021 18:21:12 +0000 Subject: fix variable name --- Zotlabs/Widget/Messages.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Messages.php b/Zotlabs/Widget/Messages.php index 9dda33d71..269d669dc 100644 --- a/Zotlabs/Widget/Messages.php +++ b/Zotlabs/Widget/Messages.php @@ -42,7 +42,7 @@ class Messages { $item_normal = item_normal(); $entries = []; $limit = 30; - $dummy_sql = ''; + $dummy_order_sql = ''; $offset = 0; if ($options['offset']) { -- cgit v1.2.3