ข้ามไปเนื้อหา

ผลต่างระหว่างรุ่นของ "CuneiForm"

บรรทัดที่ 478: บรรทัดที่ 478:


'''NOTES''' on file field behaviour, additional buttons, and image box:
'''NOTES''' on file field behaviour, additional buttons, and image box:
** ''The body of the field'' itself triggers a file selector.
* ''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 ''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 ''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 ''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 ''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'' triggers the ''view'' button. Note that the image box is not drawn automatically via the {{code|render_upload}} macro. Should it be needed, developers must create the {{code|lang=html|<img>}} element manually and give it the id {{code|lang=javascript|'<file_field_name>-imgbox'}} ''before running {{code|general_form_tail}}''. The tail macro shall automatically detect and link the image box with the form field.
* The ''image box'' triggers the ''view'' button. Note that the image box is not drawn automatically via the {{code|render_upload}} macro. Should it be needed, developers must create the {{code|lang=html|<img>}} element manually and give it the id {{code|lang=javascript|'<file_field_name>-imgbox'}} ''before running {{code|general_form_tail}}''. The tail macro shall automatically detect and link the image box with the form field.


==== Buttons & Submits ====
==== Buttons & Submits ====