Skip to content
This repository has been archived by the owner on Dec 5, 2017. It is now read-only.

Commit

Permalink
Add developer and container_id options for comment threads.
Browse files Browse the repository at this point in the history
Signed-off-by: Norman Clarke <norman@addthree.com>
  • Loading branch information
qhoxie authored and Norman Clarke committed Jan 17, 2009
1 parent fa3fe90 commit 0de0c3a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/disqus.rb
Expand Up @@ -21,6 +21,8 @@ module Disqus
@defaults = { @defaults = {
:api_key => "", :api_key => "",
:account => "", :account => "",
:developer => false,
:container_id => 'disqus_thread',
:avatar_size => 48, :avatar_size => 48,
:color => "grey", :color => "grey",
:default_tab => "popular", :default_tab => "popular",
Expand Down Expand Up @@ -67,4 +69,4 @@ def self.enable_merb


if defined?(Merb) if defined?(Merb)
Disqus::enable_merb Disqus::enable_merb
end end
8 changes: 6 additions & 2 deletions lib/disqus/widget.rb
Expand Up @@ -30,7 +30,11 @@ def thread(opts = {})
opts = Disqus::defaults.merge(opts) opts = Disqus::defaults.merge(opts)
opts[:view_thread_text] ||= "View the discussion thread" opts[:view_thread_text] ||= "View the discussion thread"
validate_opts!(opts) 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 << '<script type="text/javascript" src="' + THREAD + '"></script>'
s << '<noscript><a href="http://%s.disqus.com/?url=ref">' s << '<noscript><a href="http://%s.disqus.com/?url=ref">'
s << opts[:view_thread_text] s << opts[:view_thread_text]
Expand Down Expand Up @@ -178,4 +182,4 @@ def validate_opts!(opts)


end end


end end

0 comments on commit 0de0c3a

Please sign in to comment.