From ebc84eab3fc6b2ee29afd13295f47419f16d2fe1 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 1 Jul 2021 22:30:29 +0200 Subject: update by xchan_url to catch all associated entries --- Zotlabs/Lib/Libzot.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index ae8c725d7..cb9bf9937 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -727,7 +727,7 @@ class Libzot { || $hidden_changed || $adult_changed || $deleted_changed || $pubforum_changed) { $rup = q("update xchan set xchan_name = '%s', xchan_name_date = '%s', xchan_connurl = '%s', xchan_follow = '%s', xchan_connpage = '%s', xchan_hidden = %d, xchan_selfcensored = %d, xchan_deleted = %d, xchan_pubforum = %d, - xchan_addr = '%s', xchan_url = '%s' where xchan_hash = '%s'", + xchan_addr = '%s', xchan_url = '%s' where xchan_url = '%s'", dbesc(($arr['name']) ? escape_tags($arr['name']) : '-'), dbesc($arr['name_updated']), dbesc($arr['primary_location']['connections_url']), @@ -739,7 +739,7 @@ class Libzot { intval($arr['public_forum']), dbesc(escape_tags($arr['primary_location']['address'])), dbesc(escape_tags($arr['primary_location']['url'])), - dbesc($xchan_hash) + dbesc($r[0]['xchan_url']) ); logger('Update: existing: ' . print_r($r[0], true), LOGGER_DATA, LOG_DEBUG); -- cgit v1.2.3 From faeec0b77b49e21f17e9f38ed5ec6fa9cec138e7 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 2 Jul 2021 07:23:18 +0000 Subject: revert ebc84eab3fc6b2ee29afd13295f47419f16d2fe1 instead be more picky about the xchan in handle_tag() --- Zotlabs/Lib/Libzot.php | 4 ++-- include/text.php | 21 +++++++++------------ 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index cb9bf9937..ae8c725d7 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -727,7 +727,7 @@ class Libzot { || $hidden_changed || $adult_changed || $deleted_changed || $pubforum_changed) { $rup = q("update xchan set xchan_name = '%s', xchan_name_date = '%s', xchan_connurl = '%s', xchan_follow = '%s', xchan_connpage = '%s', xchan_hidden = %d, xchan_selfcensored = %d, xchan_deleted = %d, xchan_pubforum = %d, - xchan_addr = '%s', xchan_url = '%s' where xchan_url = '%s'", + xchan_addr = '%s', xchan_url = '%s' where xchan_hash = '%s'", dbesc(($arr['name']) ? escape_tags($arr['name']) : '-'), dbesc($arr['name_updated']), dbesc($arr['primary_location']['connections_url']), @@ -739,7 +739,7 @@ class Libzot { intval($arr['public_forum']), dbesc(escape_tags($arr['primary_location']['address'])), dbesc(escape_tags($arr['primary_location']['url'])), - dbesc($r[0]['xchan_url']) + dbesc($xchan_hash) ); logger('Update: existing: ' . print_r($r[0], true), LOGGER_DATA, LOG_DEBUG); diff --git a/include/text.php b/include/text.php index 9869bfbfa..841abdbd3 100644 --- a/include/text.php +++ b/include/text.php @@ -11,6 +11,7 @@ use Ramsey\Uuid\Exception\UnableToBuildUuidException; use Zotlabs\Lib\Crypto; use Zotlabs\Lib\SvgSanitizer; +use Zotlabs\Lib\Libzot; require_once("include/bbcode.php"); @@ -2851,7 +2852,7 @@ function handle_tag(&$body, &$str_tags, $profile_uid, $tag, $in_network = true) // BEGIN mentions - if ( in_array($termtype, [ TERM_MENTION, TERM_FORUM ] )) { + if ($termtype === TERM_MENTION) { // The @! tag will alter permissions @@ -2939,7 +2940,10 @@ function handle_tag(&$body, &$str_tags, $profile_uid, $tag, $in_network = true) // $r is set if we found something if($r) { - foreach($r as $xc) { + + $xchan[0] = Libzot::zot_record_preferred($r, 'xchan_network'); + + foreach($xchan as $xc) { $profile = $xc['xchan_url']; $newname = $xc['xchan_name']; // add the channel's xchan_hash to $access_tag if exclusive @@ -2954,16 +2958,9 @@ function handle_tag(&$body, &$str_tags, $profile_uid, $tag, $in_network = true) //create profile link $profile = str_replace(',','%2c',$profile); $url = $profile; -/* - if($termtype === TERM_FORUM) { - $newtag = '!' . (($exclusive) ? '!' : '') . '[zrl=' . $profile . ']' . $newname . '[/zrl]'; - $body = str_replace('!' . (($exclusive) ? '!' : '') . $name, $newtag, $body); - } -*/ - if ($termtype === TERM_MENTION) { - $newtag = '@' . (($exclusive) ? '!' : '') . '[zrl=' . $profile . ']' . $newname . '[/zrl]'; - $body = str_replace('@' . (($exclusive) ? '!' : '') . $name, $newtag, $body); - } + + $newtag = '@' . (($exclusive) ? '!' : '') . '[zrl=' . $profile . ']' . $newname . '[/zrl]'; + $body = str_replace('@' . (($exclusive) ? '!' : '') . $name, $newtag, $body); // append tag to str_tags if(! stristr($str_tags,$newtag)) { -- cgit v1.2.3 From 0ab7996a2a864222caaabc84ab758ca93961315f Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 2 Jul 2021 16:07:31 +0200 Subject: update changelog --- CHANGELOG | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 1c4b6cdd6..7ea061faa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,50 @@ +Hubzilla 6.0 (2021-07-xx) + + - DB update 1247 to clean up bogus entries in updates + - DB update 1246 to deprecate legacy zot xchans and hublocs + - Implement desktop notifications + - Emit a warning if the calendar for the created event is disabled + - Add an option to drop media for bbcode processing + - Make mod HQ the default landing page after login + - Implement direct messages view for mod HQ + - Implement public/restricted messages vie for mod HQ + - Implement starred messages view for mod HQ (only available if the Star Posts feature is enabled) + - Update composer libs + - Remove deprecated mod ping + - Remove legacy zot libs and functions - major cleanup + + Bugfixes + - Fix deleting and starring in unthreaded view + - Fix issue where incomplete datasets were stored into updates + - Fix where notifications were not loaded if a filter was applied + - Fix in browser email validation for registrations + - Fix directory sync issues + - Fix issue where the original rawmsg iconfig got overwritten + - Fix unmaintained id3 pareser for PHP8 + - Fix item_private state for imported items + - Random PHP8 fixes (ongoing) + + Addons + - Pubcrawl: fix ld-signature for profile updates + - Pubcrawl: deprecate as_actor_store() in favor of Activity::actor_store() + - Twitter: prevent duplicated tweets + - Remove legacy zot dpendencies and deprecated functions + - Pubcrawl: fix remote reply for peertube + - Pubcrawl: fix issue where we could end up with an xchan but without hubloc + - Diaspora: implement the direct_message_recipients hook + - Queueworker: add a simple priority mechanism to prevent not so important janitor tasks (e.g. onedirsync) stuffing up the queue and delaying deliver of items + - Pubcrawl: implement direct message recognision for activities coming from Mastodon + - Pubcrawl: always show complete threads (complete as in all the messages we have received) in public stream + - Twitter_api: remove the mail endpoint + - Mail: make interface read only with the possibility to download and delete mails (this addon will be removed in a future version) + - Pubsubhubbub: move to addons-unmaintained + - GNU-Social: move to addons-unmaintained + - Fixes to reflect core notifier changes + - Diaspora: refactor conversations a.k.a mail to implement direct messages infrastructure + - Pubcrawl: allow hublocs to be upgraded from ostatus + - Diaspora: fix issue where we could end up with an xchan but without hubloc + + Hubzilla 5.6.1 (2021-06-04) - Update spanish translations - Fix login name label if register email verification is disabled -- cgit v1.2.3 From e94eb1af0cbbb1c89332b87e6ee35ca1f4658535 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 2 Jul 2021 16:13:48 +0200 Subject: remove mail and conv tables from install SQL schemas --- install/schema_mysql.sql | 59 --------------------------------------------- install/schema_postgres.sql | 57 ------------------------------------------- 2 files changed, 116 deletions(-) diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index 17ad1767e..8267d17f7 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -366,20 +366,6 @@ CREATE TABLE IF NOT EXISTS `config` ( UNIQUE KEY `access` (`cat`,`k`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -CREATE TABLE IF NOT EXISTS `conv` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `guid` char(191) NOT NULL DEFAULT '', - `recips` mediumtext NOT NULL, - `uid` int(11) NOT NULL DEFAULT 0 , - `creator` char(191) NOT NULL DEFAULT '', - `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00', - `updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00', - `subject` mediumtext NOT NULL, - PRIMARY KEY (`id`), - KEY `created` (`created`), - KEY `updated` (`updated`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - CREATE TABLE IF NOT EXISTS `dreport` ( `dreport_id` int(11) NOT NULL AUTO_INCREMENT, `dreport_channel` int(11) NOT NULL DEFAULT 0 , @@ -730,51 +716,6 @@ CREATE TABLE IF NOT EXISTS listeners ( KEY ltype (ltype) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -CREATE TABLE IF NOT EXISTS `mail` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `convid` int(10) unsigned NOT NULL DEFAULT 0 , - `conv_guid` char(191) NOT NULL DEFAULT '', - `mail_flags` int(10) unsigned NOT NULL DEFAULT 0 , - `from_xchan` char(191) NOT NULL DEFAULT '', - `to_xchan` char(191) NOT NULL DEFAULT '', - `account_id` int(10) unsigned NOT NULL DEFAULT 0 , - `channel_id` int(10) unsigned NOT NULL DEFAULT 0 , - `mail_mimetype` char(64) NOT NULL DEFAULT 'text/bbcode', - `title` text NOT NULL, - `body` mediumtext NOT NULL, - `sig` text NOT NULL, - `attach` mediumtext NOT NULL, - `mid` char(191) NOT NULL DEFAULT '', - `parent_mid` char(191) NOT NULL DEFAULT '', - `mail_deleted` tinyint(4) NOT NULL DEFAULT 0 , - `mail_replied` tinyint(4) NOT NULL DEFAULT 0 , - `mail_isreply` tinyint(4) NOT NULL DEFAULT 0 , - `mail_seen` tinyint(4) NOT NULL DEFAULT 0 , - `mail_recalled` tinyint(4) NOT NULL DEFAULT 0 , - `mail_obscured` smallint(6) NOT NULL DEFAULT 0 , - `mail_raw` tinyint(4) NOT NULL DEFAULT 0 , - `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00', - `expires` datetime NOT NULL DEFAULT '0001-01-01 00:00:00', - PRIMARY KEY (`id`), - KEY `created` (`created`), - KEY `mail_flags` (`mail_flags`), - KEY `account_id` (`account_id`), - KEY `channel_id` (`channel_id`), - KEY `from_xchan` (`from_xchan`), - KEY `to_xchan` (`to_xchan`), - KEY `mid` (`mid`), - KEY `parent_mid` (`parent_mid`), - KEY `expires` (`expires`), - KEY `convid` (`convid`), - KEY `conv_guid` (`conv_guid`), - KEY `mail_deleted` (`mail_deleted`), - KEY `mail_replied` (`mail_replied`), - KEY `mail_isreply` (`mail_isreply`), - KEY `mail_seen` (`mail_seen`), - KEY `mail_recalled` (`mail_recalled`), - KEY `mail_obscured` (`mail_obscured`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - CREATE TABLE IF NOT EXISTS `menu` ( `menu_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `menu_channel_id` int(10) unsigned NOT NULL DEFAULT 0 , diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index c18cc087b..f3fe28f93 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -356,19 +356,6 @@ CREATE TABLE "config" ( PRIMARY KEY ("id"), UNIQUE ("cat","k") ); -CREATE TABLE "conv" ( - "id" serial NOT NULL, - "guid" text NOT NULL, - "recips" text NOT NULL, - "uid" bigint NOT NULL, - "creator" text NOT NULL, - "created" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00', - "updated" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00', - "subject" text NOT NULL, - PRIMARY KEY ("id") -); -create index "conv_created_idx" on conv ("created"); -create index "conv_updated_idx" on conv ("updated"); CREATE TABLE IF NOT EXISTS "dreport" ( "dreport_id" serial NOT NULL, @@ -729,50 +716,6 @@ create index "target_id_idx" on listeners ("target_id"); create index "portable_id_idx" on listeners ("portable_id"); create index "ltype_idx" on listeners ("ltype"); -CREATE TABLE "mail" ( - "id" serial NOT NULL, - "convid" bigint NOT NULL DEFAULT '0', - "conv_guid" text NOT NULL, - "mail_flags" bigint NOT NULL DEFAULT '0', - "from_xchan" text NOT NULL DEFAULT '', - "to_xchan" text NOT NULL DEFAULT '', - "account_id" bigint NOT NULL DEFAULT '0', - "channel_id" bigint NOT NULL DEFAULT '0', - "mail_mimetype" varchar(64) NOT NULL DEFAULT '0', - "title" text NOT NULL, - "body" text NOT NULL, - "sig" text NOT NULL, - "attach" text NOT NULL DEFAULT '', - "mid" text NOT NULL, - "parent_mid" text NOT NULL, - "mail_deleted" smallint NOT NULL DEFAULT '0', - "mail_replied" smallint NOT NULL DEFAULT '0', - "mail_isreply" smallint NOT NULL DEFAULT '0', - "mail_seen" smallint NOT NULL DEFAULT '0', - "mail_recalled" smallint NOT NULL DEFAULT '0', - "mail_obscured" smallint NOT NULL DEFAULT '0', - "mail_raw" smallint NOT NULL DEFAULT '0', - "created" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00', - "expires" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00', - PRIMARY KEY ("id") -); -create index "mail_convid" on mail ("convid"); -create index "mail_conv_guid" on mail ("conv_guid"); -create index "mail_created" on mail ("created"); -create index "mail_flags" on mail ("mail_flags"); -create index "mail_account_id" on mail ("account_id"); -create index "mail_channel_id" on mail ("channel_id"); -create index "mail_from_xchan" on mail ("from_xchan"); -create index "mail_to_xchan" on mail ("to_xchan"); -create index "mail_mid" on mail ("mid"); -create index "mail_parent_mid" on mail ("parent_mid"); -create index "mail_expires" on mail ("expires"); -create index "mail_deleted" on mail ("mail_deleted"); -create index "mail_replied" on mail ("mail_replied"); -create index "mail_isreply" on mail ("mail_isreply"); -create index "mail_seen" on mail ("mail_seen"); -create index "mail_recalled" on mail ("mail_recalled"); -create index "mail_obscured" on mail ("mail_obscured"); CREATE TABLE "menu" ( "menu_id" serial NOT NULL, "menu_channel_id" bigint NOT NULL DEFAULT '0', -- cgit v1.2.3 From f5912e05ef37d70a95012a9ef8b533c0a8129486 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 2 Jul 2021 16:37:50 +0200 Subject: do not use summary in photo object --- include/photos.php | 1 - 1 file changed, 1 deletion(-) diff --git a/include/photos.php b/include/photos.php index cfa29a253..967acf955 100644 --- a/include/photos.php +++ b/include/photos.php @@ -412,7 +412,6 @@ function photo_upload($channel, $observer, $args) { $object = [ 'type' => 'Image', 'name' => $title, - 'summary' => $p['description'], 'published' => datetime_convert('UTC','UTC',$p['created'],ATOM_TIME), 'updated' => datetime_convert('UTC','UTC',$p['edited'],ATOM_TIME), // This is a placeholder and will get over-ridden by the item mid, which is critical for sharing as a conversational item over activitypub -- cgit v1.2.3 From 933c097a52cd3947019a5fc00d534c53ccf94484 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 2 Jul 2021 16:46:49 +0200 Subject: changelog typos --- CHANGELOG | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7ea061faa..15af421ab 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,7 @@ Hubzilla 6.0 (2021-07-xx) - DB update 1247 to clean up bogus entries in updates - - DB update 1246 to deprecate legacy zot xchans and hublocs + - DB update 1246 to mark legacy zot xchans and hublocs deleted - Implement desktop notifications - Emit a warning if the calendar for the created event is disabled - Add an option to drop media for bbcode processing @@ -16,7 +16,8 @@ Hubzilla 6.0 (2021-07-xx) Bugfixes - Fix deleting and starring in unthreaded view - Fix issue where incomplete datasets were stored into updates - - Fix where notifications were not loaded if a filter was applied + - Fix photo item tags not stored and propagated + - Fix notifications not loading if a filter was applied - Fix in browser email validation for registrations - Fix directory sync issues - Fix issue where the original rawmsg iconfig got overwritten @@ -32,7 +33,7 @@ Hubzilla 6.0 (2021-07-xx) - Pubcrawl: fix remote reply for peertube - Pubcrawl: fix issue where we could end up with an xchan but without hubloc - Diaspora: implement the direct_message_recipients hook - - Queueworker: add a simple priority mechanism to prevent not so important janitor tasks (e.g. onedirsync) stuffing up the queue and delaying deliver of items + - Queueworker: add a simple priority mechanism to prevent not so important janitor tasks (e.g. onedirsync) stuffing up the queue and delaying delivery of items - Pubcrawl: implement direct message recognision for activities coming from Mastodon - Pubcrawl: always show complete threads (complete as in all the messages we have received) in public stream - Twitter_api: remove the mail endpoint -- cgit v1.2.3 From cca3eb8c56f429e12d69033facb62ceda56cb27c Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 2 Jul 2021 17:49:03 +0200 Subject: work around the fact that sticky does not stick if a parent element has set overflow to hidden --- view/theme/redbasic/js/redbasic.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js index b0b8d5dfc..35811b524 100644 --- a/view/theme/redbasic/js/redbasic.js +++ b/view/theme/redbasic/js/redbasic.js @@ -139,12 +139,12 @@ function makeFullScreen(full) { function toggleAside() { $('#expand-aside-icon').toggleClass('fa-arrow-circle-right').toggleClass('fa-arrow-circle-left'); if($('main').hasClass('region_1-on')){ - $('html, body').css('overflow-x', ''); + $('html, body').css({ 'position': '', 'left': '' }); $('main').removeClass('region_1-on') $('#overlay').remove(); } else { - $('html, body').css('overflow-x', 'hidden'); + $('html, body').css({ 'position': 'sticky', 'left': 0 }); $('main').addClass('region_1-on') $('
').appendTo('section'); } -- cgit v1.2.3 From 081d82218bc2e00169614f268278f7d9dc1e5402 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 3 Jul 2021 14:27:55 +0200 Subject: implement a very simple swipe mechanism for bringing in left aside --- view/theme/redbasic/js/redbasic.js | 64 +++++++++++++++++++++++++++++++------- 1 file changed, 53 insertions(+), 11 deletions(-) diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js index 35811b524..1ce1a6d89 100644 --- a/view/theme/redbasic/js/redbasic.js +++ b/view/theme/redbasic/js/redbasic.js @@ -11,7 +11,7 @@ $(document).ready(function() { if($(window).width() < 992) { $('main').css('width', $(window).width() + $('aside').outerWidth() ); } else { - $('main').css('width', '100%' ); + $('main').css('width', '100%'); } }); } @@ -20,11 +20,18 @@ $(document).ready(function() { stickyScroll('.aside_spacer_left', '.aside_spacer_top_left', '.content', parseFloat(window.getComputedStyle(document.querySelector('#region_1')).getPropertyValue('padding-top')), 0); stickyScroll('.aside_spacer_right', '.aside_spacer_top_right', '.content', parseFloat(window.getComputedStyle(document.querySelector('#region_3')).getPropertyValue('padding-top')), 20); - $('#expand-aside').on('click', toggleAside); + $('#expand-aside').on('click', function() { + if($('main').hasClass('region_1-on')){ + toggleAside('left'); + } + else { + toggleAside('right'); + } + }); $('section').on('click', function() { if($('main').hasClass('region_1-on')){ - toggleAside(); + toggleAside('left'); } }); @@ -69,6 +76,39 @@ $(document).ready(function() { } } setInterval(function () {checkNotify();}, 10 * 1000); + + var touch_start = null; + window.addEventListener('touchstart', function(e) { + if (e.touches.length === 1){ + //just one finger touched + touch_start = e.touches.item(0).clientX; + } + else { + //a second finger hit the screen, abort the touch + touch_start = null; + } + }); + + window.addEventListener('touchend', function(e) { + let touch_offset = 50; //at least 100px are a swipe + let touch_max = 100; + if (touch_start) { + //the only finger that hit the screen left it + let touch_end = e.changedTouches.item(0).clientX; + + if (touch_end > (touch_start + touch_offset)) { + //a left -> right swipe + if (touch_start < touch_max) { + toggleAside('right'); + } + } + if (touch_end < (touch_start - touch_offset)) { + //a right -> left swipe + //toggleAside('left'); + } + } + }); + }); function setStyle(element, cssProperty) { @@ -136,16 +176,18 @@ function makeFullScreen(full) { } } -function toggleAside() { - $('#expand-aside-icon').toggleClass('fa-arrow-circle-right').toggleClass('fa-arrow-circle-left'); - if($('main').hasClass('region_1-on')){ - $('html, body').css({ 'position': '', 'left': '' }); - $('main').removeClass('region_1-on') +function toggleAside(swipe) { + + if ($('main').hasClass('region_1-on') && swipe === 'left') { + $('#expand-aside-icon').addClass('fa-arrow-circle-right').removeClass('fa-arrow-circle-left'); + $('html, body').css('overflow-x', ''); + $('main').removeClass('region_1-on'); $('#overlay').remove(); } - else { - $('html, body').css({ 'position': 'sticky', 'left': 0 }); - $('main').addClass('region_1-on') + if (!$('main').hasClass('region_1-on') && swipe === 'right') { + $('#expand-aside-icon').removeClass('fa-arrow-circle-right').addClass('fa-arrow-circle-left'); + $('html, body').css('overflow-x', 'hidden'); + $('main').addClass('region_1-on'); $('
').appendTo('section'); } } -- cgit v1.2.3 From a1f7f7a966b9d70b4b80f9fe47e2fb76b2ed5681 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 3 Jul 2021 14:36:27 +0200 Subject: since position sticky has no effect if overflow is hidden and the workarounds also have issues, we will automatically scroll to top when left aside is brought in --- view/theme/redbasic/js/redbasic.js | 1 + 1 file changed, 1 insertion(+) diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js index 1ce1a6d89..0ae81f93e 100644 --- a/view/theme/redbasic/js/redbasic.js +++ b/view/theme/redbasic/js/redbasic.js @@ -186,6 +186,7 @@ function toggleAside(swipe) { } if (!$('main').hasClass('region_1-on') && swipe === 'right') { $('#expand-aside-icon').removeClass('fa-arrow-circle-right').addClass('fa-arrow-circle-left'); + $(window).scrollTop(0); $('html, body').css('overflow-x', 'hidden'); $('main').addClass('region_1-on'); $('
').appendTo('section'); -- cgit v1.2.3 From 86d471834e26e2b12b8cab4d8759f5f7257a71e0 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 3 Jul 2021 14:52:00 +0200 Subject: do not call stickyScroll() on small screens - it is not functional --- view/theme/redbasic/js/redbasic.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js index 0ae81f93e..b867244fb 100644 --- a/view/theme/redbasic/js/redbasic.js +++ b/view/theme/redbasic/js/redbasic.js @@ -17,8 +17,10 @@ $(document).ready(function() { } $('#css3-calc').remove(); // Remove the test element - stickyScroll('.aside_spacer_left', '.aside_spacer_top_left', '.content', parseFloat(window.getComputedStyle(document.querySelector('#region_1')).getPropertyValue('padding-top')), 0); - stickyScroll('.aside_spacer_right', '.aside_spacer_top_right', '.content', parseFloat(window.getComputedStyle(document.querySelector('#region_3')).getPropertyValue('padding-top')), 20); + if($(window).width() > 992) { + stickyScroll('.aside_spacer_left', '.aside_spacer_top_left', '.content', parseFloat(window.getComputedStyle(document.querySelector('#region_1')).getPropertyValue('padding-top')), 0); + stickyScroll('.aside_spacer_right', '.aside_spacer_top_right', '.content', parseFloat(window.getComputedStyle(document.querySelector('#region_3')).getPropertyValue('padding-top')), 20); + } $('#expand-aside').on('click', function() { if($('main').hasClass('region_1-on')){ -- cgit v1.2.3 From c43f5017167d1ca61f1180c0b8b9579731f0a7da Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 4 Jul 2021 13:57:20 +0200 Subject: ux fixes --- view/theme/redbasic/css/style.css | 8 ++++---- view/theme/redbasic/js/redbasic.js | 30 +++++++++++++----------------- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 2ed7a03c1..e0be54f63 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -47,11 +47,11 @@ main { } #overlay { - position: absolute; + position: fixed; top: 0; - left: 0; - width: 100%; - height: 100%; + left: $left_aside_widthpx; + width: 100vw; + height: 100vh; background: rgba(0, 0, 0, .3); cursor: pointer; z-index: 1028; diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js index b867244fb..05f590c53 100644 --- a/view/theme/redbasic/js/redbasic.js +++ b/view/theme/redbasic/js/redbasic.js @@ -17,10 +17,8 @@ $(document).ready(function() { } $('#css3-calc').remove(); // Remove the test element - if($(window).width() > 992) { - stickyScroll('.aside_spacer_left', '.aside_spacer_top_left', '.content', parseFloat(window.getComputedStyle(document.querySelector('#region_1')).getPropertyValue('padding-top')), 0); - stickyScroll('.aside_spacer_right', '.aside_spacer_top_right', '.content', parseFloat(window.getComputedStyle(document.querySelector('#region_3')).getPropertyValue('padding-top')), 20); - } + stickyScroll('.aside_spacer_left', '.aside_spacer_top_left', '.content', parseFloat(window.getComputedStyle(document.querySelector('#region_1')).getPropertyValue('padding-top')), 0); + stickyScroll('.aside_spacer_right', '.aside_spacer_top_right', '.content', parseFloat(window.getComputedStyle(document.querySelector('#region_3')).getPropertyValue('padding-top')), 20); $('#expand-aside').on('click', function() { if($('main').hasClass('region_1-on')){ @@ -31,13 +29,6 @@ $(document).ready(function() { } }); - $('section').on('click', function() { - if($('main').hasClass('region_1-on')){ - toggleAside('left'); - } - }); - - $('.usermenu').click(function() { if($('#navbar-collapse-1, #navbar-collapse-2').hasClass('show')){ $('#navbar-collapse-1, #navbar-collapse-2').removeClass('show'); @@ -80,10 +71,15 @@ $(document).ready(function() { setInterval(function () {checkNotify();}, 10 * 1000); var touch_start = null; + var touch_max = 70; + window.addEventListener('touchstart', function(e) { if (e.touches.length === 1){ //just one finger touched touch_start = e.touches.item(0).clientX; + if (touch_start < touch_max) { + $('html, body').css('overflow-y', 'hidden'); + } } else { //a second finger hit the screen, abort the touch @@ -92,8 +88,9 @@ $(document).ready(function() { }); window.addEventListener('touchend', function(e) { - let touch_offset = 50; //at least 100px are a swipe - let touch_max = 100; + $('html, body').css('overflow-y', ''); + + let touch_offset = 30; //at least 100px are a swipe if (touch_start) { //the only finger that hit the screen left it let touch_end = e.changedTouches.item(0).clientX; @@ -182,15 +179,14 @@ function toggleAside(swipe) { if ($('main').hasClass('region_1-on') && swipe === 'left') { $('#expand-aside-icon').addClass('fa-arrow-circle-right').removeClass('fa-arrow-circle-left'); - $('html, body').css('overflow-x', ''); + $('html, body').css({ 'position': '', left: '' }); $('main').removeClass('region_1-on'); $('#overlay').remove(); } if (!$('main').hasClass('region_1-on') && swipe === 'right') { $('#expand-aside-icon').removeClass('fa-arrow-circle-right').addClass('fa-arrow-circle-left'); - $(window).scrollTop(0); - $('html, body').css('overflow-x', 'hidden'); + $('html, body').css({ 'position': 'sticky', 'left': '0px'}); $('main').addClass('region_1-on'); - $('
').appendTo('section'); + $('
').appendTo('body').one('click', function() { toggleAside('left'); }); } } -- cgit v1.2.3 From 50ead82bc4a3dc0a3289cbfcf9625dcd5a04da4d Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 4 Jul 2021 14:05:48 +0200 Subject: remove redundant z-index --- view/theme/redbasic/css/style.css | 1 - 1 file changed, 1 deletion(-) diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index e0be54f63..3b74c5ea1 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -54,7 +54,6 @@ main { height: 100vh; background: rgba(0, 0, 0, .3); cursor: pointer; - z-index: 1028; } h1, .h1 { -- cgit v1.2.3 From d45df824edaf6f05ca33df31ece56846809685d0 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 5 Jul 2021 10:42:36 +0200 Subject: redbasic: close left aside if hq control button is clicked --- view/js/mod_hq.js | 2 ++ view/theme/redbasic/js/redbasic.js | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/view/js/mod_hq.js b/view/js/mod_hq.js index 48fbf1f9b..ad77e0af0 100644 --- a/view/js/mod_hq.js +++ b/view/js/mod_hq.js @@ -2,12 +2,14 @@ $(document).ready(function() { $(document).on('click', '.jot-toggle', function(e) { $(window).scrollTop(0); + $(document).trigger('hz:hqControlsClickAction'); $('#jot-popup').toggle(); $('#profile-jot-text').focus(); }); $(document).on('click', '.notes-toggle', function(e) { $(window).scrollTop(0); + $(document).trigger('hz:hqControlsClickAction'); $('#personal-notes').toggleClass('d-none'); $('#note-text').focus(); }); diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js index 05f590c53..a354682d7 100644 --- a/view/theme/redbasic/js/redbasic.js +++ b/view/theme/redbasic/js/redbasic.js @@ -108,6 +108,10 @@ $(document).ready(function() { } }); + $(document).on('hz:hqControlsClickAction', function(e) { + toggleAside('left'); + }); + }); function setStyle(element, cssProperty) { -- cgit v1.2.3