//META{"name":"DCMQuotingPlugin"}*// //Crossplatform script... IE 8 -> Chrome -> Better discord "support" //This class is for hacky QUOTE INJECTION only function DCMQuotingPlugin(){ var ghostModId = 3; this.load = function(){}; this.start = function(){ inject(); }; this.unload = function(){ this.disable(); }; this.stop = function(){ this.disable(); }; this.disable = function(){ window.DCMQuoting.enabled = false; //removeAllEvents(document, "DOMNodeInsertedIntoDocument"); //removeAllEvents(document, "DOMNodeInserted"); }; var checkVal = function(a){ if ((typeof(a)) === "undefined") return 300; var h2 = a.getElementsByTagName("h2")[0]; if ((typeof(h2)) === "undefined") return 300; return h2.childNodes.length; }; var inject = function(){ window.DCMQuoting.enabled = true; document.addEventListener("DOMNodeInsertedIntoDocument", function() { update(); }, false); document.addEventListener("DOMNodeInserted", function() { update(); }, false); }; var createSpan = function(){ var span = document.createElement("span"); span.setAttribute("style", "display:inline-block"); span.innerText = " [quote]"; span.className = "timestamp"; span.setAttribute("onclick", "DCMQuoting.clicked(this);"); return span; }; //Still no good way to get all messages with BetterDiscord (afaik meaning I'm probably wrong)... copy OP whilst using a mod id (mod id = expected amount of ghosts scripted installed + 2) var update = function(){ var messageEle = document.getElementsByClassName("messages")[0]; if (((typeof(messageEle)) !== 'undefined') && (window.DCMQuoting.enabled)) { var elements = messageEle.getElementsByTagName("div"); for (var i = 0, im = elements.length; im > i; i++) { var element = elements[i].getElementsByTagName("span"); for (var ia = 0, ima = element.length; ima > ia; ia++) { var content = element[ia].parentElement.parentElement; if ((content.className === "body") && (checkVal(content) === ghostModId)) content.getElementsByTagName("h2")[0].appendChild(createSpan()) } } } }; }; DCMQuotingPlugin.prototype.getName = function() { return "Quoting"; }; DCMQuotingPlugin.prototype.getDescription = function() { return "Quoting from Discord Client Modding ported by NotGGhost"; }; DCMQuotingPlugin.prototype.getVersion = function() { return "0.1.9"; }; DCMQuotingPlugin.prototype.getAuthor = function() { return "Ghost"; }; DCMQuotingPlugin.prototype.getSettingsPanel = function() { return '
