2014-11-03, 01:34 PM
I just realized it may've been because I was using WAMP offline (i was hella tired and encoding a load of clips last night) I'll give it another go later when i have some free time.
(2014-11-14, 12:36 PM)mujeebdgk Wrote: [ -> ]https://drive.google.com/file/d/0B8t35P-...8tTEk/view
here is your required File . @Yadomi
(2014-12-02, 09:08 AM)Leefish Wrote: [ -> ]Martec, the test user for us to preview the imgur addon is returning an error? Maybe someone changed the pass?
I was thinking of adding this, but I am getting an error on the upload - "undefined"- I just wanted to check I had applied the changes correctly, but the user is not available.
{$editor_language}
$(function() {
$("#{$bind}").sceditor(opt_editor);
MyBBEditor = $("#{$bind}").sceditor("instance");
{$sourcemode}
});
$.sceditor.command.set("imgur", {
_imgur: function() {
document.querySelector("textarea").insertAdjacentHTML("afterEnd", '<input class="imgur" style="visibility:hidden;position:absolute;top:0;" type="file" onchange="upload(this.files[0])" accept="image/*">');
document.querySelector("input.imgur").click();
},
exec: function() {
$.sceditor.command.get("imgur")._imgur();
},
txtExec: function() {
$.sceditor.command.get("imgur")._imgur();
},
tooltip: "Upload to Imgur"
});
function upload(a) {
if (!a || !a.type.match(/image.*/)) return;
document.body.className = "uploading";
var b = document.querySelector(".sceditor-button-imgur div");
b.className = b.className + " imgurup";
var c = new FormData();
c.append("image", a);
var d = new XMLHttpRequest();
d.open("POST", "https://api.imgur.com/3/image.json");
d.onload = function() {
var a = "[img]" + JSON.parse(d.responseText).data.link + "[/img]";
$('#message, #signature, textarea[name*="value"]').data("sceditor").insert(a);
var b = document.querySelector(".sceditor-button-imgur div.imgurup");
b.className = b.className - " imgurup";
document.querySelector("input.imgur").remove();
};
d.setRequestHeader("Authorization", "Client-ID xxxx");
d.send(c);
}