@millistream/millistream-widgets 1.0.30 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/millistream-widgets.js +83 -26
- package/package.json +1 -1
package/millistream-widgets.js
CHANGED
|
@@ -2962,7 +2962,7 @@ function Milli_Chart(settings) {
|
|
|
2962
2962
|
// Compare functions
|
|
2963
2963
|
_this.removeAllCompares = function() {
|
|
2964
2964
|
if (_this.instruments.length == 1) return;
|
|
2965
|
-
for (var i =
|
|
2965
|
+
for (var i = 1; i < 3; i++)
|
|
2966
2966
|
_this.instruments[i] = { insref: 0 };
|
|
2967
2967
|
};
|
|
2968
2968
|
|
|
@@ -3477,7 +3477,10 @@ function Milli_OptionsList(settings) {
|
|
|
3477
3477
|
custom_columns: {},
|
|
3478
3478
|
sortorder: 'asc',
|
|
3479
3479
|
strikedateHeader: true,
|
|
3480
|
-
hidePuts: false
|
|
3480
|
+
hidePuts: false,
|
|
3481
|
+
mirror_custom_columns: true,
|
|
3482
|
+
header_on_strike: true
|
|
3483
|
+
|
|
3481
3484
|
};
|
|
3482
3485
|
MillistreamWidgetApi_AssignObject(MillistreamWidgetSettings, _this.settings);
|
|
3483
3486
|
|
|
@@ -3708,6 +3711,7 @@ function Milli_OptionsList(settings) {
|
|
|
3708
3711
|
let pos = 0;
|
|
3709
3712
|
let newinsrefs = [];
|
|
3710
3713
|
let s, h1, h2, i;
|
|
3714
|
+
let firstHeader = true;
|
|
3711
3715
|
for (i = 0; i < m_strikes.length; i++) {
|
|
3712
3716
|
if (m_strikes[i].strikedate != strikedate) {
|
|
3713
3717
|
if (_this.settings.strikedateHeader) {
|
|
@@ -3724,8 +3728,14 @@ function Milli_OptionsList(settings) {
|
|
|
3724
3728
|
}
|
|
3725
3729
|
} else {
|
|
3726
3730
|
if (_this.settings.strikedateHeader) {
|
|
3727
|
-
|
|
3728
|
-
|
|
3731
|
+
if(firstHeader || _this.settings.header_on_strike == true) {
|
|
3732
|
+
firstHeader = false;
|
|
3733
|
+
h1.style.display = 'table-row';
|
|
3734
|
+
h2.style.display = 'table-row';
|
|
3735
|
+
} else {
|
|
3736
|
+
h1.style.display = 'none';
|
|
3737
|
+
h2.style.display = 'none';
|
|
3738
|
+
}
|
|
3729
3739
|
}
|
|
3730
3740
|
for (s = pos; s < i; s++) {
|
|
3731
3741
|
m_strikes[s].row.style.display = 'table-row';
|
|
@@ -3754,8 +3764,11 @@ function Milli_OptionsList(settings) {
|
|
|
3754
3764
|
continue;
|
|
3755
3765
|
} else {
|
|
3756
3766
|
if (_this.settings.strikedateHeader) {
|
|
3757
|
-
|
|
3758
|
-
|
|
3767
|
+
if(firstHeader || _this.settings.header_on_strike == true) { // new
|
|
3768
|
+
firstHeader = false;
|
|
3769
|
+
h1.style.display = 'table-row';
|
|
3770
|
+
h2.style.display = 'table-row';
|
|
3771
|
+
}
|
|
3759
3772
|
}
|
|
3760
3773
|
}
|
|
3761
3774
|
m_strikes[s].row.style.display = 'table-row';
|
|
@@ -3817,7 +3830,7 @@ function Milli_OptionsList(settings) {
|
|
|
3817
3830
|
let display = '';
|
|
3818
3831
|
let tr, th;
|
|
3819
3832
|
if (_this.settings.strikedateHeader) {
|
|
3820
|
-
tr = MillistreamWidgetApi_addElement(_this, 'tr',
|
|
3833
|
+
tr = MillistreamWidgetApi_addElement(_this, 'tr', "millistream-optionslist-header-strikedate", tbody);
|
|
3821
3834
|
tr.setAttribute('data-strikedate', m_strikedates[s].strikedate);
|
|
3822
3835
|
if (_this.settings.strikedatefilter.length != 0 && _this.settings.strikedatefilter.indexOf(m_strikedates[s].strikedate) == -1) {
|
|
3823
3836
|
tr.style.display = 'none';
|
|
@@ -3901,20 +3914,40 @@ function Milli_OptionsList(settings) {
|
|
|
3901
3914
|
info = MillistreamWidgetApi_getColumnInfo(_this, _this.settings.fields[i]);
|
|
3902
3915
|
MillistreamWidgetApi_addElement(_this, 'th', 'millistream-optionslist-table-th millistream-' + info[1] + ' millistream-' + _this.settings.fields[i], tr, null, info[3]);
|
|
3903
3916
|
}
|
|
3904
|
-
|
|
3905
|
-
|
|
3917
|
+
let keys = Object.keys(_this.settings.custom_columns);
|
|
3918
|
+
for(let s = 0; s < keys.length; s++) {
|
|
3919
|
+
if(keys[s] == i + 1) {
|
|
3920
|
+
let cpos;
|
|
3921
|
+
if(_this.settings.mirror_custom_columns == false) cpos = keys[keys.length - s-1];
|
|
3922
|
+
else cpos = keys[s];
|
|
3906
3923
|
MillistreamWidgetApi_addElement(_this, 'th', 'millistream-optionslist-table-th', tr, null, _this.settings.custom_columns[cpos].name);
|
|
3907
3924
|
added_columns++;
|
|
3908
3925
|
}
|
|
3909
3926
|
}
|
|
3927
|
+
/*for (cpos in _this.settings.custom_columns) {
|
|
3928
|
+
if (cpos == i + 1) {
|
|
3929
|
+
MillistreamWidgetApi_addElement(_this, 'th', 'millistream-optionslist-table-th', tr, null, _this.settings.custom_columns[cpos].name);
|
|
3930
|
+
added_columns++;
|
|
3931
|
+
}
|
|
3932
|
+
}*/
|
|
3910
3933
|
added_columns++;
|
|
3911
3934
|
}
|
|
3912
|
-
|
|
3913
|
-
|
|
3935
|
+
let keys = Object.keys(_this.settings.custom_columns);
|
|
3936
|
+
for(let s = 0; s < keys.length; s++) {
|
|
3937
|
+
if(keys[s] == i + 1) {
|
|
3938
|
+
let cpos;
|
|
3939
|
+
if(_this.settings.mirror_custom_columns == false) cpos = keys[keys.length - s-1];
|
|
3940
|
+
else cpos = keys[s];
|
|
3914
3941
|
MillistreamWidgetApi_addElement(_this, 'th', 'millistream-optionslist-table-th', tr, null, _this.settings.custom_columns[cpos].name);
|
|
3915
3942
|
added_columns++;
|
|
3916
3943
|
}
|
|
3917
3944
|
}
|
|
3945
|
+
/*for (cpos in _this.settings.custom_columns) {
|
|
3946
|
+
if (cpos == i + 1) {
|
|
3947
|
+
MillistreamWidgetApi_addElement(_this, 'th', 'millistream-optionslist-table-th', tr, null, _this.settings.custom_columns[cpos].name);
|
|
3948
|
+
added_columns++;
|
|
3949
|
+
}
|
|
3950
|
+
}*/
|
|
3918
3951
|
}
|
|
3919
3952
|
let numcalls = 0;
|
|
3920
3953
|
let numputs = 0;
|
|
@@ -4018,8 +4051,12 @@ function Milli_OptionsList(settings) {
|
|
|
4018
4051
|
};
|
|
4019
4052
|
m_cellMap.set(cellMap.insref + ':' + info[0], cellMap);
|
|
4020
4053
|
}
|
|
4021
|
-
|
|
4022
|
-
|
|
4054
|
+
let keys = Object.keys(_this.settings.custom_columns);
|
|
4055
|
+
for(let s = 0; s < keys.length; s++) {
|
|
4056
|
+
if(keys[s] == x + 1) {
|
|
4057
|
+
let cpos;
|
|
4058
|
+
if(_this.settings.mirror_custom_columns == false) cpos = keys[keys.length - s-1];
|
|
4059
|
+
else cpos = keys[s];
|
|
4023
4060
|
td = MillistreamWidgetApi_addTableCell2(_this, null, 'millistream-optionslist-put-cell', otr);
|
|
4024
4061
|
if (m_strikes[i].puts && (typeof _this.settings.custom_columns[cpos].condition !== 'function' || _this.settings.custom_columns[cpos].condition(m_strikes[i].puts))) {
|
|
4025
4062
|
if (_this.settings.custom_columns[cpos].instruments && -1 != _this.settings.custom_columns[cpos].instruments.indexOf(m_strikes[i].insref)) {
|
|
@@ -4029,11 +4066,15 @@ function Milli_OptionsList(settings) {
|
|
|
4029
4066
|
}
|
|
4030
4067
|
}
|
|
4031
4068
|
added_columns++;
|
|
4032
|
-
|
|
4069
|
+
}
|
|
4033
4070
|
}
|
|
4034
4071
|
}
|
|
4035
|
-
|
|
4036
|
-
|
|
4072
|
+
let keys = Object.keys(_this.settings.custom_columns);
|
|
4073
|
+
for(let s = 0; s < keys.length; s++) {
|
|
4074
|
+
if(keys[s] == x + 1) {
|
|
4075
|
+
let cpos;
|
|
4076
|
+
if(_this.settings.mirror_custom_columns == false) cpos = keys[keys.length - s-1];
|
|
4077
|
+
else cpos = keys[s];
|
|
4037
4078
|
td = MillistreamWidgetApi_addTableCell2(_this, null, 'millistream-optionslist-put-cell', otr);
|
|
4038
4079
|
if (m_strikes[i].puts && (typeof _this.settings.custom_columns[cpos].condition !== 'function' || _this.settings.custom_columns[cpos].condition(m_strikes[i].puts))) {
|
|
4039
4080
|
if (_this.settings.custom_columns[cpos].instruments && -1 != _this.settings.custom_columns[cpos].instruments.indexOf(m_strikes[i].insref)) {
|
|
@@ -4043,14 +4084,13 @@ function Milli_OptionsList(settings) {
|
|
|
4043
4084
|
}
|
|
4044
4085
|
}
|
|
4045
4086
|
added_columns++;
|
|
4046
|
-
|
|
4087
|
+
}
|
|
4047
4088
|
}
|
|
4048
4089
|
}
|
|
4049
4090
|
} else break;
|
|
4050
4091
|
}
|
|
4051
4092
|
if (_this.settings.strikedateHeader) {
|
|
4052
4093
|
callheader.innerHTML = _this.get_lang_text('calls') + ' · ' + m_strikedates[s].strikedate + ' ' + (m_strikedates[s].expirationtype == '2' ? _this.get_lang_text('weeklytype') : ' ') + ' · ' + m_strikedates[s].dte + ' ' + _this.get_lang_text('dte') + ' · ' + numcalls + ' strikes';
|
|
4053
|
-
console.log(callheader.innerHTML);
|
|
4054
4094
|
callheader.colSpan = _this.settings.fields.length + 1 + Object.keys(_this.settings.custom_columns).length;
|
|
4055
4095
|
putheader.innerHTML = _this.get_lang_text('puts') + ' · ' + m_strikedates[s].strikedate + ' ' + (m_strikedates[s].expirationtype == '2' ? _this.get_lang_text('weeklytype') : ' ') + ' · ' + m_strikedates[s].dte + ' ' + _this.get_lang_text('dte') + ' · ' + numputs + ' strikes';
|
|
4056
4096
|
putheader.colSpan = _this.settings.fields.length + Object.keys(_this.settings.custom_columns).length;
|
|
@@ -4101,7 +4141,8 @@ function Milli_OptionsList(settings) {
|
|
|
4101
4141
|
if (this.settings.autodraw == true) this.drawWidget();
|
|
4102
4142
|
|
|
4103
4143
|
}
|
|
4104
|
-
var milli_data_api_url = 'https://stage.millistream.com/widgets/3.0.4/data/milli_widget_dataapi.php?';
|
|
4144
|
+
//var milli_data_api_url = 'https://stage.millistream.com/widgets/3.0.4/data/milli_widget_dataapi.php?';
|
|
4145
|
+
var milli_data_api_url = 'https://test.millistream.com/mws.fcgi?';
|
|
4105
4146
|
|
|
4106
4147
|
var millistream_data_api = {
|
|
4107
4148
|
callbackcounter: 0,
|
|
@@ -4410,16 +4451,16 @@ function MillistreamWidgetApi_buildQuery(widget, type) {
|
|
|
4410
4451
|
url += '&pricetype=' + widget.settings.pricetype;
|
|
4411
4452
|
}
|
|
4412
4453
|
if (typeof widget.settings.millisectorl1 !== 'undefined' && widget.settings.millisectorl1 !== null) {
|
|
4413
|
-
if (typeof widget.settings.millisectorl1 !== '
|
|
4414
|
-
url += '&millisectorl1=' + widget.settings.millisectorl1
|
|
4454
|
+
if (typeof widget.settings.millisectorl1 !== 'object') throw new Error(widget.constructor.name + ': millisectorl1 is not valid' + widget.settings.millisectorl1);
|
|
4455
|
+
url += '&millisectorl1=' + widget.settings.millisectorl1.join(',');;
|
|
4415
4456
|
}
|
|
4416
4457
|
if (typeof widget.settings.millisectorl2 !== 'undefined' && widget.settings.millisectorl2 !== null) {
|
|
4417
|
-
if (typeof widget.settings.millisectorl2 !== '
|
|
4418
|
-
url += '&millisectorl2=' + widget.settings.millisectorl2
|
|
4458
|
+
if (typeof widget.settings.millisectorl2 !== 'object') throw new Error(widget.constructor.name + ': millisectorl2 is not valid');
|
|
4459
|
+
url += '&millisectorl2=' + widget.settings.millisectorl2.join(',');;
|
|
4419
4460
|
}
|
|
4420
4461
|
if (typeof widget.settings.millisectorl3 !== 'undefined' && widget.settings.millisectorl3 !== null) {
|
|
4421
|
-
if (typeof widget.settings.millisectorl3 !== '
|
|
4422
|
-
url += '&millisectorl3=' + widget.settings.millisectorl3
|
|
4462
|
+
if (typeof widget.settings.millisectorl3 !== 'object') throw new Error(widget.constructor.name + ': millisectorl3 is not valid');
|
|
4463
|
+
url += '&millisectorl3=' + widget.settings.millisectorl3.join(',');;
|
|
4423
4464
|
}
|
|
4424
4465
|
if (typeof widget.settings.ppmfunds !== 'undefined' && widget.settings.ppmfunds !== null) {
|
|
4425
4466
|
if (typeof widget.settings.ppmfunds !== 'boolean') throw new Error(widget.constructor.name + ': millisectorl3 is not valid');
|
|
@@ -4443,7 +4484,15 @@ function MillistreamWidgetApi_buildQuery(widget, type) {
|
|
|
4443
4484
|
if (typeof widget.settings.xhr !== 'undefined' && widget.settings.xhr == true) {
|
|
4444
4485
|
url += '&xhr=1';
|
|
4445
4486
|
}
|
|
4446
|
-
|
|
4487
|
+
if (typeof widget.settings.blacklists !== 'undefined' && widget.settings.blacklist != 0) {
|
|
4488
|
+
url += '&blacklist=1';
|
|
4489
|
+
}
|
|
4490
|
+
if (typeof widget.settings.tradecode === 'number') {
|
|
4491
|
+
url += '&tradecode=' + widget.settings.tradecode;
|
|
4492
|
+
}
|
|
4493
|
+
if (typeof widget.settings.peers === 'boolean' && widget.settings.peers === true) {
|
|
4494
|
+
url += '&peer=true';
|
|
4495
|
+
}
|
|
4447
4496
|
return url;
|
|
4448
4497
|
}
|
|
4449
4498
|
|
|
@@ -5704,6 +5753,14 @@ function MillistreamWidgetApi_getColumnInfo(widget, name) {
|
|
|
5704
5753
|
case '3311':
|
|
5705
5754
|
case 'hv360':
|
|
5706
5755
|
return [3311, 'numeric', 'right', widget.get_lang_text(name) || name, 0];
|
|
5756
|
+
case '3312':
|
|
5757
|
+
case 'sectorl3name':
|
|
5758
|
+
case 'sectorl3symbol':
|
|
5759
|
+
case 'sectorl2name':
|
|
5760
|
+
case 'sectorl2symbol':
|
|
5761
|
+
case 'sectorl1name':
|
|
5762
|
+
case 'sectorl1symbol':
|
|
5763
|
+
return [3312, 'string', 'left', widget.get_lang_text(name) || name, 0];
|
|
5707
5764
|
default:
|
|
5708
5765
|
return [0, 'numeric', 'right', widget.get_lang_text(name) || name, 0];
|
|
5709
5766
|
}
|