-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrepropedia-generic.js
41 lines (39 loc) · 1.17 KB
/
repropedia-generic.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
40
41
/*
* Generic Repropedia Tooltip Loader
*
* Written for Northwestern University by gmazin (github.com/gmazin)
*
*/
(function($){
$(document).ready(function(){
var $ = document;
var cssId = 'repropediaCss';
if (!$.getElementById(cssId))
{
var head = $.getElementsByTagName('head')[0];
var link = $.createElement('link');
link.id = cssId;
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'https://raw.github.com/nuamps/RepropediaJS/master/css/repropedia.css';
link.media = 'all';
head.appendChild(link);
}
var jsId = 'repropediaJsf';
if (!$.getElementById(jsId))
{
var head = $.getElementsByTagName('head')[0];
var link = $.createElement('script');
link.id = jsId;
link.type = 'text/javascript';
link.addEventListener("load",function(){
Repropedia.init({
'CONSUMER_KEY' : 'YOUR_OAUTH_KEY_HERE',
'regions' : ['.element']
});
})
link.src = 'https://raw.github.com/nuamps/RepropediaJS/master/js/repropedia.js';
head.appendChild(link);
}
});
})(jQuery);