scratch/lib/intenseDebate.rb

27 lines
821 B
Ruby
Raw Normal View History

def getMainpage
2011-02-01 22:43:10 +00:00
if @item.parent.nil? or @item.parent.parent.nil? or @item.parent.parent.parent.nil?
return
end
2011-02-01 22:43:10 +00:00
if @item.parent.parent.parent.parent.nil?
return @item
else
return @item.parent
end
end
def generateIntenseDebateThread
mainpage=getMainpage
protectedPath=mainpage.path.gsub(/'/,"%27")
protectedTitle=mainpage[:title].gsub(/'/,"%27")
%{
<script type="text/javascript">
var idcomments_acct = 'a307f0044511ff1b5cfca573fc0a52e7';
var idcomments_post_id = '#{protectedPath}';
var idcomments_post_url = 'http://yannesposito.com#{protectedPath}';
</script>
<span id="IDCommentsPostTitle" style="display:none"></span>
2011-04-20 12:29:01 +00:00
<script type='text/javascript' src='#{@config[:webprefix]}/js/genericCommentWrapperV2.js'></script>
}
end