-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathYuukiAuctionSearch.user.js
48 lines (43 loc) · 2 KB
/
YuukiAuctionSearch.user.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
45
46
47
48
// ==UserScript==
// @name Auction Search [NI]
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Wyszukiwanie itema na Aukcji (Nowy Interfejs)
// @author Paladynka Yuuki
// @match http*://*.margonem.pl/
// @match http*://*.margonem.com/
// @exclude http*://margonem.*/*
// @exclude http*://www.margonem.*/*
// @exclude http*://new.margonem.*/*
// @exclude http*://forum.margonem.*/*
// @exclude http*://commons.margonem.*/*
// @exclude http*://dev-commons.margonem.*/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=margonem.pl
// @require https://code.jquery.com/jquery-3.6.0.min.js
// ==/UserScript==
(function() {
'use strict';
if (getCookie('interface') === 'ni') {
let initInterval = setInterval(() => {
if (Engine?.interface?.showPopupMenu) {
clearInterval(initInterval);
const originalShowPopupMenu = Engine.interface.showPopupMenu;
Engine.interface.showPopupMenu = function (menu, e, onMap) {
//const itemId = e.target.className.match(/item-id-(\d+)/)?.[1];
if (Engine.auctions) {
const auc = Engine.auctions;
menu.splice(Math.floor(menu.length / 2), 0, ["Wyszukaj na aukcji", () => {
const nameInput = auc.getAuctionWindow().getContent().find('.name-item-input input');
auc.getAuctionCards().clickCard(0, null),
auc.getAuctionItemCategory().clearItemCategory(),
auc.setActualKindOfAuction(4);
nameInput.next().css({visibility: 'visible'});
nameInput.val(e.target.dataset.name).trigger('focusout');
}]);
}
originalShowPopupMenu.call(this, menu, e, onMap);
}
}
}, 100);
}
})();