Skip to content
This repository was archived by the owner on Mar 29, 2021. It is now read-only.

Commit

Permalink
var -> let
Browse files Browse the repository at this point in the history
support should long be sufficient
  • Loading branch information
Idrinth committed May 30, 2018
1 parent dd6af7e commit 21603ad
Show file tree
Hide file tree
Showing 17 changed files with 316 additions and 316 deletions.
26 changes: 13 additions & 13 deletions src/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@
window.location.host === "web1.dawnofthedragons.com" ||
window.location.host === "dotd-web1.5thplanetgames.com"
) {
var f = function() {
console.log("s");
window.idrinth = {};
window.idrinth.add= function(data) {
var s = document.createElement("script");
s.appendChild(document.createTextNode(data));
document.getElementsByTagName("head")[0].appendChild(s);
};
let f = function() {
window.idrinth = {
add: function(data) {
let s = document.createElement("script");
s.appendChild(document.createTextNode(data));
document.getElementsByTagName("head")[0].appendChild(s);
}
};
window.addEventListener(
"message",
function(event) {
try {
var data = JSON.parse(event.data);
let data = JSON.parse(event.data);
if (
!data ||
data.to !== "idotd" ||
Expand All @@ -63,13 +63,13 @@
false
);
};
var sc = document.createElement("script");
let sc = document.createElement("script");
sc.setAttribute("id", "idotd-loader");
sc.appendChild(document.createTextNode('('+f.toString()+'());'));
document.getElementsByTagName("head")[0].appendChild(sc);
return;
}
var sc = document.createElement("script");
let sc = document.createElement("script");
sc.setAttribute(
"src",
"https://dotd.idrinth.de/static/userscript/" + GM_info.script.version + "/"
Expand All @@ -78,9 +78,9 @@
sc.setAttribute("async", "async");
sc.errorCounter = 0;
sc.errorFunction = function() {
var self = document.getElementById("idotd-loader");
let self = document.getElementById("idotd-loader");
self.parentNode.removeChild(self);
var sc = document.createElement("script");
let sc = document.createElement("script");
sc.onerror = self.onerror;
sc.errorCounter = self.errorCounter + 1;
sc.errorFunction = self.errorFunction;
Expand Down
Loading

0 comments on commit 21603ad

Please sign in to comment.