Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch copybtn.js-demonstration Through [698245db8d] Excluding Merge-Ins
This is equivalent to a diff from 148b01359c to 698245db8d
|
2019-06-03
| ||
| 09:08 | Remove unnecessary white space between the copy button and the branch name. check-in: b5bbad23b4 user: florian tags: copybtn.js-demonstration | |
|
2019-06-02
| ||
| 12:36 | Cherry-pick [6a54cf2939]: Trim leading and trailing white space from the text to be copied to clipboard (do this in Javascript, so no need to care about the extra white space when generating HTML elements). check-in: 698245db8d user: florian tags: copybtn.js-demonstration | |
| 12:32 | Trim leading and trailing white space from the text to be copied to clipboard (do this in Javascript, so no need to care about the extra white space when generating HTML elements). check-in: 6a54cf2939 user: florian tags: tooltip-copyhash | |
| 12:03 | Add a copy button for the artifact hash on the /artifact page. check-in: 3aab0bfdc0 user: florian tags: copybtn.js-demonstration | |
|
2019-05-31
| ||
| 16:36 | Demonstration of the copybtn.js module beyond tooltips: add a copy button near the full-length hash of check-ins on the /info page, to copy only the hash prefix when clicked. check-in: 46f91da1a8 user: florian tags: copybtn.js-demonstration | |
| 15:34 | Auto-init HTML-defined buttons during the "DOMContentLoaded" event, so no more Javascript code required, apart from loading the copybtn.js module. check-in: 148b01359c user: florian tags: tooltip-copyhash | |
| 15:01 | Revamp the comments, and refactor the code in preparation for an auto-init functionality for HTML-defined buttons. check-in: 7fddf96cd6 user: florian tags: tooltip-copyhash | |
Changes to src/copybtn.js.
| ︙ | ︙ | |||
56 57 58 59 60 61 62 |
if( lockCopyText ) return;
lockCopyText = true;
this.style.transition = "opacity 400ms ease-in-out";
this.style.opacity = 0;
var idTarget = this.getAttribute("data-copytarget");
var elTarget = document.getElementById(idTarget);
if( elTarget ){
| | | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
if( lockCopyText ) return;
lockCopyText = true;
this.style.transition = "opacity 400ms ease-in-out";
this.style.opacity = 0;
var idTarget = this.getAttribute("data-copytarget");
var elTarget = document.getElementById(idTarget);
if( elTarget ){
var text = elTarget.innerText.replace(/^\s+|\s+$/g,'');
var cchLength = parseInt(this.getAttribute("data-copylength"));
if( !isNaN(cchLength) && cchLength>0 ){
text = text.slice(0,cchLength); // Assume single-byte chars.
}
copyTextToClipboard(text);
}
setTimeout(function(id){
|
| ︙ | ︙ |
Changes to src/graph.js.
| ︙ | ︙ | |||
17 18 19 20 21 22 23 | ** "omitDescenders": BOOLEAN, // Omit ancestor lines off bottom of screen ** "fileDiff": BOOLEAN, // True for file diff. False for check-in ** "scrollToSelect": BOOLEAN, // Scroll to selection on first render ** "nrail": INTEGER, // Number of vertical "rails" ** "baseUrl": TEXT, // Top-level URL ** "dwellTimeout": INTEGER, // Tooltip show delay in milliseconds ** "closeTimeout": INTEGER, // Tooltip close delay in milliseconds | | | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
** "omitDescenders": BOOLEAN, // Omit ancestor lines off bottom of screen
** "fileDiff": BOOLEAN, // True for file diff. False for check-in
** "scrollToSelect": BOOLEAN, // Scroll to selection on first render
** "nrail": INTEGER, // Number of vertical "rails"
** "baseUrl": TEXT, // Top-level URL
** "dwellTimeout": INTEGER, // Tooltip show delay in milliseconds
** "closeTimeout": INTEGER, // Tooltip close delay in milliseconds
** "hashDigits": INTEGER, // Limit of tooltip hashes ("hash-digits")
** "rowinfo": ROWINFO-ARRAY }
**
** The rowinfo field is an array of structures, one per entry in the timeline,
** where each structure has the following fields:
**
** id: The id of the <div> element for the row. This is an integer.
** to get an actual id, prepend "m" to the integer. The top node
|
| ︙ | ︙ | |||
96 97 98 99 100 101 102 |
if (tooltipInfo.ixActive != -1) resumeCloseTimer();
};
/* State information for the tooltip popup and its timers */
window.tooltipInfo = {
dwellTimeout: 250, /* The tooltip dwell timeout. */
closeTimeout: 3000, /* The tooltip close timeout. */
| | | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
if (tooltipInfo.ixActive != -1) resumeCloseTimer();
};
/* State information for the tooltip popup and its timers */
window.tooltipInfo = {
dwellTimeout: 250, /* The tooltip dwell timeout. */
closeTimeout: 3000, /* The tooltip close timeout. */
hashDigits: 16, /* Limit of tooltip hashes ("hash-digits"). */
idTimer: 0, /* The tooltip dwell timer id. */
idTimerClose: 0, /* The tooltip close timer id. */
ixHover: -1, /* The id of the element with the mouse. */
ixActive: -1, /* The id of the element with the tooltip. */
nodeHover: null, /* Graph node under mouse when ixHover==-2 */
posX: 0, posY: 0 /* The last mouse position. */
};
|
| ︙ | ︙ | |||
141 142 143 144 145 146 147 |
/* Construct that graph corresponding to the timeline-data-N object that
** is passed in by the tx parameter */
function TimelineGraph(tx){
var topObj = document.getElementById("timelineTable"+tx.iTableId);
amendCss(tx.circleNodes, tx.showArrowheads);
tooltipInfo.dwellTimeout = tx.dwellTimeout
tooltipInfo.closeTimeout = tx.closeTimeout
| | | 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
/* Construct that graph corresponding to the timeline-data-N object that
** is passed in by the tx parameter */
function TimelineGraph(tx){
var topObj = document.getElementById("timelineTable"+tx.iTableId);
amendCss(tx.circleNodes, tx.showArrowheads);
tooltipInfo.dwellTimeout = tx.dwellTimeout
tooltipInfo.closeTimeout = tx.closeTimeout
tooltipInfo.hashDigits = tx.hashDigits
topObj.onclick = clickOnGraph
topObj.ondblclick = dblclickOnGraph
topObj.onmousemove = function(e) {
var ix = findTxIndex(e);
topObj.style.cursor = (ix<0) ? "" : "pointer"
/* Keep the already visible tooltip at a constant position, as long as the
** mouse is over the same element. */
|
| ︙ | ︙ | |||
595 596 597 598 599 600 601 |
function showGraphTooltip(){
var html = null
var ix = -1
if( tooltipInfo.ixHover==-2 ){
ix = parseInt(tooltipInfo.nodeHover.id.match(/\d+$/)[0],10)-tx.iTopRow
var h = tx.rowinfo[ix].h
var dest = tx.baseUrl + "/info/" + h
| | | 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 |
function showGraphTooltip(){
var html = null
var ix = -1
if( tooltipInfo.ixHover==-2 ){
ix = parseInt(tooltipInfo.nodeHover.id.match(/\d+$/)[0],10)-tx.iTopRow
var h = tx.rowinfo[ix].h
var dest = tx.baseUrl + "/info/" + h
h = h.slice(0,tooltipInfo.hashDigits); // Assume single-byte characters.
if( tx.fileDiff ){
html = "artifact <a id=\"tooltip-link\" href=\""+dest+"\">"+h+"</a>"
}else{
html = "check-in <a id=\"tooltip-link\" href=\""+dest+"\">"+h+"</a>"
}
tooltipInfo.ixActive = -2;
}else if( tooltipInfo.ixHover>=0 ){
|
| ︙ | ︙ |
Changes to src/info.c.
| ︙ | ︙ | |||
761 762 763 764 765 766 767 |
db_prepare(&q2,"SELECT substr(tag.tagname,5) FROM tagxref, tag "
" WHERE rid=%d AND tagtype>0 "
" AND tag.tagid=tagxref.tagid "
" AND +tag.tagname GLOB 'sym-*'", rid);
while( db_step(&q2)==SQLITE_ROW ){
const char *zTagName = db_column_text(&q2, 0);
if( fossil_strcmp(zTagName,zBrName)==0 ){
| > > > | | 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 |
db_prepare(&q2,"SELECT substr(tag.tagname,5) FROM tagxref, tag "
" WHERE rid=%d AND tagtype>0 "
" AND tag.tagid=tagxref.tagid "
" AND +tag.tagname GLOB 'sym-*'", rid);
while( db_step(&q2)==SQLITE_ROW ){
const char *zTagName = db_column_text(&q2, 0);
if( fossil_strcmp(zTagName,zBrName)==0 ){
@ | <span class="copy-button" id="copy-brname"
@ data-copytarget="brname" data-copylength="0">
@ </span> <span id="brname">
@ %z(href("%R/timeline?r=%T&unhide",zTagName))%h(zTagName)</a></span>
if( wiki_tagid2("branch",zTagName)!=0 ){
blob_appendf(&wiki_read_links, " | %z%h</a>",
href("%R/wiki?name=branch/%h",zTagName), zTagName);
}else if( g.perm.Write && g.perm.WrWiki ){
blob_appendf(&wiki_add_links, " | %z%h</a>",
href("%R/wikiedit?name=branch/%h",zTagName), zTagName);
}
|
| ︙ | ︙ | |||
791 792 793 794 795 796 797 |
@ <td>
@ %z(href("%R/tree?ci=%!S",zUuid))files</a>
@ | %z(href("%R/fileage?name=%!S",zUuid))file ages</a>
@ | %z(href("%R/tree?nofiles&type=tree&ci=%!S",zUuid))folders</a>
@ </td>
@ </tr>
| | > > > | 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 |
@ <td>
@ %z(href("%R/tree?ci=%!S",zUuid))files</a>
@ | %z(href("%R/fileage?name=%!S",zUuid))file ages</a>
@ | %z(href("%R/tree?nofiles&type=tree&ci=%!S",zUuid))folders</a>
@ </td>
@ </tr>
@ <tr><th>%s(hname_alg(nUuid)):</th><td>
@ <span class="copy-button" id="copy-fullhash"
@ data-copytarget="fullhash" data-copylength="%d(hash_digits(1))">
@ </span> <span id="fullhash">%.32s(zUuid)<wbr>%s(zUuid+32)</span>
if( g.perm.Setup ){
@ (Record ID: %d(rid))
}
@ </td></tr>
@ <tr><th>User & Date:</th><td>
hyperlink_to_user(zUser,zDate," on ");
hyperlink_to_date(zDate, "</td></tr>");
|
| ︙ | ︙ | |||
2179 2180 2181 2182 2183 2184 2185 |
url_add_parameter(&url, "verbose", "1");
objdescFlags |= OBJDESC_DETAIL;
}
zUuid = db_text("?", "SELECT uuid FROM blob WHERE rid=%d", rid);
if( isFile ){
@ <h2>Latest version of file '%h(zName)':</h2>
style_submenu_element("Artifact", "%R/artifact/%S", zUuid);
| | > | > > > > | | > | 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 |
url_add_parameter(&url, "verbose", "1");
objdescFlags |= OBJDESC_DETAIL;
}
zUuid = db_text("?", "SELECT uuid FROM blob WHERE rid=%d", rid);
if( isFile ){
@ <h2>Latest version of file '%h(zName)':</h2>
style_submenu_element("Artifact", "%R/artifact/%S", zUuid);
}else{
style_copy_button();
@ <h2>Artifact
@ <span class="copy-button" id="copy-artifacthash"
@ data-copytarget="artifacthash" data-copylength="%d(hash_digits(1))">
if( g.perm.Setup ){
@ </span> <span id="artifacthash">%s(zUuid)</span> (%d(rid)):</h2>
}else{
@ </span> <span id="artifacthash">%s(zUuid)</span>:</h2>
}
}
blob_zero(&downloadName);
asText = P("txt")!=0;
if( asText ) objdescFlags &= ~OBJDESC_BASE;
objType = object_description(rid, objdescFlags, &downloadName);
if( !descOnly && P("download")!=0 ){
cgi_redirectf("%R/raw/%T?name=%s", blob_str(&downloadName),
|
| ︙ | ︙ |
Changes to src/printf.c.
| ︙ | ︙ | |||
46 47 48 49 50 51 52 | #endif /* ** Return the number of artifact hash digits to display. The number is for ** human output if the bForUrl is false and is destined for a URL if ** bForUrl is false. */ | | | | 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
#endif
/*
** Return the number of artifact hash digits to display. The number is for
** human output if the bForUrl is false and is destined for a URL if
** bForUrl is false.
*/
int hash_digits(int bForUrl){
static int nDigitHuman = 0;
static int nDigitUrl = 0;
if( nDigitHuman==0 ){
nDigitHuman = db_get_int("hash-digits", FOSSIL_HASH_DIGITS);
if( nDigitHuman < 6 ) nDigitHuman = 6;
if( nDigitHuman > 40 ) nDigitHuman = 40;
nDigitUrl = nDigitHuman + 6;
if( nDigitUrl < FOSSIL_HASH_DIGITS_URL ) nDigitUrl = FOSSIL_HASH_DIGITS_URL;
if( nDigitUrl > 40 ) nDigitUrl = 40;
}
return bForUrl ? nDigitUrl : nDigitHuman;
}
/*
** Return the number of characters in a %S output.
*/
int length_of_S_display(void){
return hash_digits(0);
}
/*
** Conversion types fall into various categories as defined by the
** following enumeration.
*/
#define etRADIX 1 /* Integer types. %d, %x, %o, and so forth */
|
| ︙ | ︙ | |||
677 678 679 680 681 682 683 |
int limit = flag_alternateform ? va_arg(ap,int) : -1;
bufpt = va_arg(ap,char*);
if( bufpt==0 ){
bufpt = "";
}else if( xtype==etDYNSTRING ){
zExtra = bufpt;
}else if( xtype==etSTRINGID ){
| | | 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 |
int limit = flag_alternateform ? va_arg(ap,int) : -1;
bufpt = va_arg(ap,char*);
if( bufpt==0 ){
bufpt = "";
}else if( xtype==etDYNSTRING ){
zExtra = bufpt;
}else if( xtype==etSTRINGID ){
precision = hash_digits(flag_altform2);
}
length = StrNLen32(bufpt, limit);
if( precision>=0 && precision<length ) length = precision;
break;
}
case etBLOB: {
int limit = flag_alternateform ? va_arg(ap, int) : -1;
|
| ︙ | ︙ |
Changes to src/th_main.c.
| ︙ | ︙ | |||
265 266 267 268 269 270 271 | ** True if output is enabled. False if disabled. */ static int enableOutput = 1; /* ** TH1 command: enable_output BOOLEAN ** | | | 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 | ** True if output is enabled. False if disabled. */ static int enableOutput = 1; /* ** TH1 command: enable_output BOOLEAN ** ** Enable or disable the puts, wiki, combobox and copybtn commands. */ static int enableOutputCmd( Th_Interp *interp, void *p, int argc, const char **argv, int *argl |
| ︙ | ︙ | |||
988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 |
free(z);
}
sendText("</select>", -1, 0);
Th_Free(interp, azElem);
}
return TH_OK;
}
/*
** TH1 command: linecount STRING MAX MIN
**
** Return one more than the number of \n characters in STRING. But
** never return less than MIN or more than MAX.
*/
| > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 |
free(z);
}
sendText("</select>", -1, 0);
Th_Free(interp, azElem);
}
return TH_OK;
}
/*
** TH1 command: copybtn TARGETID TEXT ?COPYLENGTH?
**
** Output TEXT with a click-to-copy button next to it. Loads the copybtn.js
** Javascript module, and generates HTML elements with the following IDs:
**
** TARGETID: The <span> wrapper around TEXT.
** copy-TARGETID: The <span> for the copy button.
**
** The optional COPYLENGTH argument defines the length of the substring of TEXT
** copied to clipboard:
**
** <= 0: No limit (default if the argument is omitted).
** >= 3: Truncate TEXT after COPYLENGTH (single-byte) characters.
** 1: Use the "hash-digits" setting as the limit.
** 2: Use the length appropriate for URLs as the limit (defined at
** compile-time by FOSSIL_HASH_DIGITS_URL, defaults to 16).
*/
static int copybtnCmd(
Th_Interp *interp,
void *p,
int argc,
const char **argv,
int *argl
){
if( argc!=3 && argc!=4 ){
return Th_WrongNumArgs(interp, "copybtn TARGETID TEXT COPYLENGTH");
}
if( enableOutput ){
int copylength = 0;
char *zTargetId, *zText, *zResult;
if( argc==4 && Th_ToInt(interp, argv[3], argl[3], ©length) ){
return TH_ERROR;
}
if( copylength==1 ) copylength = hash_digits(0);
else if( copylength==2 ) copylength = hash_digits(1);
zTargetId = htmlize((char*)argv[1], argl[1]);
zText = htmlize((char*)argv[2], argl[2]);
zResult = mprintf(
"<span "
"class=\"copy-button\" "
"id=\"copy-%s\" "
"data-copytarget=\"%s\" "
"data-copylength=\"%d\">"
"</span>"
" "
"<span id=\"%s\">"
"%s"
"</span>",
zTargetId, zTargetId, copylength, zTargetId, zText);
free(zTargetId);
free(zText);
style_copy_button();
sendText(zResult, -1, 0);
free(zResult);
}
return TH_OK;
}
/*
** TH1 command: linecount STRING MAX MIN
**
** Return one more than the number of \n characters in STRING. But
** never return less than MIN or more than MAX.
*/
|
| ︙ | ︙ | |||
2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 |
} aCommand[] = {
{"anoncap", hascapCmd, (void*)&anonFlag},
{"anycap", anycapCmd, 0},
{"artifact", artifactCmd, 0},
{"cgiHeaderLine", cgiHeaderLineCmd, 0},
{"checkout", checkoutCmd, 0},
{"combobox", comboboxCmd, 0},
{"date", dateCmd, 0},
{"decorate", wikiCmd, (void*)&aFlags[2]},
{"dir", dirCmd, 0},
{"enable_output", enableOutputCmd, 0},
{"encode64", encode64Cmd, 0},
{"getParameter", getParameterCmd, 0},
{"glob_match", globMatchCmd, 0},
| > | 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 |
} aCommand[] = {
{"anoncap", hascapCmd, (void*)&anonFlag},
{"anycap", anycapCmd, 0},
{"artifact", artifactCmd, 0},
{"cgiHeaderLine", cgiHeaderLineCmd, 0},
{"checkout", checkoutCmd, 0},
{"combobox", comboboxCmd, 0},
{"copybtn", copybtnCmd, 0},
{"date", dateCmd, 0},
{"decorate", wikiCmd, (void*)&aFlags[2]},
{"dir", dirCmd, 0},
{"enable_output", enableOutputCmd, 0},
{"encode64", encode64Cmd, 0},
{"getParameter", getParameterCmd, 0},
{"glob_match", globMatchCmd, 0},
|
| ︙ | ︙ |
Changes to src/timeline.c.
| ︙ | ︙ | |||
830 831 832 833 834 835 836 |
int colorGraph; /* Use colors for graph lines */
int iTopRow; /* Index of the top row of the graph */
int fileDiff; /* True for file diff. False for check-in diff */
int omitDescenders; /* True to omit descenders */
int scrollToSelect; /* True to scroll to the selection */
int dwellTimeout; /* Milliseconds to wait for tooltips to show */
int closeTimeout; /* Milliseconds to wait for tooltips to close */
| < < < < < < | | 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 |
int colorGraph; /* Use colors for graph lines */
int iTopRow; /* Index of the top row of the graph */
int fileDiff; /* True for file diff. False for check-in diff */
int omitDescenders; /* True to omit descenders */
int scrollToSelect; /* True to scroll to the selection */
int dwellTimeout; /* Milliseconds to wait for tooltips to show */
int closeTimeout; /* Milliseconds to wait for tooltips to close */
u8 *aiMap; /* The rail map */
iRailPitch = atoi(PD("railpitch","0"));
showArrowheads = skin_detail_boolean("timeline-arrowheads");
circleNodes = skin_detail_boolean("timeline-circle-nodes");
colorGraph = skin_detail_boolean("timeline-color-graph-lines");
iTopRow = pGraph->pFirst ? pGraph->pFirst->idx : 0;
omitDescenders = (tmFlags & TIMELINE_DISJOINT)!=0;
fileDiff = (tmFlags & TIMELINE_FILEDIFF)!=0;
scrollToSelect = (tmFlags & TIMELINE_NOSCROLL)==0;
dwellTimeout = atoi(db_get("timeline-dwelltime","100"));
closeTimeout = atoi(db_get("timeline-closetime","250"));
@ <script id='timeline-data-%d(iTableId)' type='application/json'>{
@ "iTableId": %d(iTableId),
@ "circleNodes": %d(circleNodes),
@ "showArrowheads": %d(showArrowheads),
@ "iRailPitch": %d(iRailPitch),
@ "colorGraph": %d(colorGraph),
@ "nomo": %d(PB("nomo")),
@ "iTopRow": %d(iTopRow),
@ "omitDescenders": %d(omitDescenders),
@ "fileDiff": %d(fileDiff),
@ "scrollToSelect": %d(scrollToSelect),
@ "nrail": %d(pGraph->mxRail+1),
@ "baseUrl": "%R",
@ "dwellTimeout": %d(dwellTimeout),
@ "closeTimeout": %d(closeTimeout),
@ "hashDigit": %d(hash_digits(1)),
@ "bottomRowId": "btm-%d(iTableId)",
if( pGraph->nRow==0 ){
@ "rowinfo": null
}else{
@ "rowinfo": [
}
|
| ︙ | ︙ |
Changes to src/tktsetup.c.
| ︙ | ︙ | |||
444 445 446 447 448 449 450 451 |
}
static const char zDefaultView[] =
@ <table cellpadding="5">
@ <tr><td class="tktDspLabel">Ticket UUID:</td>
@ <th1>
@ if {[info exists tkt_uuid]} {
@ if {[hascap s]} {
| > > < | < < > | 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 |
}
static const char zDefaultView[] =
@ <table cellpadding="5">
@ <tr><td class="tktDspLabel">Ticket UUID:</td>
@ <th1>
@ if {[info exists tkt_uuid]} {
@ html "<td class='tktDspValue' colspan='3'>"
@ copybtn tkt_uuid $tkt_uuid 1
@ if {[hascap s]} {
@ html " ($tkt_id)"
@ }
@ html "</td></tr>\n"
@ } else {
@ if {[hascap s]} {
@ html "<td class='tktDspValue' colspan='3'>Deleted "
@ html "(0)</td></tr>\n"
@ } else {
@ html "<td class='tktDspValue' colspan='3'>Deleted</td></tr>\n"
@ }
|
| ︙ | ︙ |
Changes to www/th1.md.
| ︙ | ︙ | |||
168 169 170 171 172 173 174 175 176 177 178 179 180 181 | * anoncap * anycap * artifact * cgiHeaderLine * checkout * combobox * date * decorate * dir * enable\_output * encode64 * getParameter * glob\_match | > | 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | * anoncap * anycap * artifact * cgiHeaderLine * checkout * combobox * copybtn * date * decorate * dir * enable\_output * encode64 * getParameter * glob\_match |
| ︙ | ︙ | |||
275 276 277 278 279 280 281 282 283 284 285 286 287 288 | Generates and emits an HTML combobox. NAME is both the name of the CGI parameter and the name of a variable that contains the currently selected value. TEXT-LIST is a list of possible values for the combobox. NUMLINES is 1 for a true combobox. If NUMLINES is greater than one then the display is a listbox with the number of lines given. <a name="date"></a>TH1 date Command ----------------------------------- * date ?-local? Return a strings which is the current time and date. If the -local option is used, the date appears using localtime instead of UTC. | > > > > > > > > > > > > > > > > > > > > | 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 |
Generates and emits an HTML combobox. NAME is both the name of the
CGI parameter and the name of a variable that contains the currently
selected value. TEXT-LIST is a list of possible values for the
combobox. NUMLINES is 1 for a true combobox. If NUMLINES is greater
than one then the display is a listbox with the number of lines given.
<a name="copybtn"></a>TH1 copybtn Command
-----------------------------------------
* copybtn TARGETID TEXT ?COPYLENGTH?
Output TEXT with a click-to-copy button next to it. Loads the copybtn.js
Javascript module, and generates HTML elements with the following IDs:
* TARGETID: The `<span>` wrapper around TEXT.
* copy-TARGETID: The `<span>` for the copy button.
The optional COPYLENGTH argument defines the length of the substring of TEXT
copied to clipboard:
* <= 0: No limit (default if the argument is omitted).
* >= 3: Truncate TEXT after COPYLENGTH (single-byte) characters.
* 1: Use the "hash-digits" setting as the limit.
* 2: Use the length appropriate for URLs as the limit (defined at
compile-time by `FOSSIL_HASH_DIGITS_URL`, defaults to 16).
<a name="date"></a>TH1 date Command
-----------------------------------
* date ?-local?
Return a strings which is the current time and date. If the -local
option is used, the date appears using localtime instead of UTC.
|
| ︙ | ︙ | |||
308 309 310 311 312 313 314 | time zone configured for the repository). <a name="enable_output"></a>TH1 enable\_output Command ------------------------------------------------------ * enable\_output BOOLEAN | | | 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | time zone configured for the repository). <a name="enable_output"></a>TH1 enable\_output Command ------------------------------------------------------ * enable\_output BOOLEAN Enable or disable sending output when the combobox, copybtn, puts, or wiki commands are used. <a name="encode64"></a>TH1 encode64 Command ------------------------------------------- * encode64 STRING |
| ︙ | ︙ |