Fossil SCM

Double-clicking the status message bar now clears the message (useful when a long HTML-format error comes in via ajax). Removed the unsightly 'new and experimental' banner.

stephan 2020-05-12 08:54 fileedit-ajaxify
Commit ff7ad7125f25780ef6cc1bb5f1e7b018008709460d449bbcc4f1f95a04ad439b
+4 -5
--- src/fileedit.c
+++ src/fileedit.c
@@ -1671,17 +1671,16 @@
16711671
*/
16721672
style_emit_script_tag(0,0);
16731673
CX("document.body.classList.add('fileedit');\n");
16741674
style_emit_script_tag(1,0);
16751675
}
1676
- CX("<p>This page is <em>NEW AND EXPERIMENTAL</em>. "
1677
- "USE AT YOUR OWN RISK, preferably on a test "
1678
- "repo.</p>\n");
16791676
16801677
/* Status bar */
1681
- CX("<div id='fossil-status-bar'>Async. status messages will go "
1682
- "here.</div>\n"/* will be moved into the tab container via JS */);
1678
+ CX("<div id='fossil-status-bar' "
1679
+ "title='Status message area. Double-click to clear them.'>"
1680
+ "Status messages will go here.</div>\n"
1681
+ /* will be moved into the tab container via JS */);
16831682
16841683
/* Main tab container... */
16851684
CX("<div id='fileedit-tabs' class='tab-container'></div>");
16861685
16871686
/***** File/version info tab *****/
16881687
--- src/fileedit.c
+++ src/fileedit.c
@@ -1671,17 +1671,16 @@
1671 */
1672 style_emit_script_tag(0,0);
1673 CX("document.body.classList.add('fileedit');\n");
1674 style_emit_script_tag(1,0);
1675 }
1676 CX("<p>This page is <em>NEW AND EXPERIMENTAL</em>. "
1677 "USE AT YOUR OWN RISK, preferably on a test "
1678 "repo.</p>\n");
1679
1680 /* Status bar */
1681 CX("<div id='fossil-status-bar'>Async. status messages will go "
1682 "here.</div>\n"/* will be moved into the tab container via JS */);
 
 
1683
1684 /* Main tab container... */
1685 CX("<div id='fileedit-tabs' class='tab-container'></div>");
1686
1687 /***** File/version info tab *****/
1688
--- src/fileedit.c
+++ src/fileedit.c
@@ -1671,17 +1671,16 @@
1671 */
1672 style_emit_script_tag(0,0);
1673 CX("document.body.classList.add('fileedit');\n");
1674 style_emit_script_tag(1,0);
1675 }
 
 
 
1676
1677 /* Status bar */
1678 CX("<div id='fossil-status-bar' "
1679 "title='Status message area. Double-click to clear them.'>"
1680 "Status messages will go here.</div>\n"
1681 /* will be moved into the tab container via JS */);
1682
1683 /* Main tab container... */
1684 CX("<div id='fileedit-tabs' class='tab-container'></div>");
1685
1686 /***** File/version info tab *****/
1687
--- src/fossil.bootstrap.js
+++ src/fossil.bootstrap.js
@@ -30,26 +30,33 @@
3030
** Returns this object.
3131
*/
3232
F.message = function f(msg){
3333
const args = Array.prototype.slice.call(arguments,0);
3434
const tgt = f.targetElement;
35
- args.unshift(timestring(),'UTC:');
35
+ if(args.length) args.unshift(timestring(),'UTC:');
3636
if(tgt){
3737
tgt.classList.remove('error');
3838
tgt.innerText = args.join(' ');
3939
}
4040
else{
41
- args.unshift('Fossil status:');
42
- console.debug.apply(console,args);
41
+ if(args.length){
42
+ args.unshift('Fossil status:');
43
+ console.debug.apply(console,args);
44
+ }
4345
}
4446
return this;
4547
};
4648
/*
4749
** Set default message.targetElement to #fossil-status-bar, if found.
4850
*/
4951
F.message.targetElement =
5052
document.querySelector('#fossil-status-bar');
53
+ if(F.message.targetElement){
54
+ F.message.targetElement.addEventListener(
55
+ 'dblclick', ()=>F.message(), false
56
+ );
57
+ }
5158
/*
5259
** By default fossil.error() sends its first argument to
5360
** console.error(). If fossil.message.targetElement (yes,
5461
** fossil.message) is set, it adds the 'error' CSS class to
5562
** that element and sets its content as defined for message().
5663
--- src/fossil.bootstrap.js
+++ src/fossil.bootstrap.js
@@ -30,26 +30,33 @@
30 ** Returns this object.
31 */
32 F.message = function f(msg){
33 const args = Array.prototype.slice.call(arguments,0);
34 const tgt = f.targetElement;
35 args.unshift(timestring(),'UTC:');
36 if(tgt){
37 tgt.classList.remove('error');
38 tgt.innerText = args.join(' ');
39 }
40 else{
41 args.unshift('Fossil status:');
42 console.debug.apply(console,args);
 
 
43 }
44 return this;
45 };
46 /*
47 ** Set default message.targetElement to #fossil-status-bar, if found.
48 */
49 F.message.targetElement =
50 document.querySelector('#fossil-status-bar');
 
 
 
 
 
51 /*
52 ** By default fossil.error() sends its first argument to
53 ** console.error(). If fossil.message.targetElement (yes,
54 ** fossil.message) is set, it adds the 'error' CSS class to
55 ** that element and sets its content as defined for message().
56
--- src/fossil.bootstrap.js
+++ src/fossil.bootstrap.js
@@ -30,26 +30,33 @@
30 ** Returns this object.
31 */
32 F.message = function f(msg){
33 const args = Array.prototype.slice.call(arguments,0);
34 const tgt = f.targetElement;
35 if(args.length) args.unshift(timestring(),'UTC:');
36 if(tgt){
37 tgt.classList.remove('error');
38 tgt.innerText = args.join(' ');
39 }
40 else{
41 if(args.length){
42 args.unshift('Fossil status:');
43 console.debug.apply(console,args);
44 }
45 }
46 return this;
47 };
48 /*
49 ** Set default message.targetElement to #fossil-status-bar, if found.
50 */
51 F.message.targetElement =
52 document.querySelector('#fossil-status-bar');
53 if(F.message.targetElement){
54 F.message.targetElement.addEventListener(
55 'dblclick', ()=>F.message(), false
56 );
57 }
58 /*
59 ** By default fossil.error() sends its first argument to
60 ** console.error(). If fossil.message.targetElement (yes,
61 ** fossil.message) is set, it adds the 'error' CSS class to
62 ** that element and sets its content as defined for message().
63

Keyboard Shortcuts

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