Fossil SCM

Adding a boolean setting to choose the use of 'targets' in the anchors href. Default enabled. Related to the thread starting at [http://www.mail-archive.com/[email protected]/msg06588.html]

viriketo 2011-10-18 20:55 UTC trunk
Commit d29df2f0a21b292c5ea43ff43850dd4c13bf5b59
+1
--- src/db.c
+++ src/db.c
@@ -1778,10 +1778,11 @@
17781778
{ "gdiff-command", 0, 16, 0, "gdiff" },
17791779
{ "gmerge-command",0, 40, 0, "" },
17801780
{ "https-login", 0, 0, 0, "off" },
17811781
{ "ignore-glob", 0, 40, 1, "" },
17821782
{ "empty-dirs", 0, 40, 1, "" },
1783
+ { "href-targets", 0, 0, 0, "on" },
17831784
{ "http-port", 0, 16, 0, "8080" },
17841785
{ "localauth", 0, 0, 0, "off" },
17851786
{ "main-branch", 0, 40, 0, "trunk" },
17861787
{ "manifest", 0, 0, 1, "off" },
17871788
{ "max-upload", 0, 25, 0, "250000" },
17881789
--- src/db.c
+++ src/db.c
@@ -1778,10 +1778,11 @@
1778 { "gdiff-command", 0, 16, 0, "gdiff" },
1779 { "gmerge-command",0, 40, 0, "" },
1780 { "https-login", 0, 0, 0, "off" },
1781 { "ignore-glob", 0, 40, 1, "" },
1782 { "empty-dirs", 0, 40, 1, "" },
 
1783 { "http-port", 0, 16, 0, "8080" },
1784 { "localauth", 0, 0, 0, "off" },
1785 { "main-branch", 0, 40, 0, "trunk" },
1786 { "manifest", 0, 0, 1, "off" },
1787 { "max-upload", 0, 25, 0, "250000" },
1788
--- src/db.c
+++ src/db.c
@@ -1778,10 +1778,11 @@
1778 { "gdiff-command", 0, 16, 0, "gdiff" },
1779 { "gmerge-command",0, 40, 0, "" },
1780 { "https-login", 0, 0, 0, "off" },
1781 { "ignore-glob", 0, 40, 1, "" },
1782 { "empty-dirs", 0, 40, 1, "" },
1783 { "href-targets", 0, 0, 0, "on" },
1784 { "http-port", 0, 16, 0, "8080" },
1785 { "localauth", 0, 0, 0, "off" },
1786 { "main-branch", 0, 40, 0, "trunk" },
1787 { "manifest", 0, 0, 1, "off" },
1788 { "max-upload", 0, 25, 0, "250000" },
1789
+7 -2
--- src/diff.c
+++ src/diff.c
@@ -951,10 +951,13 @@
951951
Blob toAnnotate; /* Text of the final (mid) version of the file */
952952
Blob step; /* Text of previous revision */
953953
int rid; /* Artifact ID of the file being annotated */
954954
char *zLabel; /* Label to apply to a line */
955955
Stmt q; /* Query returning all ancestor versions */
956
+ const char *zInfoTarget; /* String for target info window */
957
+
958
+ zInfoTarget = db_get_boolean("href-targets", 1) ? "target='infowindow'" : "";
956959
957960
/* Initialize the annotation */
958961
rid = db_int(0, "SELECT fid FROM mlink WHERE mid=%d AND fnid=%d",mid,fnid);
959962
if( rid==0 ){
960963
fossil_panic("file #%d is unchanged in manifest #%d", fnid, mid);
@@ -987,12 +990,14 @@
987990
const char *zUuid = db_column_text(&q, 1);
988991
const char *zDate = db_column_text(&q, 2);
989992
const char *zUser = db_column_text(&q, 3);
990993
if( webLabel ){
991994
zLabel = mprintf(
992
- "<a href='%s/info/%s' target='infowindow'>%.10s</a> %s %9.9s",
993
- g.zTop, zUuid, zUuid, zDate, zUser
995
+ "<a href='%s/info/%s'%s>%.10s</a> %s %9.9s",
996
+ g.zTop, zUuid,
997
+ zInfoTarget,
998
+ zUuid, zDate, zUser
994999
);
9951000
}else{
9961001
zLabel = mprintf("%.10s %s %9.9s", zUuid, zDate, zUser);
9971002
}
9981003
p->nVers++;
9991004
--- src/diff.c
+++ src/diff.c
@@ -951,10 +951,13 @@
951 Blob toAnnotate; /* Text of the final (mid) version of the file */
952 Blob step; /* Text of previous revision */
953 int rid; /* Artifact ID of the file being annotated */
954 char *zLabel; /* Label to apply to a line */
955 Stmt q; /* Query returning all ancestor versions */
 
 
 
956
957 /* Initialize the annotation */
958 rid = db_int(0, "SELECT fid FROM mlink WHERE mid=%d AND fnid=%d",mid,fnid);
959 if( rid==0 ){
960 fossil_panic("file #%d is unchanged in manifest #%d", fnid, mid);
@@ -987,12 +990,14 @@
987 const char *zUuid = db_column_text(&q, 1);
988 const char *zDate = db_column_text(&q, 2);
989 const char *zUser = db_column_text(&q, 3);
990 if( webLabel ){
991 zLabel = mprintf(
992 "<a href='%s/info/%s' target='infowindow'>%.10s</a> %s %9.9s",
993 g.zTop, zUuid, zUuid, zDate, zUser
 
 
994 );
995 }else{
996 zLabel = mprintf("%.10s %s %9.9s", zUuid, zDate, zUser);
997 }
998 p->nVers++;
999
--- src/diff.c
+++ src/diff.c
@@ -951,10 +951,13 @@
951 Blob toAnnotate; /* Text of the final (mid) version of the file */
952 Blob step; /* Text of previous revision */
953 int rid; /* Artifact ID of the file being annotated */
954 char *zLabel; /* Label to apply to a line */
955 Stmt q; /* Query returning all ancestor versions */
956 const char *zInfoTarget; /* String for target info window */
957
958 zInfoTarget = db_get_boolean("href-targets", 1) ? "target='infowindow'" : "";
959
960 /* Initialize the annotation */
961 rid = db_int(0, "SELECT fid FROM mlink WHERE mid=%d AND fnid=%d",mid,fnid);
962 if( rid==0 ){
963 fossil_panic("file #%d is unchanged in manifest #%d", fnid, mid);
@@ -987,12 +990,14 @@
990 const char *zUuid = db_column_text(&q, 1);
991 const char *zDate = db_column_text(&q, 2);
992 const char *zUser = db_column_text(&q, 3);
993 if( webLabel ){
994 zLabel = mprintf(
995 "<a href='%s/info/%s'%s>%.10s</a> %s %9.9s",
996 g.zTop, zUuid,
997 zInfoTarget,
998 zUuid, zDate, zUser
999 );
1000 }else{
1001 zLabel = mprintf("%.10s %s %9.9s", zUuid, zDate, zUser);
1002 }
1003 p->nVers++;
1004
+6 -3
--- src/timeline.c
+++ src/timeline.c
@@ -202,18 +202,21 @@
202202
GraphContext *pGraph = 0;
203203
int prevWasDivider = 0; /* True if previous output row was <hr> */
204204
int fchngQueryInit = 0; /* True if fchngQuery is initialized */
205205
Stmt fchngQuery; /* Query for file changes on check-ins */
206206
static Stmt qbranch;
207
+ const char *zDiffTarget; /* String for the target diff window */
207208
208209
zPrevDate[0] = 0;
209210
mxWikiLen = db_get_int("timeline-max-comment", 0);
210211
if( db_get_boolean("timeline-block-markup", 0) ){
211212
wikiFlags = WIKI_INLINE;
212213
}else{
213214
wikiFlags = WIKI_INLINE | WIKI_NOBLOCK;
214215
}
216
+ zDiffTarget = db_get_boolean("href-targets", 1) ?
217
+ "target=\"diffwindow\"": "";
215218
if( tmFlags & TIMELINE_GRAPH ){
216219
pGraph = graph_init();
217220
/* style is not moved to css, because this is
218221
** a technical div for the timeline graph
219222
*/
@@ -428,25 +431,25 @@
428431
inUl = 1;
429432
}
430433
if( isNew ){
431434
@ <li> %h(zFilename) (new file) &nbsp;
432435
@ <a href="%s(g.zTop)/artifact/%S(zNew)"
433
- @ target="diffwindow">[view]</a></li>
436
+ @ %s(zDiffTarget)>[view]</a></li>
434437
}else if( isDel ){
435438
@ <li> %h(zFilename) (deleted)</li>
436439
}else if( fossil_strcmp(zOld,zNew)==0 && zOldName!=0 ){
437440
@ <li> %h(zOldName) &rarr; %h(zFilename)
438441
@ <a href="%s(g.zTop)/artifact/%S(zNew)"
439
- @ target="diffwindow">[view]</a></li>
442
+ @ %s(zDiffTarget)>[view]</a></li>
440443
}else{
441444
if( zOldName!=0 ){
442445
@ <li> %h(zOldName) &rarr; %h(zFilename)
443446
}else{
444447
@ <li> %h(zFilename) &nbsp;
445448
}
446449
@ <a href="%s(g.zTop)/fdiff?v1=%S(zOld)&v2=%S(zNew)"
447
- @ target="diffwindow">[diff]</a></li>
450
+ @ %s(zDiffTarget)>[diff]</a></li>
448451
}
449452
}
450453
db_reset(&fchngQuery);
451454
if( inUl ){
452455
@ </ul>
453456
--- src/timeline.c
+++ src/timeline.c
@@ -202,18 +202,21 @@
202 GraphContext *pGraph = 0;
203 int prevWasDivider = 0; /* True if previous output row was <hr> */
204 int fchngQueryInit = 0; /* True if fchngQuery is initialized */
205 Stmt fchngQuery; /* Query for file changes on check-ins */
206 static Stmt qbranch;
 
207
208 zPrevDate[0] = 0;
209 mxWikiLen = db_get_int("timeline-max-comment", 0);
210 if( db_get_boolean("timeline-block-markup", 0) ){
211 wikiFlags = WIKI_INLINE;
212 }else{
213 wikiFlags = WIKI_INLINE | WIKI_NOBLOCK;
214 }
 
 
215 if( tmFlags & TIMELINE_GRAPH ){
216 pGraph = graph_init();
217 /* style is not moved to css, because this is
218 ** a technical div for the timeline graph
219 */
@@ -428,25 +431,25 @@
428 inUl = 1;
429 }
430 if( isNew ){
431 @ <li> %h(zFilename) (new file) &nbsp;
432 @ <a href="%s(g.zTop)/artifact/%S(zNew)"
433 @ target="diffwindow">[view]</a></li>
434 }else if( isDel ){
435 @ <li> %h(zFilename) (deleted)</li>
436 }else if( fossil_strcmp(zOld,zNew)==0 && zOldName!=0 ){
437 @ <li> %h(zOldName) &rarr; %h(zFilename)
438 @ <a href="%s(g.zTop)/artifact/%S(zNew)"
439 @ target="diffwindow">[view]</a></li>
440 }else{
441 if( zOldName!=0 ){
442 @ <li> %h(zOldName) &rarr; %h(zFilename)
443 }else{
444 @ <li> %h(zFilename) &nbsp;
445 }
446 @ <a href="%s(g.zTop)/fdiff?v1=%S(zOld)&v2=%S(zNew)"
447 @ target="diffwindow">[diff]</a></li>
448 }
449 }
450 db_reset(&fchngQuery);
451 if( inUl ){
452 @ </ul>
453
--- src/timeline.c
+++ src/timeline.c
@@ -202,18 +202,21 @@
202 GraphContext *pGraph = 0;
203 int prevWasDivider = 0; /* True if previous output row was <hr> */
204 int fchngQueryInit = 0; /* True if fchngQuery is initialized */
205 Stmt fchngQuery; /* Query for file changes on check-ins */
206 static Stmt qbranch;
207 const char *zDiffTarget; /* String for the target diff window */
208
209 zPrevDate[0] = 0;
210 mxWikiLen = db_get_int("timeline-max-comment", 0);
211 if( db_get_boolean("timeline-block-markup", 0) ){
212 wikiFlags = WIKI_INLINE;
213 }else{
214 wikiFlags = WIKI_INLINE | WIKI_NOBLOCK;
215 }
216 zDiffTarget = db_get_boolean("href-targets", 1) ?
217 "target=\"diffwindow\"": "";
218 if( tmFlags & TIMELINE_GRAPH ){
219 pGraph = graph_init();
220 /* style is not moved to css, because this is
221 ** a technical div for the timeline graph
222 */
@@ -428,25 +431,25 @@
431 inUl = 1;
432 }
433 if( isNew ){
434 @ <li> %h(zFilename) (new file) &nbsp;
435 @ <a href="%s(g.zTop)/artifact/%S(zNew)"
436 @ %s(zDiffTarget)>[view]</a></li>
437 }else if( isDel ){
438 @ <li> %h(zFilename) (deleted)</li>
439 }else if( fossil_strcmp(zOld,zNew)==0 && zOldName!=0 ){
440 @ <li> %h(zOldName) &rarr; %h(zFilename)
441 @ <a href="%s(g.zTop)/artifact/%S(zNew)"
442 @ %s(zDiffTarget)>[view]</a></li>
443 }else{
444 if( zOldName!=0 ){
445 @ <li> %h(zOldName) &rarr; %h(zFilename)
446 }else{
447 @ <li> %h(zFilename) &nbsp;
448 }
449 @ <a href="%s(g.zTop)/fdiff?v1=%S(zOld)&v2=%S(zNew)"
450 @ %s(zDiffTarget)>[diff]</a></li>
451 }
452 }
453 db_reset(&fchngQuery);
454 if( inUl ){
455 @ </ul>
456

Keyboard Shortcuts

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