Fossil SCM

Add the "main.js" javascript file. Load that script on every page just before the </body> element, and use it to reduce the need for inline JS and CSS.

drh 2017-12-05 01:29 trunk merge
Commit 8394d2fee2273810c71a0fc18d252377d318446555c8c982a5e1414d252d6469
--- src/codecheck1.c
+++ src/codecheck1.c
@@ -312,10 +312,11 @@
312312
{ "admin_log", 1, 0 },
313313
{ "blob_append_sql", 2, FMT_NO_S },
314314
{ "blob_appendf", 2, 0 },
315315
{ "cgi_panic", 1, 0 },
316316
{ "cgi_redirectf", 1, 0 },
317
+ { "chref", 2, 0 },
317318
{ "db_blob", 2, FMT_NO_S },
318319
{ "db_double", 2, FMT_NO_S },
319320
{ "db_err", 1, 0 },
320321
{ "db_exists", 1, FMT_NO_S },
321322
{ "db_int", 2, FMT_NO_S },
322323
--- src/codecheck1.c
+++ src/codecheck1.c
@@ -312,10 +312,11 @@
312 { "admin_log", 1, 0 },
313 { "blob_append_sql", 2, FMT_NO_S },
314 { "blob_appendf", 2, 0 },
315 { "cgi_panic", 1, 0 },
316 { "cgi_redirectf", 1, 0 },
 
317 { "db_blob", 2, FMT_NO_S },
318 { "db_double", 2, FMT_NO_S },
319 { "db_err", 1, 0 },
320 { "db_exists", 1, FMT_NO_S },
321 { "db_int", 2, FMT_NO_S },
322
--- src/codecheck1.c
+++ src/codecheck1.c
@@ -312,10 +312,11 @@
312 { "admin_log", 1, 0 },
313 { "blob_append_sql", 2, FMT_NO_S },
314 { "blob_appendf", 2, 0 },
315 { "cgi_panic", 1, 0 },
316 { "cgi_redirectf", 1, 0 },
317 { "chref", 2, 0 },
318 { "db_blob", 2, FMT_NO_S },
319 { "db_double", 2, FMT_NO_S },
320 { "db_err", 1, 0 },
321 { "db_exists", 1, FMT_NO_S },
322 { "db_int", 2, FMT_NO_S },
323
+9 -9
--- src/info.c
+++ src/info.c
@@ -798,38 +798,38 @@
798798
zPageHide = "vinfo";
799799
}
800800
diffFlags = construct_diff_flags(verboseFlag, sideBySide);
801801
zW = (diffFlags&DIFF_IGNORE_ALLWS)?"&w":"";
802802
if( verboseFlag ){
803
- @ %z(xhref("class='button'","%R/%s/%T",zPageHide,zName))
803
+ @ %z(chref("button","%R/%s/%T",zPageHide,zName))
804804
@ Hide&nbsp;Diffs</a>
805805
if( sideBySide ){
806
- @ %z(xhref("class='button'","%R/%s/%T?sbs=0%s",zPage,zName,zW))
806
+ @ %z(chref("button","%R/%s/%T?sbs=0%s",zPage,zName,zW))
807807
@ Unified&nbsp;Diffs</a>
808808
}else{
809
- @ %z(xhref("class='button'","%R/%s/%T?sbs=1%s",zPage,zName,zW))
809
+ @ %z(chref("button","%R/%s/%T?sbs=1%s",zPage,zName,zW))
810810
@ Side-by-Side&nbsp;Diffs</a>
811811
}
812812
if( *zW ){
813
- @ %z(xhref("class='button'","%R/%s/%T?sbs=%d",zPage,zName,sideBySide))
813
+ @ %z(chref("button","%R/%s/%T?sbs=%d",zPage,zName,sideBySide))
814814
@ Show&nbsp;Whitespace&nbsp;Changes</a>
815815
}else{
816
- @ %z(xhref("class='button'","%R/%s/%T?sbs=%d&w",zPage,zName,sideBySide))
816
+ @ %z(chref("button","%R/%s/%T?sbs=%d&w",zPage,zName,sideBySide))
817817
@ Ignore&nbsp;Whitespace</a>
818818
}
819819
}else{
820
- @ %z(xhref("class='button'","%R/%s/%T?sbs=0",zPage,zName))
820
+ @ %z(chref("button","%R/%s/%T?sbs=0",zPage,zName))
821821
@ Show&nbsp;Unified&nbsp;Diffs</a>
822
- @ %z(xhref("class='button'","%R/%s/%T?sbs=1",zPage,zName))
822
+ @ %z(chref("button","%R/%s/%T?sbs=1",zPage,zName))
823823
@ Show&nbsp;Side-by-Side&nbsp;Diffs</a>
824824
}
825825
if( zParent ){
826
- @ %z(xhref("class='button'","%R/vpatch?from=%!S&to=%!S",zParent,zUuid))
826
+ @ %z(chref("button","%R/vpatch?from=%!S&to=%!S",zParent,zUuid))
827827
@ Patch</a>
828828
}
829829
if( g.perm.Admin ){
830
- @ %z(xhref("class='button'","%R/mlink?ci=%!S",zUuid))MLink Table</a>
830
+ @ %z(chref("button","%R/mlink?ci=%!S",zUuid))MLink Table</a>
831831
}
832832
@</div>
833833
if( pRe ){
834834
@ <p><b>Only differences that match regular expression "%h(zRe)"
835835
@ are shown.</b></p>
836836
837837
ADDED src/main.js
--- src/info.c
+++ src/info.c
@@ -798,38 +798,38 @@
798 zPageHide = "vinfo";
799 }
800 diffFlags = construct_diff_flags(verboseFlag, sideBySide);
801 zW = (diffFlags&DIFF_IGNORE_ALLWS)?"&w":"";
802 if( verboseFlag ){
803 @ %z(xhref("class='button'","%R/%s/%T",zPageHide,zName))
804 @ Hide&nbsp;Diffs</a>
805 if( sideBySide ){
806 @ %z(xhref("class='button'","%R/%s/%T?sbs=0%s",zPage,zName,zW))
807 @ Unified&nbsp;Diffs</a>
808 }else{
809 @ %z(xhref("class='button'","%R/%s/%T?sbs=1%s",zPage,zName,zW))
810 @ Side-by-Side&nbsp;Diffs</a>
811 }
812 if( *zW ){
813 @ %z(xhref("class='button'","%R/%s/%T?sbs=%d",zPage,zName,sideBySide))
814 @ Show&nbsp;Whitespace&nbsp;Changes</a>
815 }else{
816 @ %z(xhref("class='button'","%R/%s/%T?sbs=%d&w",zPage,zName,sideBySide))
817 @ Ignore&nbsp;Whitespace</a>
818 }
819 }else{
820 @ %z(xhref("class='button'","%R/%s/%T?sbs=0",zPage,zName))
821 @ Show&nbsp;Unified&nbsp;Diffs</a>
822 @ %z(xhref("class='button'","%R/%s/%T?sbs=1",zPage,zName))
823 @ Show&nbsp;Side-by-Side&nbsp;Diffs</a>
824 }
825 if( zParent ){
826 @ %z(xhref("class='button'","%R/vpatch?from=%!S&to=%!S",zParent,zUuid))
827 @ Patch</a>
828 }
829 if( g.perm.Admin ){
830 @ %z(xhref("class='button'","%R/mlink?ci=%!S",zUuid))MLink Table</a>
831 }
832 @</div>
833 if( pRe ){
834 @ <p><b>Only differences that match regular expression "%h(zRe)"
835 @ are shown.</b></p>
836
837 DDED src/main.js
--- src/info.c
+++ src/info.c
@@ -798,38 +798,38 @@
798 zPageHide = "vinfo";
799 }
800 diffFlags = construct_diff_flags(verboseFlag, sideBySide);
801 zW = (diffFlags&DIFF_IGNORE_ALLWS)?"&w":"";
802 if( verboseFlag ){
803 @ %z(chref("button","%R/%s/%T",zPageHide,zName))
804 @ Hide&nbsp;Diffs</a>
805 if( sideBySide ){
806 @ %z(chref("button","%R/%s/%T?sbs=0%s",zPage,zName,zW))
807 @ Unified&nbsp;Diffs</a>
808 }else{
809 @ %z(chref("button","%R/%s/%T?sbs=1%s",zPage,zName,zW))
810 @ Side-by-Side&nbsp;Diffs</a>
811 }
812 if( *zW ){
813 @ %z(chref("button","%R/%s/%T?sbs=%d",zPage,zName,sideBySide))
814 @ Show&nbsp;Whitespace&nbsp;Changes</a>
815 }else{
816 @ %z(chref("button","%R/%s/%T?sbs=%d&w",zPage,zName,sideBySide))
817 @ Ignore&nbsp;Whitespace</a>
818 }
819 }else{
820 @ %z(chref("button","%R/%s/%T?sbs=0",zPage,zName))
821 @ Show&nbsp;Unified&nbsp;Diffs</a>
822 @ %z(chref("button","%R/%s/%T?sbs=1",zPage,zName))
823 @ Show&nbsp;Side-by-Side&nbsp;Diffs</a>
824 }
825 if( zParent ){
826 @ %z(chref("button","%R/vpatch?from=%!S&to=%!S",zParent,zUuid))
827 @ Patch</a>
828 }
829 if( g.perm.Admin ){
830 @ %z(chref("button","%R/mlink?ci=%!S",zUuid))MLink Table</a>
831 }
832 @</div>
833 if( pRe ){
834 @ <p><b>Only differences that match regular expression "%h(zRe)"
835 @ are shown.</b></p>
836
837 DDED src/main.js
+9 -9
--- src/info.c
+++ src/info.c
@@ -798,38 +798,38 @@
798798
zPageHide = "vinfo";
799799
}
800800
diffFlags = construct_diff_flags(verboseFlag, sideBySide);
801801
zW = (diffFlags&DIFF_IGNORE_ALLWS)?"&w":"";
802802
if( verboseFlag ){
803
- @ %z(xhref("class='button'","%R/%s/%T",zPageHide,zName))
803
+ @ %z(chref("button","%R/%s/%T",zPageHide,zName))
804804
@ Hide&nbsp;Diffs</a>
805805
if( sideBySide ){
806
- @ %z(xhref("class='button'","%R/%s/%T?sbs=0%s",zPage,zName,zW))
806
+ @ %z(chref("button","%R/%s/%T?sbs=0%s",zPage,zName,zW))
807807
@ Unified&nbsp;Diffs</a>
808808
}else{
809
- @ %z(xhref("class='button'","%R/%s/%T?sbs=1%s",zPage,zName,zW))
809
+ @ %z(chref("button","%R/%s/%T?sbs=1%s",zPage,zName,zW))
810810
@ Side-by-Side&nbsp;Diffs</a>
811811
}
812812
if( *zW ){
813
- @ %z(xhref("class='button'","%R/%s/%T?sbs=%d",zPage,zName,sideBySide))
813
+ @ %z(chref("button","%R/%s/%T?sbs=%d",zPage,zName,sideBySide))
814814
@ Show&nbsp;Whitespace&nbsp;Changes</a>
815815
}else{
816
- @ %z(xhref("class='button'","%R/%s/%T?sbs=%d&w",zPage,zName,sideBySide))
816
+ @ %z(chref("button","%R/%s/%T?sbs=%d&w",zPage,zName,sideBySide))
817817
@ Ignore&nbsp;Whitespace</a>
818818
}
819819
}else{
820
- @ %z(xhref("class='button'","%R/%s/%T?sbs=0",zPage,zName))
820
+ @ %z(chref("button","%R/%s/%T?sbs=0",zPage,zName))
821821
@ Show&nbsp;Unified&nbsp;Diffs</a>
822
- @ %z(xhref("class='button'","%R/%s/%T?sbs=1",zPage,zName))
822
+ @ %z(chref("button","%R/%s/%T?sbs=1",zPage,zName))
823823
@ Show&nbsp;Side-by-Side&nbsp;Diffs</a>
824824
}
825825
if( zParent ){
826
- @ %z(xhref("class='button'","%R/vpatch?from=%!S&to=%!S",zParent,zUuid))
826
+ @ %z(chref("button","%R/vpatch?from=%!S&to=%!S",zParent,zUuid))
827827
@ Patch</a>
828828
}
829829
if( g.perm.Admin ){
830
- @ %z(xhref("class='button'","%R/mlink?ci=%!S",zUuid))MLink Table</a>
830
+ @ %z(chref("button","%R/mlink?ci=%!S",zUuid))MLink Table</a>
831831
}
832832
@</div>
833833
if( pRe ){
834834
@ <p><b>Only differences that match regular expression "%h(zRe)"
835835
@ are shown.</b></p>
836836
837837
ADDED src/main.js
--- src/info.c
+++ src/info.c
@@ -798,38 +798,38 @@
798 zPageHide = "vinfo";
799 }
800 diffFlags = construct_diff_flags(verboseFlag, sideBySide);
801 zW = (diffFlags&DIFF_IGNORE_ALLWS)?"&w":"";
802 if( verboseFlag ){
803 @ %z(xhref("class='button'","%R/%s/%T",zPageHide,zName))
804 @ Hide&nbsp;Diffs</a>
805 if( sideBySide ){
806 @ %z(xhref("class='button'","%R/%s/%T?sbs=0%s",zPage,zName,zW))
807 @ Unified&nbsp;Diffs</a>
808 }else{
809 @ %z(xhref("class='button'","%R/%s/%T?sbs=1%s",zPage,zName,zW))
810 @ Side-by-Side&nbsp;Diffs</a>
811 }
812 if( *zW ){
813 @ %z(xhref("class='button'","%R/%s/%T?sbs=%d",zPage,zName,sideBySide))
814 @ Show&nbsp;Whitespace&nbsp;Changes</a>
815 }else{
816 @ %z(xhref("class='button'","%R/%s/%T?sbs=%d&w",zPage,zName,sideBySide))
817 @ Ignore&nbsp;Whitespace</a>
818 }
819 }else{
820 @ %z(xhref("class='button'","%R/%s/%T?sbs=0",zPage,zName))
821 @ Show&nbsp;Unified&nbsp;Diffs</a>
822 @ %z(xhref("class='button'","%R/%s/%T?sbs=1",zPage,zName))
823 @ Show&nbsp;Side-by-Side&nbsp;Diffs</a>
824 }
825 if( zParent ){
826 @ %z(xhref("class='button'","%R/vpatch?from=%!S&to=%!S",zParent,zUuid))
827 @ Patch</a>
828 }
829 if( g.perm.Admin ){
830 @ %z(xhref("class='button'","%R/mlink?ci=%!S",zUuid))MLink Table</a>
831 }
832 @</div>
833 if( pRe ){
834 @ <p><b>Only differences that match regular expression "%h(zRe)"
835 @ are shown.</b></p>
836
837 DDED src/main.js
--- src/info.c
+++ src/info.c
@@ -798,38 +798,38 @@
798 zPageHide = "vinfo";
799 }
800 diffFlags = construct_diff_flags(verboseFlag, sideBySide);
801 zW = (diffFlags&DIFF_IGNORE_ALLWS)?"&w":"";
802 if( verboseFlag ){
803 @ %z(chref("button","%R/%s/%T",zPageHide,zName))
804 @ Hide&nbsp;Diffs</a>
805 if( sideBySide ){
806 @ %z(chref("button","%R/%s/%T?sbs=0%s",zPage,zName,zW))
807 @ Unified&nbsp;Diffs</a>
808 }else{
809 @ %z(chref("button","%R/%s/%T?sbs=1%s",zPage,zName,zW))
810 @ Side-by-Side&nbsp;Diffs</a>
811 }
812 if( *zW ){
813 @ %z(chref("button","%R/%s/%T?sbs=%d",zPage,zName,sideBySide))
814 @ Show&nbsp;Whitespace&nbsp;Changes</a>
815 }else{
816 @ %z(chref("button","%R/%s/%T?sbs=%d&w",zPage,zName,sideBySide))
817 @ Ignore&nbsp;Whitespace</a>
818 }
819 }else{
820 @ %z(chref("button","%R/%s/%T?sbs=0",zPage,zName))
821 @ Show&nbsp;Unified&nbsp;Diffs</a>
822 @ %z(chref("button","%R/%s/%T?sbs=1",zPage,zName))
823 @ Show&nbsp;Side-by-Side&nbsp;Diffs</a>
824 }
825 if( zParent ){
826 @ %z(chref("button","%R/vpatch?from=%!S&to=%!S",zParent,zUuid))
827 @ Patch</a>
828 }
829 if( g.perm.Admin ){
830 @ %z(chref("button","%R/mlink?ci=%!S",zUuid))MLink Table</a>
831 }
832 @</div>
833 if( pRe ){
834 @ <p><b>Only differences that match regular expression "%h(zRe)"
835 @ are shown.</b></p>
836
837 DDED src/main.js
+34
--- a/src/main.js
+++ b/src/main.js
@@ -0,0 +1,34 @@
1
+/* This script is sourced just prior to the </body> in every Fossil webpage */
2
+var x.hasAttribute("data-hrById("page-data");
3
+object OperaisOperaMini){
4
+ docume
5
+/* As an anti-robot defense, <a> edelay
6
+**antiRobot = 7;
7
+var j = anchors[i];
8
+}
9
+e/* As an anti-robot defense, <a> evar antiRobotBodybody")[0]antiRobotBantiRobotBantiRobotBantiRobotBOnce = 0;SetAllHrefs(){
10
+ if( antiRobotOnce ) return;
11
+ antiRobotOnce = 1SetMouseEventHandler(){
12
+ antiRobotSetAllHrefs();
13
+ setTimeout(antiRobotSetMouseEventHandler, g.delay);
14
+ }else{
15
+ setTimeout(antiRobotSetAllHrefs, g.delay(var i=0; i<anchors.length; i++){
16
+ var j = anchors[i];
17
+ if(j.hasAttribute("data-href")) j.href=j.getAttribute("data-href");
18
+ }
19
+ var forms = document.getElementsByTagName("form");
20
+ for(var i=0; i<forms.length; i++){
21
+ var j = forms[i];
22
+ if(j.hasAttribute("data-action")) j.action=j.getAttribute("data-action");
23
+ }
24
+}
25
+x = document.getElementById("href-data");
26
+ var jx = x.textContent || x.innerText;
27
+ var g = JSON.parse(jx);
28
+ if(g.antibot.enable){ent.getElementByTagName("body")[0] }
29
+ }else
30
+}
31
+
32
+"setAllHrefs();","setAllHrefs();antibotantibotantibot.delay);
33
+ }
34
+}
--- a/src/main.js
+++ b/src/main.js
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/src/main.js
+++ b/src/main.js
@@ -0,0 +1,34 @@
1 /* This script is sourced just prior to the </body> in every Fossil webpage */
2 var x.hasAttribute("data-hrById("page-data");
3 object OperaisOperaMini){
4 docume
5 /* As an anti-robot defense, <a> edelay
6 **antiRobot = 7;
7 var j = anchors[i];
8 }
9 e/* As an anti-robot defense, <a> evar antiRobotBodybody")[0]antiRobotBantiRobotBantiRobotBantiRobotBOnce = 0;SetAllHrefs(){
10 if( antiRobotOnce ) return;
11 antiRobotOnce = 1SetMouseEventHandler(){
12 antiRobotSetAllHrefs();
13 setTimeout(antiRobotSetMouseEventHandler, g.delay);
14 }else{
15 setTimeout(antiRobotSetAllHrefs, g.delay(var i=0; i<anchors.length; i++){
16 var j = anchors[i];
17 if(j.hasAttribute("data-href")) j.href=j.getAttribute("data-href");
18 }
19 var forms = document.getElementsByTagName("form");
20 for(var i=0; i<forms.length; i++){
21 var j = forms[i];
22 if(j.hasAttribute("data-action")) j.action=j.getAttribute("data-action");
23 }
24 }
25 x = document.getElementById("href-data");
26 var jx = x.textContent || x.innerText;
27 var g = JSON.parse(jx);
28 if(g.antibot.enable){ent.getElementByTagName("body")[0] }
29 }else
30 }
31
32 "setAllHrefs();","setAllHrefs();antibotantibotantibot.delay);
33 }
34 }
--- src/main.mk
+++ src/main.mk
@@ -194,10 +194,11 @@
194194
$(SRCDIR)/../skins/xekri/css.txt \
195195
$(SRCDIR)/../skins/xekri/details.txt \
196196
$(SRCDIR)/../skins/xekri/footer.txt \
197197
$(SRCDIR)/../skins/xekri/header.txt \
198198
$(SRCDIR)/diff.tcl \
199
+ $(SRCDIR)/main.js \
199200
$(SRCDIR)/markdown.md \
200201
$(SRCDIR)/wiki.wiki
201202
202203
TRANS_SRC = \
203204
$(OBJDIR)/add_.c \
204205
--- src/main.mk
+++ src/main.mk
@@ -194,10 +194,11 @@
194 $(SRCDIR)/../skins/xekri/css.txt \
195 $(SRCDIR)/../skins/xekri/details.txt \
196 $(SRCDIR)/../skins/xekri/footer.txt \
197 $(SRCDIR)/../skins/xekri/header.txt \
198 $(SRCDIR)/diff.tcl \
 
199 $(SRCDIR)/markdown.md \
200 $(SRCDIR)/wiki.wiki
201
202 TRANS_SRC = \
203 $(OBJDIR)/add_.c \
204
--- src/main.mk
+++ src/main.mk
@@ -194,10 +194,11 @@
194 $(SRCDIR)/../skins/xekri/css.txt \
195 $(SRCDIR)/../skins/xekri/details.txt \
196 $(SRCDIR)/../skins/xekri/footer.txt \
197 $(SRCDIR)/../skins/xekri/header.txt \
198 $(SRCDIR)/diff.tcl \
199 $(SRCDIR)/main.js \
200 $(SRCDIR)/markdown.md \
201 $(SRCDIR)/wiki.wiki
202
203 TRANS_SRC = \
204 $(OBJDIR)/add_.c \
205
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -160,10 +160,11 @@
160160
#
161161
set extra_files {
162162
diff.tcl
163163
markdown.md
164164
wiki.wiki
165
+ main.js
165166
../skins/*/*.txt
166167
}
167168
168169
# Options used to compile the included SQLite library.
169170
#
170171
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -160,10 +160,11 @@
160 #
161 set extra_files {
162 diff.tcl
163 markdown.md
164 wiki.wiki
 
165 ../skins/*/*.txt
166 }
167
168 # Options used to compile the included SQLite library.
169 #
170
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -160,10 +160,11 @@
160 #
161 set extra_files {
162 diff.tcl
163 markdown.md
164 wiki.wiki
165 main.js
166 ../skins/*/*.txt
167 }
168
169 # Options used to compile the included SQLite library.
170 #
171
+72 -77
--- src/style.c
+++ src/style.c
@@ -84,20 +84,10 @@
8484
** Ad-unit styles.
8585
*/
8686
static unsigned adUnitFlags = 0;
8787
8888
89
-/*
90
-** List of hyperlinks and forms that need to be resolved by javascript in
91
-** the footer.
92
-*/
93
-char **aHref = 0;
94
-int nHref = 0;
95
-int nHrefAlloc = 0;
96
-char **aFormAction = 0;
97
-int nFormAction = 0;
98
-
9989
/*
10090
** Generate and return a anchor tag like this:
10191
**
10292
** <a href="URL">
10393
** or <a id="ID">
@@ -126,12 +116,15 @@
126116
**
127117
** Note %z format. The string returned by this function is always
128118
** obtained from fossil_malloc() so rendering it with %z will reclaim
129119
** that memory space.
130120
**
131
-** There are two versions of this routine: href() does a plain hyperlink
132
-** and xhref() adds extra attribute text.
121
+** There are three versions of this routine:
122
+**
123
+** (1) href() does a plain hyperlink
124
+** (2) xhref() adds extra attribute text
125
+** (3) chref() adds a class name
133126
**
134127
** g.perm.Hyperlink is true if the user has the Hyperlink (h) property.
135128
** Most logged in users should have this property, since we can assume
136129
** that a logged in user is not a bot. Only "nobody" lacks g.perm.Hyperlink,
137130
** typically.
@@ -145,16 +138,26 @@
145138
if( g.perm.Hyperlink && !g.javascriptHyperlink ){
146139
char *zHUrl = mprintf("<a %s href=\"%h\">", zExtra, zUrl);
147140
fossil_free(zUrl);
148141
return zHUrl;
149142
}
150
- if( nHref>=nHrefAlloc ){
151
- nHrefAlloc = nHrefAlloc*2 + 10;
152
- aHref = fossil_realloc(aHref, nHrefAlloc*sizeof(aHref[0]));
143
+ return mprintf("<a %s data-href='%z' href='%R/honeypot'>",
144
+ zExtra, zUrl);
145
+}
146
+char *chref(const char *zExtra, const char *zFormat, ...){
147
+ char *zUrl;
148
+ va_list ap;
149
+ va_start(ap, zFormat);
150
+ zUrl = vmprintf(zFormat, ap);
151
+ va_end(ap);
152
+ if( g.perm.Hyperlink && !g.javascriptHyperlink ){
153
+ char *zHUrl = mprintf("<a %s href=\"%h\">", zExtra, zUrl);
154
+ fossil_free(zUrl);
155
+ return zHUrl;
153156
}
154
- aHref[nHref++] = zUrl;
155
- return mprintf("<a %s id='a%d' href='%R/honeypot'>", zExtra, nHref);
157
+ return mprintf("<a class='%s' data-href='%z' href='%R/honeypot'>",
158
+ zExtra, zUrl);
156159
}
157160
char *href(const char *zFormat, ...){
158161
char *zUrl;
159162
va_list ap;
160163
va_start(ap, zFormat);
@@ -163,16 +166,12 @@
163166
if( g.perm.Hyperlink && !g.javascriptHyperlink ){
164167
char *zHUrl = mprintf("<a href=\"%h\">", zUrl);
165168
fossil_free(zUrl);
166169
return zHUrl;
167170
}
168
- if( nHref>=nHrefAlloc ){
169
- nHrefAlloc = nHrefAlloc*2 + 10;
170
- aHref = fossil_realloc(aHref, nHrefAlloc*sizeof(aHref[0]));
171
- }
172
- aHref[nHref++] = zUrl;
173
- return mprintf("<a id='a%d' href='%R/honeypot'>", nHref);
171
+ return mprintf("<a data-href='%s' href='%R/honeypot'>",
172
+ zUrl);
174173
}
175174
176175
/*
177176
** Generate <form method="post" action=ARG>. The ARG value is inserted
178177
** by javascript.
@@ -185,59 +184,13 @@
185184
zLink = vmprintf(zAction, ap);
186185
va_end(ap);
187186
if( g.perm.Hyperlink && !g.javascriptHyperlink ){
188187
@ <form method="POST" action="%z(zLink)" %s(zOtherArgs)>
189188
}else{
190
- int n;
191
- aFormAction = fossil_realloc(aFormAction, (nFormAction+1)*sizeof(char*));
192
- aFormAction[nFormAction++] = zLink;
193
- n = nFormAction;
194
- @ <form id="form%d(n)" method="POST" action='%R/login' %s(zOtherArgs)>
195
- }
196
-}
197
-
198
-/*
199
-** Generate javascript that will set the href= attribute on all anchors.
200
-*/
201
-void style_resolve_href(void){
202
- int i;
203
- int nDelay = db_get_int("auto-hyperlink-delay",10);
204
- if( !g.perm.Hyperlink ) return;
205
- if( nHref==0 && nFormAction==0 ) return;
206
- @ <script>
207
- @ function setAllHrefs(){
208
- if( g.javascriptHyperlink ){
209
- for(i=0; i<nHref; i++){
210
- @ gebi("a%d(i+1)").href="%s(aHref[i])";
211
- }
212
- }
213
- for(i=0; i<nFormAction; i++){
214
- @ gebi("form%d(i+1)").action="%s(aFormAction[i])";
215
- }
216
- @ }
217
- if( sqlite3_strglob("*Opera Mini/[1-9]*", PD("HTTP_USER_AGENT",""))==0 ){
218
- /* Special case for Opera Mini, which executes JS server-side */
219
- @ var isOperaMini = Object.prototype.toString.call(window.operamini)
220
- @ === "[object OperaMini]";
221
- @ if( isOperaMini ){
222
- @ setTimeout("setAllHrefs();",%d(nDelay));
223
- @ }
224
- }else if( db_get_boolean("auto-hyperlink-ishuman",0) && g.isHuman ){
225
- /* Active hyperlinks after a delay */
226
- @ setTimeout("setAllHrefs();",%d(nDelay));
227
- }else if( db_get_boolean("auto-hyperlink-mouseover",0) ){
228
- /* Require mouse movement before starting the teim that will
229
- ** activating hyperlinks */
230
- @ document.getElementsByTagName("body")[0].onmousemove=function(){
231
- @ setTimeout("setAllHrefs();",%d(nDelay));
232
- @ this.onmousemove = null;
233
- @ }
234
- }else{
235
- /* Active hyperlinks after a delay */
236
- @ setTimeout("setAllHrefs();",%d(nDelay));
237
- }
238
- @ </script>
189
+ @ <form method="POST" data-action='%s(zLink)' action='%R/login' \
190
+ @ %s(zOtherArgs)>
191
+ }
239192
}
240193
241194
/*
242195
** Add a new element to the submenu
243196
*/
@@ -423,15 +376,17 @@
423376
*/
424377
static char zDfltHeader[] =
425378
@ <html>
426379
@ <head>
427380
@ <base href="$baseurl/$current_page" />
381
+@ <meta http-equiv="Content-Security-Policy-xxx" \
382
+@ content="default-src 'self' 'unsafe-inline'" />
428383
@ <title>$<project_name>: $<title></title>
429
-@ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
430
-@ href="$home/timeline.rss" />
431
-@ <link rel="stylesheet" href="$stylesheet_url" type="text/css"
432
-@ media="screen" />
384
+@ <link rel="alternate" type="application/rss+xml" title="RSS Feed" \
385
+@ href="$home/timeline.rss" />
386
+@ <link rel="stylesheet" href="$stylesheet_url" type="text/css" \
387
+@ media="screen" />
433388
@ </head>
434389
@ <body>
435390
;
436391
437392
/*
@@ -556,10 +511,11 @@
556511
*/
557512
void style_footer(void){
558513
const char *zFooter;
559514
const char *zAd = 0;
560515
unsigned int mAdFlags = 0;
516
+ int bMouseover = 0; /* Active hyperlinks after mouseover */
561517
562518
if( !headerHasBeenGenerated ) return;
563519
564520
/* Go back and put the submenu at the top of the page. We delay the
565521
** creation of the submenu until the end so that we can add elements
@@ -706,15 +662,38 @@
706662
*/
707663
@ <div class="endContent"></div>
708664
}
709665
@ </div>
710666
667
+#if 0
711668
/* Set the href= field on hyperlinks. Do this before the footer since
712669
** the footer will be generating </html> */
713670
style_resolve_href();
671
+#endif
672
+
673
+ /* Load up the page data */
674
+ @ <script id='page-data' type='application/json'>
675
+ if( !g.javascriptHyperlink ){
676
+ @ {"antibot":{"enable":0},
677
+ }else{
678
+ int nDelay = db_get_int("auto-hyperlink-delay",0);
679
+ int bMouseover;
680
+ bMouseover = (!g.isHuman || db_get_boolean("auto-hyperlink-ishuman",0))
681
+ && db_get_boolean("auto-hyperlink-mouseover",0);
682
+ @ {"antibot":
683
+ @ {"enable":1,
684
+ @ "delay":%d(nDelay),
685
+ @ "mouseover":%d(bMouseover)},
686
+ }
687
+ @ "noop":0}
688
+ @ </script>
689
+
714690
715691
zFooter = skin_get("footer");
692
+ if( sqlite3_strlike("%</body>%", zFooter, 0)==0 ){
693
+ @ <script src='%s(g.zBaseURL)/main.js' type='application/javascript'>\
694
+ }
716695
if( g.thTrace ) Th_Trace("BEGIN_FOOTER<br />\n", -1);
717696
Th_Render(zFooter);
718697
if( g.thTrace ) Th_Trace("END_FOOTER<br />\n", -1);
719698
720699
/* Render trace log if TH1 tracing is enabled. */
@@ -724,11 +703,14 @@
724703
cgi_append_content("</span>\n", -1);
725704
}
726705
727706
/* Add document end mark if it was not in the footer */
728707
if( sqlite3_strlike("%</body>%", zFooter, 0)!=0 ){
729
- @ </body></html>
708
+ @ <script src='%s(g.zBaseURL)/main.js' type='application/javascript'>\
709
+ @ </script>
710
+ @ </body>
711
+ @ </html>
730712
}
731713
}
732714
733715
/*
734716
** Begin a side-box on the right-hand side of a page. The title and
@@ -858,10 +840,23 @@
858840
Th_Render(blob_str(&css));
859841
860842
/* Tell CGI that the content returned by this page is considered cacheable */
861843
g.isConst = 1;
862844
}
845
+
846
+/*
847
+** WEBPAGE: main.js
848
+**
849
+** Return the javascript
850
+*/
851
+void page_main_js(void){
852
+ Blob mainjs;
853
+ cgi_set_content_type("application/javascript");
854
+ blob_init(&mainjs, builtin_text("main.js"), -1);
855
+ cgi_set_content(&mainjs);
856
+}
857
+
863858
864859
/*
865860
** WEBPAGE: test_env
866861
**
867862
** Display CGI-variables and other aspects of the run-time
868863
--- src/style.c
+++ src/style.c
@@ -84,20 +84,10 @@
84 ** Ad-unit styles.
85 */
86 static unsigned adUnitFlags = 0;
87
88
89 /*
90 ** List of hyperlinks and forms that need to be resolved by javascript in
91 ** the footer.
92 */
93 char **aHref = 0;
94 int nHref = 0;
95 int nHrefAlloc = 0;
96 char **aFormAction = 0;
97 int nFormAction = 0;
98
99 /*
100 ** Generate and return a anchor tag like this:
101 **
102 ** <a href="URL">
103 ** or <a id="ID">
@@ -126,12 +116,15 @@
126 **
127 ** Note %z format. The string returned by this function is always
128 ** obtained from fossil_malloc() so rendering it with %z will reclaim
129 ** that memory space.
130 **
131 ** There are two versions of this routine: href() does a plain hyperlink
132 ** and xhref() adds extra attribute text.
 
 
 
133 **
134 ** g.perm.Hyperlink is true if the user has the Hyperlink (h) property.
135 ** Most logged in users should have this property, since we can assume
136 ** that a logged in user is not a bot. Only "nobody" lacks g.perm.Hyperlink,
137 ** typically.
@@ -145,16 +138,26 @@
145 if( g.perm.Hyperlink && !g.javascriptHyperlink ){
146 char *zHUrl = mprintf("<a %s href=\"%h\">", zExtra, zUrl);
147 fossil_free(zUrl);
148 return zHUrl;
149 }
150 if( nHref>=nHrefAlloc ){
151 nHrefAlloc = nHrefAlloc*2 + 10;
152 aHref = fossil_realloc(aHref, nHrefAlloc*sizeof(aHref[0]));
 
 
 
 
 
 
 
 
 
 
153 }
154 aHref[nHref++] = zUrl;
155 return mprintf("<a %s id='a%d' href='%R/honeypot'>", zExtra, nHref);
156 }
157 char *href(const char *zFormat, ...){
158 char *zUrl;
159 va_list ap;
160 va_start(ap, zFormat);
@@ -163,16 +166,12 @@
163 if( g.perm.Hyperlink && !g.javascriptHyperlink ){
164 char *zHUrl = mprintf("<a href=\"%h\">", zUrl);
165 fossil_free(zUrl);
166 return zHUrl;
167 }
168 if( nHref>=nHrefAlloc ){
169 nHrefAlloc = nHrefAlloc*2 + 10;
170 aHref = fossil_realloc(aHref, nHrefAlloc*sizeof(aHref[0]));
171 }
172 aHref[nHref++] = zUrl;
173 return mprintf("<a id='a%d' href='%R/honeypot'>", nHref);
174 }
175
176 /*
177 ** Generate <form method="post" action=ARG>. The ARG value is inserted
178 ** by javascript.
@@ -185,59 +184,13 @@
185 zLink = vmprintf(zAction, ap);
186 va_end(ap);
187 if( g.perm.Hyperlink && !g.javascriptHyperlink ){
188 @ <form method="POST" action="%z(zLink)" %s(zOtherArgs)>
189 }else{
190 int n;
191 aFormAction = fossil_realloc(aFormAction, (nFormAction+1)*sizeof(char*));
192 aFormAction[nFormAction++] = zLink;
193 n = nFormAction;
194 @ <form id="form%d(n)" method="POST" action='%R/login' %s(zOtherArgs)>
195 }
196 }
197
198 /*
199 ** Generate javascript that will set the href= attribute on all anchors.
200 */
201 void style_resolve_href(void){
202 int i;
203 int nDelay = db_get_int("auto-hyperlink-delay",10);
204 if( !g.perm.Hyperlink ) return;
205 if( nHref==0 && nFormAction==0 ) return;
206 @ <script>
207 @ function setAllHrefs(){
208 if( g.javascriptHyperlink ){
209 for(i=0; i<nHref; i++){
210 @ gebi("a%d(i+1)").href="%s(aHref[i])";
211 }
212 }
213 for(i=0; i<nFormAction; i++){
214 @ gebi("form%d(i+1)").action="%s(aFormAction[i])";
215 }
216 @ }
217 if( sqlite3_strglob("*Opera Mini/[1-9]*", PD("HTTP_USER_AGENT",""))==0 ){
218 /* Special case for Opera Mini, which executes JS server-side */
219 @ var isOperaMini = Object.prototype.toString.call(window.operamini)
220 @ === "[object OperaMini]";
221 @ if( isOperaMini ){
222 @ setTimeout("setAllHrefs();",%d(nDelay));
223 @ }
224 }else if( db_get_boolean("auto-hyperlink-ishuman",0) && g.isHuman ){
225 /* Active hyperlinks after a delay */
226 @ setTimeout("setAllHrefs();",%d(nDelay));
227 }else if( db_get_boolean("auto-hyperlink-mouseover",0) ){
228 /* Require mouse movement before starting the teim that will
229 ** activating hyperlinks */
230 @ document.getElementsByTagName("body")[0].onmousemove=function(){
231 @ setTimeout("setAllHrefs();",%d(nDelay));
232 @ this.onmousemove = null;
233 @ }
234 }else{
235 /* Active hyperlinks after a delay */
236 @ setTimeout("setAllHrefs();",%d(nDelay));
237 }
238 @ </script>
239 }
240
241 /*
242 ** Add a new element to the submenu
243 */
@@ -423,15 +376,17 @@
423 */
424 static char zDfltHeader[] =
425 @ <html>
426 @ <head>
427 @ <base href="$baseurl/$current_page" />
 
 
428 @ <title>$<project_name>: $<title></title>
429 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
430 @ href="$home/timeline.rss" />
431 @ <link rel="stylesheet" href="$stylesheet_url" type="text/css"
432 @ media="screen" />
433 @ </head>
434 @ <body>
435 ;
436
437 /*
@@ -556,10 +511,11 @@
556 */
557 void style_footer(void){
558 const char *zFooter;
559 const char *zAd = 0;
560 unsigned int mAdFlags = 0;
 
561
562 if( !headerHasBeenGenerated ) return;
563
564 /* Go back and put the submenu at the top of the page. We delay the
565 ** creation of the submenu until the end so that we can add elements
@@ -706,15 +662,38 @@
706 */
707 @ <div class="endContent"></div>
708 }
709 @ </div>
710
 
711 /* Set the href= field on hyperlinks. Do this before the footer since
712 ** the footer will be generating </html> */
713 style_resolve_href();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
714
715 zFooter = skin_get("footer");
 
 
 
716 if( g.thTrace ) Th_Trace("BEGIN_FOOTER<br />\n", -1);
717 Th_Render(zFooter);
718 if( g.thTrace ) Th_Trace("END_FOOTER<br />\n", -1);
719
720 /* Render trace log if TH1 tracing is enabled. */
@@ -724,11 +703,14 @@
724 cgi_append_content("</span>\n", -1);
725 }
726
727 /* Add document end mark if it was not in the footer */
728 if( sqlite3_strlike("%</body>%", zFooter, 0)!=0 ){
729 @ </body></html>
 
 
 
730 }
731 }
732
733 /*
734 ** Begin a side-box on the right-hand side of a page. The title and
@@ -858,10 +840,23 @@
858 Th_Render(blob_str(&css));
859
860 /* Tell CGI that the content returned by this page is considered cacheable */
861 g.isConst = 1;
862 }
 
 
 
 
 
 
 
 
 
 
 
 
 
863
864 /*
865 ** WEBPAGE: test_env
866 **
867 ** Display CGI-variables and other aspects of the run-time
868
--- src/style.c
+++ src/style.c
@@ -84,20 +84,10 @@
84 ** Ad-unit styles.
85 */
86 static unsigned adUnitFlags = 0;
87
88
 
 
 
 
 
 
 
 
 
 
89 /*
90 ** Generate and return a anchor tag like this:
91 **
92 ** <a href="URL">
93 ** or <a id="ID">
@@ -126,12 +116,15 @@
116 **
117 ** Note %z format. The string returned by this function is always
118 ** obtained from fossil_malloc() so rendering it with %z will reclaim
119 ** that memory space.
120 **
121 ** There are three versions of this routine:
122 **
123 ** (1) href() does a plain hyperlink
124 ** (2) xhref() adds extra attribute text
125 ** (3) chref() adds a class name
126 **
127 ** g.perm.Hyperlink is true if the user has the Hyperlink (h) property.
128 ** Most logged in users should have this property, since we can assume
129 ** that a logged in user is not a bot. Only "nobody" lacks g.perm.Hyperlink,
130 ** typically.
@@ -145,16 +138,26 @@
138 if( g.perm.Hyperlink && !g.javascriptHyperlink ){
139 char *zHUrl = mprintf("<a %s href=\"%h\">", zExtra, zUrl);
140 fossil_free(zUrl);
141 return zHUrl;
142 }
143 return mprintf("<a %s data-href='%z' href='%R/honeypot'>",
144 zExtra, zUrl);
145 }
146 char *chref(const char *zExtra, const char *zFormat, ...){
147 char *zUrl;
148 va_list ap;
149 va_start(ap, zFormat);
150 zUrl = vmprintf(zFormat, ap);
151 va_end(ap);
152 if( g.perm.Hyperlink && !g.javascriptHyperlink ){
153 char *zHUrl = mprintf("<a %s href=\"%h\">", zExtra, zUrl);
154 fossil_free(zUrl);
155 return zHUrl;
156 }
157 return mprintf("<a class='%s' data-href='%z' href='%R/honeypot'>",
158 zExtra, zUrl);
159 }
160 char *href(const char *zFormat, ...){
161 char *zUrl;
162 va_list ap;
163 va_start(ap, zFormat);
@@ -163,16 +166,12 @@
166 if( g.perm.Hyperlink && !g.javascriptHyperlink ){
167 char *zHUrl = mprintf("<a href=\"%h\">", zUrl);
168 fossil_free(zUrl);
169 return zHUrl;
170 }
171 return mprintf("<a data-href='%s' href='%R/honeypot'>",
172 zUrl);
 
 
 
 
173 }
174
175 /*
176 ** Generate <form method="post" action=ARG>. The ARG value is inserted
177 ** by javascript.
@@ -185,59 +184,13 @@
184 zLink = vmprintf(zAction, ap);
185 va_end(ap);
186 if( g.perm.Hyperlink && !g.javascriptHyperlink ){
187 @ <form method="POST" action="%z(zLink)" %s(zOtherArgs)>
188 }else{
189 @ <form method="POST" data-action='%s(zLink)' action='%R/login' \
190 @ %s(zOtherArgs)>
191 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192 }
193
194 /*
195 ** Add a new element to the submenu
196 */
@@ -423,15 +376,17 @@
376 */
377 static char zDfltHeader[] =
378 @ <html>
379 @ <head>
380 @ <base href="$baseurl/$current_page" />
381 @ <meta http-equiv="Content-Security-Policy-xxx" \
382 @ content="default-src 'self' 'unsafe-inline'" />
383 @ <title>$<project_name>: $<title></title>
384 @ <link rel="alternate" type="application/rss+xml" title="RSS Feed" \
385 @ href="$home/timeline.rss" />
386 @ <link rel="stylesheet" href="$stylesheet_url" type="text/css" \
387 @ media="screen" />
388 @ </head>
389 @ <body>
390 ;
391
392 /*
@@ -556,10 +511,11 @@
511 */
512 void style_footer(void){
513 const char *zFooter;
514 const char *zAd = 0;
515 unsigned int mAdFlags = 0;
516 int bMouseover = 0; /* Active hyperlinks after mouseover */
517
518 if( !headerHasBeenGenerated ) return;
519
520 /* Go back and put the submenu at the top of the page. We delay the
521 ** creation of the submenu until the end so that we can add elements
@@ -706,15 +662,38 @@
662 */
663 @ <div class="endContent"></div>
664 }
665 @ </div>
666
667 #if 0
668 /* Set the href= field on hyperlinks. Do this before the footer since
669 ** the footer will be generating </html> */
670 style_resolve_href();
671 #endif
672
673 /* Load up the page data */
674 @ <script id='page-data' type='application/json'>
675 if( !g.javascriptHyperlink ){
676 @ {"antibot":{"enable":0},
677 }else{
678 int nDelay = db_get_int("auto-hyperlink-delay",0);
679 int bMouseover;
680 bMouseover = (!g.isHuman || db_get_boolean("auto-hyperlink-ishuman",0))
681 && db_get_boolean("auto-hyperlink-mouseover",0);
682 @ {"antibot":
683 @ {"enable":1,
684 @ "delay":%d(nDelay),
685 @ "mouseover":%d(bMouseover)},
686 }
687 @ "noop":0}
688 @ </script>
689
690
691 zFooter = skin_get("footer");
692 if( sqlite3_strlike("%</body>%", zFooter, 0)==0 ){
693 @ <script src='%s(g.zBaseURL)/main.js' type='application/javascript'>\
694 }
695 if( g.thTrace ) Th_Trace("BEGIN_FOOTER<br />\n", -1);
696 Th_Render(zFooter);
697 if( g.thTrace ) Th_Trace("END_FOOTER<br />\n", -1);
698
699 /* Render trace log if TH1 tracing is enabled. */
@@ -724,11 +703,14 @@
703 cgi_append_content("</span>\n", -1);
704 }
705
706 /* Add document end mark if it was not in the footer */
707 if( sqlite3_strlike("%</body>%", zFooter, 0)!=0 ){
708 @ <script src='%s(g.zBaseURL)/main.js' type='application/javascript'>\
709 @ </script>
710 @ </body>
711 @ </html>
712 }
713 }
714
715 /*
716 ** Begin a side-box on the right-hand side of a page. The title and
@@ -858,10 +840,23 @@
840 Th_Render(blob_str(&css));
841
842 /* Tell CGI that the content returned by this page is considered cacheable */
843 g.isConst = 1;
844 }
845
846 /*
847 ** WEBPAGE: main.js
848 **
849 ** Return the javascript
850 */
851 void page_main_js(void){
852 Blob mainjs;
853 cgi_set_content_type("application/javascript");
854 blob_init(&mainjs, builtin_text("main.js"), -1);
855 cgi_set_content(&mainjs);
856 }
857
858
859 /*
860 ** WEBPAGE: test_env
861 **
862 ** Display CGI-variables and other aspects of the run-time
863
+1 -1
--- src/tag.c
+++ src/tag.c
@@ -669,11 +669,11 @@
669669
);
670670
@ <ul>
671671
while( db_step(&q)==SQLITE_ROW ){
672672
const char *zName = db_column_text(&q, 0);
673673
if( g.perm.Hyperlink ){
674
- @ <li>%z(xhref("class='taglink'","%R/timeline?t=%T&n=200",zName))
674
+ @ <li>%z(chref("taglink","%R/timeline?t=%T&n=200",zName))
675675
@ %h(zName)</a></li>
676676
}else{
677677
@ <li><span class="tagDsp">%h(zName)</span></li>
678678
}
679679
}
680680
--- src/tag.c
+++ src/tag.c
@@ -669,11 +669,11 @@
669 );
670 @ <ul>
671 while( db_step(&q)==SQLITE_ROW ){
672 const char *zName = db_column_text(&q, 0);
673 if( g.perm.Hyperlink ){
674 @ <li>%z(xhref("class='taglink'","%R/timeline?t=%T&n=200",zName))
675 @ %h(zName)</a></li>
676 }else{
677 @ <li><span class="tagDsp">%h(zName)</span></li>
678 }
679 }
680
--- src/tag.c
+++ src/tag.c
@@ -669,11 +669,11 @@
669 );
670 @ <ul>
671 while( db_step(&q)==SQLITE_ROW ){
672 const char *zName = db_column_text(&q, 0);
673 if( g.perm.Hyperlink ){
674 @ <li>%z(chref("taglink","%R/timeline?t=%T&n=200",zName))
675 @ %h(zName)</a></li>
676 }else{
677 @ <li><span class="tagDsp">%h(zName)</span></li>
678 }
679 }
680
+4 -4
--- src/timeline.c
+++ src/timeline.c
@@ -50,11 +50,11 @@
5050
/*
5151
** Generate a hyperlink to a version.
5252
*/
5353
void hyperlink_to_uuid(const char *zUuid){
5454
if( g.perm.Hyperlink ){
55
- @ %z(xhref("class='timelineHistLink'","%R/info/%!S",zUuid))[%S(zUuid)]</a>
55
+ @ %z(chref("timelineHistLink","%R/info/%!S",zUuid))[%S(zUuid)]</a>
5656
}else{
5757
@ <span class="timelineHistDsp">[%S(zUuid)]</span>
5858
}
5959
}
6060
@@ -387,11 +387,11 @@
387387
zId = db_text(0, "SELECT substr(tagname, 7) FROM tag WHERE tagid=%d",
388388
tagid);
389389
zDateLink = href("%R/technote/%s",zId);
390390
free(zId);
391391
}else if( zUuid ){
392
- zDateLink = xhref("class='timelineHistLink'", "%R/info/%!S", zUuid);
392
+ zDateLink = chref("timelineHistLink", "%R/info/%!S", zUuid);
393393
}else{
394394
zDateLink = mprintf("<a>");
395395
}
396396
/* WAS: zDateLink = href("%R/timeline?c=%!S&unhide", zUuid); */
397397
@ <td class="timelineTime">%z(zDateLink)%s(zTime)</a></td>
@@ -2295,16 +2295,16 @@
22952295
if( zError ){
22962296
@ <p class="generalError">%h(zError)</p>
22972297
}
22982298
22992299
if( zNewerButton ){
2300
- @ %z(xhref("class='button'","%z",zNewerButton))More&nbsp;&uarr;</a>
2300
+ @ %z(chref("button","%z",zNewerButton))More&nbsp;&uarr;</a>
23012301
}
23022302
www_print_timeline(&q, tmFlags, zThisUser, zThisTag, selectedRid, 0);
23032303
db_finalize(&q);
23042304
if( zOlderButton ){
2305
- @ %z(xhref("class='button'","%z",zOlderButton))More&nbsp;&darr;</a>
2305
+ @ %z(chref("button","%z",zOlderButton))More&nbsp;&darr;</a>
23062306
}
23072307
style_footer();
23082308
}
23092309
23102310
/*
23112311
--- src/timeline.c
+++ src/timeline.c
@@ -50,11 +50,11 @@
50 /*
51 ** Generate a hyperlink to a version.
52 */
53 void hyperlink_to_uuid(const char *zUuid){
54 if( g.perm.Hyperlink ){
55 @ %z(xhref("class='timelineHistLink'","%R/info/%!S",zUuid))[%S(zUuid)]</a>
56 }else{
57 @ <span class="timelineHistDsp">[%S(zUuid)]</span>
58 }
59 }
60
@@ -387,11 +387,11 @@
387 zId = db_text(0, "SELECT substr(tagname, 7) FROM tag WHERE tagid=%d",
388 tagid);
389 zDateLink = href("%R/technote/%s",zId);
390 free(zId);
391 }else if( zUuid ){
392 zDateLink = xhref("class='timelineHistLink'", "%R/info/%!S", zUuid);
393 }else{
394 zDateLink = mprintf("<a>");
395 }
396 /* WAS: zDateLink = href("%R/timeline?c=%!S&unhide", zUuid); */
397 @ <td class="timelineTime">%z(zDateLink)%s(zTime)</a></td>
@@ -2295,16 +2295,16 @@
2295 if( zError ){
2296 @ <p class="generalError">%h(zError)</p>
2297 }
2298
2299 if( zNewerButton ){
2300 @ %z(xhref("class='button'","%z",zNewerButton))More&nbsp;&uarr;</a>
2301 }
2302 www_print_timeline(&q, tmFlags, zThisUser, zThisTag, selectedRid, 0);
2303 db_finalize(&q);
2304 if( zOlderButton ){
2305 @ %z(xhref("class='button'","%z",zOlderButton))More&nbsp;&darr;</a>
2306 }
2307 style_footer();
2308 }
2309
2310 /*
2311
--- src/timeline.c
+++ src/timeline.c
@@ -50,11 +50,11 @@
50 /*
51 ** Generate a hyperlink to a version.
52 */
53 void hyperlink_to_uuid(const char *zUuid){
54 if( g.perm.Hyperlink ){
55 @ %z(chref("timelineHistLink","%R/info/%!S",zUuid))[%S(zUuid)]</a>
56 }else{
57 @ <span class="timelineHistDsp">[%S(zUuid)]</span>
58 }
59 }
60
@@ -387,11 +387,11 @@
387 zId = db_text(0, "SELECT substr(tagname, 7) FROM tag WHERE tagid=%d",
388 tagid);
389 zDateLink = href("%R/technote/%s",zId);
390 free(zId);
391 }else if( zUuid ){
392 zDateLink = chref("timelineHistLink", "%R/info/%!S", zUuid);
393 }else{
394 zDateLink = mprintf("<a>");
395 }
396 /* WAS: zDateLink = href("%R/timeline?c=%!S&unhide", zUuid); */
397 @ <td class="timelineTime">%z(zDateLink)%s(zTime)</a></td>
@@ -2295,16 +2295,16 @@
2295 if( zError ){
2296 @ <p class="generalError">%h(zError)</p>
2297 }
2298
2299 if( zNewerButton ){
2300 @ %z(chref("button","%z",zNewerButton))More&nbsp;&uarr;</a>
2301 }
2302 www_print_timeline(&q, tmFlags, zThisUser, zThisTag, selectedRid, 0);
2303 db_finalize(&q);
2304 if( zOlderButton ){
2305 @ %z(chref("button","%z",zOlderButton))More&nbsp;&darr;</a>
2306 }
2307 style_footer();
2308 }
2309
2310 /*
2311
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -603,10 +603,11 @@
603603
$(SRCDIR)/../skins/xekri/css.txt \
604604
$(SRCDIR)/../skins/xekri/details.txt \
605605
$(SRCDIR)/../skins/xekri/footer.txt \
606606
$(SRCDIR)/../skins/xekri/header.txt \
607607
$(SRCDIR)/diff.tcl \
608
+ $(SRCDIR)/main.js \
608609
$(SRCDIR)/markdown.md \
609610
$(SRCDIR)/wiki.wiki
610611
611612
TRANS_SRC = \
612613
$(OBJDIR)/add_.c \
613614
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -603,10 +603,11 @@
603 $(SRCDIR)/../skins/xekri/css.txt \
604 $(SRCDIR)/../skins/xekri/details.txt \
605 $(SRCDIR)/../skins/xekri/footer.txt \
606 $(SRCDIR)/../skins/xekri/header.txt \
607 $(SRCDIR)/diff.tcl \
 
608 $(SRCDIR)/markdown.md \
609 $(SRCDIR)/wiki.wiki
610
611 TRANS_SRC = \
612 $(OBJDIR)/add_.c \
613
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -603,10 +603,11 @@
603 $(SRCDIR)/../skins/xekri/css.txt \
604 $(SRCDIR)/../skins/xekri/details.txt \
605 $(SRCDIR)/../skins/xekri/footer.txt \
606 $(SRCDIR)/../skins/xekri/header.txt \
607 $(SRCDIR)/diff.tcl \
608 $(SRCDIR)/main.js \
609 $(SRCDIR)/markdown.md \
610 $(SRCDIR)/wiki.wiki
611
612 TRANS_SRC = \
613 $(OBJDIR)/add_.c \
614
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -529,10 +529,11 @@
529529
$(SRCDIR)\../skins/xekri/css.txt \
530530
$(SRCDIR)\../skins/xekri/details.txt \
531531
$(SRCDIR)\../skins/xekri/footer.txt \
532532
$(SRCDIR)\../skins/xekri/header.txt \
533533
$(SRCDIR)\diff.tcl \
534
+ $(SRCDIR)\main.js \
534535
$(SRCDIR)\markdown.md \
535536
$(SRCDIR)\wiki.wiki
536537
537538
OBJ = $(OX)\add$O \
538539
$(OX)\allrepo$O \
539540
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -529,10 +529,11 @@
529 $(SRCDIR)\../skins/xekri/css.txt \
530 $(SRCDIR)\../skins/xekri/details.txt \
531 $(SRCDIR)\../skins/xekri/footer.txt \
532 $(SRCDIR)\../skins/xekri/header.txt \
533 $(SRCDIR)\diff.tcl \
 
534 $(SRCDIR)\markdown.md \
535 $(SRCDIR)\wiki.wiki
536
537 OBJ = $(OX)\add$O \
538 $(OX)\allrepo$O \
539
--- win/Makefile.msc
+++ win/Makefile.msc
@@ -529,10 +529,11 @@
529 $(SRCDIR)\../skins/xekri/css.txt \
530 $(SRCDIR)\../skins/xekri/details.txt \
531 $(SRCDIR)\../skins/xekri/footer.txt \
532 $(SRCDIR)\../skins/xekri/header.txt \
533 $(SRCDIR)\diff.tcl \
534 $(SRCDIR)\main.js \
535 $(SRCDIR)\markdown.md \
536 $(SRCDIR)\wiki.wiki
537
538 OBJ = $(OX)\add$O \
539 $(OX)\allrepo$O \
540

Keyboard Shortcuts

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