HTMLify
preview feature
Views: 1003 | Author: abh
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | <!DOCTYPE html> <html> <head> <title>Editing - updates/preview-feature.html</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> /* edit css */ /* body { font-family: Arial, sans-serif; background-color: #f2f2f2; margin: 0; padding: 0; display: flex; justify-content: center; align-items: center; height: 100vh; }*/ .edit-form { background-color: #ffffff; padding: 20px; border-radius: 5px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); } .edit-form h1 { text-align: center; margin-bottom: 20px; } .edit-form input[type="text"], .edit-form input[type="radio"] { margin-right: 5px; } .edit-form textarea { width: 100%; height: 90vh; padding: 10px; margin-top: 10px; font-size: 16px; border: 1px solid #ccc; border-radius: 5px; resize: vertical; } .edit-form input[type="submit"] { background-color: #007BFF; color: #fff; cursor: pointer; margin-top: 10px; padding: 10px 15px; } .edit-form a { display: inline-block; margin-top: 10px; text-decoration: none; color: #007BFF; padding: 10px 15px; border: 1px solid #007BFF; border-radius: 5px; } .edit-form a:hover { background-color: #007BFF; color: #fff; } .github-fetch-form input[type="text"]{ //display: flex; //width: 30px; border: none; border-bottom: 2px solid #ddd; text-decoration: underline; } /* login page style */ /* body { font-family: Arial, sans-serif; background-color: #f2f2f2; margin: 0; padding: 0; display: flex; justify-content: center; align-items: center; height: 100vh; }*/ .login-form { background-color: #ffffff; padding: 20px; border-radius: 5px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); max-width: 400px; margin: auto; } .login-form h1 { text-align: center; margin-bottom: 20px; } .login-form input { display: block; width: 90%; padding: 10px; margin-bottom: 10px; font-size: 16px; border: 1px solid #ccc; border-radius: 5px; } .login-form input[type="submit"] { background-color: #007BFF; color: #fff; cursor: pointer; } .login-form input[type="submit"]:hover { background-color: #0056b3; } /* file upload css */ /* body { font-family: Arial, sans-serif; background-color: #f2f2f2; margin: 0; padding: 0; }*/ .upload-form { max-width: 400px; margin: 20px auto; padding: 20px; background-color: #fff; border: 1px solid #ccc; border-radius: 5px; } .upload-form label { display: block; margin-bottom: 10px; } .upload-form input[type="text"], .upload-form input[type="file"] { width: 100%; padding: 8px; margin-bottom: 15px; } .upload-form input[type="submit"] { background-color: #007BFF; color: #fff; border: none; padding: 10px; cursor: pointer; } /* search result page style */ /* body { font-family: Arial, sans-serif; background-color: #f2f2f2; margin: 0; padding: 0; } /* .search-form { margin: 20px; text-align: center; } </style> <!-- Extras file, containts of this file will be available in all templates just above </head> --> <link rel="stylesheet" src="/pygments.css" /> <style> </style> </head> <body> <div class="edit-form"> <h1>Editing - updates/priew-feature.html</h1> <form action="/action/edit" method="POST"> <input type="text" name="path" value="updates/preview-feature.html" placeholder="File path" /> Title: <input type="text" name="title" value="updates/preview-feature.html" placeholder="File title" /><br> <br> Mode: <select name="mode"> <option value="p" selected>Parse</option> <option value="r" >Raw</option> <option value="s" >Show</option> </select> | Visibility: <select name="visibility"> <option value="p" selected/> Public <option value="h" /> Hide <option value="o" /> Once </select><br><br> Password: <input type="text" name="password" value=""><br> <input type="submit" value="Save" /> <a href="/abh/hehe.html">View</a> <a href="#preview" onclick="preview()">Preview</a> <a href="/dashboard">Back</a> <textarea name="filecontent" placeholder="file content" rows="10"><h1>New Update</h2> <p>Now you can Preview you HTMLs on same page <br;> It will also help to prevent unwanted view counts<br;> Just click on "Preview" button to see preview of this HTML Document</p> </textarea><br> </form> <details class="more-edit-menu"><summary>More</summary> <form action="/edit" method="POST"> Fetch from PasteBin: PasteId: <input type="text" name="pasteid" /> <input type="submit" name="pastebin" value="Fetch" /> </form> </details> <iframe id="preview" src="" style="width:100%;height:90vh;border:none;"></iframe> </div> <script> var preview = function (){ let filecontent = document.querySelector("textarea"); filecontent = encodeURIComponent(filecontent.value); document.getElementById("preview").setAttribute("src", "/api/render?html=" + filecontent); } </script> </body> </html> |