Fossil SCM

Use Javascript to hide the branch hiding checkbox when necessary. Also update the branch name in the branch hiding text when a branch is specified.

andybradford 2013-12-05 08:15 hidden-tag
Commit 11e8a48e4d5cd9014f7c260e15965a2eba925e12
1 file changed +59 -6
+59 -6
--- src/info.c
+++ src/info.c
@@ -2207,10 +2207,37 @@
22072207
}
22082208
blob_zero(&comment);
22092209
blob_append(&comment, zNewComment, -1);
22102210
zUuid[10] = 0;
22112211
style_header("Edit Check-in [%s]", zUuid);
2212
+ /*
2213
+ ** Javascript functions to assist in modifying hidden branch options
2214
+ ** sihbi: sets the innerHTML for the given element id to val
2215
+ ** hcbxbi: hids the checkbox and unchecks for the given element id
2216
+ ** hauc: hides and unchecks the checkbox when needed
2217
+ */
2218
+ @ <script>
2219
+ @ function sihbi(id,val){
2220
+ @ id.innerHTML = val;
2221
+ @ }
2222
+ @ function hcbxbi(id,toggle){
2223
+ @ if( toggle ){
2224
+ @ id.style.visibility = "hidden";
2225
+ @ id.checked = false;
2226
+ @ }else{
2227
+ @ id.style.visibility = "visible";
2228
+ @ }
2229
+ @ }
2230
+ @ function hauc(cbxid,hidbrid,zdef,formid,toggle){
2231
+ @ if( cbxid ) hcbxbi(cbxid,toggle);
2232
+ @ if( toggle ){
2233
+ @ sihbi(hidbrid,zdef);
2234
+ @ }else{
2235
+ @ if( gebi(formid).value ) sihbi(hidbrid,gebi(formid).value);
2236
+ @ }
2237
+ @ }
2238
+ @ </script>
22122239
if( P("preview") ){
22132240
Blob suffix;
22142241
int nTag = 0;
22152242
@ <b>Preview:</b>
22162243
@ <blockquote>
@@ -2330,22 +2357,48 @@
23302357
db_finalize(&q);
23312358
@ </td></tr>
23322359
23332360
@ <tr><th align="right" valign="top">Branching:</th>
23342361
@ <td valign="top">
2335
- @ <label><input id="newbr" type="checkbox" name="newbr"%s(zNewBrFlag) />
2362
+ @ <label><input id="newbr" type="checkbox" name="newbr"%s(zNewBrFlag)
2363
+ if( !fHasHidden && zBranchName ){
2364
+ if( fossil_strcmp(zBranchName, "trunk")==0 ){
2365
+ @ onclick="hauc(gebi('hidebr'),gebi('hbranch'),'%s(zBranchName)',
2366
+ @ 'brname',this.value)"
2367
+ }else{
2368
+ @ onclick="hauc(null,gebi('hbranch'),'%s(zBranchName)',
2369
+ @ 'brname',this.value)"
2370
+ }
2371
+ }
2372
+ @ />
23362373
@ Make this check-in the start of a new branch named:</label>
2337
- @ <input type="text" style="width:15;" name="brname" value="%h(zNewBranch)"
2338
- @ onkeyup="gebi('newbr').checked=!!this.value" />
2374
+ @ <input type="text" style="width:15;" id="brname" name="brname"
2375
+ @ value="%h(zNewBranch)"
2376
+ if( !fHasHidden && zBranchName ){
2377
+ @ onkeyup="gebi('newbr').checked=!!this.value;
2378
+ if( fossil_strcmp(zBranchName, "trunk")==0 ){
2379
+ @ hauc(gebi('hidebr'),gebi('hbranch'),'%s(zBranchName)',
2380
+ @ 'brname',!this.value)"
2381
+ }else{
2382
+ @ hauc(null,gebi('hbranch'),'%s(zBranchName)','brname',!this.value)"
2383
+ }
2384
+ }
2385
+ @ />
23392386
@ </td></tr>
23402387
23412388
if( !fHasHidden && zBranchName ){
23422389
@ <tr><th align="right" valign="top">Branch Hiding:</th>
23432390
@ <td valign="top">
2344
- @ <label><input type="checkbox" name="hide"%s(zHideFlag) />
2345
- @ Hide branch <b>%s(zBranchName)</b> from the timeline starting from this
2346
- @ check-in</label>
2391
+ @ <label><input type="checkbox" id="hidebr" name="hide"%s(zHideFlag)
2392
+ if( fossil_strcmp(zBranchName, "trunk")==0 ){
2393
+ @ style="visibility: hidden" />
2394
+ }else{
2395
+ @ />
2396
+ }
2397
+ @ Hide branch
2398
+ @ <span style="font-weight:bold" id="hbranch">%s(zBranchName)</span>
2399
+ @ from the timeline starting from this check-in</label>
23472400
@ </td></tr>
23482401
}
23492402
23502403
23512404
if( !fHasClosed ){
23522405
--- src/info.c
+++ src/info.c
@@ -2207,10 +2207,37 @@
2207 }
2208 blob_zero(&comment);
2209 blob_append(&comment, zNewComment, -1);
2210 zUuid[10] = 0;
2211 style_header("Edit Check-in [%s]", zUuid);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2212 if( P("preview") ){
2213 Blob suffix;
2214 int nTag = 0;
2215 @ <b>Preview:</b>
2216 @ <blockquote>
@@ -2330,22 +2357,48 @@
2330 db_finalize(&q);
2331 @ </td></tr>
2332
2333 @ <tr><th align="right" valign="top">Branching:</th>
2334 @ <td valign="top">
2335 @ <label><input id="newbr" type="checkbox" name="newbr"%s(zNewBrFlag) />
 
 
 
 
 
 
 
 
 
 
2336 @ Make this check-in the start of a new branch named:</label>
2337 @ <input type="text" style="width:15;" name="brname" value="%h(zNewBranch)"
2338 @ onkeyup="gebi('newbr').checked=!!this.value" />
 
 
 
 
 
 
 
 
 
 
2339 @ </td></tr>
2340
2341 if( !fHasHidden && zBranchName ){
2342 @ <tr><th align="right" valign="top">Branch Hiding:</th>
2343 @ <td valign="top">
2344 @ <label><input type="checkbox" name="hide"%s(zHideFlag) />
2345 @ Hide branch <b>%s(zBranchName)</b> from the timeline starting from this
2346 @ check-in</label>
 
 
 
 
 
 
2347 @ </td></tr>
2348 }
2349
2350
2351 if( !fHasClosed ){
2352
--- src/info.c
+++ src/info.c
@@ -2207,10 +2207,37 @@
2207 }
2208 blob_zero(&comment);
2209 blob_append(&comment, zNewComment, -1);
2210 zUuid[10] = 0;
2211 style_header("Edit Check-in [%s]", zUuid);
2212 /*
2213 ** Javascript functions to assist in modifying hidden branch options
2214 ** sihbi: sets the innerHTML for the given element id to val
2215 ** hcbxbi: hids the checkbox and unchecks for the given element id
2216 ** hauc: hides and unchecks the checkbox when needed
2217 */
2218 @ <script>
2219 @ function sihbi(id,val){
2220 @ id.innerHTML = val;
2221 @ }
2222 @ function hcbxbi(id,toggle){
2223 @ if( toggle ){
2224 @ id.style.visibility = "hidden";
2225 @ id.checked = false;
2226 @ }else{
2227 @ id.style.visibility = "visible";
2228 @ }
2229 @ }
2230 @ function hauc(cbxid,hidbrid,zdef,formid,toggle){
2231 @ if( cbxid ) hcbxbi(cbxid,toggle);
2232 @ if( toggle ){
2233 @ sihbi(hidbrid,zdef);
2234 @ }else{
2235 @ if( gebi(formid).value ) sihbi(hidbrid,gebi(formid).value);
2236 @ }
2237 @ }
2238 @ </script>
2239 if( P("preview") ){
2240 Blob suffix;
2241 int nTag = 0;
2242 @ <b>Preview:</b>
2243 @ <blockquote>
@@ -2330,22 +2357,48 @@
2357 db_finalize(&q);
2358 @ </td></tr>
2359
2360 @ <tr><th align="right" valign="top">Branching:</th>
2361 @ <td valign="top">
2362 @ <label><input id="newbr" type="checkbox" name="newbr"%s(zNewBrFlag)
2363 if( !fHasHidden && zBranchName ){
2364 if( fossil_strcmp(zBranchName, "trunk")==0 ){
2365 @ onclick="hauc(gebi('hidebr'),gebi('hbranch'),'%s(zBranchName)',
2366 @ 'brname',this.value)"
2367 }else{
2368 @ onclick="hauc(null,gebi('hbranch'),'%s(zBranchName)',
2369 @ 'brname',this.value)"
2370 }
2371 }
2372 @ />
2373 @ Make this check-in the start of a new branch named:</label>
2374 @ <input type="text" style="width:15;" id="brname" name="brname"
2375 @ value="%h(zNewBranch)"
2376 if( !fHasHidden && zBranchName ){
2377 @ onkeyup="gebi('newbr').checked=!!this.value;
2378 if( fossil_strcmp(zBranchName, "trunk")==0 ){
2379 @ hauc(gebi('hidebr'),gebi('hbranch'),'%s(zBranchName)',
2380 @ 'brname',!this.value)"
2381 }else{
2382 @ hauc(null,gebi('hbranch'),'%s(zBranchName)','brname',!this.value)"
2383 }
2384 }
2385 @ />
2386 @ </td></tr>
2387
2388 if( !fHasHidden && zBranchName ){
2389 @ <tr><th align="right" valign="top">Branch Hiding:</th>
2390 @ <td valign="top">
2391 @ <label><input type="checkbox" id="hidebr" name="hide"%s(zHideFlag)
2392 if( fossil_strcmp(zBranchName, "trunk")==0 ){
2393 @ style="visibility: hidden" />
2394 }else{
2395 @ />
2396 }
2397 @ Hide branch
2398 @ <span style="font-weight:bold" id="hbranch">%s(zBranchName)</span>
2399 @ from the timeline starting from this check-in</label>
2400 @ </td></tr>
2401 }
2402
2403
2404 if( !fHasClosed ){
2405

Keyboard Shortcuts

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