blob: 2a5b5e4100cf28a0254ecdb80f2e66c4192af520 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
import select from 'select-dom';
import features from '../libs/features';
import {getUsername} from '../libs/utils';
function init(): false | void {
const menuItem = select(`#user-links a.dropdown-item[href="/${getUsername()}"]`);
if (menuItem) {
menuItem.setAttribute('data-hotkey', 'g m');
} else {
return false;
}
}
features.add({
id: __featureName__,
description: 'Adds a keyboard shortcut to visit your own profile: `g` `m`.',
screenshot: false,
load: features.onDomReady,
shortcuts: {
'g m': 'Go to Profile'
},
init
});
|