Skip to content

Commit 81d2ec1

Browse files
committed
Wheee! What a lineup!!!
1 parent 4820349 commit 81d2ec1

2 files changed

Lines changed: 36 additions & 13 deletions

File tree

apps/dev/Grok.js

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
/*6/8/25: Let's (maybe) separate the response section into the same sections, but
1+
/*6/9/25: Just made a mechanism (util.GetPoint) that gets invoked by the Win's
2+
selectPoint method. In order to return a point relative to the main div's top-right
3+
corner, call it like:
4+
rv = await Win.selectPoint({isRelative: true});
5+
Otherwise it returns the absolute point, to be used by document.element[s]FromPoint().
6+
*/
7+
/*6/8/25: Let's (maybe) separate the response section into the same sections, but«
28
let's definitely put all code sections into their own expandable divs.
39
410
If the curKid is toggled and the _activeTab is *not* the first, then let's
511
make escape make it the first, so that enter will toggle *that* (rather than
612
any <code>s).
713
8-
*/
14+
»*/
915
/*Instructions:«
1016
1117
I DIDN'T NEED TO TOGGLE "Show inline", SO I WAS ABLE TO GET EVERYTHING IN
@@ -416,6 +422,10 @@ atBottom(){//«
416422
return Math.abs(main.scrollHeight - main.clientHeight - main.scrollTop) <= 1;
417423
}//»
418424
quesIsActive(){return this.curKid.isToggled()&& this.curKid._activeTab===0;}
425+
async getPoint(){
426+
let rv = await this.Win.selectPoint();
427+
log(rv);
428+
}
419429
onescape(){//«
420430
if (this.deselect()) return true;
421431
if (this.statBar.innerHTML){
@@ -434,6 +444,10 @@ atBottom(){//«
434444
return false;
435445
}//»
436446
onkeydown(e, k){//«
447+
if (this.Win.pointSelectMode) {
448+
e.preventDefault();
449+
return;
450+
}
437451
if (k==="UP_"){/* « */
438452
if (this.curKid.isToggled()) return;
439453
e.preventDefault();
@@ -497,16 +511,19 @@ atBottom(){//«
497511
else if (k==="l_") this.dumpCurKid({log: true});
498512
else if (k==="l_S") this.dumpCenter({log: true});
499513
else if (k==="p_S") this.dumpCenter({pop: true});
500-
else if (k===",_S") {
514+
else if (k===",_S") {//«
501515
if (this.prevSize < 10) return;
502516
this.prevSize-=5;
503517
this.setPrevDivs();
504-
}
505-
else if (k==="._S") {
518+
}//»
519+
else if (k==="._S") {//«
506520
this.setPrevDivs();
507521
this.prevSize+=5;
508522
this.setPrevDivs();
509-
}
523+
}//»
524+
else if (k==="SPACE_CAS"){
525+
this.getPoint();
526+
}
510527
}//»
511528
getActiveTab(){return this.curKid._tabOrder[this.curKid._activeTab];}
512529

sys/desk.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ a system-level hotkey which simply stores the lastSelectedPoint
2626
onto the Window object. This is what select_point_from_window() does,
2727
but we are currently commenting that out @FWIKNGH.
2828
29+
We should generalize it for the specific colors (grid crosshairs) we want for
30+
out background.
2931
»*/
3032
/*Keep it simple: If an app defines onreload, just call *that* instead of doing the«
3133
system default @HGLAURJF. This is for applications that have their own internal
@@ -2222,6 +2224,7 @@ cwarn(`win_reload: "dev mode" is not enabled!`);
22222224
}//»
22232225
if (CWIN.isLayout || CWIN.isMinimized || CWIN.killed) return;
22242226
if (CWIN.pointSelectMode===true){
2227+
e.preventDefault();
22252228
CWIN.handlePointSelect(kstr);
22262229
return;
22272230
}
@@ -3480,6 +3483,8 @@ ICONS = OK;
34803483
return ret;
34813484
};//»
34823485
async reload(opts={}){//«
3486+
if (this.pointSelectMode) this.stopPointSelect();
3487+
34833488
let {app, appName, main} = this;
34843489
if (this.killed){
34853490
poperr("This window has been killed");
@@ -3624,7 +3629,8 @@ div._pos="absolute";
36243629
div._w = main.clientWidth;
36253630
div._h = main.clientHeight;
36263631
div._x=0;
3627-
div._y=0;
3632+
log(main.scrollTop);
3633+
div._y=main.scrollTop;
36283634
div._z=9999999;
36293635
main._add(div);
36303636
this.pointSelectResize=()=>{
@@ -3672,7 +3678,7 @@ break;
36723678
//break;
36733679
}
36743680
}/* » */
3675-
stopPointSelect(if_abort){/* « */
3681+
stopPointSelect(){/* « */
36763682
this.pointSelectCb(null);
36773683

36783684
this.pointSelectMode = false;
@@ -7915,11 +7921,6 @@ or when there is an active context menu.
79157921
cwin.context_menu.kill();
79167922
return
79177923
}
7918-
if (!cwin.isMinimized && cobj && cobj.onescape && cobj.onescape()) return;
7919-
if (cwin.appName==FOLDER_APP && ICONS.length){
7920-
icon_array_off(12);
7921-
return;
7922-
}
79237924
//BSHDKFLG
79247925
if (cwin.pointSelectMode) {
79257926
if (cwin.pointSelect.onEscape()) {
@@ -7930,6 +7931,11 @@ cwarn("ABORT pointSelect");
79307931
cwin.stopPointSelect(true);
79317932
return;
79327933
}
7934+
if (!cwin.isMinimized && cobj && cobj.onescape && cobj.onescape()) return;
7935+
if (cwin.appName==FOLDER_APP && ICONS.length){
7936+
icon_array_off(12);
7937+
return;
7938+
}
79337939
cwin.off();
79347940
return;
79357941
}//»

0 commit comments

Comments
 (0)