forked from oaa-tools/bookmarklets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
loader.js
39 lines (34 loc) · 1.87 KB
/
loader.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
(function (baseUrl, src) {
var done, link, script, head;
function createLink() {
var el = document.createElement('link');
el.rel = 'stylesheet';
el.type = 'text/css';
el.href = baseUrl + 'oaa-utils.css';
return el;
}
if (typeof window.OAAUtils === 'undefined') {
done = false;
link = createLink();
script = document.createElement('script');
script.src = baseUrl + 'oaa-utils.js';
script.onload = script.onreadystatechange = function () {
if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) {
done = true;
initMyBookmarklet();
}
};
head = document.getElementsByTagName('head')[0];
head.appendChild(script);
head.appendChild(link);
}
else {
initMyBookmarklet();
}
function initMyBookmarklet() {
var el=document.createElement('script');
el.setAttribute('src', baseUrl + src);
document.body.appendChild(el);
}
})('https://raw.githubusercontent.com/brandonbowersox/bookmarklets/master/', 'message.js');
(function(baseUrl,src){var done,link,script,head;function createLink(){var el=document.createElement('link');el.rel='stylesheet';el.type='text/css';el.href=baseUrl+'oaa-utils.css';return el}if(typeof window.OAAUtils==='undefined'){done=false;link=createLink();script=document.createElement('script');script.src=baseUrl+'oaa-utils.js';script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=='loaded'||this.readyState=='complete')){done=true;initMyBookmarklet()}};head=document.getElementsByTagName('head')[0];head.appendChild(script);head.appendChild(link)}else{initMyBookmarklet()}function initMyBookmarklet(){var el=document.createElement('script');el.setAttribute('src',baseUrl+src);document.body.appendChild(el)}})('https://raw.githubusercontent.com/brandonbowersox/bookmarklets/master/','message.js');