Created
October 5, 2018 13:24
-
-
Save BaalEvan/2ff7b3d3084378545b1c87f3dab29dd9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| window.onload = function () { | |
| var readme = document.querySelector('.section'); | |
| if (readme) { | |
| //var readmeParent = readme.parentElement; | |
| var disqusContainer = document.createElement("div"); | |
| disqusContainer.setAttribute("id", "disqus_thread"); | |
| readme.append(disqusContainer); | |
| /* * * DON'T EDIT BELOW THIS LINE * * */ | |
| (function () { | |
| var url = window.location.toString(); | |
| url = url.replace(/(.*unity3d\.com\/)([\d\.bf]*\/Documentation\/)?(.*)/, "$1$3"); | |
| var code = "var disqus_config = function ()\n" | |
| + "{this.page.identifier = '"+url+"';\n" | |
| + "this.page.url = '"+url+"';\n" | |
| + "};"; | |
| var dsq2 = document.createElement('script'); | |
| dsq2.type = 'text/javascript'; | |
| dsq2.text = code; | |
| (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq2); | |
| var dsq = document.createElement('script'); | |
| dsq.type = 'text/javascript'; | |
| dsq.async = true; | |
| dsq.setAttribute('data-timestamp', +new Date()); | |
| dsq.src = 'https://unitycomments.disqus.com/embed.js'; | |
| (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); | |
| })(); | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment