Permalink
Browse files

Add developer and container_id options for comment threads.

Signed-off-by: Norman Clarke <norman@addthree.com>
  • Loading branch information...
1 parent fa3fe90 commit 0de0c3a14250712c911d8746a0d4ce5f3fa03c59 @qhoxie qhoxie committed with Norman Clarke Jan 13, 2009
Showing with 9 additions and 3 deletions.
  1. +3 −1 lib/disqus.rb
  2. +6 −2 lib/disqus/widget.rb
View
@@ -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
@@ -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

0 comments on commit 0de0c3a

Please sign in to comment.