Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/components/Icon/CheckAllIcon.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<script>
export let viewBox;
</script>

<svg on:click class="icon" viewBox={viewBox}>
<path
d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"
></path>
<path
d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"
></path>
</svg>
2 changes: 2 additions & 0 deletions src/components/Icon/Icon.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import Active from './Active.svelte';
import Add from './Add.svelte';
import All from './All.svelte';
import CheckAllIcon from './CheckAllIcon.svelte';
import CheckboxCheckmark from './CheckboxCheckmark.svelte';
import Checkmark from './Checkmark.svelte';
import Chevron from './Chevron.svelte';
Expand Down Expand Up @@ -36,6 +37,7 @@
Active,
Add,
All,
CheckAllIcon,
CheckboxCheckmark,
Checkmark,
Chevron,
Expand Down
9 changes: 9 additions & 0 deletions src/components/TopBar/TopBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import { Add, Remove } from '~components/Modal';
import { torrents, modals, selectedTorrents, panel } from '~helpers/stores';

const sortedTorrents = torrents.sorted;

onMount(() => {
const url = new URL(window.location.href);
const magnet = url.searchParams.get('addtorrent');
Expand All @@ -23,6 +25,10 @@
panel.toggle();
};

const handleSelectAll = () => {
selectedTorrents.set($sortedTorrents.map((t) => t.id));
};

const handleStart = () => {
torrents.start($selectedTorrents);
};
Expand All @@ -46,6 +52,9 @@
<button class="button" on:click={togglePanel}>
<Icon name="MenuIcon" viewBox="0 0 60 60" />
</button>
<button class="button" on:click={handleSelectAll}>
<Icon name="CheckAllIcon" viewBox="0 0 16 16" />
</button>
</div>
</div>
<div class="right">
Expand Down