Fossil SCM
Add the submit button IDs programmatically (was previously hand-coded), to avoid them getting out of sync with their enum.
Commit
032a0326e86d37ef8faea0a82486392bbade5dd1bf24a6b80b9db23b1bad49cf
Parent
ae8e24d0217191c…
1 file changed
+8
-8
+8
-8
| --- src/fileedit.c | ||
| +++ src/fileedit.c | ||
| @@ -1459,14 +1459,14 @@ | ||
| 1459 | 1459 | |
| 1460 | 1460 | /******* Buttons *******/ |
| 1461 | 1461 | CX("<a id='buttons'></a>"); |
| 1462 | 1462 | CX("<fieldset class='fileedit-options'>" |
| 1463 | 1463 | "<legend>Tell the server to...</legend><div>"); |
| 1464 | - CX("<button type='submit' name='submit' value='1'>" | |
| 1465 | - "Save</button>"); | |
| 1466 | - CX("<button type='submit' name='submit' value='2'>" | |
| 1467 | - "Preview</button>"); | |
| 1464 | + CX("<button type='submit' name='submit' value='%d'>" | |
| 1465 | + "Save</button>", SUBMIT_SAVE); | |
| 1466 | + CX("<button type='submit' name='submit' value='%d'>" | |
| 1467 | + "Preview</button>", SUBMIT_PREVIEW); | |
| 1468 | 1468 | { |
| 1469 | 1469 | /* Preview rendering mode selection... */ |
| 1470 | 1470 | previewRenderMode = atoi(PD("preview_render_mode","0")); |
| 1471 | 1471 | if(0==previewRenderMode){ |
| 1472 | 1472 | previewRenderMode = fileedit_render_mode_for_mimetype(zFileMime); |
| @@ -1504,14 +1504,14 @@ | ||
| 1504 | 1504 | "If on, plain-text files (only) will get " |
| 1505 | 1505 | "line numbers added to the preview.", |
| 1506 | 1506 | previewLn); |
| 1507 | 1507 | } |
| 1508 | 1508 | } |
| 1509 | - CX("<button type='submit' name='submit' value='3'>" | |
| 1510 | - "Diff (SBS)</button>"); | |
| 1511 | - CX("<button type='submit' name='submit' value='4'>" | |
| 1512 | - "Diff (Unified)</button>"); | |
| 1509 | + CX("<button type='submit' name='submit' value='%d'>" | |
| 1510 | + "Diff (SBS)</button>", SUBMIT_DIFF_SBS); | |
| 1511 | + CX("<button type='submit' name='submit' value='%d'>" | |
| 1512 | + "Diff (Unified)</button>", SUBMIT_DIFF_UNIFIED); | |
| 1513 | 1513 | CX("</div></fieldset>"); |
| 1514 | 1514 | |
| 1515 | 1515 | /******* End of form *******/ |
| 1516 | 1516 | CX("</form>\n"); |
| 1517 | 1517 | |
| 1518 | 1518 |
| --- src/fileedit.c | |
| +++ src/fileedit.c | |
| @@ -1459,14 +1459,14 @@ | |
| 1459 | |
| 1460 | /******* Buttons *******/ |
| 1461 | CX("<a id='buttons'></a>"); |
| 1462 | CX("<fieldset class='fileedit-options'>" |
| 1463 | "<legend>Tell the server to...</legend><div>"); |
| 1464 | CX("<button type='submit' name='submit' value='1'>" |
| 1465 | "Save</button>"); |
| 1466 | CX("<button type='submit' name='submit' value='2'>" |
| 1467 | "Preview</button>"); |
| 1468 | { |
| 1469 | /* Preview rendering mode selection... */ |
| 1470 | previewRenderMode = atoi(PD("preview_render_mode","0")); |
| 1471 | if(0==previewRenderMode){ |
| 1472 | previewRenderMode = fileedit_render_mode_for_mimetype(zFileMime); |
| @@ -1504,14 +1504,14 @@ | |
| 1504 | "If on, plain-text files (only) will get " |
| 1505 | "line numbers added to the preview.", |
| 1506 | previewLn); |
| 1507 | } |
| 1508 | } |
| 1509 | CX("<button type='submit' name='submit' value='3'>" |
| 1510 | "Diff (SBS)</button>"); |
| 1511 | CX("<button type='submit' name='submit' value='4'>" |
| 1512 | "Diff (Unified)</button>"); |
| 1513 | CX("</div></fieldset>"); |
| 1514 | |
| 1515 | /******* End of form *******/ |
| 1516 | CX("</form>\n"); |
| 1517 | |
| 1518 |
| --- src/fileedit.c | |
| +++ src/fileedit.c | |
| @@ -1459,14 +1459,14 @@ | |
| 1459 | |
| 1460 | /******* Buttons *******/ |
| 1461 | CX("<a id='buttons'></a>"); |
| 1462 | CX("<fieldset class='fileedit-options'>" |
| 1463 | "<legend>Tell the server to...</legend><div>"); |
| 1464 | CX("<button type='submit' name='submit' value='%d'>" |
| 1465 | "Save</button>", SUBMIT_SAVE); |
| 1466 | CX("<button type='submit' name='submit' value='%d'>" |
| 1467 | "Preview</button>", SUBMIT_PREVIEW); |
| 1468 | { |
| 1469 | /* Preview rendering mode selection... */ |
| 1470 | previewRenderMode = atoi(PD("preview_render_mode","0")); |
| 1471 | if(0==previewRenderMode){ |
| 1472 | previewRenderMode = fileedit_render_mode_for_mimetype(zFileMime); |
| @@ -1504,14 +1504,14 @@ | |
| 1504 | "If on, plain-text files (only) will get " |
| 1505 | "line numbers added to the preview.", |
| 1506 | previewLn); |
| 1507 | } |
| 1508 | } |
| 1509 | CX("<button type='submit' name='submit' value='%d'>" |
| 1510 | "Diff (SBS)</button>", SUBMIT_DIFF_SBS); |
| 1511 | CX("<button type='submit' name='submit' value='%d'>" |
| 1512 | "Diff (Unified)</button>", SUBMIT_DIFF_UNIFIED); |
| 1513 | CX("</div></fieldset>"); |
| 1514 | |
| 1515 | /******* End of form *******/ |
| 1516 | CX("</form>\n"); |
| 1517 | |
| 1518 |