Fossil SCM
Remove some unnecessary quoting. Only emit window.fossil.config.forumStatuses if the repo has any.
Commit
218cca5e9179c6e4b1fb1cf83479ea3cec4ff1db4e195d4ca270ef90c354273c
Parent
bd2bb5faccc4ad3…
1 file changed
+3
-9
+3
-9
| --- src/builtin.c | ||
| +++ src/builtin.c | ||
| @@ -679,26 +679,20 @@ | ||
| 679 | 679 | CX("isDark: %s" |
| 680 | 680 | "/*true if the current skin has the 'white-foreground' detail*/", |
| 681 | 681 | skin_detail_boolean("white-foreground") ? "true" : "false"); |
| 682 | 682 | CX("}\n"/*fossil.config.skin*/); |
| 683 | 683 | CX("};\n"/* fossil.config */); |
| 684 | - CX("window.fossil.config.forumStatuses ="); | |
| 685 | 684 | if( forum_statuses()->n>1 ){ |
| 686 | 685 | const ForumStatusList * fsl = forum_statuses(); |
| 687 | 686 | int i; |
| 688 | - CX("["); | |
| 687 | + CX("window.fossil.config.forumStatuses = ["); | |
| 689 | 688 | for(i = 0; i < fsl->n; ++i){ |
| 690 | 689 | const ForumStatus *fs = &fsl->aStatus[i]; |
| 691 | - if(i){ | |
| 692 | - CX(","); | |
| 693 | - } | |
| 694 | - CX("{\"label\":%!j,\"value\":%!j}", | |
| 695 | - fs->zLabel, fs->zValue); | |
| 690 | + if(i) CX(","); | |
| 691 | + CX("{label:%!j, value:%!j}", fs->zLabel, fs->zValue); | |
| 696 | 692 | } |
| 697 | 693 | CX("];\n"); |
| 698 | - }else{ | |
| 699 | - CX("[];\n"); | |
| 700 | 694 | } |
| 701 | 695 | CX("window.fossil.user = {"); |
| 702 | 696 | CX("name: %!j,", (g.zLogin&&*g.zLogin) ? g.zLogin : "guest"); |
| 703 | 697 | CX("isAdmin: %s,", (g.perm.Admin || g.perm.Setup) ? "true" : "false"); |
| 704 | 698 | CX("mayAttachForum: %s,", g.perm.AttachForum ? "true" : "false"); |
| 705 | 699 |
| --- src/builtin.c | |
| +++ src/builtin.c | |
| @@ -679,26 +679,20 @@ | |
| 679 | CX("isDark: %s" |
| 680 | "/*true if the current skin has the 'white-foreground' detail*/", |
| 681 | skin_detail_boolean("white-foreground") ? "true" : "false"); |
| 682 | CX("}\n"/*fossil.config.skin*/); |
| 683 | CX("};\n"/* fossil.config */); |
| 684 | CX("window.fossil.config.forumStatuses ="); |
| 685 | if( forum_statuses()->n>1 ){ |
| 686 | const ForumStatusList * fsl = forum_statuses(); |
| 687 | int i; |
| 688 | CX("["); |
| 689 | for(i = 0; i < fsl->n; ++i){ |
| 690 | const ForumStatus *fs = &fsl->aStatus[i]; |
| 691 | if(i){ |
| 692 | CX(","); |
| 693 | } |
| 694 | CX("{\"label\":%!j,\"value\":%!j}", |
| 695 | fs->zLabel, fs->zValue); |
| 696 | } |
| 697 | CX("];\n"); |
| 698 | }else{ |
| 699 | CX("[];\n"); |
| 700 | } |
| 701 | CX("window.fossil.user = {"); |
| 702 | CX("name: %!j,", (g.zLogin&&*g.zLogin) ? g.zLogin : "guest"); |
| 703 | CX("isAdmin: %s,", (g.perm.Admin || g.perm.Setup) ? "true" : "false"); |
| 704 | CX("mayAttachForum: %s,", g.perm.AttachForum ? "true" : "false"); |
| 705 |
| --- src/builtin.c | |
| +++ src/builtin.c | |
| @@ -679,26 +679,20 @@ | |
| 679 | CX("isDark: %s" |
| 680 | "/*true if the current skin has the 'white-foreground' detail*/", |
| 681 | skin_detail_boolean("white-foreground") ? "true" : "false"); |
| 682 | CX("}\n"/*fossil.config.skin*/); |
| 683 | CX("};\n"/* fossil.config */); |
| 684 | if( forum_statuses()->n>1 ){ |
| 685 | const ForumStatusList * fsl = forum_statuses(); |
| 686 | int i; |
| 687 | CX("window.fossil.config.forumStatuses = ["); |
| 688 | for(i = 0; i < fsl->n; ++i){ |
| 689 | const ForumStatus *fs = &fsl->aStatus[i]; |
| 690 | if(i) CX(","); |
| 691 | CX("{label:%!j, value:%!j}", fs->zLabel, fs->zValue); |
| 692 | } |
| 693 | CX("];\n"); |
| 694 | } |
| 695 | CX("window.fossil.user = {"); |
| 696 | CX("name: %!j,", (g.zLogin&&*g.zLogin) ? g.zLogin : "guest"); |
| 697 | CX("isAdmin: %s,", (g.perm.Admin || g.perm.Setup) ? "true" : "false"); |
| 698 | CX("mayAttachForum: %s,", g.perm.AttachForum ? "true" : "false"); |
| 699 |