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.
Commit
ff7ad7125f25780ef6cc1bb5f1e7b018008709460d449bbcc4f1f95a04ad439b
Parent
2318c419c9e2c3c…
2 files changed
+4
-5
+10
-3
+4
-5
| --- src/fileedit.c | ||
| +++ src/fileedit.c | ||
| @@ -1671,17 +1671,16 @@ | ||
| 1671 | 1671 | */ |
| 1672 | 1672 | style_emit_script_tag(0,0); |
| 1673 | 1673 | CX("document.body.classList.add('fileedit');\n"); |
| 1674 | 1674 | style_emit_script_tag(1,0); |
| 1675 | 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 | 1676 | |
| 1680 | 1677 | /* 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 */); | |
| 1683 | 1682 | |
| 1684 | 1683 | /* Main tab container... */ |
| 1685 | 1684 | CX("<div id='fileedit-tabs' class='tab-container'></div>"); |
| 1686 | 1685 | |
| 1687 | 1686 | /***** File/version info tab *****/ |
| 1688 | 1687 |
| --- 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 |
+10
-3
| --- src/fossil.bootstrap.js | ||
| +++ src/fossil.bootstrap.js | ||
| @@ -30,26 +30,33 @@ | ||
| 30 | 30 | ** Returns this object. |
| 31 | 31 | */ |
| 32 | 32 | F.message = function f(msg){ |
| 33 | 33 | const args = Array.prototype.slice.call(arguments,0); |
| 34 | 34 | const tgt = f.targetElement; |
| 35 | - args.unshift(timestring(),'UTC:'); | |
| 35 | + if(args.length) args.unshift(timestring(),'UTC:'); | |
| 36 | 36 | if(tgt){ |
| 37 | 37 | tgt.classList.remove('error'); |
| 38 | 38 | tgt.innerText = args.join(' '); |
| 39 | 39 | } |
| 40 | 40 | 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 | + } | |
| 43 | 45 | } |
| 44 | 46 | return this; |
| 45 | 47 | }; |
| 46 | 48 | /* |
| 47 | 49 | ** Set default message.targetElement to #fossil-status-bar, if found. |
| 48 | 50 | */ |
| 49 | 51 | F.message.targetElement = |
| 50 | 52 | document.querySelector('#fossil-status-bar'); |
| 53 | + if(F.message.targetElement){ | |
| 54 | + F.message.targetElement.addEventListener( | |
| 55 | + 'dblclick', ()=>F.message(), false | |
| 56 | + ); | |
| 57 | + } | |
| 51 | 58 | /* |
| 52 | 59 | ** By default fossil.error() sends its first argument to |
| 53 | 60 | ** console.error(). If fossil.message.targetElement (yes, |
| 54 | 61 | ** fossil.message) is set, it adds the 'error' CSS class to |
| 55 | 62 | ** that element and sets its content as defined for message(). |
| 56 | 63 |
| --- 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 |