fork/chhoto-url
git clone https://git.julia.blue/fork/chhoto-url
82d9903
unicode
1<!-- SPDX-FileCopyrightText: 2023-2026 Sayantan Santra <sayantan.santra689@gmail.com> --> 2<!-- SPDX-License-Identifier: MIT --> 3 4<!doctype html > 5< html lang ="en "> 6< head > 7< meta charset ="UTF-8 "/> 8< meta 9name ="viewport " 10content ="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0 " 11/> 12< meta http-equiv ="X-UA-Compatible "content ="ie=edge "/> 13 14< title > Chhoto URL</ title > 15 16< meta 17name ="description " 18content ="A simple selfhosted URL shortener with no unnecessary features. " 19/> 20< meta property ="og:title "content ="Chhoto URL "/> 21< meta 22property ="og:description " 23content ="A simple selfhosted URL shortener with no unnecessary features. " 24/> 25< meta 26property ="og:image " 27content ="https://chhoto.link/static/assets/banner.png " 28/> 29 30< meta 31name ="keywords " 32content ="url shortener, link shortener, self hosted, open source " 33/> 34< link 35rel ="icon " 36type ="image/x-icon " 37href ="assets/favicon.ico " 38sizes ="any " 39/> 40< link rel ="icon "type ="image/svg+xml "href ="assets/favicon.svg "/> 41< link 42rel ="icon " 43type ="image/png " 44href ="assets/favicon-32.png " 45sizes ="32x32 " 46/> 47< link 48rel ="icon " 49type ="image/png " 50href ="assets/favicon-196.png " 51sizes ="196x196 " 52/> 53 54< link rel ="preconnect "href ="https://cdn.jsdelivr.net "crossorigin /> 55< link rel ="preconnect "href ="https://fonts.googleapis.com "/> 56< link rel ="preconnect "href ="https://fonts.gstatic.com "crossorigin /> 57< script 58src ="https://cdn.jsdelivr.net/gh/sintan1729/qrcodejs@0.1.0/qrcode.min.js " 59async 60></ script > 61< script 62src ="https://cdn.jsdelivr.net/npm/punycode-okam@1.4.1/punycode.min.js " 63async 64></ script > 65< script src ="static/script.js "defer ></ script > 66< link 67rel ="stylesheet " 68href ="https://cdn.jsdelivr.net/npm/purecss@3.0.0/build/pure-min.css " 69integrity ="sha384-X38yfunGUhNzHpBaEBsWLO+A0HDYOQi8ufWDkZ0k9e0eXz/tH3II7uKZ9msv++Ls " 70crossorigin ="anonymous " 71/> 72< link 73rel ="stylesheet " 74type ="text/css " 75target ="_blank " 76href ="static/styles.css " 77/> 78</ head > 79 80< body > 81< div class ="container "id ="container "> 82< form class ="pure-form pure-form-aligned "name ="new-url-form "> 83< fieldset > 84< legend id ="logo "> 85< img src ="assets/favicon.svg "alt ="chhoto-url-logo "/> 86< span > Chhoto URL</ span > 87</ legend > 88< div class ="pure-control-group "> 89< label for ="longUrl "> Long URL</ label > 90< input 91class ="chhoto-input " 92type ="url " 93name ="longUrl " 94id ="longUrl " 95placeholder ="Please enter a valid URL " 96required 97/> 98</ div > 99< div class ="pure-control-group "> 100< label for ="shortUrl "> Short URL (optional)</ label > 101< input 102class ="chhoto-input " 103type ="text " 104name ="shortUrl " 105id ="shortUrl " 106placeholder ="Lots of unicode characters are allowed " 107title ="Lots of unicode characters are allowed " 108autocapitalize ="off " 109/> 110</ div > 111< div class ="pure-form-section "> 112< details class ="chhoto-input "id ="optionsSection "> 113< summary class ="pure-controls "> More options</ summary > 114< div class ="pure-control-group "> 115< label for ="expiryDelay "> Expiry</ label > 116< select 117class ="chhoto-select " 118name ="expiryDelay " 119id ="expiryDelay " 120> 121< option value ="0 "> Never</ option > 122< option value ="600 "> 10 Minutes</ option > 123< option value ="1800 "> 30 Minutes</ option > 124< option value ="3600 "> 1 Hour</ option > 125< option value ="43200 "> 12 Hours</ option > 126< option value ="86400 "> 1 Day</ option > 127< option value ="604800 "> 1 Week</ option > 128< option value ="2592000 "> 1 Month</ option > 129< option value ="7776000 "> 3 Months</ option > 130< option value ="15552000 "> 6 Months</ option > 131< option value ="31536000 "> 1 Year</ option > 132</ select > 133</ div > 134< div class ="pure-control-group "> 135< label for ="notes "> Notes</ label > 136< input 137class ="chhoto-input " 138type ="text " 139name ="notes " 140id ="notes " 141placeholder ="Notes for the link, used for filtering " 142pattern ="[\x20-\x7E]* " 143title ="Only printable ASCII characters are allowed " 144autocapitalize ="off " 145/> 146</ div > 147</ details > 148</ div > 149< div class ="pure-controls "id ="controls "> 150< button class ="chhoto-button pure-button pure-button-primary "> 151 Shorten! 152</ button > 153< div id ="alert-box "> </ div > 154</ div > 155</ fieldset > 156</ form > 157 158< p id ="loading-text "> Loading links table...</ p > 159< table class ="chhoto-table pure-table "id ="table-box "hidden > 160< caption > 161< span name ="label "> Active links</ span > 162< span id ="pageControls "hidden ="true "> 163< button 164id ="prevPageBtn " 165class ="svg-button " 166title ="Previous Page " 167></ button > 168< button 169id ="nextPageBtn " 170class ="svg-button " 171title ="Next Page " 172></ button > 173</ span > 174< div id ="filter-div "> 175< form class ="pure-form "name ="filter-form "> 176< fieldset > 177< input 178class ="chhoto-input " 179type ="text " 180name ="filter " 181id ="filterText " 182placeholder ="Filter shortlinks " 183pattern ="^$|(?=(?:.*[A-Za-z0-9]){3,})[\x20-\x7E]+$ " 184title ="Only printable ASCII is allowed, min length 3 chars " 185autocapitalize ="off " 186/> 187< button class ="chhoto-button pure-button pure-button-primary "> 188 Filter 189</ button > 190</ fieldset > 191</ form > 192</ div > 193</ caption > 194< br /> 195< thead > 196< tr > 197< th name ="numColumn "> #</ th > 198< th id ="short-url-header "> Short URL</ th > 199< th > Long URL</ th > 200< th name ="hitsColumn "> Hits</ th > 201< th name ="expiryColumn "> Expiry</ th > 202< th name ="actions "> Actions</ th > 203</ tr > 204</ thead > 205< tbody id ="url-table "> 206<!-- The links would be inserted here --> 207</ tbody > 208</ table > 209</ div > 210 211< div name ="links-div "> 212< button class ="linkButton "id ="admin-button "hidden > 213<!-- https://svgicons.com/icon/109760/account --> 214< svg 215xmlns ="http://www.w3.org/2000/svg " 216width ="24 " 217height ="24 " 218viewBox ="0 0 24 24 " 219> 220< title > Account SVG Icon</ title > 221< g 222fill ="none " 223stroke ="currentColor " 224stroke-dasharray ="28 " 225stroke-linecap ="round " 226stroke-linejoin ="round " 227stroke-width ="2 " 228> 229< path 230d ="M4 21v-1c0 -3.31 2.69 -6 6 -6h4c3.31 0 6 2.69 6 6v1 " 231></ path > 232< path 233d ="M12 11c-2.21 0 -4 -1.79 -4 -4c0 -2.21 1.79 -4 4 -4c2.21 0 4 1.79 4 4c0 2.21 -1.79 4 -4 4Z " 234></ path > 235</ g > 236</ svg > 237< span > login</ span > 238</ button > 239<!-- https://svgicons.com/icon/13641/bxl-github --> 240< a 241id ="version-number " 242class ="linkButton " 243href ="https://github.com/SinTan1729/chhoto-url " 244target ="_blank " 245rel ="noopener noreferrer " 246hidden 247> 248< svg 249xmlns ="http://www.w3.org/2000/svg " 250width ="24 " 251height ="24 " 252viewBox ="0 0 24 24 " 253> 254< path 255fill-rule ="evenodd " 256clip-rule ="evenodd " 257d ="M12.026 2c-5.509 0-9.974 4.465-9.974 9.974c0 4.406 2.857 8.145 6.821 9.465 258c.499.09.679-.217.679-.481c0-.237-.008-.865-.011-1.696c-2.775.602-3.361-1.338-3.361-1.338 259c-.452-1.152-1.107-1.459-1.107-1.459c-.905-.619.069-.605.069-.605c1.002.07 1.527 1.028 1.527 1.028 260c.89 1.524 2.336 1.084 2.902.829c.091-.645.351-1.085.635-1.334c-2.214-.251-4.542-1.107-4.542-4.93 261c0-1.087.389-1.979 1.024-2.675c-.101-.253-.446-1.268.099-2.64c0 0 .837-.269 2.742 1.021 262a9.582 9.582 0 0 1 2.496-.336a9.554 9.554 0 0 1 2.496.336c1.906-1.291 2.742-1.021 2.742-1.021 263c.545 1.372.203 2.387.099 2.64c.64.696 1.024 1.587 1.024 2.675c0 3.833-2.33 4.675-4.552 4.922 264c.355.308.675.916.675 1.846c0 1.334-.012 2.41-.012 2.737c0 .267.178.577.687.479 265C19.146 20.115 22 16.379 22 11.974C22 6.465 17.535 2 12.026 2z " 266fill ="currentColor " 267/> 268</ svg > 269< span > Source Code</ span > 270</ a > 271</ div > 272 273< dialog id ="login-dialog "closedby ="none "class ="chhoto-dialog "> 274< form class ="pure-form "name ="login-form "> 275< p > Please enter password to access this website</ p > 276< div > 277< input class ="chhoto-input "type ="password "id ="password "/> 278< button 279type ="button " 280id ="password-eye-button " 281title ="Toggle Password Visibility " 282> 283 👁 284</ button > 285</ div > 286< div > 287< label for ="login-checkbox "> 288< input type ="checkbox "id ="login-checkbox "/> 289 Remember me 290</ label > 291</ div > 292< button 293class ="chhoto-button pure-button pure-button-primary " 294value ="default " 295> 296 Log in 297</ button > 298< p id ="wrong-pass "hidden > Wrong password!</ p > 299</ form > 300</ dialog > 301 302< dialog id ="edit-dialog "class ="chhoto-dialog "> 303< form class ="pure-form pure-form-aligned "name ="edit-form "> 304< p > 305 Enter new details for< span id ="edit-link "> placeholder</ span > .< br /> 306 Be careful. It cannot be undone. 307</ p > 308< fieldset > 309< div class ="pure-control-group "> 310< label for ="edited-url "> Long URL</ label > 311< input class ="chhoto-input "type ="url "id ="edited-url "/> 312</ div > 313< div class ="pure-control-group "> 314< label for ="edited-notes "> Notes</ label > 315< input 316class ="chhoto-input " 317type ="text " 318pattern ="[\x20-\x7E]* " 319id ="edited-notes " 320/> 321</ div > 322< div class ="pure-control-group "> 323< label for ="edited-expiry "> Expiry</ label > 324< input 325class ="chhoto-input " 326type ="datetime-local " 327step ="1 " 328id ="edited-expiry " 329/> 330</ div > 331< label for ="edit-checkbox "> 332< input type ="checkbox "id ="edit-checkbox "/> 333 Reset hit count 334</ label > 335< div id ="edit-buttons "> 336< button 337class ="chhoto-button pure-button pure-button-primary " 338id ="edit-cancel-button " 339type ="button " 340> 341 Cancel 342</ button > 343< button 344class ="chhoto-button pure-button pure-button-primary " 345value ="default " 346> 347 Submit 348</ button > 349</ div > 350</ fieldset > 351</ form > 352</ dialog > 353 354< dialog id ="info-dialog "closedby ="any "class ="chhoto-dialog "> 355<!-- https://svgicons.com/icon/13141/cross-filled --> 356< button class ="dialog-close-button "id ="info-close-button "> 357< svg 358xmlns ="http://www.w3.org/2000/svg " 359width ="24 " 360height ="24 " 361viewBox ="0 0 24 24 " 362> 363< g fill ="currentColor "fill-rule ="evenodd "clip-rule ="evenodd "> 364< path 365d ="M5.47 5.47a.75.75 0 0 1 1.06 0l12 12a.75.75 0 1 1-1.06 1.06l-12-12a.75.75 0 0 1 0-1.06 " 366/> 367< path 368d ="M18.53 5.47a.75.75 0 0 1 0 1.06l-12 12a.75.75 0 0 1-1.06-1.06l12-12a.75.75 0 0 1 1.06 0 " 369/> 370</ g > 371</ svg > 372</ button > 373< div id ="info-div "> 374< table class ="pure-table "id ="info-table "> 375< tbody > 376< tr > 377< td class ="label "> Short:</ td > 378< td id ="info-short "></ td > 379</ tr > 380< tr > 381< td class ="label "> Long:</ td > 382< td id ="info-long "></ td > 383</ tr > 384< tr > 385< td class ="label "> Hits:</ td > 386< td id ="info-hits "></ td > 387</ tr > 388< tr > 389< td class ="label "> Expiry:</ td > 390< td id ="info-expiry "></ td > 391</ tr > 392< tr > 393< td class ="label "> Notes:</ td > 394< td id ="info-notes "></ td > 395</ tr > 396</ tbody > 397</ table > 398</ div > 399</ dialog > 400 401< dialog id ="qr-code-dialog "closedby ="any "class ="chhoto-dialog "> 402<!-- https://svgicons.com/icon/10667/download-solid --> 403< a class ="dialog-close-button "id ="qr-download-button "href =""> 404< svg 405xmlns ="http://www.w3.org/2000/svg " 406width ="24 " 407height ="24 " 408viewBox ="0 0 24 24 " 409> 410< path 411fill ="currentColor " 412fill-rule ="evenodd " 413d ="M5 16.25a.75.75 0 0 1 .75.75v2c0 .138.112.25.25.25h12a.25.25 0 0 0 .25-.25v-2a.75.75 0 0 1 1.5 0v2A1.75 1.75 0 0 1 18 20.75H6A1.75 1.75 0 0 1 4.25 19v-2a.75.75 0 0 1 .75-.75 " 414clip-rule ="evenodd " 415/> 416< path 417fill ="currentColor " 418d ="M10.738 3.75a.992.992 0 0 0-.988.906a36.618 36.618 0 0 0-.082 5.27c-.247.013-.493.03-.74.047l-1.49.109a.76.76 0 0 0-.585 1.167a15.555 15.555 0 0 0 4.032 4.258l.597.429a.888.888 0 0 0 1.036 0l.597-.429a15.556 15.556 0 0 0 4.032-4.258a.76.76 0 0 0-.585-1.167l-1.49-.109a42.274 42.274 0 0 0-.74-.047a36.62 36.62 0 0 0-.081-5.27a.992.992 0 0 0-.989-.906z " 419/> 420</ svg > 421</ a > 422<!-- https://svgicons.com/icon/13141/cross-filled --> 423< button class ="dialog-close-button "id ="qr-close-button "> 424< svg 425xmlns ="http://www.w3.org/2000/svg " 426width ="24 " 427height ="24 " 428viewBox ="0 0 24 24 " 429> 430< g fill ="currentColor "fill-rule ="evenodd "clip-rule ="evenodd "> 431< path 432d ="M5.47 5.47a.75.75 0 0 1 1.06 0l12 12a.75.75 0 1 1-1.06 1.06l-12-12a.75.75 0 0 1 0-1.06 " 433/> 434< path 435d ="M18.53 5.47a.75.75 0 0 1 0 1.06l-12 12a.75.75 0 0 1-1.06-1.06l12-12a.75.75 0 0 1 1.06 0 " 436/> 437</ g > 438</ svg > 439</ button > 440< div id ="qr-code "></ div > 441</ dialog > 442</ body > 443</ html >