-
Notifications
You must be signed in to change notification settings - Fork 0
/
bookmarklet.js
44 lines (35 loc) · 994 Bytes
/
bookmarklet.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
javascript:
if (location.host === 'scryfall.com') {
var isCreature =
/(Creature|Planeswalker)/.test(
document
.getElementsByClassName('card-text-type-line')
.item(0)
.innerText
);
var url =
'url=' +
document.getElementsByClassName('card-image-front').item(0)
.getElementsByTagName('img').item(0)
.getAttribute('src');
}
else {
var isCreature =
document
.getElementById('ctl00_ctl00_ctl00_MainContent_SubContent_SubContent_typeRow')
.getElementsByClassName('value')
.item(0)
.innerText
.match(/Creature/) !== null;
var url =
'multiverseid=' +
document.getElementById('ctl00_ctl00_ctl00_MainContent_SubContent_SubContent_cardImage')
.getAttribute('src')
.match(/multiverseid=(\d+)/)[1];
}
var box =
confirm('Hide copyright?') ?
'box=' + (isCreature ? 'creature' : '') + '&' :
'';
location.href = 'http://docker:13207/index.php?' + box + url;
void(0);