File: cocomment.rb

package info (click to toggle)
tdiary-contrib 5.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,772 kB
  • sloc: ruby: 17,305; javascript: 8,263; lisp: 562; xml: 451; php: 61; sql: 40; makefile: 18
file content (37 lines) | stat: -rw-r--r-- 986 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# cocomment.rb $Revision: 1.6 $
#
# Copyright (C) 2006 by Hiroshi SHIBATA
# You can redistribute it and/or modify it under GPL2.
#

if @mode == 'day' and not bot?
	add_body_enter_proc do |date|
		<<-SCRIPT
		<script type="text/javascript">
		coco =
		{
			 blogTool					: "tDiary",
			 blogURL						: "#{h @conf.base_url}",
			 blogTitle					: "#{h @conf.html_title}",
			 postURL						: "#{h @conf.base_url + anchor( date.strftime( '%Y%m%d' ) )}",
			 postTitle					: "#{h apply_plugin( @diaries[date.strftime('%Y%m%d')].title, true )}",
			 commentAuthorFieldName : "name",
			 commentAuthorLoggedIn	: false,
			 commentFormName			: "comment-form",
			 commentTextFieldName	: "body",
			 commentButtonName		: "comment"
		}
		</script>
		<script id="cocomment-fetchlet" src="http://www.cocomment.com/js/enabler.js" type="text/javascript">
		</script>
		SCRIPT
	end
end

# Local Variables:
# mode: ruby
# indent-tabs-mode: t
# tab-width: 3
# ruby-indent-level: 3
# End:
# vi: ts=3 sw=3