Fossil SCM

More robust check whether the query parameter to update the display cookie is present.

florian 2024-09-13 14:03 diff-keyboard-navigation
Commit ac348b03e50a3259d8b134f35d080bec6b97629353da57714872f40a61af4f4d
1 file changed +3 -6
--- src/fossil.diff.js
+++ src/fossil.diff.js
@@ -139,16 +139,13 @@
139139
if( href && href!=location.href.slice(-href.length) ){
140140
location.href = href;
141141
}
142142
}
143143
else if( key==kUDCD ){
144
- var
145
- pqry = 'udc=1',
146
- psep = /\?/.test(location.href) ? '&' : '?',
147
- href = location.href + psep + pqry;
148
- if( location.href.slice(-pqry.length)!=pqry ){
149
- location.href = href;
144
+ if( !/[?&]udc=1/.test(location.href) ){
145
+ var sep = /\?/.test(location.href) ? '&' : '?';
146
+ location.href += sep + 'udc=1';
150147
}
151148
}
152149
}/*,true*/);
153150
},false);
154151
}());
155152
--- src/fossil.diff.js
+++ src/fossil.diff.js
@@ -139,16 +139,13 @@
139 if( href && href!=location.href.slice(-href.length) ){
140 location.href = href;
141 }
142 }
143 else if( key==kUDCD ){
144 var
145 pqry = 'udc=1',
146 psep = /\?/.test(location.href) ? '&' : '?',
147 href = location.href + psep + pqry;
148 if( location.href.slice(-pqry.length)!=pqry ){
149 location.href = href;
150 }
151 }
152 }/*,true*/);
153 },false);
154 }());
155
--- src/fossil.diff.js
+++ src/fossil.diff.js
@@ -139,16 +139,13 @@
139 if( href && href!=location.href.slice(-href.length) ){
140 location.href = href;
141 }
142 }
143 else if( key==kUDCD ){
144 if( !/[?&]udc=1/.test(location.href) ){
145 var sep = /\?/.test(location.href) ? '&' : '?';
146 location.href += sep + 'udc=1';
 
 
 
147 }
148 }
149 }/*,true*/);
150 },false);
151 }());
152

Keyboard Shortcuts

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