{"id":13,"date":"2021-09-21T02:45:13","date_gmt":"2021-09-21T02:45:13","guid":{"rendered":"https:\/\/pbsod.com\/index.php\/post-image-2\/"},"modified":"2021-09-27T22:55:51","modified_gmt":"2021-09-27T22:55:51","slug":"post-image","status":"publish","type":"page","link":"https:\/\/pbsod.com\/index.php\/post-image\/","title":{"rendered":"Submit"},"content":{"rendered":"\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-0343839583535055\"\n     crossorigin=\"anonymous\"><\/script>\n\n\n<p>Please submit your images with 2MB or less file size.<br>\nTag your @handle in the Description for a shoutout!<\/p>\n\n<div id=\"flexi_ajax\">\n\n    <!-- Image loader -->\n    <div id='flexi_loader' style='display: none;'>\n\n        <br>\n        Uploading        <div class=\"flexi_progress-bar\">\n            <span id=\"flexi_progress\" class=\"flexi_progress-bar-load\" style=\"width: 0%;text-align: center;\"><\/span>\n        <\/div>\n        <br>\n        Processing        <div class=\"flexi_progress-bar\">\n            <span id=\"flexi_progress_process\" class=\"flexi_progress-bar-process\"\n                style=\"width: 0%;text-align: center;\"><\/span>\n        <\/div>\n\n    <\/div>\n\n    <div class='flexi_response'>\n\n    <\/div>\n    <div id=\"flexi_after_response\" style='display: none;'>\n\n    <\/div>\n\n<\/div>\n\n<div id=\"flexi_form\">\n<form\nid=\"flexi-request-form\"\nclass=\"flexi_ajax_post flexi_form_style\"\nmethod=\"post\"\nenctype=\"multipart\/form-data\"\naction=\"https:\/\/pbsod.com\/wp-admin\/admin-ajax.php\"\n><div class=\"fl-field\"><label class='fl-label fl-label fl-has-text-dark' for=\"user-submitted-title\">Title<\/label><div class=\"fl-control\"><input type=\"text\" name=\"user-submitted-title\" value=\"\" placeholder=\"\" class=\"fl-input\" required><\/div><\/div><div class=\"fl-field\"><label class='fl-label fl-label fl-has-text-dark' for=\"tags\">Insert tag<\/label><div class=\"fl-control\"><input type=\"\" name=\"tags\" value=\"\" id=\"tags\" placeholder=\"\" class=\"\"> <script>\n          jQuery(document).ready(function ()\n          {\n\n              jQuery('#tags').tagsInput();\n          });\n          <\/script><\/div><\/div><div class=\"fl-field\"><label class='fl-label fl-label fl-has-text-dark' for=\"user-submitted-content\">Description<\/label><div class=\"fl-control\"><textarea name=\"user-submitted-content\" rows=\"4\" cols=\"40\" id=\"\" placeholder=\"\" class=\"fl-textarea\"><\/textarea><\/div><\/div><div class=\"fl-field\">\n    <div id=\"file-js-flexi\" class=\"fl-file fl-has-name\">\n        <label class=\"fl-file-label\">\n            <input type=\"file\" name=\"user-submitted-image[]\" value=\"\" id=\"file\" class=\"fl-file-input\" required=\"\">\n            <span class=\"fl-file-cta\">\n                <span class=\"fl-file-icon\">\n                    <i class=\"fas fa-upload\"><\/i>\n                <\/span>\n                <span class=\"fl-file-label\">\n                    Select file                <\/span>\n            <\/span>\n            <span class=\"fl-file-name\">\n                No file selected            <\/span>\n        <\/label>\n    <\/div>\n<\/div>\n<script>\nconst fileInput = document.querySelector('#file-js-flexi input[type=file]');\nfileInput.onchange = () => {\n    if (fileInput.files.length > 0) {\n        const fileName = document.querySelector('#file-js-flexi .fl-file-name');\n        fileName.textContent = fileInput.files[0].name;\n    }\n}\n<\/script>\n\n\n\n<div class=\"fl-field\"><div class=\"fl-control\"><input type=\"submit\" name=\"submit\" value=\"Submit Now\" id=\"submit\" class=\"\"><\/div><script>\njQuery(document).ready(function() {\n    var error = false;\n    jQuery(\"form input\").change(function(e) {\n        if (this.files && this.files.length) {\n            var file_size = this.files[0].size;\n            \/\/ console.log(this.files);\n            var max = 5242880;\n            jQuery(\"form p\").text(this.files.length + \" file(s) selected\");\n            var notices = \"\";\n            for (i = 0; i < this.files.length; i++) {\n                error = false;\n                document.getElementById(\"flexi_submit_notice\").innerHTML = \"\";\n                var cur = this.files[i].size;\n                var name = this.files[i].name;\n                \/\/console.log(cur+\"--\"+max);\n                if (cur > max) {\n                    \/\/console.log(e);\n                    error = true;\n                    \/\/console.log(name+\" - \"+cur);\n                    notices += \"<div class=\\\"flexi_alert-box flexi_error\\\">\" + name + \" - \" + ((cur \/\n                            1024) \/ 1024).toFixed(2) +\n                        \"MB (5MB)<\/div>\";\n\n                }\n            }\n            document.getElementById(\"flexi_submit_notice\").innerHTML = notices;\n        }\n        if (error) {\n            \/\/console.log(\"Disable Form\");\n            \/\/Disable Submit Button\n            jQuery(\"#submit\").attr(\"disabled\", true);\n        } else {\n            \/\/console.log(\"Enable Form\");\n            \/\/Disable Submit Button\n            jQuery(\"#submit\").removeAttr(\"disabled\");\n        }\n    });\n\n});\n<\/script>\n\n<\/div><br>\n<input type=\"hidden\" id=\"flexi-nonce\" name=\"flexi-nonce\" value=\"0c04dfd8f2\" \/><input type=\"hidden\" name=\"action\" value=\"flexi_ajax_post\"><input type=\"hidden\" name=\"detail_layout\" value=\"default\"><input type=\"hidden\" name=\"edit_page\" value=\"0\"><input type=\"hidden\" name=\"form_name\" value=\"my_form\"><input type=\"hidden\" name=\"flexi_attach_at\" value=\"13\"><input type=\"hidden\" name=\"edit\" value=\"false\"><input type=\"hidden\" name=\"type\" value=\"image\"><input type=\"hidden\" name=\"unique\" value=\"\"><input type=\"hidden\" name=\"upload_type\" value=\"flexi\"><\/form><div id=\"flexi_submit_notice\"><\/div><\/div>\n\n\n<script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-0343839583535055\"\n     crossorigin=\"anonymous\"><\/script>\n","protected":false},"excerpt":{"rendered":"<p>Please submit your images with 2MB or less file size. Tag your @handle in the Description for a shoutout!<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-13","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/pbsod.com\/index.php\/wp-json\/wp\/v2\/pages\/13","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pbsod.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pbsod.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pbsod.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pbsod.com\/index.php\/wp-json\/wp\/v2\/comments?post=13"}],"version-history":[{"count":9,"href":"https:\/\/pbsod.com\/index.php\/wp-json\/wp\/v2\/pages\/13\/revisions"}],"predecessor-version":[{"id":339,"href":"https:\/\/pbsod.com\/index.php\/wp-json\/wp\/v2\/pages\/13\/revisions\/339"}],"wp:attachment":[{"href":"https:\/\/pbsod.com\/index.php\/wp-json\/wp\/v2\/media?parent=13"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}