Closed phicha20224 closed 2 years ago
Thank you To. Mr Jan Tojnar
This code allow selfoss to filter keyword by using url http://www.domain.com/selfoss/#newest/all?search=[keyword]
--- a/assets/js/selfoss-events.js +++ b/assets/js/selfoss-events.js @@ -82,6 +82,9 @@ selfoss.events = { // assume the hash is encoded hash = decodeURIComponent(location.href.split('#').splice(1).join('#')); + let hashQs; + [ hash, ...hashQs ] = hash.split('?'); + const hashParams = new URLSearchParams(hashQs.join('?')); if (!selfoss.events.reloadSamePath && hash == selfoss.events.lasthash) { @@ -158,6 +161,7 @@ selfoss.events = { selfoss.filter.type = selfoss.events.section; selfoss.filter.tag = ''; selfoss.filter.source = ''; + selfoss.filter.search = hashParams.get('search') || ''; if (selfoss.events.subsection) { selfoss.events.lastSubsection = selfoss.events.subsection; if (selfoss.events.subsection.substr(0, 4) == 'tag-') {
Thanks, this was implemented in https://github.com/fossar/selfoss/pull/1216.
Thank you To. Mr Jan Tojnar
This code allow selfoss to filter keyword by using url http://www.domain.com/selfoss/#newest/all?search=[keyword]