diff options
author | Jacques Erasmus <jerasmus@gitlab.com> | 2020-10-23 15:40:08 +0300 |
---|---|---|
committer | Jacques Erasmus <jerasmus@gitlab.com> | 2020-10-23 15:40:08 +0300 |
commit | ea37f4856ea7af2c5f888b3bea3a5487589d49a9 (patch) | |
tree | 2d6ad8c4d99e7e29f0f9e1b926a0fcabd631f72d /layouts/feedback.html | |
parent | fdd1fc948cd47c6b130e78e00b6b9e8f4e1b39eb (diff) |
Revert "Merge branch 'csp-headers' into 'master'"
This reverts merge request !1217
Diffstat (limited to 'layouts/feedback.html')
-rw-r--r-- | layouts/feedback.html | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/layouts/feedback.html b/layouts/feedback.html index 235ffdd1..5c69e7eb 100644 --- a/layouts/feedback.html +++ b/layouts/feedback.html @@ -60,7 +60,30 @@ <div id="disqus_thread" class="disqus-comments-gitlab"></div> - <script src="<%= @items['/assets/javascripts/disqus.*'].path %>"></script> + <script> + var disqus_config = function () { + this.page.url = '<%= @config[:base_url] %><%= @item.identifier.without_ext + '.html' %>'; + this.page.title = '<%= @item.key?(:title) ? "#{item[:title]} - GitLab Documentation" : "GitLab Documentation" %>'; + <% if @item[:disqus_identifier] %> + this.page.identifier = '<%= @item[:disqus_identifier] %>'; + <% else %> + this.page.identifier = '<%= @config[:base_url] %><%= @item.identifier.without_ext + '.html' %>'; + <% end %> + }; + + var is_disqus_loaded = false; + window.loadDisqus = function() { + if (!is_disqus_loaded){ + is_disqus_loaded = true; + var disqusThread = document.getElementById('disqus_thread'); + var d = document, s = d.createElement('script'); + disqusThread.innerHTML = ''; + s.src = 'https://gitlab-docs.disqus.com/embed.js'; + s.setAttribute('data-timestamp', +new Date()); + (d.head || d.body).appendChild(s); + } + }; + </script> <script src="<%= @items['/frontend/feedback/feedback.*'].path %>"></script> <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript> <% end %> |