JAVASCRIPT 90
Disqus.js Guest on 10th June 2020 11:40:17 PM
  1. var disqus_url = embedVars.disqusUrl;
  2. var disqus_identifier = embedVars.disqusIdentifier;
  3. var disqus_container_id = 'disqus_thread';
  4. var disqus_shortname = embedVars.disqusShortname;
  5. var disqus_title = embedVars.disqusTitle;
  6. var disqus_config_custom = window.disqus_config;
  7. var disqus_config = function () {
  8.     /*
  9.     All currently supported events:
  10.     onReady: fires when everything is ready,
  11.     onNewComment: fires when a new comment is posted,
  12.     onIdentify: fires when user is authenticated
  13.     */
  14.     if (typeof embedVars.disqusConfig.remote_auth_s3 !== 'undefined') {
  15.         this.page.remote_auth_s3 = embedVars.disqusConfig.remote_auth_s3;
  16.     }
  17.  
  18.     if (typeof embedVars.disqusConfig.api_key !== 'undefined') {
  19.         this.page.api_key = embedVars.disqusConfig.api_key;
  20.     }
  21.  
  22.     if (typeof embedVars.disqusConfig.sso !== 'undefined') {
  23.         this.sso = {
  24.             name: embedVars.disqusConfig.sso.name,
  25.             button: embedVars.disqusConfig.sso.button,
  26.             url: embedVars.disqusConfig.sso.url,
  27.             logout: embedVars.disqusConfig.sso.logout,
  28.             width: embedVars.disqusConfig.sso.width,
  29.             height: embedVars.disqusConfig.sso.height
  30.         };
  31.     }
  32.  
  33.     this.language = embedVars.disqusConfig.language;
  34.     this.callbacks.onReady.push(function () {
  35.         if (!embedVars.options.manualSync) {
  36.             // sync comments in the background so we don't block the page
  37.             var script = document.createElement('script');
  38.             script.async = true;
  39.             script.src = '?cf_action=sync_comments&post_id=' + embedVars.postId;
  40.  
  41.             var firstScript = document.getElementsByTagName('script')[0];
  42.             firstScript.parentNode.insertBefore(script, firstScript);
  43.         }
  44.     });
  45.  
  46.     if (disqus_config_custom) {
  47.         disqus_config_custom.call(this);
  48.     }
  49. };
  50.  
  51. (function() {
  52.     var dsq = document.createElement('script'); dsq.type = 'text/javascript';
  53.     dsq.async = true;
  54.     dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
  55.     (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
  56. })();

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.