diff options
author | Mario <mario@mariovavti.com> | 2022-07-26 18:00:00 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2022-07-26 18:00:00 +0000 |
commit | 40377796edd8c612ce9d68f52fc146ad32302f9e (patch) | |
tree | 92cce4a3ee3627ed28f45ce8f0bb3598be87c8c9 | |
parent | c452a621fe7db5405d929ebc5f5433c9670fc367 (diff) | |
parent | fedad7f31a1b9133bfd63de7fc19de6916485254 (diff) | |
download | volse-hubzilla-7.6.tar.gz volse-hubzilla-7.6.tar.bz2 volse-hubzilla-7.6.zip |
Merge branch '7.6RC'7.6
36 files changed, 661 insertions, 265 deletions
@@ -1,28 +1,50 @@ +Hubzilla 7.6 (2022-07-26) + - Add filter rule to check for false conition + - Implement HQ dashboard to display recently created content for various modules + - Updated spanish translations + - Implement a max oembed size which defaults to 1MB + - Update composer libs + + Addons + - Cart: do not attempt oembed + - Cards: implement channel_activities_widget for HQ dashboard + - Articles: implement channel_activities_widget for HQ dashboard + - Wiki: implement channel_activities_widget for HQ dashboard + + Bugfixes + - Fix language filter filtering ambigous results + - Fix vcard-card background for dark schema + - Fix contact edit dialog not displayed in chrome browser + - Fix readability of category pills in dark schema + - Fix opengraph images inside zmg opening tag + - Fix oembed attempted for text previews + + Hubzilla 7.4 (2022-06-01) - Updated russian translations - Raise min PHP version to 8.0 - Rewrite inbound attachment handling - Move photo flag feature from addon to core - Adjust default production php logging - Update composer libs - Add a hidden config to enable the hs2019 http signature algorithm - Allow starring of pubstream items - Update spanish translations - Add the title in forum post reshares if applicable - Implement inbound pleroma reactions - Add real name info to the navbar template data - Add the updated date to the icon url so that other platforms will pick it up on change - Move wiki from core to addon - Move articles from core to addon - Move cards from core to addon + - Updated russian translations + - Raise min PHP version to 8.0 + - Rewrite inbound attachment handling + - Move photo flag feature from addon to core + - Adjust default production php logging + - Update composer libs + - Add a hidden config to enable the hs2019 http signature algorithm + - Allow starring of pubstream items + - Update spanish translations + - Add the title in forum post reshares if applicable + - Implement inbound pleroma reactions + - Add real name info to the navbar template data + - Add the updated date to the icon url so that other platforms will pick it up on change + - Move wiki from core to addon + - Move articles from core to addon + - Move cards from core to addon Addons - Rendezvous: add missing default value to sql schema - Wiki: moved from core to addons - Articles: moved from core to addons - Cards: moved from core to addons - Photoflag: moved to core - Sse: fix issue where notifications were emited for created tasks + - Rendezvous: add missing default value to sql schema + - Wiki: moved from core to addons + - Articles: moved from core to addons + - Cards: moved from core to addons + - Photoflag: moved to core + - Sse: fix issue where notifications were emited for created tasks Bugfixes - Fix issue where inbound activitypub items lost image descriptions (issue 1679) diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php index 59e4d9a4e..07c426960 100644 --- a/Zotlabs/Lib/Enotify.php +++ b/Zotlabs/Lib/Enotify.php @@ -860,7 +860,7 @@ class Enotify { // convert this logic into a json array just like the system notifications $who = (($item['verb'] === ACTIVITY_SHARE) ? 'owner' : 'author'); - $body = html2plain(bbcode($item['body'], ['drop_media']), 75, true); + $body = html2plain(bbcode($item['body'], ['drop_media' => true, 'tryoembed' => false]), 75, true); if ($body) { $body = htmlentities($body, ENT_QUOTES, 'UTF-8', false); } diff --git a/Zotlabs/Lib/MessageFilter.php b/Zotlabs/Lib/MessageFilter.php index 70b0188c4..7d6dcbe8e 100644 --- a/Zotlabs/Lib/MessageFilter.php +++ b/Zotlabs/Lib/MessageFilter.php @@ -29,7 +29,19 @@ class MessageFilter { if (! $word) { continue; } - if (substr($word, 0, 1) === '#' && $tags) { + if (isset($lang) && ((strpos($word, 'lang=') === 0) || (strpos($word, 'lang!=') === 0))) { + if (!strlen($lang)) { + // Result is ambiguous. As we are matching deny rules only at this time, continue tests. + // Any matching deny rule concludes testing. + continue; + } + if (strpos($word, 'lang=') === 0 && strcasecmp($lang, trim(substr($word, 5))) == 0) { + return false; + } elseif (strpos($word, 'lang!=') === 0 && strcasecmp($lang, trim(substr($word, 6))) != 0) { + return false; + } + } + elseif (substr($word, 0, 1) === '#' && $tags) { foreach ($tags as $t) { if ((($t['ttype'] == TERM_HASHTAG) || ($t['ttype'] == TERM_COMMUNITYTAG)) && (($t['term'] === substr($word, 1)) || (substr($word, 1) === '*'))) { return false; @@ -51,10 +63,6 @@ class MessageFilter { } } elseif ((strpos($word, '/') === 0) && preg_match($word, $text)) { return false; - } elseif ((strpos($word, 'lang=') === 0) && ($lang) && (strcasecmp($lang, trim(substr($word, 5))) == 0)) { - return false; - } elseif ((strpos($word, 'lang!=') === 0) && ($lang) && (strcasecmp($lang, trim(substr($word, 6))) != 0)) { - return false; } elseif (stristr($text, $word) !== false) { return false; } @@ -69,7 +77,19 @@ class MessageFilter { if (! $word) { continue; } - if (substr($word, 0, 1) === '#' && $tags) { + if (isset($lang) && ((strpos($word, 'lang=') === 0) || (strpos($word, 'lang!=') === 0))) { + if (!strlen($lang)) { + // Result is ambiguous. However we are checking allow rules + // and an ambiguous language is always permitted. + return true; + } + if (strpos($word, 'lang=') === 0 && strcasecmp($lang, trim(substr($word, 5))) == 0) { + return true; + } elseif (strpos($word, 'lang!=') === 0 && strcasecmp($lang, trim(substr($word, 6))) != 0) { + return true; + } + } + elseif (substr($word, 0, 1) === '#' && $tags) { foreach ($tags as $t) { if ((($t['ttype'] == TERM_HASHTAG) || ($t['ttype'] == TERM_COMMUNITYTAG)) && (($t['term'] === substr($word, 1)) || (substr($word, 1) === '*'))) { return true; @@ -91,10 +111,6 @@ class MessageFilter { } } elseif ((strpos($word, '/') === 0) && preg_match($word, $text)) { return true; - } elseif ((strpos($word, 'lang=') === 0) && ($lang) && (strcasecmp($lang, trim(substr($word, 5))) == 0)) { - return true; - } elseif ((strpos($word, 'lang!=') === 0) && ($lang) && (strcasecmp($lang, trim(substr($word, 6))) != 0)) { - return true; } elseif (stristr($text, $word) !== false) { return true; } @@ -123,7 +139,8 @@ class MessageFilter { * - ?foo {} baz which will check if 'baz' is an array element in item.foo * - ?foo {*} baz which will check if 'baz' is an array key in item.foo * - ?foo which will check for a return of a true condition for item.foo; - * + * - ?!foo which will check for a return of a false condition for item.foo; + * * The values 0, '', an empty array, and an unset value will all evaluate to false. * * @param string $s @@ -205,6 +222,15 @@ class MessageFilter { return false; } + // Ordering of this check (for falsiness) with relation to the following one (check for truthiness) is important. + if (preg_match('/\!(.*?)$/', $s, $matches)) { + $x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR); + if (!$x) { + return true; + } + return false; + } + if (preg_match('/(.*?)$/', $s, $matches)) { $x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR); if ($x) { diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php index 5001bbe62..efbfcf084 100644 --- a/Zotlabs/Module/Hq.php +++ b/Zotlabs/Module/Hq.php @@ -49,16 +49,16 @@ class Hq extends \Zotlabs\Web\Controller { $sql_extra = ''; if(! $item_hash) { - $r = q("SELECT mid FROM item - WHERE uid = %d $item_normal - AND mid = parent_mid - AND item_private IN (0, 1) - ORDER BY created DESC LIMIT 1", - intval(local_channel()) - ); - if($r[0]['mid']) { - $item_hash = $r[0]['mid']; - } + //$r = q("SELECT mid FROM item + //WHERE uid = %d $item_normal + //AND mid = parent_mid + //AND item_private IN (0, 1) + //ORDER BY created DESC LIMIT 1", + //intval(local_channel()) + //); + //if($r[0]['mid']) { + //$item_hash = $r[0]['mid']; + //} } if($item_hash) { diff --git a/Zotlabs/Module/Page.php b/Zotlabs/Module/Page.php index 5fdd32825..8a698005a 100644 --- a/Zotlabs/Module/Page.php +++ b/Zotlabs/Module/Page.php @@ -9,42 +9,42 @@ class Page extends \Zotlabs\Web\Controller { function init() { // We need this to make sure the channel theme is always loaded. - + $which = argv(1); $profile = 0; profile_load($which,$profile); - - - + + + if(\App::$profile['profile_uid']) head_set_icon(\App::$profile['thumb']); - + // load the item here in the init function because we need to extract // the page layout and initialise the correct theme. - - + + $observer = \App::get_observer(); $ob_hash = (($observer) ? $observer['xchan_hash'] : ''); - - - // perm_is_allowed is denied unconditionally when 'site blocked to unauthenticated members'. + + + // perm_is_allowed is denied unconditionally when 'site blocked to unauthenticated members'. // This bypasses that restriction for sys channel (public) content - + if((! perm_is_allowed(\App::$profile['profile_uid'],$ob_hash,'view_pages')) && (! is_sys_channel(\App::$profile['profile_uid']))) { notice( t('Permission denied.') . EOL); return; } - + if(argc() < 3) { notice( t('Invalid item.') . EOL); return; } - + $channel_address = argv(1); - + // Always look first for the page name prefixed by the observer language; for instance page/nickname/de/foo // followed by page/nickname/foo if that is not found. - // If your browser language is de and you want to access the default in this case, + // If your browser language is de and you want to access the default in this case, // use page/nickname/-/foo to over-ride the language and access only the page with pagelink of 'foo' $page_name = ''; @@ -63,33 +63,33 @@ class Page extends \Zotlabs\Web\Controller { // The page link title was stored in a urlencoded format // php or the browser may/will have decoded it, so re-encode it for our search - + $page_id = urlencode($page_name); $lang_page_id = urlencode(\App::$language . '/' . $page_name); $u = q("select channel_id from channel where channel_address = '%s' limit 1", dbesc($channel_address) ); - + if(! $u) { notice( t('Channel not found.') . EOL); return; } - + if($_REQUEST['rev']) $revision = " and revision = " . intval($_REQUEST['rev']) . " "; else $revision = " order by revision desc "; - + require_once('include/security.php'); $sql_options = item_permissions_sql($u[0]['channel_id']); - $r = null; + $r = null; if(! $ignore_language) { $r = q("select item.* from item left join iconfig on item.id = iconfig.iid - where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0 - and iconfig.k = 'WEBPAGE' and item_type = %d + where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0 + and iconfig.k = 'WEBPAGE' and item_type = %d $sql_options $revision limit 1", intval($u[0]['channel_id']), dbesc($lang_page_id), @@ -98,8 +98,8 @@ class Page extends \Zotlabs\Web\Controller { } if(! $r) { $r = q("select item.* from item left join iconfig on item.id = iconfig.iid - where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0 - and iconfig.k = 'WEBPAGE' and item_type = %d + where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0 + and iconfig.k = 'WEBPAGE' and item_type = %d $sql_options $revision limit 1", intval($u[0]['channel_id']), dbesc($page_id), @@ -109,7 +109,7 @@ class Page extends \Zotlabs\Web\Controller { if(! $r) { // no webpage by that name, but we do allow you to load/preview a layout using this module. Try that. $r = q("select item.* from item left join iconfig on item.id = iconfig.iid - where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0 + where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0 and iconfig.k = 'PDL' AND item_type = %d $sql_options $revision limit 1", intval($u[0]['channel_id']), dbesc($page_id), @@ -117,17 +117,17 @@ class Page extends \Zotlabs\Web\Controller { ); } if(! $r) { - + // Check again with no permissions clause to see if it is a permissions issue - + $x = q("select item.* from item left join iconfig on item.id = iconfig.iid - where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0 + where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0 and iconfig.k = 'WEBPAGE' and item_type = %d $revision limit 1", intval($u[0]['channel_id']), dbesc($page_id), intval(ITEM_TYPE_WEBPAGE) ); - + if($x) { // Yes, it's there. You just aren't allowed to see it. notice( t('Permission denied.') . EOL); @@ -140,7 +140,7 @@ class Page extends \Zotlabs\Web\Controller { if($r[0]['title']) \App::$page['title'] = escape_tags($r[0]['title']); - + if($r[0]['item_type'] == ITEM_TYPE_PDL) { \App::$comanche = new \Zotlabs\Render\Comanche(); \App::$comanche->parse($r[0]['body']); @@ -151,40 +151,41 @@ class Page extends \Zotlabs\Web\Controller { dbesc($r[0]['layout_mid']), intval($u[0]['channel_id']) ); - + if($l) { \App::$comanche = new \Zotlabs\Render\Comanche(); \App::$comanche->parse($l[0]['body']); \App::$pdl = $l[0]['body']; } } - + \App::$data['webpage'] = $r; - + } - + function get() { - + $r = \App::$data['webpage']; + if(! $r) return; - + if($r[0]['item_type'] == ITEM_TYPE_PDL) { $r[0]['body'] = t('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'); $r[0]['mimetype'] = 'text/plain'; $r[0]['title'] = ''; - + } - + xchan_query($r); $r = fetch_post_tags($r,true); - + if($r[0]['mimetype'] === 'application/x-pdl') \App::$page['pdl_content'] = true; - + $o .= prepare_page($r[0]); return $o; - + } - + } diff --git a/Zotlabs/Render/Comanche.php b/Zotlabs/Render/Comanche.php index 230c2455e..7288c7fd7 100644 --- a/Zotlabs/Render/Comanche.php +++ b/Zotlabs/Render/Comanche.php @@ -219,7 +219,8 @@ class Comanche { * - [if $config.system.foo {} baz] which will check if 'baz' is an array element in get_config('system','foo') * - [if $config.system.foo {*} baz] which will check if 'baz' is an array key in get_config('system','foo') * - [if $config.system.foo] which will check for a return of a true condition for get_config('system','foo'); - * + * - [if !$config.system.foo] which will check for a return of a false condition for get_config('system','foo'); + * * The values 0, '', an empty array, and an unset value will all evaluate to false. * * @param int|string $s @@ -299,6 +300,15 @@ class Comanche { return false; } + // Ordering of this check (for falsiness) with relation to the following one (check for truthiness) is important. + if (preg_match('/[\!\$](.*?)$/', $s, $matches)) { + $x = $this->get_condition_var($matches[1]); + if (!$x) { + return true; + } + return false; + } + if(preg_match('/[\$](.*?)$/',$s,$matches)) { $x = $this->get_condition_var($matches[1]); if($x) diff --git a/Zotlabs/Widget/Channel_activities.php b/Zotlabs/Widget/Channel_activities.php new file mode 100644 index 000000000..d12d80a8c --- /dev/null +++ b/Zotlabs/Widget/Channel_activities.php @@ -0,0 +1,251 @@ +<?php + +/** + * * Name: Channel Activity + * * Description: A widget that shows you a greeting and info about your last login and other channel activities + */ + +namespace Zotlabs\Widget; + +use App; +use Zotlabs\Lib\Apps; + +class Channel_activities { + + public static $activities = []; + public static $uid = null; + public static $limit = 3; + public static $channel = []; + + public static function widget($arr) { + if (!local_channel()) { + return EMPTY_STR; + } + + self::$uid = local_channel(); + self::$channel = App::get_channel(); + + $o .= '<div id="channel-activities" class="d-none overflow-hidden">'; + $o .= '<h2 class="mb-4">Welcome ' . self::$channel['channel_name'] . '!</h2>'; + //$o .= 'Last login date: ' . get_pconfig(self::$uid, 'system', 'stored_login_date') . ' from ' . get_pconfig(self::$uid, 'system', 'stored_login_addr'); + + self::get_photos_activity(); + self::get_files_activity(); + self::get_webpages_activity(); + self::get_channels_activity(); + + $hookdata = [ + 'channel' => self::$channel, + 'activities' => self::$activities, + 'limit' => self::$limit + ]; + + call_hooks('channel_activities_widget', $hookdata); + + if (!$hookdata['activities']) { + $o .= '<h3>No recent activity to display</h3>'; + return $o; + } + + $keys = array_column($hookdata['activities'], 'date'); + + array_multisort($keys, SORT_DESC, $hookdata['activities']); + + // hz_syslog('activities: ' . print_r($hookdata['activities'], true)); + + foreach($hookdata['activities'] as $a) { + $o .= replace_macros(get_markup_template($a['tpl']), [ + '$url' => $a['url'], + '$icon' => $a['icon'], + '$label' => $a['label'], + '$items' => $a['items'] + ]); + } + + $o .= '</div>'; + + return $o; + } + + private static function get_photos_activity() { + + $r = q("SELECT edited, height, width, imgscale, description, filename, resource_id FROM photo WHERE uid = %d + AND photo_usage = 0 AND is_nsfw = 0 AND imgscale = 3 + ORDER BY edited DESC LIMIT 6", + intval(self::$uid) + ); + + if (!$r) { + return; + } + + foreach($r as $rr) { + $i[] = [ + 'url' => z_root() . '/photos/' . self::$channel['channel_address'] . '/image/' . $rr['resource_id'], + 'edited' => datetime_convert('UTC', date_default_timezone_get(), $rr['edited']), + 'width' => $rr['width'], + 'height' => $rr['height'], + 'alt' => (($rr['description']) ? $rr['description'] : $rr['filename']), + 'src' => z_root() . '/photo/' . $rr['resource_id'] . '-' . $rr['imgscale'] + ]; + } + + self::$activities['photos'] = [ + 'label' => t('Photos'), + 'icon' => 'photo', + 'url' => z_root() . '/photos/' . self::$channel['channel_address'], + 'date' => $r[0]['edited'], + 'items' => $i, + 'tpl' => 'channel_activities_photos.tpl' + ]; + + } + + private static function get_files_activity() { + + $r = q("SELECT * FROM attach WHERE uid = %d + AND is_dir = 0 AND is_photo = 0 + ORDER BY edited DESC LIMIT %d", + intval(self::$uid), + intval(self::$limit) + ); + + if (!$r) { + return; + } + + foreach($r as $rr) { + $i[] = [ + 'url' => z_root() . '/cloud/' . self::$channel['channel_address'] . '/' . rtrim($rr['display_path'], $rr['filename']) . '#' . $rr['id'], + 'summary' => $rr['filename'], + 'footer' => datetime_convert('UTC', date_default_timezone_get(), $rr['edited']) + ]; + } + + self::$activities['files'] = [ + 'label' => t('Files'), + 'icon' => 'folder-open', + 'url' => z_root() . '/cloud/' . self::$channel['channel_address'], + 'date' => $r[0]['edited'], + 'items' => $i, + 'tpl' => 'channel_activities.tpl' + ]; + + } + + private static function get_webpages_activity() { + + if(!Apps::system_app_installed(self::$uid, 'Webpages')) { + return; + } + + $r = q("SELECT * FROM iconfig LEFT JOIN item ON iconfig.iid = item.id WHERE item.uid = %d + AND iconfig.cat = 'system' AND iconfig.k = 'WEBPAGE' AND item_type = %d + ORDER BY item.edited DESC LIMIT %d", + intval(self::$uid), + intval(ITEM_TYPE_WEBPAGE), + intval(self::$limit) + ); + + if (!$r) { + return; + } + + foreach($r as $rr) { + $summary = html2plain(purify_html(bbcode($rr['body'], ['drop_media' => true, 'tryoembed' => false])), 85, true); + if ($summary) { + $summary = substr_words(htmlentities($summary, ENT_QUOTES, 'UTF-8', false), 85); + } + + $i[] = [ + 'url' => z_root() . '/page/' . self::$channel['channel_address'] . '/' . $rr['v'], + 'title' => $rr['title'], + 'summary' => $summary, + 'footer' => datetime_convert('UTC', date_default_timezone_get(), $rr['edited']) + ]; + } + + self::$activities['webpages'] = [ + 'label' => t('Webpages'), + 'icon' => 'newspaper-o', + 'url' => z_root() . '/webpages/' . self::$channel['channel_address'], + 'date' => $r[0]['edited'], + 'items' => $i, + 'tpl' => 'channel_activities.tpl' + ]; + + } + + private static function get_channels_activity() { + + $account = App::get_account(); + + $r = q("SELECT channel_id, channel_name, xchan_photo_s FROM channel + LEFT JOIN xchan ON channel_hash = xchan_hash + WHERE channel_account_id = %d + AND channel_id != %d AND channel_removed = 0", + intval($account['account_id']), + intval(self::$uid) + ); + + if (!$r) { + return; + } + + $channels_activity = 0; + + foreach($r as$rr) { + + $intros = q("SELECT COUNT(abook_id) AS total FROM abook WHERE abook_channel = %d + AND abook_pending = 1 AND abook_self = 0 AND abook_ignored = 0", + intval($rr['channel_id']) + ); + + $notices = q("SELECT COUNT(id) AS total FROM notify WHERE uid = %d AND seen = 0", + intval($rr['channel_id']) + ); + + if (!$intros[0]['total'] && !$notices[0]['total']) { + continue; + } + + $footer = ''; + + if ($intros[0]['total']) { + $footer .= intval($intros[0]['total']) . ' ' . tt('new connection', 'new connections', intval($intros[0]['total']), 'noun'); + if ($notices[0]['total']) { + $footer .= ', '; + } + } + if ($notices[0]['total']) { + $footer .= intval($notices[0]['total']) . ' ' . tt('notice', 'notices', intval($notices[0]['total']), 'noun'); + } + + $i[] = [ + 'url' => z_root() . '/manage/' . $rr['channel_id'], + 'title' => '', + 'summary' => '<img src="' . $rr['xchan_photo_s'] . '" class="menu-img-2">' . $rr['channel_name'], + 'footer' => $footer + ]; + + $channels_activity++; + + } + + if(!$channels_activity) { + return; + } + + self::$activities['channels'] = [ + 'label' => t('Channels'), + 'icon' => 'home', + 'url' => z_root() . '/manage', + 'date' => datetime_convert(), + 'items' => $i, + 'tpl' => 'channel_activities.tpl' + ]; + + } + +} + diff --git a/Zotlabs/Widget/Hq_controls.php b/Zotlabs/Widget/Hq_controls.php index 7b1fe817d..51212d145 100644 --- a/Zotlabs/Widget/Hq_controls.php +++ b/Zotlabs/Widget/Hq_controls.php @@ -19,15 +19,13 @@ class Hq_controls { if (! local_channel()) return; - $entries = [ - 'toggle_editor' => [ - 'label' => t('Toggle post editor'), - 'href' => '#', - 'class' => 'btn jot-toggle', - 'type' => 'button', - 'icon' => 'pencil', - 'extra' => 'data-toggle="button"' - ] + $entries['toggle_editor'] = [ + 'label' => t('Toggle post editor'), + 'href' => '#', + 'class' => 'btn jot-toggle', + 'type' => 'button', + 'icon' => 'pencil', + 'extra' => 'data-toggle="button"' ]; if(Apps::system_app_installed(local_channel(), 'Notes')) { @@ -41,6 +39,15 @@ class Hq_controls { ]; } + $entries['toggle_channel_activities'] = [ + 'label' => t('Channel activities'), + 'href' => '#', + 'class' => 'btn channel-activities-toggle d-none', + 'type' => 'button', + 'icon' => 'user-circle-o', + 'extra' => 'data-toggle="button"' + ]; + return replace_macros(get_markup_template('hq_controls.tpl'), [ '$entries' => $entries, diff --git a/Zotlabs/Widget/Messages.php b/Zotlabs/Widget/Messages.php index d045ae85b..3d9ed8955 100644 --- a/Zotlabs/Widget/Messages.php +++ b/Zotlabs/Widget/Messages.php @@ -113,7 +113,7 @@ class Messages { } if (!$summary) { - $summary = html2plain(bbcode($item['body'], ['drop_media' => true]), 75, true); + $summary = html2plain(bbcode($item['body'], ['drop_media' => true, 'tryoembed' => false]), 75, true); if ($summary) { $summary = htmlentities($summary, ENT_QUOTES, 'UTF-8', false); } diff --git a/Zotlabs/Widget/Notes.php b/Zotlabs/Widget/Notes.php index c9d08c6b7..836159edd 100644 --- a/Zotlabs/Widget/Notes.php +++ b/Zotlabs/Widget/Notes.php @@ -31,7 +31,7 @@ class Notes { $o = replace_macros($tpl, array( '$text' => $text, - '$html' => bbcode($text), + '$html' => bbcode($text, ['tryoembed' => false]), '$app' => ((isset($arr['app'])) ? true : false), '$hidden' => ((isset($arr['hidden'])) ? true : false), '$strings' => [ @@ -60,7 +60,7 @@ require_once('include/bbcode.php'); require_once('include/items.php'); define('PLATFORM_NAME', 'hubzilla'); -define('STD_VERSION', '7.4'); +define('STD_VERSION', '7.6'); define('ZOT_REVISION', '6.0'); define('DB_UPDATE_VERSION', 1253); diff --git a/include/attach.php b/include/attach.php index 2109b84f1..32a86fcba 100644 --- a/include/attach.php +++ b/include/attach.php @@ -2702,10 +2702,11 @@ function attach_move($channel_id, $resource_id, $new_folder_hash, $newname = '', } - q("update attach set content = '%s', folder = '%s', filename = '%s' where id = %d", + q("update attach set content = '%s', folder = '%s', filename = '%s', edited = '%s' where id = %d", dbescbin($newstorepath), dbesc($new_folder_hash), dbesc($filename), + dbesc(datetime_convert()), intval($r[0]['id']) ); diff --git a/include/conversation.php b/include/conversation.php index 1d6295df7..d509342d4 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1719,12 +1719,14 @@ function prepare_page($item) { } $body = prepare_body($item, true, [ 'newwin' => false ]); + $edit_link = (($item['uid'] === local_channel()) ? z_root() . '/editwebpage/' . argv(1) . '/' . $item['id'] : ''); if(App::$page['template'] == 'none') { $tpl = 'page_display_empty.tpl'; return replace_macros(get_markup_template($tpl), array( - '$body' => $body['html'] + '$body' => $body['html'], + '$edit_link' => $edit_link )); } @@ -1741,6 +1743,7 @@ function prepare_page($item) { '$body' => $body['html'], '$preview' => $preview, '$link' => $link, + '$edit_link' => $edit_link )); } diff --git a/include/oembed.php b/include/oembed.php index 36938c577..bcf5d525c 100644 --- a/include/oembed.php +++ b/include/oembed.php @@ -164,6 +164,25 @@ function oembed_fetch_url($embedurl){ $txt = EMPTY_STR; if ($action !== 'block') { + $max_oembed_size = get_config('system', 'oembed_max_size', 1 * 1024 * 1024 /* 1MB */); + + stream_context_set_default( + [ + 'http' => [ + 'method' => 'HEAD', + 'timeout' => 5 + ] + ] + ); + + $headers = get_headers($furl, true); + + if (isset($headers['Content-Length']) && $headers['Content-Length'] > $max_oembed_size) { + $action = 'block'; + } + } + + if ($action !== 'block') { // try oembed autodiscovery $redirects = 0; $result = z_fetch_url($furl, false, $redirects, diff --git a/include/opengraph.php b/include/opengraph.php index 465acbd39..f62970c5d 100644 --- a/include/opengraph.php +++ b/include/opengraph.php @@ -21,7 +21,7 @@ $ogtitle = $item['title']; // find first image if exist - if(preg_match("/\[[zi]mg(=[0-9]+x[0-9]+)?\]([^\[]+)/is", $item['body'], $matches)) { + if (preg_match("/\[[zi]mg(=[0-9]+x[0-9]+)?\]([^\[]+)/is", $item['body'], $matches) || preg_match("/\[[zi]mg(=)([^\]]+)/is", $item['body'], $matches)) { $ogimage = $matches[2]; $ogimagetype = guess_image_type($ogimage); } diff --git a/util/hmessages.po b/util/hmessages.po index 9437f7618..869b4e716 100644 --- a/util/hmessages.po +++ b/util/hmessages.po @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: 7.4RC1\n" +"Project-Id-Version: 7.6RC\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-25 08:39+0000\n" +"POT-Creation-Date: 2022-07-19 09:43+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -538,12 +538,12 @@ msgid "Page name" msgstr "" #: ../../addon/wiki/Widget/Wiki_list.php:20 ../../addon/wiki/Mod_Wiki.php:209 -#: ../../include/nav.php:516 +#: ../../addon/wiki/wiki.php:75 ../../include/nav.php:516 msgid "Wikis" msgstr "" #: ../../addon/wiki/Widget/Wiki_page_history.php:28 -#: ../../addon/wiki/Lib/NativeWikiPage.php:580 +#: ../../addon/wiki/Lib/NativeWikiPage.php:588 #: ../../addon/wiki/Mod_Wiki.php:221 ../../addon/rendezvous/rendezvous.php:172 #: ../../Zotlabs/Module/Oauth.php:111 ../../Zotlabs/Module/Oauth.php:137 #: ../../Zotlabs/Module/Chat.php:255 ../../Zotlabs/Module/Cdav.php:1372 @@ -555,24 +555,24 @@ msgid "Name" msgstr "" #: ../../addon/wiki/Widget/Wiki_page_history.php:29 -#: ../../addon/wiki/Lib/NativeWikiPage.php:581 +#: ../../addon/wiki/Lib/NativeWikiPage.php:589 msgctxt "wiki_history" msgid "Message" msgstr "" #: ../../addon/wiki/Widget/Wiki_page_history.php:30 -#: ../../addon/wiki/Lib/NativeWikiPage.php:582 +#: ../../addon/wiki/Lib/NativeWikiPage.php:590 msgid "Date" msgstr "" #: ../../addon/wiki/Widget/Wiki_page_history.php:31 -#: ../../addon/wiki/Lib/NativeWikiPage.php:583 +#: ../../addon/wiki/Lib/NativeWikiPage.php:591 #: ../../addon/wiki/Mod_Wiki.php:370 msgid "Revert" msgstr "" #: ../../addon/wiki/Widget/Wiki_page_history.php:32 -#: ../../addon/wiki/Lib/NativeWikiPage.php:584 +#: ../../addon/wiki/Lib/NativeWikiPage.php:592 msgid "Compare" msgstr "" @@ -611,40 +611,40 @@ msgid "Error reading page content" msgstr "" #: ../../addon/wiki/Lib/NativeWikiPage.php:367 -#: ../../addon/wiki/Lib/NativeWikiPage.php:417 -#: ../../addon/wiki/Lib/NativeWikiPage.php:485 -#: ../../addon/wiki/Lib/NativeWikiPage.php:526 +#: ../../addon/wiki/Lib/NativeWikiPage.php:425 +#: ../../addon/wiki/Lib/NativeWikiPage.php:493 +#: ../../addon/wiki/Lib/NativeWikiPage.php:534 msgid "Error reading wiki" msgstr "" -#: ../../addon/wiki/Lib/NativeWikiPage.php:404 +#: ../../addon/wiki/Lib/NativeWikiPage.php:411 msgid "Page update failed." msgstr "" -#: ../../addon/wiki/Lib/NativeWikiPage.php:439 +#: ../../addon/wiki/Lib/NativeWikiPage.php:447 msgid "Nothing deleted" msgstr "" -#: ../../addon/wiki/Lib/NativeWikiPage.php:506 +#: ../../addon/wiki/Lib/NativeWikiPage.php:514 msgid "Compare: object not found." msgstr "" -#: ../../addon/wiki/Lib/NativeWikiPage.php:513 +#: ../../addon/wiki/Lib/NativeWikiPage.php:521 msgid "Page updated" msgstr "" -#: ../../addon/wiki/Lib/NativeWikiPage.php:521 +#: ../../addon/wiki/Lib/NativeWikiPage.php:529 msgid "Wiki resource_id required for git commit" msgstr "" -#: ../../addon/wiki/Lib/NativeWikiPage.php:537 ../../addon/cards/cards.php:103 -#: ../../addon/articles/articles.php:103 ../../include/help.php:133 +#: ../../addon/wiki/Lib/NativeWikiPage.php:545 ../../addon/cards/cards.php:105 +#: ../../addon/articles/articles.php:105 ../../include/help.php:133 #: ../../Zotlabs/Module/Display.php:142 ../../Zotlabs/Module/Page.php:136 #: ../../Zotlabs/Module/Block.php:77 ../../Zotlabs/Web/Router.php:186 msgid "Page not found." msgstr "" -#: ../../addon/wiki/Lib/NativeWikiPage.php:622 ../../include/bbcode.php:1050 +#: ../../addon/wiki/Lib/NativeWikiPage.php:630 ../../include/bbcode.php:1050 #: ../../include/bbcode.php:1235 msgid "Different viewers will see this text differently" msgstr "" @@ -746,9 +746,9 @@ msgid "Error downloading wiki: " msgstr "" #: ../../addon/wiki/Mod_Wiki.php:214 ../../addon/wiki/Mod_Wiki.php:387 -#: ../../addon/cards/Mod_Card_edit.php:99 ../../addon/cards/cards.php:73 +#: ../../addon/cards/Mod_Card_edit.php:99 ../../addon/cards/cards.php:75 #: ../../addon/articles/Mod_Article_edit.php:97 -#: ../../addon/articles/articles.php:73 ../../include/menu.php:120 +#: ../../addon/articles/articles.php:75 ../../include/menu.php:120 #: ../../include/channel.php:1530 ../../include/channel.php:1534 #: ../../Zotlabs/Widget/Cdav.php:142 ../../Zotlabs/Widget/Cdav.php:179 #: ../../Zotlabs/Module/Group.php:245 ../../Zotlabs/Module/Oauth.php:171 @@ -3536,16 +3536,16 @@ msgstr "" msgid "Delete" msgstr "" -#: ../../addon/cards/cards.php:47 ../../addon/cards/Mod_Cards.php:209 -#: ../../Zotlabs/Lib/Apps.php:330 +#: ../../addon/cards/cards.php:49 ../../addon/cards/cards.php:166 +#: ../../addon/cards/Mod_Cards.php:209 ../../Zotlabs/Lib/Apps.php:330 msgid "Cards" msgstr "" -#: ../../addon/cards/cards.php:50 +#: ../../addon/cards/cards.php:52 msgid "View Cards" msgstr "" -#: ../../addon/cards/cards.php:81 ../../addon/articles/articles.php:81 +#: ../../addon/cards/cards.php:83 ../../addon/articles/articles.php:83 #: ../../include/conversation.php:842 msgid "View in context" msgstr "" @@ -4007,12 +4007,12 @@ msgstr "" msgid "Edit Article" msgstr "" -#: ../../addon/articles/articles.php:46 +#: ../../addon/articles/articles.php:48 ../../addon/articles/articles.php:165 #: ../../addon/articles/Mod_Articles.php:228 ../../Zotlabs/Lib/Apps.php:329 msgid "Articles" msgstr "" -#: ../../addon/articles/articles.php:49 +#: ../../addon/articles/articles.php:51 msgid "View Articles" msgstr "" @@ -4976,6 +4976,7 @@ msgid "Ability to display only posts that you've interacted on" msgstr "" #: ../../include/features.php:368 ../../include/nav.php:448 +#: ../../Zotlabs/Widget/Channel_activities.php:94 #: ../../Zotlabs/Module/Fbrowser.php:29 ../../Zotlabs/Lib/Apps.php:349 msgid "Photos" msgstr "" @@ -5596,7 +5597,8 @@ msgstr "" msgid "Click to authenticate to your home hub" msgstr "" -#: ../../include/nav.php:99 ../../Zotlabs/Widget/Admin.php:29 +#: ../../include/nav.php:99 ../../Zotlabs/Widget/Channel_activities.php:240 +#: ../../Zotlabs/Widget/Admin.php:29 #: ../../Zotlabs/Module/Admin/Channels.php:146 #: ../../Zotlabs/Module/Manage.php:162 ../../Zotlabs/Module/Admin.php:116 msgid "Channels" @@ -5738,7 +5740,8 @@ msgstr "" msgid "Profile Details" msgstr "" -#: ../../include/nav.php:456 ../../Zotlabs/Widget/Notifications.php:107 +#: ../../include/nav.php:456 ../../Zotlabs/Widget/Channel_activities.php:126 +#: ../../Zotlabs/Widget/Notifications.php:107 #: ../../Zotlabs/Module/Fbrowser.php:85 ../../Zotlabs/Lib/Apps.php:344 #: ../../Zotlabs/Storage/Browser.php:351 msgid "Files" @@ -5762,8 +5765,8 @@ msgstr "" msgid "Saved Bookmarks" msgstr "" -#: ../../include/nav.php:505 ../../Zotlabs/Module/Webpages.php:249 -#: ../../Zotlabs/Lib/Apps.php:345 +#: ../../include/nav.php:505 ../../Zotlabs/Widget/Channel_activities.php:169 +#: ../../Zotlabs/Module/Webpages.php:249 ../../Zotlabs/Lib/Apps.php:345 msgid "Webpages" msgstr "" @@ -6194,7 +6197,7 @@ msgstr "" msgid "Summary (optional)" msgstr "" -#: ../../include/conversation.php:1775 ../../include/taxonomy.php:670 +#: ../../include/conversation.php:1778 ../../include/taxonomy.php:670 #: ../../include/channel.php:1774 ../../Zotlabs/Module/Photos.php:1142 #: ../../Zotlabs/Lib/ThreadItem.php:259 msgctxt "noun" @@ -6203,7 +6206,7 @@ msgid_plural "Likes" msgstr[0] "" msgstr[1] "" -#: ../../include/conversation.php:1778 ../../Zotlabs/Module/Photos.php:1147 +#: ../../include/conversation.php:1781 ../../Zotlabs/Module/Photos.php:1147 #: ../../Zotlabs/Lib/ThreadItem.php:264 msgctxt "noun" msgid "Dislike" @@ -6211,42 +6214,42 @@ msgid_plural "Dislikes" msgstr[0] "" msgstr[1] "" -#: ../../include/conversation.php:1781 +#: ../../include/conversation.php:1784 msgctxt "noun" msgid "Attending" msgid_plural "Attending" msgstr[0] "" msgstr[1] "" -#: ../../include/conversation.php:1784 +#: ../../include/conversation.php:1787 msgctxt "noun" msgid "Not Attending" msgid_plural "Not Attending" msgstr[0] "" msgstr[1] "" -#: ../../include/conversation.php:1787 +#: ../../include/conversation.php:1790 msgctxt "noun" msgid "Undecided" msgid_plural "Undecided" msgstr[0] "" msgstr[1] "" -#: ../../include/conversation.php:1790 +#: ../../include/conversation.php:1793 msgctxt "noun" msgid "Agree" msgid_plural "Agrees" msgstr[0] "" msgstr[1] "" -#: ../../include/conversation.php:1793 +#: ../../include/conversation.php:1796 msgctxt "noun" msgid "Disagree" msgid_plural "Disagrees" msgstr[0] "" msgstr[1] "" -#: ../../include/conversation.php:1796 +#: ../../include/conversation.php:1799 msgctxt "noun" msgid "Abstain" msgid_plural "Abstains" @@ -7238,19 +7241,19 @@ msgstr "" msgid "View PDF" msgstr "" -#: ../../include/oembed.php:367 +#: ../../include/oembed.php:386 msgid " by " msgstr "" -#: ../../include/oembed.php:368 +#: ../../include/oembed.php:387 msgid " on " msgstr "" -#: ../../include/oembed.php:397 +#: ../../include/oembed.php:416 msgid "Embedded content" msgstr "" -#: ../../include/oembed.php:406 +#: ../../include/oembed.php:425 msgid "Embedding disabled" msgstr "" @@ -7327,6 +7330,20 @@ msgstr "" msgid "Chat Members" msgstr "" +#: ../../Zotlabs/Widget/Channel_activities.php:215 +msgctxt "noun" +msgid "new connection" +msgid_plural "new connections" +msgstr[0] "" +msgstr[1] "" + +#: ../../Zotlabs/Widget/Channel_activities.php:221 +msgctxt "noun" +msgid "notice" +msgid_plural "notices" +msgstr[0] "" +msgstr[1] "" + #: ../../Zotlabs/Widget/Pinned.php:73 ../../Zotlabs/Lib/ThreadItem.php:222 msgid "I will attend" msgstr "" @@ -7537,14 +7554,18 @@ msgstr "" msgid "App Categories" msgstr "" -#: ../../Zotlabs/Widget/Hq_controls.php:24 +#: ../../Zotlabs/Widget/Hq_controls.php:23 msgid "Toggle post editor" msgstr "" -#: ../../Zotlabs/Widget/Hq_controls.php:35 +#: ../../Zotlabs/Widget/Hq_controls.php:33 msgid "Toggle personal notes" msgstr "" +#: ../../Zotlabs/Widget/Hq_controls.php:43 +msgid "Channel activities" +msgstr "" + #: ../../Zotlabs/Widget/Permcats.php:42 msgid "Add new role" msgstr "" @@ -12840,7 +12861,7 @@ msgstr "" msgid "Invalid item." msgstr "" -#: ../../Zotlabs/Module/Page.php:173 +#: ../../Zotlabs/Module/Page.php:174 msgid "" "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod " "tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, " diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 27745d2c2..5eca74c12 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -1721,6 +1721,7 @@ return array( 'Zotlabs\\Widget\\Catcloud_wall' => $baseDir . '/Zotlabs/Widget/Catcloud_wall.php', 'Zotlabs\\Widget\\Categories' => $baseDir . '/Zotlabs/Widget/Categories.php', 'Zotlabs\\Widget\\Cdav' => $baseDir . '/Zotlabs/Widget/Cdav.php', + 'Zotlabs\\Widget\\Channel_activities' => $baseDir . '/Zotlabs/Widget/Channel_activities.php', 'Zotlabs\\Widget\\Chatroom_list' => $baseDir . '/Zotlabs/Widget/Chatroom_list.php', 'Zotlabs\\Widget\\Chatroom_members' => $baseDir . '/Zotlabs/Widget/Chatroom_members.php', 'Zotlabs\\Widget\\Clock' => $baseDir . '/Zotlabs/Widget/Clock.php', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 73eb5014a..09ed04857 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -1932,6 +1932,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d 'Zotlabs\\Widget\\Catcloud_wall' => __DIR__ . '/../..' . '/Zotlabs/Widget/Catcloud_wall.php', 'Zotlabs\\Widget\\Categories' => __DIR__ . '/../..' . '/Zotlabs/Widget/Categories.php', 'Zotlabs\\Widget\\Cdav' => __DIR__ . '/../..' . '/Zotlabs/Widget/Cdav.php', + 'Zotlabs\\Widget\\Channel_activities' => __DIR__ . '/../..' . '/Zotlabs/Widget/Channel_activities.php', 'Zotlabs\\Widget\\Chatroom_list' => __DIR__ . '/../..' . '/Zotlabs/Widget/Chatroom_list.php', 'Zotlabs\\Widget\\Chatroom_members' => __DIR__ . '/../..' . '/Zotlabs/Widget/Chatroom_members.php', 'Zotlabs\\Widget\\Clock' => __DIR__ . '/../..' . '/Zotlabs/Widget/Clock.php', diff --git a/view/css/bootstrap-red.css b/view/css/bootstrap-red.css index 8a33f3b2e..7207086b9 100644 --- a/view/css/bootstrap-red.css +++ b/view/css/bootstrap-red.css @@ -41,20 +41,6 @@ nav .dropdown-menu { overflow: auto; } -#navbar-collapse-2 { - flex-basis: 100%; - max-height: 70vh; -} - -#navbar-collapse-2.show { - overflow: auto; -} - - -#navbar-collapse-2.collapsing .dropdown-header, -#navbar-collapse-2.show .dropdown-header { - padding: 0.5rem 0.1rem; -} .navbar-dark .navbar-toggler { color: rgba(255,255,255,1); diff --git a/view/css/conversation.css b/view/css/conversation.css index b6d47e3c3..169808c57 100644 --- a/view/css/conversation.css +++ b/view/css/conversation.css @@ -316,14 +316,10 @@ a.wall-item-name-link { } code { - font-family: Courier, monospace; - font-size: 1em; - padding: 1em 1.5em; display: block; } code.inline-code { - padding: 0.2em; display: inline; } diff --git a/view/css/mod_wiki.css b/view/css/mod_wiki.css index 7e47dca21..defb40dbb 100644 --- a/view/css/mod_wiki.css +++ b/view/css/mod_wiki.css @@ -1,5 +1,5 @@ #ace-editor { - position: relative; + position: relative; width: 100%; height: 500px; border: 1px solid #ccc; @@ -47,27 +47,3 @@ td > i { #wikis-index td:nth-last-child(1){ padding-right: 10px; } - -pre code { - background: #F5F5F5; - font-family: Courier, monospace; - font-size: 1em; - padding: 1em 1.5em; - display: block; - white-space: pre-wrap; - word-break: break-all; -} - -code { - background: #F5F5F5; - font-family: Courier, monospace; - font-size: 1em; - display: inline; - padding: 0.2em 0.2em; - white-space: pre-wrap; - word-break: break-all; -} - -#wiki-content-container code { - background: #F5F5F5; -} diff --git a/view/es-es/hmessages.po b/view/es-es/hmessages.po index ce0a26aaa..17d4477c5 100644 --- a/view/es-es/hmessages.po +++ b/view/es-es/hmessages.po @@ -7256,7 +7256,7 @@ msgstr "Configuración del canal" #: ../../Zotlabs/Widget/Settings_menu.php:49 msgid "Privacy settings" -msgstr "Ajustes de peivacidad" +msgstr "Ajustes de privacidad" #: ../../Zotlabs/Widget/Settings_menu.php:56 msgid "Display settings" @@ -11807,7 +11807,7 @@ msgstr "Aprobar contacto" #: ../../Zotlabs/Module/Contactedit.php:431 #: ../../Zotlabs/Module/Connedit.php:717 msgid "Their" -msgstr "Su/Sus" +msgstr "Su" #: ../../Zotlabs/Module/Contactedit.php:432 #: ../../Zotlabs/Module/Connedit.php:718 diff --git a/view/es-es/hstrings.php b/view/es-es/hstrings.php index 1e4b43055..47a18171d 100644 --- a/view/es-es/hstrings.php +++ b/view/es-es/hstrings.php @@ -2,7 +2,7 @@ if(! function_exists("string_plural_select_es_es")) { function string_plural_select_es_es($n){ - return ($n != 1); + return ($n != 1 ? 1 : 0); }} App::$rtl = 0; App::$strings["plural_function_code"] = "(n != 1 ? 1 : 0)"; @@ -1619,7 +1619,7 @@ App::$strings["Remove term"] = "Eliminar término"; App::$strings["Suggested Chatrooms"] = "Salas de chat sugeridas"; App::$strings["Account settings"] = "Configuración de la cuenta"; App::$strings["Channel settings"] = "Configuración del canal"; -App::$strings["Privacy settings"] = "Ajustes de peivacidad"; +App::$strings["Privacy settings"] = "Ajustes de privacidad"; App::$strings["Display settings"] = "Ajustes de visualización"; App::$strings["Manage locations"] = "Gestión de ubicaciones (clones) del canal"; App::$strings["Overview"] = "Resumen"; @@ -2653,7 +2653,7 @@ App::$strings["Custom Filter"] = "Filtro personalizado"; App::$strings["Only import posts with this text"] = "Importar solo entradas que contengan este texto"; App::$strings["Do not import posts with this text"] = "No importar entradas que contengan este texto"; App::$strings["Approve contact"] = "Aprobar contacto"; -App::$strings["Their"] = "Su/Sus"; +App::$strings["Their"] = "Su"; App::$strings["My"] = "Mi"; App::$strings["Roles"] = "Roles"; App::$strings["Compare permissions"] = "Comparar permisos"; diff --git a/view/js/main.js b/view/js/main.js index f7709f9d1..3fe916d1d 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -164,8 +164,8 @@ $(document).ready(function() { jQuery.timeago.settings.allowFuture = true; $(document).on('click', '.notification, .message', function(e) { - let b64mid = $(this).data('b64mid'); - let notify_id = $(this).data('notify_id'); + let b64mid = this.dataset.b64mid; + let notify_id = this.dataset.notify_id; let path = $(this)[0].pathname.split('/')[1]; let stateObj = { b64mid: b64mid }; let singlethread_modules = ['display', 'hq']; @@ -882,7 +882,7 @@ function updateInit() { if($('#live-channel').length) { src = 'channel'; } if($('#live-pubstream').length) { src = 'pubstream'; } if($('#live-display').length) { src = 'display'; } - if($('#live-hq').length) { src = 'hq'; } + //if($('#live-hq').length) { src = 'hq'; } if($('#live-search').length) { src = 'search'; } // if($('#live-cards').length) { src = 'cards'; } // if($('#live-articles').length) { src = 'articles'; } diff --git a/view/js/mod_cloud.js b/view/js/mod_cloud.js index 1f444e4fe..7f9cb4fd1 100644 --- a/view/js/mod_cloud.js +++ b/view/js/mod_cloud.js @@ -14,6 +14,11 @@ $(document).ready(function () { // Per File Tools + // highlight and scroll into view if we got an id via hash + if(window.location.hash) { + $('#cloud-index-' + window.location.hash.substr(1)).addClass('cloud-index-active').get(0).scrollIntoView({block: 'center'}); + } + $('.cloud-tool-info-btn').on('click', function (e) { e.preventDefault(); let id = $(this).data('id'); diff --git a/view/js/mod_hq.js b/view/js/mod_hq.js index 5f8430b4d..dc274c5bf 100644 --- a/view/js/mod_hq.js +++ b/view/js/mod_hq.js @@ -1,17 +1,42 @@ $(document).ready(function() { - $(document).on('click', '.jot-toggle', function(e) { + $('.autotime').timeago(); + + if (bParam_mid) { + src = 'hq'; + $('.channel-activities-toggle').removeClass('d-none'); + } + else { + $('#channel-activities').removeClass('d-none'); + } + + $(document).one('click', '.notification, .message', function(e) { + page_load = false; + followUpPageLoad = true; + src = 'hq'; + $('#channel-activities').addClass('d-none'); + $('.channel-activities-toggle').removeClass('d-none'); + }); + + $(document).on('click', '.channel-activities-toggle', function(e) { $(window).scrollTop(0); $(document).trigger('hz:hqControlsClickAction'); + $('#channel-activities').toggleClass('d-none'); + $(this).toggleClass('active'); + }); + + $(document).on('click', '.jot-toggle', function(e) { + $(document).trigger('hz:hqControlsClickAction'); $('#jot-popup').toggle(); - $('#profile-jot-text').focus(); + $('#profile-jot-text').focus().get(0).scrollIntoView({block: 'center'}); + $(this).toggleClass('active'); }); $(document).on('click', '.notes-toggle', function(e) { - $(window).scrollTop(0); $(document).trigger('hz:hqControlsClickAction'); $('#personal-notes').toggleClass('d-none'); - $('#note-text').focus(); + $('#note-text-html').get(0).scrollIntoView({block: 'center'}); + $(this).toggleClass('active'); }); }); diff --git a/view/pdl/mod_hq.pdl b/view/pdl/mod_hq.pdl index 9e139d7b9..d396ffa81 100644 --- a/view/pdl/mod_hq.pdl +++ b/view/pdl/mod_hq.pdl @@ -6,6 +6,7 @@ [/widget] [/region] [region=content] +[widget=channel_activities][/widget] [widget=notes] [var=hidden]1[/var] [var=app]1[/var] diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 3b2370b7f..d282e1a3b 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -145,23 +145,6 @@ input[type=text], textarea { white-space: pre; } -pre code { - border: none; - padding: 1em 1.5em; -} - -code { - background: #ccc; - color: #000; -} - -pre { - background: #F5F5F5; - color: #333; - border:1px solid #ccc; - border-radius: $radius; -} - .heart { color: #FF0000; } @@ -209,7 +192,7 @@ nav { max-height: 50%; background: $comment_item_colour; padding: 1rem; - border-bottom: #ccc 1px solid; + border-bottom: #e0e0e0 1px solid; overflow: auto; -moz-box-shadow: 0px 3px 3px rgba(0,0,0,0.2); -webkit-box-shadow: 0px 3px 3px rgba(0,0,0,0.2); @@ -455,7 +438,7 @@ footer { .pager-prev, .pager-next, .pager_n { - border: 1px solid #ccc; + border: 1px solid #e0e0e0; background: transparent; padding: 4px; } @@ -706,7 +689,7 @@ nav .acpopup { */ .oauthapp { height: auto; overflow: auto; - border-bottom: 2px solid #cccccc; + border-bottom: 2px solid #e0e0e0; padding-bottom: 1em; margin-bottom: 1em; } @@ -1086,7 +1069,7 @@ img.mail-conv-sender-photo { .hide-comments-outer { background-color: $comment_item_colour; - border-top-color: #ccc; + border-top-color: #e0e0e0; border-style: solid; border-top-style: dashed; border-width: 1px 0px 0px 0px; @@ -1140,13 +1123,13 @@ img.mail-conv-sender-photo { .comment-edit-text { - border: 1px solid #ccc; + border: 1px solid #e0e0e0; border-radius: $radius; } .divgrow-showmore { display: block; - border-top: 1px dashed #ccc; + border-top: 1px dashed #e0e0e0; text-align: center; } @@ -1180,7 +1163,7 @@ img.mail-conv-sender-photo { } #datebrowse-sidebar select { - border: 1px solid #ccc; + border: 1px solid #e0e0e0; border-radius: $radius; } @@ -1265,7 +1248,7 @@ img.mail-conv-sender-photo { } .generic-content-wrapper { - border: 1px solid rgba(0, 0, 0, .2); + border: 1px solid #e0e0e0; border-radius: $radius; margin-bottom: 1.5rem; } @@ -1437,7 +1420,7 @@ main.fullscreen .section-content-wrapper-np { blockquote { font-size: 1rem; font-style: italic; - border-left: 3px solid #ccc; + border-left: 3px solid #e0e0e0; padding: 1em 0px 1em 1.5em; margin: 0px; } @@ -1612,7 +1595,7 @@ dl.bb-dl > dd > li { .onoffswitch.checkbox > div label { display: block; overflow: hidden; cursor: pointer; - border: 1px solid #ccc; + border: 1px solid #e0e0e0; border-radius: 12px; margin:0px; -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; @@ -1651,13 +1634,13 @@ dl.bb-dl > dd > li { .onoffswitch-inner:after { content: attr(data-off); padding-left: 21px; - background-color: $item_colour; color: #ccc; + background-color: $item_colour; color: #e0e0e0; text-align: left; } .onoffswitch-switch { display: block; width: 15px; margin:4px; - background: #ccc; + background: #e0e0e0; border-radius: 10px; position: absolute; top: 0; bottom: 0; right: 36px; -moz-transition: all 0.3s ease-in 0s; -webkit-transition: all 0.3s ease-in 0s; @@ -1801,3 +1784,7 @@ span.default-highlight { .bootstrap-tagsinput { width: 100%; } + +.jg-entry img { + border-radius: $radius; +} diff --git a/view/theme/redbasic/php/style.php b/view/theme/redbasic/php/style.php index 3dbc29a96..fd79b02a9 100644 --- a/view/theme/redbasic/php/style.php +++ b/view/theme/redbasic/php/style.php @@ -80,13 +80,13 @@ if (! $nav_active_icon_colour) if (! $link_colour) $link_colour = '#0d6efd'; if (! $banner_colour) - $banner_colour = '#fff'; + $banner_colour = '#efefef'; if (! $bgcolour) $bgcolour = 'rgb(254,254,254)'; if (! $background_image) $background_image =''; if (! $item_colour) - $item_colour = 'rgb(238,238,238)'; + $item_colour = '#f6f6f6'; if (! $comment_item_colour) $comment_item_colour = 'rgb(255,255,255)'; if (! $item_opacity) diff --git a/view/theme/redbasic/schema/dark.css b/view/theme/redbasic/schema/dark.css index e7049a1c5..751ce25e8 100644 --- a/view/theme/redbasic/schema/dark.css +++ b/view/theme/redbasic/schema/dark.css @@ -40,13 +40,19 @@ option { color: $link_colour !important; } -.vcard, #contact-block, .widget { +.vcard, +#contact-block, +.widget { background-color: transparent; border: none; border-bottom: 1px solid #333; border-radius: 0px } +.vcard-card { + background-color: transparent; +} + #profile-photo-wrapper { border: none; } @@ -323,10 +329,6 @@ a, a:visited, a:link, .fakelink, .fakelink:visited, .fakelink:link { background-color: #222; } -.text-dark { - color: #aaa !important; -} - .group-selected, .fileas-selected, .categories-selected, .search-selected, a.active { color: #fff !important; text-decoration: underline !important; @@ -484,18 +486,18 @@ pre { /* category badge fix: */ -a.text-dark:focus, a.text-dark:hover { - color: #ddd !important; -} -.badge-warning { -/* background-color: #ffc927; */ +.bg-warning { + background-color: #e38916; +} +.bg-warning:hover, .bg-warning:focus { + background-color: #ffc927 !important; } -.badge-warning a.text-dark { - color: #333 !important; +.bg-warning a.text-dark { + color: #111 !important; } -.badge-warning a.text-dark:focus, .badge-warning a.text-dark:hover { - color: red !important; +.bg-warning a.text-dark:focus, .bg-warning a.text-dark:hover { + color: #bd0000 !important; text-decoration: none; } diff --git a/view/tpl/channel_activities.tpl b/view/tpl/channel_activities.tpl new file mode 100644 index 000000000..a675f71db --- /dev/null +++ b/view/tpl/channel_activities.tpl @@ -0,0 +1,21 @@ +<div class="mb-1 text-uppercase"> + <a href="{{$url}}"><i class="fa fa-fw fa-{{$icon}} generic-icons-nav"></i>{{$label}}</a> +</div> +<div class="row mb-3"> + {{foreach $items as $i}} + <div class="col-sm-4 mb-3"> + <div class="card"> + <a href="{{$i.url}}" class="text-dark"> + <div class="card-body"> + {{if $i.title}} + <strong>{{$i.title}}</strong> + <hr> + {{/if}} + {{$i.summary}} + </div> + <div class="card-footer text-muted autotime" title="{{$i.footer}}">{{$i.footer}}</div> + </a> + </div> + </div> + {{/foreach}} +</div> diff --git a/view/tpl/channel_activities_photos.tpl b/view/tpl/channel_activities_photos.tpl new file mode 100644 index 000000000..b0079f382 --- /dev/null +++ b/view/tpl/channel_activities_photos.tpl @@ -0,0 +1,19 @@ +<div class="mb-1 text-uppercase"> + <a href="{{$url}}"><i class="fa fa-fw fa-{{$icon}} generic-icons-nav"></i>{{$label}}</a> +</div> +<div id="photo-album" class="mb-4"> + {{foreach $items as $i}} + <a href="{{$i.url}}" title="{{$i.alt}}"> + <img src="{{$i.src}}" width="{{$i.width}}" height="{{$i.height}}" alt="{{$i.alt}}"> + <div class='jg-caption autotime' title="{{$i.edited}}"></div> + </a> + {{/foreach}} +</div> +<script> + $('#photo-album').justifiedGallery({ + border: 0, + margins: 3, + maxRowsCount: 1, + waitThumbnailsLoad: false + }); +</script> diff --git a/view/tpl/contact_edit_modal.tpl b/view/tpl/contact_edit_modal.tpl index ddb1557c1..72feb7138 100644 --- a/view/tpl/contact_edit_modal.tpl +++ b/view/tpl/contact_edit_modal.tpl @@ -24,29 +24,24 @@ </div> </div> <script> + let poi; let section = 'roles'; let sub_section; - - $('#edit-modal').on('hidden.bs.modal', function (e) { - if (window.location.hash) { - history.replaceState(null, '', 'connections'); - } - }) - - if (window.location.hash) { - poi = window.location.hash.substr(1); - init_contact_edit(poi); - } - - window.onhashchange = function() { + $(document).ready(function() { if (window.location.hash) { poi = window.location.hash.substr(1); init_contact_edit(poi); } - }; + window.onhashchange = function() { + if (window.location.hash) { + poi = window.location.hash.substr(1); + init_contact_edit(poi); + } + }; + }); $(document).on('click', '.contact-edit', function (e) { e.preventDefault(); @@ -101,6 +96,12 @@ } }); + $('#edit-modal').on('hidden.bs.modal', function (e) { + if (window.location.hash) { + history.replaceState(null, '', 'connections'); + } + }); + function init_contact_edit(poi) { if (!poi) return; diff --git a/view/tpl/messages_widget.tpl b/view/tpl/messages_widget.tpl index 83f563db6..ddb21beb5 100644 --- a/view/tpl/messages_widget.tpl +++ b/view/tpl/messages_widget.tpl @@ -69,7 +69,9 @@ $(document).ready(function () { $('.messages-timeago').timeago(); - $('.message[data-b64mid=\'' + bParam_mid + '\']').addClass('active'); + if (bParam_mid) { + $('.message[data-b64mid=\'' + bParam_mid + '\']').addClass('active'); + } }); $('#messages-widget').on('scroll', function() { @@ -130,7 +132,9 @@ else { $('#messages-empty').show(); } - $('.message[data-b64mid=\'' + bParam_mid + '\']').addClass('active'); + if (bParam_mid) { + $('.message[data-b64mid=\'' + bParam_mid + '\']').addClass('active'); + } $('#messages-loading').hide(); $('.messages-timeago').timeago(); diff --git a/view/tpl/page_display.tpl b/view/tpl/page_display.tpl index a320920c7..589de0b41 100644 --- a/view/tpl/page_display.tpl +++ b/view/tpl/page_display.tpl @@ -9,6 +9,11 @@ <div class="page-author"><a class="page-author-link" href="{{$auth_url}}">{{$author}}</a></div> <div class="page-date">{{$date}}</div> <div class="page-body">{{$body}}</div> + {{if $edit_link}} + <div class="position-fixed bottom-0 end-0 m-3"> + <a href="{{$edit_link}}" class="btn btn-lg btn-primary rounded-circle"><i class="fa fa-pencil"></i></a> + </div> + {{/if}} </div> </div> </div> diff --git a/view/tpl/page_display_empty.tpl b/view/tpl/page_display_empty.tpl index 9f000dee8..5a3bdc530 100644 --- a/view/tpl/page_display_empty.tpl +++ b/view/tpl/page_display_empty.tpl @@ -1 +1,6 @@ -{{$body}}
\ No newline at end of file +{{$body}} +{{if $edit_link}} +<div class="position-fixed bottom-0 end-0 m-3"> + <a href="{{$edit_link}}" class="btn btn-lg btn-primary rounded-circle"><i class="fa fa-pencil"></i></a> +</div> +{{/if}} |