1,813
การแก้ไข
| บรรทัดที่ 478: | บรรทัดที่ 478: | ||
'''NOTES''' on file field behaviour, additional buttons, and image box: | '''NOTES''' on file field behaviour, additional buttons, and image box: | ||
* Actions related to a file field and its associated elements: | |||
** ''The body of the field'' itself triggers a file selector. | |||
** The ''view'' button [[ไฟล์:Cuneifox view btn.png|25px|frameless|alt=View file button|View file button]] opens the currently selected file in a new tab. | |||
** The ''cam'' button [[ไฟล์:Cuneifox cam btn.png|25px|frameless|alt=Camera button|Camera button]] activates the camera modal where the user can capture an image with an applicable peripheral. This button only appears if the form has a BooleanField named {{code|lang=python|'<file_field_name>_isshot'}} drawn ''(can be hidden)'' on the page. | |||
** The ''revert'' button [[ไฟล์:Cuneifox revert btn.png|25px|frameless|alt=Revert button|Revert button]] undoes the change made to the file field and restore its original file/value. | |||
** The ''unselect'' button [[ไฟล์:Cuneifox file delete btn.png|25px|frameless|alt=Unselect button|Unselect button]] clears the file field. This button only appears if the form has a BooleanField named {{code|lang=python|'<file_field_name>_isdel'}} drawn ''(can be hidden)'' on the page. | |||
* The image box is not drawn as a part of the Jinja2 macro. Developers must create the {{code|lang=html|<img>}} manually and assign to it the id {{code|lang=javascript|'<field_id>-imgbox'}} ''before running {{code|general_form_tail}}''. The tail macro shall automatically link the image box with the form field. | * The image box is not drawn as a part of the Jinja2 macro. Developers must create the {{code|lang=html|<img>}} manually and assign to it the id {{code|lang=javascript|'<field_id>-imgbox'}} ''before running {{code|general_form_tail}}''. The tail macro shall automatically link the image box with the form field. | ||
==== Buttons & Submits ==== | ==== Buttons & Submits ==== | ||