Skip to content

Commit

Permalink
Improves support for readlater plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
kalvn committed Apr 2, 2023
1 parent d110252 commit 6a005c9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
7 changes: 4 additions & 3 deletions material/page.header.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<!--
{$isCalledFromBookmarklet=array_key_exists('source', $_GET) && in_array($_GET['source'], array('bookmarklet'))}
{$displayAddNewLinkIcon=(($is_logged_in || $openshaarli) && in_array($pageName, array('linklist', 'tools', 'tag.cloud', 'tag.list', 'picwall', 'daily')))}
{$plugins=$conf->get('general.enabled_plugins')}

{$filterClass=(($visibility==='private'||$visibility==='public'||$untaggedonly)?'has-filters':'')}
-->
{if="$isCalledFromBookmarklet"}
{ignore} When called as a popup from bookmarklet, do not display menu. {/ignore}
{else}
Expand Down Expand Up @@ -107,9 +109,8 @@
{/if}
<div class="toolbar-button-container">
{if="$pageName === 'linklist'"}
<button type="button" class="popup-trigger icon-header ripple" data-popup="popup-filter" title="{'Filters'|t}">
<button type="button" class="header-button-filter popup-trigger icon-header ripple {$filterClass}" data-popup="popup-filter" title="{'Filters'|t}">
<i class="mdi mdi-filter"></i>
{if="$visibility==='private' || $visibility==='public' || $untaggedonly"}<div class="red-dot"></div>{/if}
</button>
<div id="popup-filter" class="popup popup-filter hidden">
<div class="popup-title">{'Filters'|t}<button class="popup-close"><i class="mdi mdi-close"></i></button></div>
Expand Down
1 change: 1 addition & 0 deletions src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const init = function () {

if ($('.filter-on').length > 0) {
$('#input-readlater').prop('checked', true);
$('.header-button-filter').addClass('has-filter-readlater');
}
};

Expand Down
28 changes: 20 additions & 8 deletions src/scss/components/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,28 @@
}
}

.red-dot {
position: absolute;
width: 7px;
height: 7px;
top: 4px;
right: 4px;
border-radius: 50%;
background: $color-secondary;

.header-button-filter {
&.has-filter-readlater,
&.has-filters {
&::before {
content: '';
position: absolute;
width: 7px;
height: 7px;
top: 4px;
right: 4px;
border-radius: 50%;
background: $color-secondary;
z-index: 10;
}
}
}

// Remove the readlater filter button from the original theme.
a[href="/plugin/readitlater/toggle-filter"] {
display: none;
}

.header-main{
width: 100%;
Expand Down

0 comments on commit 6a005c9

Please sign in to comment.