Advertisement
Guest User

Untitled

a guest
Sep 30th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. ...
  2. <content select=".disqus1"></content>
  3. </template>
  4.  
  5. <script>
  6. Polymer({
  7. is: 'my-testView1',
  8.  
  9. ready: function ()
  10. {
  11. var disqus_config = function () {
  12. this.page.url = 'https://www.example.com/testView1';
  13. this.page.identifier = '/testView1';
  14. this.page.disqus_shortname = "myChannelID";
  15. };
  16.  
  17. (function() {
  18. var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
  19. dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
  20. (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
  21. })();
  22.  
  23. }
  24. });
  25. </script>
  26.  
  27. ...
  28. <content select=".disqus2"></content>
  29. </template>
  30.  
  31. <script>
  32. Polymer({
  33. is: 'my-testView2',
  34.  
  35. ready: function ()
  36. {
  37. var reset = function (newIdentifier, newUrl) {
  38. DISQUS.reset({
  39. reload: true,
  40. config: function () {
  41. this.page.identifier = 'https://www.example.com/testView2';
  42. this.page.url = '/testView2';
  43. }
  44. });
  45. };
  46.  
  47. (function() {
  48. var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
  49. dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
  50. (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
  51. })();
  52.  
  53. }
  54. });
  55. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement