2022-01-20 18:27:56 +00:00
|
|
|
/* @license This file Copyright (C) 2020-2022 Mnemosyne LLC.
|
2022-02-07 16:25:02 +00:00
|
|
|
It may be used under GPLv2 (SPDX: GPL-2.0-only), GPLv3 (SPDX: GPL-3.0-only),
|
2022-01-20 18:27:56 +00:00
|
|
|
or any future license endorsed by Mnemosyne LLC.
|
|
|
|
License text can be found in the licenses/ folder. */
|
2020-10-24 01:04:25 +00:00
|
|
|
|
|
|
|
import { ActionManager } from './action-manager.js';
|
|
|
|
import { Notifications } from './notifications.js';
|
|
|
|
import { Prefs } from './prefs.js';
|
|
|
|
import { Transmission } from './transmission.js';
|
|
|
|
import { debounce } from './utils.js';
|
|
|
|
|
|
|
|
import '../style/transmission-app.scss';
|
|
|
|
|
|
|
|
function main() {
|
|
|
|
const action_manager = new ActionManager();
|
|
|
|
const prefs = new Prefs();
|
|
|
|
const notifications = new Notifications(prefs);
|
|
|
|
const transmission = new Transmission(action_manager, notifications, prefs);
|
|
|
|
|
|
|
|
const scroll_soon = debounce(() =>
|
|
|
|
transmission.elements.torrent_list.scrollTo(0, 1)
|
|
|
|
);
|
|
|
|
window.addEventListener('load', scroll_soon);
|
|
|
|
window.onorientationchange = scroll_soon;
|
|
|
|
}
|
|
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', main);
|