-
Notifications
You must be signed in to change notification settings - Fork 62
/
betterOipulse.user.js
80 lines (67 loc) · 2.51 KB
/
betterOipulse.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// ==UserScript==
// @name betterOipulse
// @namespace https://github.com/amit0rana/betterOipulse
// @version 0.01
// @description
// @author Amit
// @match https://oipulse.com/*
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_addStyle
// @grant GM_registerMenuCommand
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
// @require https://raw.githubusercontent.com/amit0rana/MonkeyConfig/master/monkeyconfig.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @downloadURL https://github.com/amit0rana/betterOptionsTrading/raw/master/betterOipulse.user.js
// @updateURL https://github.com/amit0rana/betterOptionsTrading/raw/master/betterOipulse.meta.js
// ==/UserScript==
const formatter = Intl.NumberFormat('en-IN');
var i = document.createElement("INPUT");
i.type = 'button';
i.name='addLot';
i.value='Multiply 75';
i.classList.add("randomClassToHelpHide");
i.id='addLot';
function main() {
$('#main_navbar').append(i);
$(document).on('click',"#addLot", function() {
var allRows = $('#optionChainTable-indices > tbody > tr');
allRows.each(function(rowIndex) {
//2 , 3, 21, 22
var col = $(this).find("td:nth-child(2)");
var txt = parseInt($(col).text().split(",").join(""));
if (!isNaN(txt)) {
$(col).text(getNumber(txt));
}
col = $(this).find("td:nth-child(3)");
txt = parseInt($(col).text().split(",").join(""));
if (!isNaN(txt)) {
$(col).text(getNumber(txt));
}
col = $(this).find("td:nth-child(21)");
txt = parseInt($(col).text().split(",").join(""));
if (!isNaN(txt)) {
$(col).text(getNumber(txt));
}
col = $(this).find("td:nth-child(22)");
txt = parseInt($(col).text().split(",").join(""));
if (!isNaN(txt)) {
$(col).text(getNumber(txt));
}
});
changeButtonName();
});
$(document).on('change',"#expirySelect", function() {
isMultiply = false;
changeButtonName();
});
$(document).on('click',".fullViewBtn", function() {
$(".randomClassToHelpHide").remove();
$('#goBackSite').before(i);
});
$(document).on('click',"#goBackSite", function() {
$(".randomClassToHelpHide").remove();
$('#main_navbar').append(i);
});
}
main();