Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not Solved [How To?] put https in imgur js
#1
Not Solved
I have this code 

 /* Lets build a FormData object*/
 var fd = new FormData(); // I wrote about it: https://hacks.mozilla.org/2011/01/how-to-develop-a-html5-image-uploader/
fd.append("image", file); // Append the file
var xhr = new XMLHttpRequest(); // Create the XHR (Cross-Domain XHR FTW!!!) Thank you sooooo much imgur.com
xhr.open("POST", "https://api.imgur.com/3/image.json"); // Boooom!
xhr.onload = function() {
var code = '' +'https://'+ JSON.parse(xhr.responseText).data.link + '[/img]';
$('#message, #signature, textarea[name*="value"]').data('sceditor').insert(code);
var d = document.querySelector(".sceditor-button-imgur div.imgurup");
d.className = d.className - " imgurup";
document.querySelector('input.imgur').remove();
}
// Ok, I don't handle the errors. An exercice for the reader.
xhr.setRequestHeader('Authorization', 'Client-ID '+iclid+'');
/* And now, we send the formdata */
xhr.send(fd);
};

I add https 
' +'https://'+ JSON.parse(xhr.responseText).data.link + '[/img]';

but now the form is https://http://link

how remove http://??

this is js : https://github.com/martec/myinsertbutton...ibutton.js
Reply
#2
Not Solved
Hi AlexanderPep I installed this plugin made sure I changed the address in admin cp on my site hope it helps

https://community.mybb.com/mods.php?action=view&pid=450


Reply
#3
Not Solved
Yes...with this plugin works because can make image proxy Big Grin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)