Advertisement
Guest User

ClickB8.io Upload - TemperMonkey

a guest
Jul 27th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         ClickB8.io Uploader
  3. // @namespace    *://clickb8.io/*
  4. // @match        *://clickb8.io/*
  5. // @version      2.0
  6. // @description  Upload to ClickB8 with a single click!
  7. // @run-at       document-start
  8. // @author       CX
  9. // @grant        none
  10. // ==/UserScript==
  11.  
  12. var imageLoader = document.createElement('input');
  13. imageLoader.type = "file";
  14. imageLoader.addEventListener('change', handleImage, false);
  15. var canvas = document.getElementById('thumbnailPaintCanvas');
  16. var ctx = canvas.getContext('2d');
  17. function handleImage(e){
  18.     var reader = new FileReader();
  19.     reader.onload = function(event){
  20.         var img = new Image();
  21.         img.onload = function(){
  22.             canvas.width = img.width;
  23.             canvas.height = img.height;
  24.             ctx.drawImage(img,0,0);
  25.         };
  26.         img.src = event.target.result;
  27.     };
  28.     reader.readAsDataURL(e.target.files[0]);
  29. }
  30. imageLoader.style.display = "block";
  31. imageLoader.style.margin = "10px auto 0";
  32. imageLoader.style.fontSize = "20px";
  33. document.getElementById('createVideoContainer').appendChild(imageLoader);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement