forked from smartchicago/kimball
-
Notifications
You must be signed in to change notification settings - Fork 2
/
embed_code_for_new_people.html
40 lines (40 loc) · 1.3 KB
/
embed_code_for_new_people.html
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
<iframe id="patterns_iframe" src="#"></iframe>
<script>
document.getElementById('patterns_iframe').src="https://patterns.brl.nyc/public/people/new?referrer=" + window.location.href;
var jQueryScriptOutputted = false;
function initJQuery() {
//if the jQuery object isn't available
if (typeof(jQuery) === 'undefined') {
if (! jQueryScriptOutputted) {
//only output the script once..
jQueryScriptOutputted = true;
//output the script (load it from google api)
var s = document.createElement('script');
s.src ="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js";
document.head.appendChild(s);
}
setTimeout("initJQuery()", 50);
} else {
jQuery(function() {
var s = document.createElement('script');
s.src = "https://patterns.brl.nyc/js/seamless.parent.min.js";
document.head.appendChild(s);
setTimeout("initSeamless()", 50);
});
}
}
function initSeamless(){
jQuery(function() {
if (jQuery.isFunction(jQuery.fn.seamless)){
var child = jQuery('#patterns_iframe').seamless();
var cssSheets = jQuery.map(document.styleSheets,function(n,style){
return n.href ? n.href : null;
});
child.send({ stylesheets: cssSheets});
}else{
setTimeout("initSeamless()", 50);
}
});
}
initJQuery();
</script>