-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from LadyCaster/new_course
fix widget loading
- Loading branch information
Showing
8 changed files
with
289 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
document.addEventListener("DOMContentLoaded", function() { | ||
var script = document.getElementById('f5be3bcced9b8d99a4cc095aadcc152acc1c0aa02'); | ||
|
||
var par = script.parentNode; | ||
script.parentNode.style.overflow = 'hidden'; | ||
|
||
var iframe = document.createElement('iframe'); | ||
iframe.src = 'https://learnpythonru.getcourse.ru/pl/lite/widget/widget' | ||
+ "?" + window.location.search.substring(1) | ||
+ "&id=1151238" | ||
+ "&ref=" + encodeURIComponent(document.referrer) | ||
+ "&loc=" + encodeURIComponent(document.location.href); | ||
iframe.style.width = '100%'; | ||
iframe.style.height = '0px'; | ||
iframe.style.border = 'none'; | ||
iframe.style.overflow = 'hidden'; | ||
iframe.setAttribute('allowfullscreen', 'allowfullscreen'); | ||
iframe.className = '511'; | ||
iframe.id = 'c6b45c08ef83f13b64a41560165b2147de61cf2a' + '_' + iframe.className; | ||
// name можно получить изнутри iframe | ||
iframe.name = iframe.className; | ||
|
||
var iframeId = iframe.id; | ||
|
||
var gcEmbedOnMessage = function(e) { | ||
var insertedIframe = document.getElementById(iframeId); | ||
if (!insertedIframe) { | ||
return; | ||
} | ||
|
||
if (e.data.uniqName == 'f5be3bcced9b8d99a4cc095aadcc152acc1c0aa0') { | ||
if (e.data.height) { | ||
if (e.data.iframeName) { | ||
if (e.data.iframeName == iframe.name) { | ||
par.style.height = ( e.data.height ) + "px"; | ||
insertedIframe.style.height = (e.data.height) + "px"; | ||
} | ||
} else { | ||
par.style.height = ( e.data.height ) + "px"; | ||
insertedIframe.style.height = (e.data.height) + "px"; | ||
} | ||
} | ||
} | ||
}; | ||
|
||
if (window.addEventListener) { | ||
window.addEventListener("message", gcEmbedOnMessage, false); | ||
} else if (window.attachEvent) { | ||
window.attachEvent('onmessage', gcEmbedOnMessage) | ||
} else { | ||
window['onmessage'] = gcEmbedOnMessage | ||
} | ||
|
||
script.parentNode.insertBefore(iframe, script); | ||
par.removeChild( script ) | ||
}); | ||
|
||
var getLocation = function(href) { | ||
var l = document.createElement("a"); | ||
l.href = href; | ||
return l; | ||
}; | ||
|
||
var currentScript = document.currentScript || (function() { | ||
var scripts = document.getElementsByTagName('script'); | ||
return scripts[scripts.length - 1]; | ||
})(); | ||
|
||
var domain = ( (getLocation( currentScript.src )).hostname ); |
69 changes: 69 additions & 0 deletions
69
landing_page/mainpage/static/js/widgets/advance_widget_bottom.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
document.addEventListener("DOMContentLoaded", function() { | ||
var script = document.getElementById('f5be3bcced9b8d99a4cc095aadcc152acc1c0aa0'); | ||
|
||
var par = script.parentNode; | ||
script.parentNode.style.overflow = 'hidden'; | ||
|
||
var iframe = document.createElement('iframe'); | ||
iframe.src = 'https://learnpythonru.getcourse.ru/pl/lite/widget/widget' | ||
+ "?" + window.location.search.substring(1) | ||
+ "&id=1151238" | ||
+ "&ref=" + encodeURIComponent(document.referrer) | ||
+ "&loc=" + encodeURIComponent(document.location.href); | ||
iframe.style.width = '100%'; | ||
iframe.style.height = '0px'; | ||
iframe.style.border = 'none'; | ||
iframe.style.overflow = 'hidden'; | ||
iframe.setAttribute('allowfullscreen', 'allowfullscreen'); | ||
iframe.className = '51'; | ||
iframe.id = 'c6b45c08ef83f13b64a41560165b2147de61cf2a' + '_' + iframe.className; | ||
// name можно получить изнутри iframe | ||
iframe.name = iframe.className; | ||
|
||
var iframeId = iframe.id; | ||
|
||
var gcEmbedOnMessage = function(e) { | ||
var insertedIframe = document.getElementById(iframeId); | ||
if (!insertedIframe) { | ||
return; | ||
} | ||
|
||
if (e.data.uniqName == 'f5be3bcced9b8d99a4cc095aadcc152acc1c0aa0') { | ||
if (e.data.height) { | ||
if (e.data.iframeName) { | ||
if (e.data.iframeName == iframe.name) { | ||
par.style.height = ( e.data.height ) + "px"; | ||
insertedIframe.style.height = (e.data.height) + "px"; | ||
} | ||
} else { | ||
par.style.height = ( e.data.height ) + "px"; | ||
insertedIframe.style.height = (e.data.height) + "px"; | ||
} | ||
} | ||
} | ||
}; | ||
|
||
if (window.addEventListener) { | ||
window.addEventListener("message", gcEmbedOnMessage, false); | ||
} else if (window.attachEvent) { | ||
window.attachEvent('onmessage', gcEmbedOnMessage) | ||
} else { | ||
window['onmessage'] = gcEmbedOnMessage | ||
} | ||
|
||
script.parentNode.insertBefore(iframe, script); | ||
par.removeChild( script ) | ||
}); | ||
|
||
var getLocation = function(href) { | ||
var l = document.createElement("a"); | ||
l.href = href; | ||
return l; | ||
}; | ||
|
||
var currentScript = document.currentScript || (function() { | ||
var scripts = document.getElementsByTagName('script'); | ||
return scripts[scripts.length - 1]; | ||
})(); | ||
|
||
var domain = ( (getLocation( currentScript.src )).hostname ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
console.log('in file') | ||
|
||
document.addEventListener("DOMContentLoaded", function() { | ||
var script = document.getElementById('3e6321862d90cf3a72c6198927067b35e82b0b822'); | ||
// var script = document.currentScript; | ||
var par = script.parentNode; | ||
script.parentNode.style.overflow = 'hidden'; | ||
|
||
var iframe = document.createElement('iframe'); | ||
iframe.src = 'https://learnpythonru.getcourse.ru/pl/lite/widget/widget' | ||
+ "?" + window.location.search.substring(1) | ||
+ "&id=1139675" | ||
+ "&ref=" + encodeURIComponent(document.referrer) | ||
+ "&loc=" + encodeURIComponent(document.location.href); | ||
iframe.style.width = '100%'; | ||
iframe.style.height = '0px'; | ||
iframe.style.border = 'none'; | ||
iframe.style.overflow = 'hidden'; | ||
iframe.setAttribute('allowfullscreen', 'allowfullscreen'); | ||
iframe.className = '941'; | ||
iframe.id = 'cc9d55a8a649fc463bf0a580d1c0567f6542b153' + '_' + iframe.className; | ||
// name можно получить изнутри iframe | ||
iframe.name = iframe.className; | ||
|
||
var iframeId = iframe.id; | ||
|
||
var gcEmbedOnMessage = function(e) { | ||
var insertedIframe = document.getElementById(iframeId); | ||
if (!insertedIframe) { | ||
return; | ||
} | ||
|
||
if (e.data.uniqName == '3e6321862d90cf3a72c6198927067b35e82b0b82') { | ||
if (e.data.height) { | ||
if (e.data.iframeName) { | ||
if (e.data.iframeName == iframe.name) { | ||
par.style.height = ( e.data.height ) + "px"; | ||
insertedIframe.style.height = (e.data.height) + "px"; | ||
} | ||
} else { | ||
par.style.height = ( e.data.height ) + "px"; | ||
insertedIframe.style.height = (e.data.height) + "px"; | ||
} | ||
} | ||
} | ||
}; | ||
|
||
if (window.addEventListener) { | ||
window.addEventListener("message", gcEmbedOnMessage, false); | ||
} else if (window.attachEvent) { | ||
window.attachEvent('onmessage', gcEmbedOnMessage) | ||
} else { | ||
window['onmessage'] = gcEmbedOnMessage | ||
} | ||
|
||
script.parentNode.insertBefore(iframe, script); | ||
par.removeChild( script ) | ||
}); | ||
|
||
var getLocation = function(href) { | ||
var l = document.createElement("a"); | ||
l.href = href; | ||
return l; | ||
}; | ||
|
||
var currentScript = document.currentScript || (function() { | ||
var scripts = document.getElementsByTagName('script'); | ||
return scripts[scripts.length - 1]; | ||
})(); | ||
|
||
var domain = ( (getLocation( currentScript.src )).hostname ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
console.log('in file') | ||
|
||
document.addEventListener("DOMContentLoaded", function() { | ||
var script = document.getElementById('3e6321862d90cf3a72c6198927067b35e82b0b82'); | ||
// var script = document.currentScript; | ||
var par = script.parentNode; | ||
script.parentNode.style.overflow = 'hidden'; | ||
|
||
var iframe = document.createElement('iframe'); | ||
iframe.src = 'https://learnpythonru.getcourse.ru/pl/lite/widget/widget' | ||
+ "?" + window.location.search.substring(1) | ||
+ "&id=1139675" | ||
+ "&ref=" + encodeURIComponent(document.referrer) | ||
+ "&loc=" + encodeURIComponent(document.location.href); | ||
iframe.style.width = '100%'; | ||
iframe.style.height = '0px'; | ||
iframe.style.border = 'none'; | ||
iframe.style.overflow = 'hidden'; | ||
iframe.setAttribute('allowfullscreen', 'allowfullscreen'); | ||
iframe.className = '940'; | ||
iframe.id = 'cc9d55a8a649fc463bf0a580d1c0567f6542b153' + '_' + iframe.className; | ||
// name можно получить изнутри iframe | ||
iframe.name = iframe.className; | ||
|
||
var iframeId = iframe.id; | ||
|
||
var gcEmbedOnMessage = function(e) { | ||
var insertedIframe = document.getElementById(iframeId); | ||
if (!insertedIframe) { | ||
return; | ||
} | ||
|
||
if (e.data.uniqName == '3e6321862d90cf3a72c6198927067b35e82b0b82') { | ||
if (e.data.height) { | ||
if (e.data.iframeName) { | ||
if (e.data.iframeName == iframe.name) { | ||
par.style.height = ( e.data.height ) + "px"; | ||
insertedIframe.style.height = (e.data.height) + "px"; | ||
} | ||
} else { | ||
par.style.height = ( e.data.height ) + "px"; | ||
insertedIframe.style.height = (e.data.height) + "px"; | ||
} | ||
} | ||
} | ||
}; | ||
|
||
if (window.addEventListener) { | ||
window.addEventListener("message", gcEmbedOnMessage, false); | ||
} else if (window.attachEvent) { | ||
window.attachEvent('onmessage', gcEmbedOnMessage) | ||
} else { | ||
window['onmessage'] = gcEmbedOnMessage | ||
} | ||
|
||
script.parentNode.insertBefore(iframe, script); | ||
par.removeChild( script ) | ||
}); | ||
|
||
var getLocation = function(href) { | ||
var l = document.createElement("a"); | ||
l.href = href; | ||
return l; | ||
}; | ||
|
||
var currentScript = document.currentScript || (function() { | ||
var scripts = document.getElementsByTagName('script'); | ||
return scripts[scripts.length - 1]; | ||
})(); | ||
|
||
var domain = ( (getLocation( currentScript.src )).hostname ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters