Teknik is a suite of services with attractive and functional interfaces. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main.php 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <div class="container">
  2. <div class="row text-center">
  3. <form action="../includes/upload.php" class="dropzone" id="TeknikUpload" name="TeknikUpload">
  4. <div class="dz-message text-center" id="upload_message">
  5. <div class="row">
  6. <div class="col-sm-12">
  7. <h1>Drop your files here</h1>
  8. </div>
  9. </div>
  10. <div class="row">
  11. <div class="col-sm-12">
  12. <h2>Or just click here</h2>
  13. </div>
  14. </div>
  15. <div class="row">
  16. <div class="col-sm-12">
  17. <h3>Your Choice</h3>
  18. </div>
  19. </div>
  20. </div>
  21. <div class="fallback text-center">
  22. <div class="row">
  23. <div class="col-sm-12">
  24. <input name="file" type="file" class="form-control" multiple />
  25. </div>
  26. </div>
  27. </div>
  28. </form>
  29. </div>
  30. <br />
  31. <div class="progress">
  32. <div class="progress-bar progress-bar-success" id="progressBar" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 0%">0%</div>
  33. </div>
  34. <div class="container" id="upload-links">
  35. </div>
  36. <br />
  37. <div class="well text-center">Each file is encrypted on upload using an AES-256-CBC cipher. If you wish to view the file decrypted, you must use the direct Teknik link.</div>
  38. <div class="text-center">
  39. Useful Tools: <a href="<?php echo get_page_url('git', $CONF); ?>/Tools.git/blob/master/Upload/upload.sh">Bash Upload Script</a>
  40. <br />
  41. <br />
  42. You can now upload your screenshots automatically using <a href="https://github.com/KittyKatt/screenFetch">Screenfetch</a>!
  43. </div>
  44. </div>
  45. <script>
  46. Dropzone.options.TeknikUpload = {
  47. paramName: "file", // The name that will be used to transfer the file
  48. maxFilesize: <?php echo $CONF['max_upload_size']; ?>, // MB
  49. addRemoveLinks: true,
  50. clickable: true,
  51. init: function() {
  52. this.on("addedfile", function(file, responseText) {
  53. $("#upload_message").css('display', 'none', 'important');
  54. });
  55. this.on("success", function(file, responseText) {
  56. obj = JSON.parse(responseText);
  57. var name = obj.results.file.name;
  58. var short_name = file.name.split(".")[0].hashCode();
  59. $("#upload-links").css('display', 'inline', 'important');
  60. $("#upload-links").prepend(' \
  61. <div class="row link_'+short_name+'"> \
  62. <div class="col-sm-6"> \
  63. '+file.name+' \
  64. </div> \
  65. <div class="col-sm-3"> \
  66. <a href="<?php echo get_page_url('u', $CONF); ?>/'+name+'" target="_blank" class="alert-link"><?php echo get_page_url('u', $CONF); ?>/'+name+'</a> \
  67. </div> \
  68. <div class="col-sm-3"> \
  69. <button type="button" class="btn btn-default btn-xs generate-delete-link-'+short_name+'" id="'+name+'">Generate Deletion URL</button> \
  70. </div> \
  71. </div> \
  72. ');
  73. linkUploadDelete('.generate-delete-link-'+short_name+'');
  74. });
  75. this.on("removedfile", function(file) {
  76. var name = file.name.split(".")[0].hashCode();
  77. $('.link_'+name).remove();
  78. });
  79. this.on("reset", function(file, responseText) {
  80. $("#upload_message").css('display', 'inline', 'important');
  81. $(".progress").children('.progress-bar').css('width', '0%');
  82. $(".progress").children('.progress-bar').html('0%');
  83. });
  84. this.on("error", function(file, errorMessage) {
  85. this.removeFile(file);
  86. $("#top_msg").css('display', 'inline', 'important');
  87. $("#top_msg").html('<div class="alert alert-danger alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>'+errorMessage+'</div>');
  88. });
  89. this.on("totaluploadprogress", function(progress, totalBytes, totalBytesSent) {
  90. $(".progress").children('.progress-bar').css('width', progress.toFixed(2)+'%');
  91. if (progress != 100)
  92. {
  93. $(".progress").children('.progress-bar').html(progress.toFixed(2)+'%');
  94. }
  95. else
  96. {
  97. $(".progress").children('.progress-bar').html('Encrypting');
  98. }
  99. });
  100. this.on("queuecomplete", function() {
  101. $(".progress").children('.progress-bar').html('Complete');
  102. });
  103. }
  104. };
  105. </script>