Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
...
In any form that contains File Upload field, add a Custom HTML and put in the following code.
Note |
---|
Ensure in File Upload properties, the "Download as attachment field" is unchecked. |
Code Block | ||||
---|---|---|---|---|
| ||||
<div id="pdfPreview" style="display:none;"> <object data="pdfFilePath" type="application/pdf" width="100%" height="100%"> <iframe src="pdfFilePath" width="100%" height="100%" style="border: none;"> <p>Your browser does not support PDFs. <a href="pdfFilePath">Download the PDF</a>.</p> </iframe> </object> </div> <script type="text/javascript"> $(function(){ $("ul.form-fileupload-value > li > a").click(function(e){ url = $(this).attr("href"); if(url.endsWith(".pdf.")){ e.preventDefault(); showPopupActionDialog(url); } }); }); function showPopupActionDialog(url){ var wWidth = $(window).width(); var dWidth = wWidth * 0.9; var wHeight = $(window).height(); var dHeight = wHeight * 0.9; var previewObj = $( "#pdfPreview" ).clone().html(function(index,html){ return html.replace(/pdfFilePath/g, url); }); var inputDialog = $( previewObj ).dialog({ autoOpen: true, height: dHeight, width: dWidth, modal: true, buttons: [ { text: "Close", click: function() { inputDialog.dialog( "close" ); } } ] }); } </script> |