Skip to content

Commit 0325d16

Browse files
committed
Build with menu changes
1 parent 708ee68 commit 0325d16

File tree

2 files changed

+67
-51
lines changed

2 files changed

+67
-51
lines changed

build/jsroot.js

+66-50
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const version_id = 'dev',
1212

1313
/** @summary version date
1414
* @desc Release date in format day/month/year like '14/04/2022' */
15-
version_date = '27/01/2025',
15+
version_date = '30/01/2025',
1616

1717
/** @summary version id and date
1818
* @desc Produced by concatenation of {@link version_id} and {@link version_date}
@@ -61563,7 +61563,8 @@ class JSRootMenu {
6156361563
}
6156461564

6156561565
this.add('endcolumn:');
61566-
if (!this.native()) break;
61566+
if (!this.native())
61567+
break;
6156761568
}
6156861569

6156961570
this.endsub();
@@ -61576,7 +61577,8 @@ class JSRootMenu {
6157661577

6157761578
let values = [], miss_current = false;
6157861579
if (isObject(step)) {
61579-
values = step; step = 1;
61580+
values = step;
61581+
step = 1;
6158061582
} else {
6158161583
for (let sz = min; sz <= max; sz += step)
6158261584
values.push(sz);
@@ -61616,7 +61618,6 @@ class JSRootMenu {
6161661618
this.sub('Palette', () => this.input('Enter palette code [1..113]', curr, 'int', 1, 113).then(set_func));
6161761619

6161861620
this.add('column:');
61619-
6162061621
add(57, 'Bird', 'Default color palette', (curr > 113));
6162161622
add(55, 'Rainbow');
6162261623
add(51, 'Deep Sea');
@@ -61630,14 +61631,12 @@ class JSRootMenu {
6163061631
add(59, '', 'Green Red Violet');
6163161632
add(60, '', 'Blue Red Yellow');
6163261633
add(61, 'Ocean');
61633-
6163461634
this.add('endcolumn:');
6163561635

6163661636
if (!this.native())
6163761637
return this.endsub();
6163861638

6163961639
this.add('column:');
61640-
6164161640
add(62, '', 'Color Printable On Grey');
6164261641
add(63, 'Alpine');
6164361642
add(64, 'Aquamarine');
@@ -61651,10 +61650,9 @@ class JSRootMenu {
6165161650
add(72, 'Brown Cyan');
6165261651
add(73, 'CMYK');
6165361652
add(74, 'Candy');
61654-
6165561653
this.add('endcolumn:');
61656-
this.add('column:');
6165761654

61655+
this.add('column:');
6165861656
add(75, 'Cherry');
6165961657
add(76, 'Coffee');
6166061658
add(77, '', 'Dark Rain Bow');
@@ -61668,10 +61666,9 @@ class JSRootMenu {
6166861666
add(85, 'Island');
6166961667
add(86, 'Lake');
6167061668
add(87, '', 'Light Temperature');
61671-
6167261669
this.add('endcolumn:');
61673-
this.add('column:');
6167461670

61671+
this.add('column:');
6167561672
add(88, '', 'Light Terrain');
6167661673
add(89, 'Mint');
6167761674
add(90, 'Neon');
@@ -61685,10 +61682,9 @@ class JSRootMenu {
6168561682
add(98, '', 'Sandy Terrain');
6168661683
add(99, 'Sienna');
6168761684
add(100, 'Solar');
61688-
6168961685
this.add('endcolumn:');
61690-
this.add('column:');
6169161686

61687+
this.add('column:');
6169261688
add(101, '', 'South West');
6169361689
add(102, '', 'Starry Night');
6169461690
add(103, '', 'Sunset');
@@ -61702,7 +61698,6 @@ class JSRootMenu {
6170261698
add(111, '', 'Gist Earth');
6170361699
add(112, 'Viridis');
6170461700
add(113, 'Cividis');
61705-
6170661701
this.add('endcolumn:');
6170761702

6170861703
this.endsub();
@@ -61812,7 +61807,8 @@ class JSRootMenu {
6181261807
supported.push(3144, 3244, 3344, 3305, 3315, 3325, 3490, 3481, 3472);
6181361808

6181461809
for (let n = 0; n < supported.length; ++n) {
61815-
if (n % 7 === 0) this.add('column:');
61810+
if (n % 7 === 0)
61811+
this.add('column:');
6181661812

6181761813
const selected = (value === supported[n]);
6181861814

@@ -61826,7 +61822,8 @@ class JSRootMenu {
6182661822
this.add(svgelement.node().outerHTML, supported[n], arg => set_func(parseInt(arg)), `Pattern : ${supported[n]}` + (selected ? ' Active' : ''));
6182761823
} else
6182861824
this.addchk(selected, supported[n].toString(), supported[n], arg => set_func(parseInt(arg)));
61829-
if (n % 7 === 6) this.add('endcolumn:');
61825+
if (n % 7 === 6)
61826+
this.add('endcolumn:');
6183061827
}
6183161828
this.endsub();
6183261829
}
@@ -62344,7 +62341,8 @@ class JSRootMenu {
6234462341
}, 'Store settings and gStyle in browser local storage');
6234562342
this.add('Delete settings', () => { saveSettings(-1); saveStyle(-1); }, 'Delete settings and gStyle from browser local storage');
6234662343

62347-
if (!alone) this.endsub();
62344+
if (!alone)
62345+
this.endsub();
6234862346
}
6234962347

6235062348
/** @summary Run modal dialog
@@ -62566,30 +62564,33 @@ class StandaloneMenu extends JSRootMenu {
6256662564
_buildContextmenu(menu, left, top, loc) {
6256762565
const doc = getDocument(),
6256862566
outer = doc.createElement('div'),
62567+
clname = 'jsroot_ctxt_container',
62568+
clfocus = 'jsroot_ctxt_focus',
62569+
clcolumn = 'jsroot_ctxt_column',
6256962570
container_style =
6257062571
'position: absolute; top: 0; user-select: none; z-index: 100000; background-color: rgb(250, 250, 250); margin: 0; padding: 0px; width: auto;'+
6257162572
'min-width: 100px; box-shadow: 0px 0px 10px rgb(0, 0, 0, 0.2); border: 3px solid rgb(215, 215, 215); font-family: Arial, helvetica, sans-serif, serif;'+
6257262573
'font-size: 13px; color: rgb(0, 0, 0, 0.8); line-height: 15px;';
6257362574

6257462575
// if loc !== doc.body then its a submenu, so it needs to have position: relative;
6257562576
if (loc === doc.body) {
62576-
// delete all elements with className jsroot_ctxt_container
62577-
const deleteElems = doc.getElementsByClassName('jsroot_ctxt_container');
62578-
while (deleteElems.length > 0)
62579-
deleteElems[0].parentNode.removeChild(deleteElems[0]);
62577+
// delete all elements with menu className
62578+
const deleteElems = doc.getElementsByClassName(clname);
62579+
for (let k = deleteElems.length - 1; k >= 0; --k)
62580+
deleteElems[k].parentNode.removeChild(deleteElems[k]);
6258062581

62581-
outer.className = 'jsroot_ctxt_container';
62582+
outer.className = clname;
6258262583
outer.style = container_style;
6258362584
outer.style.position = 'fixed';
6258462585
outer.style.left = left + 'px';
6258562586
outer.style.top = top + 'px';
6258662587
} else if ((left < 0) && (top === left)) {
6258762588
// column
62588-
outer.className = 'jsroot_ctxt_column';
62589+
outer.className = clcolumn;
6258962590
outer.style.float = 'left';
6259062591
outer.style.width = (100/-left).toFixed(1) + '%';
6259162592
} else {
62592-
outer.className = 'jsroot_ctxt_container';
62593+
outer.className = clname;
6259362594
outer.style = container_style;
6259462595
outer.style.left = -loc.offsetLeft + loc.offsetWidth + 'px';
6259562596
}
@@ -62708,12 +62709,12 @@ class StandaloneMenu extends JSRootMenu {
6270862709

6270962710
function changeFocus(item, on) {
6271062711
if (on) {
62711-
item.classList.add('jsroot_ctxt_focus');
62712+
item.classList.add(clfocus);
6271262713
item.style['background-color'] = 'rgb(220, 220, 220)';
62713-
} else if (item.classList.contains('jsroot_ctxt_focus')) {
62714+
} else if (item.classList.contains(clfocus)) {
6271462715
item.style['background-color'] = null;
62715-
item.classList.remove('jsroot_ctxt_focus');
62716-
item.querySelector('.jsroot_ctxt_container')?.remove();
62716+
item.classList.remove(clfocus);
62717+
item.querySelector(`.${clname}`)?.remove();
6271762718
}
6271862719
}
6271962720

@@ -62728,7 +62729,7 @@ class StandaloneMenu extends JSRootMenu {
6272862729
extraText.addEventListener('click', evnt => {
6272962730
evnt.preventDefault();
6273062731
evnt.stopPropagation();
62731-
const was_active = item.parentNode.querySelector('.jsroot_ctxt_focus');
62732+
const was_active = item.parentNode.querySelector(`.${clfocus}`);
6273262733

6273362734
if (was_active)
6273462735
changeFocus(was_active, false);
@@ -62787,7 +62788,7 @@ class StandaloneMenu extends JSRootMenu {
6278762788
// Does contextmenu overflow window height?
6278862789
outer.style.top = (docHeight - outer.offsetHeight) + 'px';
6278962790
}
62790-
} else if (outer.className !== 'jsroot_ctxt_column') {
62791+
} else if (outer.className !== clcolumn) {
6279162792
// if its sub-contextmenu
6279262793
const dimensionsLoc = loc.getBoundingClientRect(), dimensionsOuter = outer.getBoundingClientRect();
6279362794

@@ -62821,15 +62822,15 @@ class StandaloneMenu extends JSRootMenu {
6282162822
async show(event) {
6282262823
this.remove();
6282362824

62824-
if (!event && this.show_evnt) event = this.show_evnt;
62825+
if (!event && this.show_evnt)
62826+
event = this.show_evnt;
6282562827

6282662828
const doc = getDocument(),
6282762829
woffset = typeof window === 'undefined' ? { x: 0, y: 0 } : { x: window.scrollX, y: window.scrollY };
6282862830

6282962831
doc.body.addEventListener('click', this.remove_handler);
6283062832

62831-
const oldmenu = doc.getElementById(this.menuname);
62832-
if (oldmenu) oldmenu.remove();
62833+
doc.getElementById(this.menuname)?.remove();
6283362834

6283462835
this.element = this._buildContextmenu(this.code, (event?.clientX || 0) + woffset.x, (event?.clientY || 0) + woffset.y, doc.body);
6283562836

@@ -62840,9 +62841,11 @@ class StandaloneMenu extends JSRootMenu {
6284062841

6284162842
/** @summary Run modal elements with standalone code */
6284262843
createModal(title, main_content, args) {
62843-
if (!args) args = {};
62844+
if (!args)
62845+
args = {};
6284462846

62845-
if (!args.Ok) args.Ok = 'Ok';
62847+
if (!args.Ok)
62848+
args.Ok = 'Ok';
6284662849

6284762850
const modal = { args }, dlg_id = (this?.menuname ?? sDfltName) + sDfltDlg;
6284862851
select(`#${dlg_id}`).remove();
@@ -62909,8 +62912,10 @@ class StandaloneMenu extends JSRootMenu {
6290962912
});
6291062913

6291162914
let f = modal.element.select('.jsroot_dialog_content').select('input');
62912-
if (f.empty()) f = modal.element.select('.jsroot_dialog_footer').select('button');
62913-
if (!f.empty()) f.node().focus();
62915+
if (f.empty())
62916+
f = modal.element.select('.jsroot_dialog_footer').select('button');
62917+
if (!f.empty())
62918+
f.node().focus();
6291462919
return modal;
6291562920
}
6291662921

@@ -101856,9 +101861,11 @@ class TFile {
101856101861
obj_name = obj_name.slice(0, pos);
101857101862
}
101858101863

101859-
if (typeof cycle !== 'number') cycle = -1;
101864+
if (typeof cycle !== 'number')
101865+
cycle = -1;
101860101866
// remove leading slashes
101861-
while (obj_name.length && (obj_name[0] === '/')) obj_name = obj_name.slice(1);
101867+
while (obj_name.length && (obj_name[0] === '/'))
101868+
obj_name = obj_name.slice(1);
101862101869

101863101870
// one uses Promises while in some cases we need to
101864101871
// read sub-directory to get list of keys
@@ -101923,8 +101930,8 @@ class TFile {
101923101930
try {
101924101931
buf.classStreamer(lst, clTList);
101925101932
} catch (err) {
101926-
console.error('Fail extract streamer infos', err);
101927-
return;
101933+
console.error('Fail extract streamer infos', err);
101934+
return;
101928101935
}
101929101936

101930101937
lst._typename = clTStreamerInfoList;
@@ -101939,7 +101946,8 @@ class TFile {
101939101946
if (!si.fElements) continue;
101940101947
for (let l = 0; l < si.fElements.arr.length; ++l) {
101941101948
const elem = si.fElements.arr[l];
101942-
if (!elem.fTypeName || !elem.fType) continue;
101949+
if (!elem.fTypeName || !elem.fType)
101950+
continue;
101943101951

101944101952
let typ = elem.fType, typname = elem.fTypeName;
101945101953

@@ -102025,7 +102033,8 @@ class TFile {
102025102033
nbytes += 4; // fDatimeM.Sizeof();
102026102034
nbytes += 18; // fUUID.Sizeof();
102027102035
// assume that the file may be above 2 Gbytes if file version is > 4
102028-
if (this.fVersion >= 40000) nbytes += 12;
102036+
if (this.fVersion >= 40000)
102037+
nbytes += 12;
102029102038

102030102039
// this part typically read from the header, no need to optimize
102031102040
return this.readBuffer([this.fBEGIN, Math.max(300, nbytes)]);
@@ -102048,7 +102057,7 @@ class TFile {
102048102057
}).then(blobs => {
102049102058
const buf4 = new TBuffer(blobs[0], 0, this);
102050102059

102051-
buf4.readTKey(); //
102060+
buf4.readTKey();
102052102061
const nkeys = buf4.ntoi4();
102053102062
for (let i = 0; i < nkeys; ++i)
102054102063
this.fKeys.push(buf4.readTKey());
@@ -102082,15 +102091,17 @@ class TFile {
102082102091
* @param {number} [checksum] - streamer info checksum, have to match when specified
102083102092
* @private */
102084102093
findStreamerInfo(clname, clversion, checksum) {
102085-
if (!this.fStreamerInfos) return null;
102094+
if (!this.fStreamerInfos)
102095+
return null;
102086102096

102087102097
const arr = this.fStreamerInfos.arr, len = arr.length;
102088102098

102089102099
if (checksum !== undefined) {
102090102100
let cache = this.fStreamerInfos.cache;
102091102101
if (!cache) cache = this.fStreamerInfos.cache = {};
102092102102
let si = cache[checksum];
102093-
if (si !== undefined) return si;
102103+
if (si !== undefined)
102104+
return si;
102094102105

102095102106
for (let i = 0; i < len; ++i) {
102096102107
si = arr[i];
@@ -102103,7 +102114,8 @@ class TFile {
102103102114
} else {
102104102115
for (let i = 0; i < len; ++i) {
102105102116
const si = arr[i];
102106-
if ((si.fName === clname) && ((si.fClassVersion === clversion) || (clversion === undefined))) return si;
102117+
if ((si.fName === clname) && ((si.fClassVersion === clversion) || (clversion === undefined)))
102118+
return si;
102107102119
}
102108102120
}
102109102121

@@ -102122,7 +102134,8 @@ class TFile {
102122102134
if (ver) {
102123102135
fullname += (ver.checksum ? `$chksum${ver.checksum}` : `$ver${ver.val}`);
102124102136
streamer = this.fStreamers[fullname];
102125-
if (streamer !== undefined) return streamer;
102137+
if (streamer !== undefined)
102138+
return streamer;
102126102139
}
102127102140

102128102141
const custom = CustomStreamers[clname];
@@ -102175,9 +102188,11 @@ class TFile {
102175102188
/** @summary Here we produce list of members, resolving all base classes
102176102189
* @private */
102177102190
getSplittedStreamer(streamer, tgt) {
102178-
if (!streamer) return tgt;
102191+
if (!streamer)
102192+
return tgt;
102179102193

102180-
if (!tgt) tgt = [];
102194+
if (!tgt)
102195+
tgt = [];
102181102196

102182102197
for (let n = 0; n < streamer.length; ++n) {
102183102198
const elem = streamer[n];
@@ -102193,7 +102208,8 @@ class TFile {
102193102208
buf.ntoi2(); // read version, why it here??
102194102209
obj.fUniqueID = buf.ntou4();
102195102210
obj.fBits = buf.ntou4();
102196-
if (obj.fBits & kIsReferenced) buf.ntou2(); // skip pid
102211+
if (obj.fBits & kIsReferenced)
102212+
buf.ntou2(); // skip pid
102197102213
}
102198102214
});
102199102215
continue;

modules/core.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const version_id = 'dev',
44

55
/** @summary version date
66
* @desc Release date in format day/month/year like '14/04/2022' */
7-
version_date = '27/01/2025',
7+
version_date = '30/01/2025',
88

99
/** @summary version id and date
1010
* @desc Produced by concatenation of {@link version_id} and {@link version_date}

0 commit comments

Comments
 (0)