Fossil SCM

Renamed TooltipWidget to PopupWidget because's it's not *quite* a tooltip and we're soon going to need something closer to a genuine tooltip. Minor adjacent cleanups and code consolidation.

stephan 2020-08-15 23:30 line-number-selection
Commit 3998ccef446f3005431cd19b255e734206504d012c104471d0e241a3917fbffd
--- src/fossil.copybutton.js
+++ src/fossil.copybutton.js
@@ -73,16 +73,11 @@
7373
srcElem = document.querySelector('#'+srcId);
7474
}
7575
const extract = opt.extractText || (
7676
undefined===srcElem.value ? ()=>srcElem.innerText : ()=>srcElem.value
7777
);
78
- if(opt.style){
79
- let k;
80
- for(k in opt.style){
81
- if(opt.style.hasOwnProperty(k)) e.style[k] = opt.style[k];
82
- }
83
- }
78
+ D.copyStyle(e, opt.style);
8479
e.addEventListener(
8580
'click',
8681
function(){
8782
const txt = extract.call(opt);
8883
//console.debug("extracted ",txt);
8984
--- src/fossil.copybutton.js
+++ src/fossil.copybutton.js
@@ -73,16 +73,11 @@
73 srcElem = document.querySelector('#'+srcId);
74 }
75 const extract = opt.extractText || (
76 undefined===srcElem.value ? ()=>srcElem.innerText : ()=>srcElem.value
77 );
78 if(opt.style){
79 let k;
80 for(k in opt.style){
81 if(opt.style.hasOwnProperty(k)) e.style[k] = opt.style[k];
82 }
83 }
84 e.addEventListener(
85 'click',
86 function(){
87 const txt = extract.call(opt);
88 //console.debug("extracted ",txt);
89
--- src/fossil.copybutton.js
+++ src/fossil.copybutton.js
@@ -73,16 +73,11 @@
73 srcElem = document.querySelector('#'+srcId);
74 }
75 const extract = opt.extractText || (
76 undefined===srcElem.value ? ()=>srcElem.innerText : ()=>srcElem.value
77 );
78 D.copyStyle(e, opt.style);
 
 
 
 
 
79 e.addEventListener(
80 'click',
81 function(){
82 const txt = extract.call(opt);
83 //console.debug("extracted ",txt);
84
+38 -10
--- src/fossil.dom.js
+++ src/fossil.dom.js
@@ -471,19 +471,24 @@
471471
return e;
472472
};
473473
474474
/**
475475
"Blinks" the given element a single time for the given number of
476
- milliseconds, defaulting to flashOnce.defaultTimeMs. This will
477
- only activate once per element during that timeframe - further
478
- calls will become no-ops until the blink is completed. This
479
- routine adds a dataset member to the element for the duration of
480
- the blink, to allow it to block multiple blinks.
481
-
482
- Returns e.
483
- */
484
- dom.flashOnce = function f(e,howLongMs){
476
+ milliseconds, defaulting (if the 2nd argument is falsy or not a
477
+ number) to flashOnce.defaultTimeMs. If a 3rd argument is passed
478
+ in, it must be a function, and it gets callback back at the end
479
+ of the asynchronous flashing processes.
480
+
481
+ This will only activate once per element during that timeframe -
482
+ further calls will become no-ops until the blink is
483
+ completed. This routine adds a dataset member to the element for
484
+ the duration of the blink, to allow it to block multiple blinks.
485
+
486
+ Returns e, noting that the flash itself is asynchronous and may
487
+ still be running, or not yet started, when this function returns.
488
+ */
489
+ dom.flashOnce = function f(e,howLongMs,afterFlashCallback){
485490
if(e.dataset.isBlinking){
486491
return;
487492
}
488493
if(!howLongMs || 'number'!==typeof howLongMs){
489494
howLongMs = f.defaultTimeMs;
@@ -495,17 +500,18 @@
495500
e.style.opacity = 0;
496501
setTimeout(function(){
497502
e.style.transition = transition;
498503
e.style.opacity = opacity;
499504
delete e.dataset.isBlinking;
505
+ if(afterFlashCallback) afterFlashCallback();
500506
}, howLongMs);
501507
return e;
502508
};
503509
dom.flashOnce.defaultTimeMs = 400;
504510
505511
/**
506
- Attempts to copy the given text to the system clipboard. Returns
512
+ Attempts to copy the given text to the system clipboard. Returns
507513
true if it succeeds, else false.
508514
*/
509515
dom.copyTextToClipboard = function(text){
510516
if( window.clipboardData && window.clipboardData.setData ){
511517
clipboardData.setData('Text',text);
@@ -526,8 +532,30 @@
526532
document.body.removeChild(x);
527533
}
528534
return rc;
529535
}
530536
};
537
+
538
+ /**
539
+ Copies all properties from the 2nd argument (a plain object) into
540
+ the style member of the first argument (DOM element or a
541
+ forEach-capable list of elements). If the 2nd argument is falsy
542
+ or empty, this is a no-op.
543
+
544
+ Returns its first argument.
545
+ */
546
+ dom.copyStyle = function f(e, style){
547
+ if(e.forEach){
548
+ e.forEach((x)=>f(x, style));
549
+ return e;
550
+ }
551
+ if(style){
552
+ let k;
553
+ for(k in style){
554
+ if(style.hasOwnProperty(k)) e.style[k] = style[k];
555
+ }
556
+ }
557
+ return e;
558
+ };
531559
532560
return F.dom = dom;
533561
})(window.fossil);
534562
--- src/fossil.dom.js
+++ src/fossil.dom.js
@@ -471,19 +471,24 @@
471 return e;
472 };
473
474 /**
475 "Blinks" the given element a single time for the given number of
476 milliseconds, defaulting to flashOnce.defaultTimeMs. This will
477 only activate once per element during that timeframe - further
478 calls will become no-ops until the blink is completed. This
479 routine adds a dataset member to the element for the duration of
480 the blink, to allow it to block multiple blinks.
481
482 Returns e.
483 */
484 dom.flashOnce = function f(e,howLongMs){
 
 
 
 
 
485 if(e.dataset.isBlinking){
486 return;
487 }
488 if(!howLongMs || 'number'!==typeof howLongMs){
489 howLongMs = f.defaultTimeMs;
@@ -495,17 +500,18 @@
495 e.style.opacity = 0;
496 setTimeout(function(){
497 e.style.transition = transition;
498 e.style.opacity = opacity;
499 delete e.dataset.isBlinking;
 
500 }, howLongMs);
501 return e;
502 };
503 dom.flashOnce.defaultTimeMs = 400;
504
505 /**
506 Attempts to copy the given text to the system clipboard. Returns
507 true if it succeeds, else false.
508 */
509 dom.copyTextToClipboard = function(text){
510 if( window.clipboardData && window.clipboardData.setData ){
511 clipboardData.setData('Text',text);
@@ -526,8 +532,30 @@
526 document.body.removeChild(x);
527 }
528 return rc;
529 }
530 };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
531
532 return F.dom = dom;
533 })(window.fossil);
534
--- src/fossil.dom.js
+++ src/fossil.dom.js
@@ -471,19 +471,24 @@
471 return e;
472 };
473
474 /**
475 "Blinks" the given element a single time for the given number of
476 milliseconds, defaulting (if the 2nd argument is falsy or not a
477 number) to flashOnce.defaultTimeMs. If a 3rd argument is passed
478 in, it must be a function, and it gets callback back at the end
479 of the asynchronous flashing processes.
480
481 This will only activate once per element during that timeframe -
482 further calls will become no-ops until the blink is
483 completed. This routine adds a dataset member to the element for
484 the duration of the blink, to allow it to block multiple blinks.
485
486 Returns e, noting that the flash itself is asynchronous and may
487 still be running, or not yet started, when this function returns.
488 */
489 dom.flashOnce = function f(e,howLongMs,afterFlashCallback){
490 if(e.dataset.isBlinking){
491 return;
492 }
493 if(!howLongMs || 'number'!==typeof howLongMs){
494 howLongMs = f.defaultTimeMs;
@@ -495,17 +500,18 @@
500 e.style.opacity = 0;
501 setTimeout(function(){
502 e.style.transition = transition;
503 e.style.opacity = opacity;
504 delete e.dataset.isBlinking;
505 if(afterFlashCallback) afterFlashCallback();
506 }, howLongMs);
507 return e;
508 };
509 dom.flashOnce.defaultTimeMs = 400;
510
511 /**
512 Attempts to copy the given text to the system clipboard. Returns
513 true if it succeeds, else false.
514 */
515 dom.copyTextToClipboard = function(text){
516 if( window.clipboardData && window.clipboardData.setData ){
517 clipboardData.setData('Text',text);
@@ -526,8 +532,30 @@
532 document.body.removeChild(x);
533 }
534 return rc;
535 }
536 };
537
538 /**
539 Copies all properties from the 2nd argument (a plain object) into
540 the style member of the first argument (DOM element or a
541 forEach-capable list of elements). If the 2nd argument is falsy
542 or empty, this is a no-op.
543
544 Returns its first argument.
545 */
546 dom.copyStyle = function f(e, style){
547 if(e.forEach){
548 e.forEach((x)=>f(x, style));
549 return e;
550 }
551 if(style){
552 let k;
553 for(k in style){
554 if(style.hasOwnProperty(k)) e.style[k] = style[k];
555 }
556 }
557 return e;
558 };
559
560 return F.dom = dom;
561 })(window.fossil);
562
--- src/fossil.numbered-lines.js
+++ src/fossil.numbered-lines.js
@@ -2,11 +2,11 @@
22
/*
33
JS counterpart of info.c:output_text_with_line_numbers()
44
which ties an event handler to the line numbers to allow
55
selection of individual lines or ranges.
66
7
- Requires: fossil.bootstrap, fossil.dom, fossil.tooltip,
7
+ Requires: fossil.bootstrap, fossil.dom, fossil.popupwidget,
88
fossil.copybutton
99
*/
1010
var tbl = arg || document.querySelectorAll('table.numbered-lines');
1111
if(!tbl) return /* no matching elements */;
1212
else if(!arg){
@@ -22,11 +22,11 @@
2222
const lineState = {
2323
urlArgs: (window.location.search||'?').replace(/&?\bln=[^&]*/,''),
2424
start: 0, end: 0
2525
};
2626
27
- const lineTip = new fossil.TooltipWidget({
27
+ const lineTip = new fossil.PopupWidget({
2828
refresh: function(){
2929
const link = this.state.link;
3030
D.clearElement(link);
3131
if(lineState.start){
3232
const ls = [lineState.start];
3333
3434
ADDED src/fossil.popupwidget.js
3535
DELETED src/fossil.tooltip.js
--- src/fossil.numbered-lines.js
+++ src/fossil.numbered-lines.js
@@ -2,11 +2,11 @@
2 /*
3 JS counterpart of info.c:output_text_with_line_numbers()
4 which ties an event handler to the line numbers to allow
5 selection of individual lines or ranges.
6
7 Requires: fossil.bootstrap, fossil.dom, fossil.tooltip,
8 fossil.copybutton
9 */
10 var tbl = arg || document.querySelectorAll('table.numbered-lines');
11 if(!tbl) return /* no matching elements */;
12 else if(!arg){
@@ -22,11 +22,11 @@
22 const lineState = {
23 urlArgs: (window.location.search||'?').replace(/&?\bln=[^&]*/,''),
24 start: 0, end: 0
25 };
26
27 const lineTip = new fossil.TooltipWidget({
28 refresh: function(){
29 const link = this.state.link;
30 D.clearElement(link);
31 if(lineState.start){
32 const ls = [lineState.start];
33
34 DDED src/fossil.popupwidget.js
35 ELETED src/fossil.tooltip.js
--- src/fossil.numbered-lines.js
+++ src/fossil.numbered-lines.js
@@ -2,11 +2,11 @@
2 /*
3 JS counterpart of info.c:output_text_with_line_numbers()
4 which ties an event handler to the line numbers to allow
5 selection of individual lines or ranges.
6
7 Requires: fossil.bootstrap, fossil.dom, fossil.popupwidget,
8 fossil.copybutton
9 */
10 var tbl = arg || document.querySelectorAll('table.numbered-lines');
11 if(!tbl) return /* no matching elements */;
12 else if(!arg){
@@ -22,11 +22,11 @@
22 const lineState = {
23 urlArgs: (window.location.search||'?').replace(/&?\bln=[^&]*/,''),
24 start: 0, end: 0
25 };
26
27 const lineTip = new fossil.PopupWidget({
28 refresh: function(){
29 const link = this.state.link;
30 D.clearElement(link);
31 if(lineState.start){
32 const ls = [lineState.start];
33
34 DDED src/fossil.popupwidget.js
35 ELETED src/fossil.tooltip.js
--- a/src/fossil.popupwidget.js
+++ b/src/fossil.popupwidget.js
@@ -1,10 +1,12 @@
11
(function(F/*fossil object*/){
2
- 30 widgetbject*/fossil object*/){
2
+ 30 */
3
+ installClickToHiden or basic user intera(function(F/*fossil object*/){
34
3000sClass = cssClass;
4
- unction(F/*fossil objecoltip-like widget. The options are available to clients after this returns via
5
- theTooltip.options, and
6
- D.append(any 30 */
7
- installClickT(function(F/*fosswidget. It's intended to be popped up
5
+ unct}, true);isplay basic information ClickToHide(nction(F/*fossil object*/fossil object*/){
6
+ 3000sClass = cssClass;
7
+ unction(F/*fossil object*/){
8
+ /**
9
+ A very basic tooltip-like widget. It's intended to be popped up
810
to display basic information or basic user interaction
911
components, e.g. a cop or movopy-to-clipboard butt
1012
if needed,l.dom
@@ -108,4 +110,25 @@
108110
f.toast = function ff(argsObject){
109111
if(!ff.toaster) f ['fossil-tooltip', 'fossil-toast']
110112
});
111
- i@1hi,
113
+ i@1hi,X: D.clearElement(ff.toaster.e);9@1SA,2w:var i = 0;
114
+ for( ; i < argsObject.length; ++i ){
115
+ D.append(ff.toaster.e, argsObject[i]);
116
+ };
117
+ ff.toaster.show(f.config.position.x, f.config.position.y);
118
+ Q@1mw,1m:()=>ff.toaster.hide(), f.config.displayTimeMs);
119
+ };
120
+ }
121
+ f.toast(arguments);
122
+ };
123
+ F.toast.config = {
124
+10@1pR,i:displayTimeMs: 2500
125
+ };
126
+
127
+})(window.fossil);
128
+ZfWzX;(function(F/*fossil object*/){
129
+ (function(F/*fossil object*/){
130
+ 30, y = 0D[showIt ? if(x || y){
131
+}
132
+ return this;
133
+
134
+})(window.fossil);
--- a/src/fossil.popupwidget.js
+++ b/src/fossil.popupwidget.js
@@ -1,10 +1,12 @@
1 (function(F/*fossil object*/){
2 30 widgetbject*/fossil object*/){
 
3 3000sClass = cssClass;
4 unction(F/*fossil objecoltip-like widget. The options are available to clients after this returns via
5 theTooltip.options, and
6 D.append(any 30 */
7 installClickT(function(F/*fosswidget. It's intended to be popped up
 
8 to display basic information or basic user interaction
9 components, e.g. a cop or movopy-to-clipboard butt
10 if needed,l.dom
@@ -108,4 +110,25 @@
108 f.toast = function ff(argsObject){
109 if(!ff.toaster) f ['fossil-tooltip', 'fossil-toast']
110 });
111 i@1hi,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/src/fossil.popupwidget.js
+++ b/src/fossil.popupwidget.js
@@ -1,10 +1,12 @@
1 (function(F/*fossil object*/){
2 30 */
3 installClickToHiden or basic user intera(function(F/*fossil object*/){
4 3000sClass = cssClass;
5 unct}, true);isplay basic information ClickToHide(nction(F/*fossil object*/fossil object*/){
6 3000sClass = cssClass;
7 unction(F/*fossil object*/){
8 /**
9 A very basic tooltip-like widget. It's intended to be popped up
10 to display basic information or basic user interaction
11 components, e.g. a cop or movopy-to-clipboard butt
12 if needed,l.dom
@@ -108,4 +110,25 @@
110 f.toast = function ff(argsObject){
111 if(!ff.toaster) f ['fossil-tooltip', 'fossil-toast']
112 });
113 i@1hi,X: D.clearElement(ff.toaster.e);9@1SA,2w:var i = 0;
114 for( ; i < argsObject.length; ++i ){
115 D.append(ff.toaster.e, argsObject[i]);
116 };
117 ff.toaster.show(f.config.position.x, f.config.position.y);
118 Q@1mw,1m:()=>ff.toaster.hide(), f.config.displayTimeMs);
119 };
120 }
121 f.toast(arguments);
122 };
123 F.toast.config = {
124 10@1pR,i:displayTimeMs: 2500
125 };
126
127 })(window.fossil);
128 ZfWzX;(function(F/*fossil object*/){
129 (function(F/*fossil object*/){
130 30, y = 0D[showIt ? if(x || y){
131 }
132 return this;
133
134 })(window.fossil);
D src/fossil.tooltip.js
-111
--- a/src/fossil.tooltip.js
+++ b/src/fossil.tooltip.js
@@ -1,111 +0,0 @@
1
-(function(F/*fossil object*/){
2
- 30 widgetbject*/fossil object*/){
3
- 3000sClass = cssClass;
4
- unction(F/*fossil objecoltip-like widget. The options are available to clients after this returns via
5
- theTooltip.options, and
6
- D.append(any 30 */
7
- installClickT(function(F/*fosswidget. It's intended to be popped up
8
- to display basic information or basic user interaction
9
- components, e.g. a cop or movopy-to-clipboard butt
10
- if needed,l.dom
11
- */
12
- const D = F.dom
13
- base DOMwidget using the
14
-). If theallback whic
15
- h is cal){
16
- 30 */
17
- installClickTo
18
- set up via theintera(function(F/*fossil object*/){
19
- 3000sClass = cssClass;
20
- unct}, true);isplay basic information ClickToHide(nction(F/*fossil object*/fossil object*/){
21
- 3000sClass = cssClass;
22
- unction(F/*fossil object*/){
23
- /**
24
- A very basic tooltip-like widget. It's intended to be popped up
25
- to display basic information or basic user interaction
26
- components, e.g. a copy-to-clipboard button.
27
-
28
- Requires: fossil.bootstrap, fossil.dom
29
- */
30
- conbjecthe popup when either
31
- call this
32
- show(falseshow(falseshow(falseconst hide Just be careful to mess only with the X coordinate
33
- and the width. The browser will try to keep the widget
34
- from being truncated off-screen on the right, shifting it
35
- to the left if needed, and we cannot generically be sure
36
- that an enforced fully on-screen size will actually fit
37
- the current help textclickHandler){const rect1unction(F/*fossil object*(function(F/*fossil object*/){})(window.fossil);
38
-deleteleft');
39
- deletea toas(function(F/*fossil o*fossil object*/){
40
-function(F/*fossil ct*/){
41
- 30 */
42
- installClickToHiden or basic user intera(fun*/
43
- F.toast = function f(/*...*/){
44
- f.toast = function ff(argsObject){
45
- if(!ff.toaster) f ['fossil-tooltip', 'fossil-toast']
46
- });
47
- i@1hi,X: D.clearElement(ff.toaster.e);9@1SA,2w:var i = 0;
48
- for( ; i < argsObject.length; ++i ){
49
- D.append(ff.toaster.e, argsObject[i]);
50
- };
51
- ff.toaster.show(f.config.position.x, f.config.position.y);
52
- Q@1mw,1m:()=>ff.toaster.hide(), f.config.displayTimeMs);
53
- };
54
- }
55
- f.toast(arguments);
56
- };
57
- F.toast.config = {
58
-10@1pR,i:displayTimeMs: 2500
59
- };
60
-
61
-})(window.fossil);
62
-ZfWzX;(function(F/*fossil object*/){
63
- 30 */
64
- installClickToHiden or basic user intera(function(F/*fossil object*/){
65
- 3000sClass = cssClass;
66
- unct}, true);isplay basic information ClickToHide(nction(F/*fossil object*/fossil object*/){
67
- 3000sClass = cssClass;
68
- unction(F/*fossil object*/){
69
- /**
70
- A very basic tooltip-like widget. It's intended to be popped up
71
- to display basic information or basic user interaction
72
- components, e.g. a cop or movopy-to-clipboard butt
73
- if needed,l.dom
74
- */
75
- const D = F.dom
76
- base DOMwidget using the
77
-). If theallback whic
78
- h is called just before*/){
79
- 30 */
80
- instfunction(F/*fossil object*/){
81
- 30 */
82
- installClickToHiden or basic user intera(function(F/*fossil object*/){
83
- 3000sClass = cssClass;
84
- unct}, true);isplay basic information ClickToHide(nction(F/*fossil object*/fossil object*/){
85
- 3000sClass = cssClass;
86
- unction(F/*fossil object*/){
87
- /**
88
- A very basic tooltip-like widget. It's intended to be popped up
89
- to display basic information or basic user interaction
90
- components, e.g. a copy-to-clipboard button.
91
-
92
- Requires: fossil.bootstrap, fossil.dom
93
- */
94
- conbjecthe popup when either
95
- call this
96
- show(falseshow(falseshow(falseconst hide Just be careful to mess only with the X coordinate
97
- and the width. The browser will try to keep the widget
98
- from being truncated off-screen on the right, shifting it
99
- to the left if needed, and we cannot generically be sure
100
- that an enforced fully on-screen size will actually fit
101
- the current help textclickHandler){const rect1unction(F/*fossil object*(function(F/*fossil object*/){})(window.fossil);
102
-deleteleft');
103
- deletea toas(function(F/*fossil o*fossil object*/){
104
-function(F/*fossil ct*/){
105
- 30 */
106
- installClickToHiden or basic user intera(fun*/
107
- F.toast = function f(/*...*/){
108
- f.toast = function ff(argsObject){
109
- if(!ff.toaster) f ['fossil-tooltip', 'fossil-toast']
110
- });
111
- i@1hi,
--- a/src/fossil.tooltip.js
+++ b/src/fossil.tooltip.js
@@ -1,111 +0,0 @@
1 (function(F/*fossil object*/){
2 30 widgetbject*/fossil object*/){
3 3000sClass = cssClass;
4 unction(F/*fossil objecoltip-like widget. The options are available to clients after this returns via
5 theTooltip.options, and
6 D.append(any 30 */
7 installClickT(function(F/*fosswidget. It's intended to be popped up
8 to display basic information or basic user interaction
9 components, e.g. a cop or movopy-to-clipboard butt
10 if needed,l.dom
11 */
12 const D = F.dom
13 base DOMwidget using the
14 ). If theallback whic
15 h is cal){
16 30 */
17 installClickTo
18 set up via theintera(function(F/*fossil object*/){
19 3000sClass = cssClass;
20 unct}, true);isplay basic information ClickToHide(nction(F/*fossil object*/fossil object*/){
21 3000sClass = cssClass;
22 unction(F/*fossil object*/){
23 /**
24 A very basic tooltip-like widget. It's intended to be popped up
25 to display basic information or basic user interaction
26 components, e.g. a copy-to-clipboard button.
27
28 Requires: fossil.bootstrap, fossil.dom
29 */
30 conbjecthe popup when either
31 call this
32 show(falseshow(falseshow(falseconst hide Just be careful to mess only with the X coordinate
33 and the width. The browser will try to keep the widget
34 from being truncated off-screen on the right, shifting it
35 to the left if needed, and we cannot generically be sure
36 that an enforced fully on-screen size will actually fit
37 the current help textclickHandler){const rect1unction(F/*fossil object*(function(F/*fossil object*/){})(window.fossil);
38 deleteleft');
39 deletea toas(function(F/*fossil o*fossil object*/){
40 function(F/*fossil ct*/){
41 30 */
42 installClickToHiden or basic user intera(fun*/
43 F.toast = function f(/*...*/){
44 f.toast = function ff(argsObject){
45 if(!ff.toaster) f ['fossil-tooltip', 'fossil-toast']
46 });
47 i@1hi,X: D.clearElement(ff.toaster.e);9@1SA,2w:var i = 0;
48 for( ; i < argsObject.length; ++i ){
49 D.append(ff.toaster.e, argsObject[i]);
50 };
51 ff.toaster.show(f.config.position.x, f.config.position.y);
52 Q@1mw,1m:()=>ff.toaster.hide(), f.config.displayTimeMs);
53 };
54 }
55 f.toast(arguments);
56 };
57 F.toast.config = {
58 10@1pR,i:displayTimeMs: 2500
59 };
60
61 })(window.fossil);
62 ZfWzX;(function(F/*fossil object*/){
63 30 */
64 installClickToHiden or basic user intera(function(F/*fossil object*/){
65 3000sClass = cssClass;
66 unct}, true);isplay basic information ClickToHide(nction(F/*fossil object*/fossil object*/){
67 3000sClass = cssClass;
68 unction(F/*fossil object*/){
69 /**
70 A very basic tooltip-like widget. It's intended to be popped up
71 to display basic information or basic user interaction
72 components, e.g. a cop or movopy-to-clipboard butt
73 if needed,l.dom
74 */
75 const D = F.dom
76 base DOMwidget using the
77 ). If theallback whic
78 h is called just before*/){
79 30 */
80 instfunction(F/*fossil object*/){
81 30 */
82 installClickToHiden or basic user intera(function(F/*fossil object*/){
83 3000sClass = cssClass;
84 unct}, true);isplay basic information ClickToHide(nction(F/*fossil object*/fossil object*/){
85 3000sClass = cssClass;
86 unction(F/*fossil object*/){
87 /**
88 A very basic tooltip-like widget. It's intended to be popped up
89 to display basic information or basic user interaction
90 components, e.g. a copy-to-clipboard button.
91
92 Requires: fossil.bootstrap, fossil.dom
93 */
94 conbjecthe popup when either
95 call this
96 show(falseshow(falseshow(falseconst hide Just be careful to mess only with the X coordinate
97 and the width. The browser will try to keep the widget
98 from being truncated off-screen on the right, shifting it
99 to the left if needed, and we cannot generically be sure
100 that an enforced fully on-screen size will actually fit
101 the current help textclickHandler){const rect1unction(F/*fossil object*(function(F/*fossil object*/){})(window.fossil);
102 deleteleft');
103 deletea toas(function(F/*fossil o*fossil object*/){
104 function(F/*fossil ct*/){
105 30 */
106 installClickToHiden or basic user intera(fun*/
107 F.toast = function f(/*...*/){
108 f.toast = function ff(argsObject){
109 if(!ff.toaster) f ['fossil-tooltip', 'fossil-toast']
110 });
111 i@1hi,
--- a/src/fossil.tooltip.js
+++ b/src/fossil.tooltip.js
@@ -1,111 +0,0 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
+1 -1
--- src/info.c
+++ src/info.c
@@ -2118,11 +2118,11 @@
21182118
cgi_printf("%z", htmlize(z, nZ));
21192119
CX("</code></pre></td></tr></tbody></table>\n");
21202120
if( db_int(0, "SELECT EXISTS(SELECT 1 FROM lnos)") ){
21212121
builtin_request_js("scroll.js");
21222122
}
2123
- style_emit_fossil_js_apis(0, "dom", "copybutton", "tooltip",
2123
+ style_emit_fossil_js_apis(0, "dom", "copybutton", "popupwidget",
21242124
"numbered-lines", 0);
21252125
}
21262126
21272127
/*
21282128
** COMMAND: test-line-numbers
21292129
--- src/info.c
+++ src/info.c
@@ -2118,11 +2118,11 @@
2118 cgi_printf("%z", htmlize(z, nZ));
2119 CX("</code></pre></td></tr></tbody></table>\n");
2120 if( db_int(0, "SELECT EXISTS(SELECT 1 FROM lnos)") ){
2121 builtin_request_js("scroll.js");
2122 }
2123 style_emit_fossil_js_apis(0, "dom", "copybutton", "tooltip",
2124 "numbered-lines", 0);
2125 }
2126
2127 /*
2128 ** COMMAND: test-line-numbers
2129
--- src/info.c
+++ src/info.c
@@ -2118,11 +2118,11 @@
2118 cgi_printf("%z", htmlize(z, nZ));
2119 CX("</code></pre></td></tr></tbody></table>\n");
2120 if( db_int(0, "SELECT EXISTS(SELECT 1 FROM lnos)") ){
2121 builtin_request_js("scroll.js");
2122 }
2123 style_emit_fossil_js_apis(0, "dom", "copybutton", "popupwidget",
2124 "numbered-lines", 0);
2125 }
2126
2127 /*
2128 ** COMMAND: test-line-numbers
2129
+1 -1
--- src/main.mk
+++ src/main.mk
@@ -230,13 +230,13 @@
230230
$(SRCDIR)/fossil.fetch.js \
231231
$(SRCDIR)/fossil.numbered-lines.js \
232232
$(SRCDIR)/fossil.page.fileedit.js \
233233
$(SRCDIR)/fossil.page.forumpost.js \
234234
$(SRCDIR)/fossil.page.wikiedit.js \
235
+ $(SRCDIR)/fossil.popupwidget.js \
235236
$(SRCDIR)/fossil.storage.js \
236237
$(SRCDIR)/fossil.tabs.js \
237
- $(SRCDIR)/fossil.tooltip.js \
238238
$(SRCDIR)/graph.js \
239239
$(SRCDIR)/href.js \
240240
$(SRCDIR)/login.js \
241241
$(SRCDIR)/markdown.md \
242242
$(SRCDIR)/menu.js \
243243
--- src/main.mk
+++ src/main.mk
@@ -230,13 +230,13 @@
230 $(SRCDIR)/fossil.fetch.js \
231 $(SRCDIR)/fossil.numbered-lines.js \
232 $(SRCDIR)/fossil.page.fileedit.js \
233 $(SRCDIR)/fossil.page.forumpost.js \
234 $(SRCDIR)/fossil.page.wikiedit.js \
 
235 $(SRCDIR)/fossil.storage.js \
236 $(SRCDIR)/fossil.tabs.js \
237 $(SRCDIR)/fossil.tooltip.js \
238 $(SRCDIR)/graph.js \
239 $(SRCDIR)/href.js \
240 $(SRCDIR)/login.js \
241 $(SRCDIR)/markdown.md \
242 $(SRCDIR)/menu.js \
243
--- src/main.mk
+++ src/main.mk
@@ -230,13 +230,13 @@
230 $(SRCDIR)/fossil.fetch.js \
231 $(SRCDIR)/fossil.numbered-lines.js \
232 $(SRCDIR)/fossil.page.fileedit.js \
233 $(SRCDIR)/fossil.page.forumpost.js \
234 $(SRCDIR)/fossil.page.wikiedit.js \
235 $(SRCDIR)/fossil.popupwidget.js \
236 $(SRCDIR)/fossil.storage.js \
237 $(SRCDIR)/fossil.tabs.js \
 
238 $(SRCDIR)/graph.js \
239 $(SRCDIR)/href.js \
240 $(SRCDIR)/login.js \
241 $(SRCDIR)/markdown.md \
242 $(SRCDIR)/menu.js \
243
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -642,13 +642,13 @@
642642
$(SRCDIR)/fossil.fetch.js \
643643
$(SRCDIR)/fossil.numbered-lines.js \
644644
$(SRCDIR)/fossil.page.fileedit.js \
645645
$(SRCDIR)/fossil.page.forumpost.js \
646646
$(SRCDIR)/fossil.page.wikiedit.js \
647
+ $(SRCDIR)/fossil.popupwidget.js \
647648
$(SRCDIR)/fossil.storage.js \
648649
$(SRCDIR)/fossil.tabs.js \
649
- $(SRCDIR)/fossil.tooltip.js \
650650
$(SRCDIR)/graph.js \
651651
$(SRCDIR)/href.js \
652652
$(SRCDIR)/login.js \
653653
$(SRCDIR)/markdown.md \
654654
$(SRCDIR)/menu.js \
655655
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -642,13 +642,13 @@
642 $(SRCDIR)/fossil.fetch.js \
643 $(SRCDIR)/fossil.numbered-lines.js \
644 $(SRCDIR)/fossil.page.fileedit.js \
645 $(SRCDIR)/fossil.page.forumpost.js \
646 $(SRCDIR)/fossil.page.wikiedit.js \
 
647 $(SRCDIR)/fossil.storage.js \
648 $(SRCDIR)/fossil.tabs.js \
649 $(SRCDIR)/fossil.tooltip.js \
650 $(SRCDIR)/graph.js \
651 $(SRCDIR)/href.js \
652 $(SRCDIR)/login.js \
653 $(SRCDIR)/markdown.md \
654 $(SRCDIR)/menu.js \
655
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -642,13 +642,13 @@
642 $(SRCDIR)/fossil.fetch.js \
643 $(SRCDIR)/fossil.numbered-lines.js \
644 $(SRCDIR)/fossil.page.fileedit.js \
645 $(SRCDIR)/fossil.page.forumpost.js \
646 $(SRCDIR)/fossil.page.wikiedit.js \
647 $(SRCDIR)/fossil.popupwidget.js \
648 $(SRCDIR)/fossil.storage.js \
649 $(SRCDIR)/fossil.tabs.js \
 
650 $(SRCDIR)/graph.js \
651 $(SRCDIR)/href.js \
652 $(SRCDIR)/login.js \
653 $(SRCDIR)/markdown.md \
654 $(SRCDIR)/menu.js \
655
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -563,13 +563,13 @@
563563
"$(SRCDIR)\fossil.fetch.js" \
564564
"$(SRCDIR)\fossil.numbered-lines.js" \
565565
"$(SRCDIR)\fossil.page.fileedit.js" \
566566
"$(SRCDIR)\fossil.page.forumpost.js" \
567567
"$(SRCDIR)\fossil.page.wikiedit.js" \
568
+ "$(SRCDIR)\fossil.popupwidget.js" \
568569
"$(SRCDIR)\fossil.storage.js" \
569570
"$(SRCDIR)\fossil.tabs.js" \
570
- "$(SRCDIR)\fossil.tooltip.js" \
571571
"$(SRCDIR)\graph.js" \
572572
"$(SRCDIR)\href.js" \
573573
"$(SRCDIR)\login.js" \
574574
"$(SRCDIR)\markdown.md" \
575575
"$(SRCDIR)\menu.js" \
@@ -1160,13 +1160,13 @@
11601160
echo "$(SRCDIR)\fossil.fetch.js" >> $@
11611161
echo "$(SRCDIR)\fossil.numbered-lines.js" >> $@
11621162
echo "$(SRCDIR)\fossil.page.fileedit.js" >> $@
11631163
echo "$(SRCDIR)\fossil.page.forumpost.js" >> $@
11641164
echo "$(SRCDIR)\fossil.page.wikiedit.js" >> $@
1165
+ echo "$(SRCDIR)\fossil.popupwidget.js" >> $@
11651166
echo "$(SRCDIR)\fossil.storage.js" >> $@
11661167
echo "$(SRCDIR)\fossil.tabs.js" >> $@
1167
- echo "$(SRCDIR)\fossil.tooltip.js" >> $@
11681168
echo "$(SRCDIR)\graph.js" >> $@
11691169
echo "$(SRCDIR)\href.js" >> $@
11701170
echo "$(SRCDIR)\login.js" >> $@
11711171
echo "$(SRCDIR)\markdown.md" >> $@
11721172
echo "$(SRCDIR)\menu.js" >> $@
11731173
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -563,13 +563,13 @@
563 "$(SRCDIR)\fossil.fetch.js" \
564 "$(SRCDIR)\fossil.numbered-lines.js" \
565 "$(SRCDIR)\fossil.page.fileedit.js" \
566 "$(SRCDIR)\fossil.page.forumpost.js" \
567 "$(SRCDIR)\fossil.page.wikiedit.js" \
 
568 "$(SRCDIR)\fossil.storage.js" \
569 "$(SRCDIR)\fossil.tabs.js" \
570 "$(SRCDIR)\fossil.tooltip.js" \
571 "$(SRCDIR)\graph.js" \
572 "$(SRCDIR)\href.js" \
573 "$(SRCDIR)\login.js" \
574 "$(SRCDIR)\markdown.md" \
575 "$(SRCDIR)\menu.js" \
@@ -1160,13 +1160,13 @@
1160 echo "$(SRCDIR)\fossil.fetch.js" >> $@
1161 echo "$(SRCDIR)\fossil.numbered-lines.js" >> $@
1162 echo "$(SRCDIR)\fossil.page.fileedit.js" >> $@
1163 echo "$(SRCDIR)\fossil.page.forumpost.js" >> $@
1164 echo "$(SRCDIR)\fossil.page.wikiedit.js" >> $@
 
1165 echo "$(SRCDIR)\fossil.storage.js" >> $@
1166 echo "$(SRCDIR)\fossil.tabs.js" >> $@
1167 echo "$(SRCDIR)\fossil.tooltip.js" >> $@
1168 echo "$(SRCDIR)\graph.js" >> $@
1169 echo "$(SRCDIR)\href.js" >> $@
1170 echo "$(SRCDIR)\login.js" >> $@
1171 echo "$(SRCDIR)\markdown.md" >> $@
1172 echo "$(SRCDIR)\menu.js" >> $@
1173
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -563,13 +563,13 @@
563 "$(SRCDIR)\fossil.fetch.js" \
564 "$(SRCDIR)\fossil.numbered-lines.js" \
565 "$(SRCDIR)\fossil.page.fileedit.js" \
566 "$(SRCDIR)\fossil.page.forumpost.js" \
567 "$(SRCDIR)\fossil.page.wikiedit.js" \
568 "$(SRCDIR)\fossil.popupwidget.js" \
569 "$(SRCDIR)\fossil.storage.js" \
570 "$(SRCDIR)\fossil.tabs.js" \
 
571 "$(SRCDIR)\graph.js" \
572 "$(SRCDIR)\href.js" \
573 "$(SRCDIR)\login.js" \
574 "$(SRCDIR)\markdown.md" \
575 "$(SRCDIR)\menu.js" \
@@ -1160,13 +1160,13 @@
1160 echo "$(SRCDIR)\fossil.fetch.js" >> $@
1161 echo "$(SRCDIR)\fossil.numbered-lines.js" >> $@
1162 echo "$(SRCDIR)\fossil.page.fileedit.js" >> $@
1163 echo "$(SRCDIR)\fossil.page.forumpost.js" >> $@
1164 echo "$(SRCDIR)\fossil.page.wikiedit.js" >> $@
1165 echo "$(SRCDIR)\fossil.popupwidget.js" >> $@
1166 echo "$(SRCDIR)\fossil.storage.js" >> $@
1167 echo "$(SRCDIR)\fossil.tabs.js" >> $@
 
1168 echo "$(SRCDIR)\graph.js" >> $@
1169 echo "$(SRCDIR)\href.js" >> $@
1170 echo "$(SRCDIR)\login.js" >> $@
1171 echo "$(SRCDIR)\markdown.md" >> $@
1172 echo "$(SRCDIR)\menu.js" >> $@
1173

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button