-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbricklink-subinclude.js
36 lines (34 loc) · 1.26 KB
/
bricklink-subinclude.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
function quixblsetpercentages() {
var inputs = document.getElementsByTagName('input');
var val = $('input[type=text]#quixblpercentages').val();
for(var i = 0; i < inputs.length; i++) {
if(inputs[i].name.indexOf('newInvSale') == 0) {
inputs[i].value = val;
}
}
}
function quixblsetpercentagespartout() {
var inputs = document.getElementsByTagName('input');
var val = $('input[type=text]#quixblpercentages').val();
for(var i = 0; i < inputs.length; i++) {
if(inputs[i].name.indexOf('nS') == 0) {
inputs[i].value = val;
}
}
}
function quixblpriceguideavgset() {
avgn = '';
avgu = '';
if($('table.ta tbody tr:eq(2) td:eq(0)').text().match(/new:/i)) {
avgn = $('table.ta tbody tr:eq(2) td:eq(4)').text().replace(/US \$/,'');
avgu = $('table.ta tbody tr:eq(3) td:eq(4)').text().replace(/US \$/,'');
} else if($('table.ta tbody tr:eq(2) td:eq(0)').text().match(/used:/i)) {
avgu = $('table.ta tbody tr:eq(2) td:eq(4)').text().replace(/US \$/,'');
}
if($('input:radio[name=invNew]:checked').val()=='N') {
$('input[name=p_price]').val(avgn);
}
if($('input:radio[name=invNew]:checked').val()=='U') {
$('input[name=p_price]').val(avgu);
}
}