Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add developer and container_id options for comment threads.

Signed-off-by: Norman Clarke <norman@addthree.com>
  • Loading branch information...
commit 0de0c3a14250712c911d8746a0d4ce5f3fa03c59 1 parent fa3fe90
@qhoxie qhoxie authored Norman Clarke committed
Showing with 9 additions and 3 deletions.
  1. +3 −1 lib/disqus.rb
  2. +6 −2 lib/disqus/widget.rb
View
4 lib/disqus.rb
@@ -21,6 +21,8 @@ module Disqus
@defaults = {
:api_key => "",
:account => "",
+ :developer => false,
+ :container_id => 'disqus_thread',
:avatar_size => 48,
:color => "grey",
:default_tab => "popular",
@@ -67,4 +69,4 @@ def self.enable_merb
if defined?(Merb)
Disqus::enable_merb
-end
+end
View
8 lib/disqus/widget.rb
@@ -30,7 +30,11 @@ def thread(opts = {})
opts = Disqus::defaults.merge(opts)
opts[:view_thread_text] ||= "View the discussion thread"
validate_opts!(opts)
- s = '<div id="disqus_thread"></div>'
+ s = ''
+ if opts[:developer]
+ s << '<script type="text/javascript">var disqus_developer = 1;</script>'
+ end
+ s << '<div id="disqus_thread"></div>'
s << '<script type="text/javascript" src="' + THREAD + '"></script>'
s << '<noscript><a href="http://%s.disqus.com/?url=ref">'
s << opts[:view_thread_text]
@@ -178,4 +182,4 @@ def validate_opts!(opts)
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.