Index: amazon.rb
===================================================================
RCS file: /cvsroot/tdiary/plugin/amazon.rb,v
retrieving revision 1.48.2.14
diff -u -r1.48.2.14 amazon.rb
--- amazon.rb 5 May 2007 21:48:37 -0000 1.48.2.14
+++ amazon.rb 11 Nov 2007 22:54:00 -0000
@@ -7,6 +7,7 @@
#
require 'open-uri'
require 'timeout'
+require 'uri'
require 'rexml/document'
# do not change these variables
@@ -83,7 +84,15 @@
end
def amazon_url( item )
- item.elements.to_a( 'DetailPageURL' )[0].text
+ if not @conf['amazon.preview'] then
+ item.elements.to_a( 'DetailPageURL' )[0].text
+ else
+ asin = item.elements.to_a( 'ASIN' )[0].text
+ uri = URI::parse(item.elements.to_a( 'DetailPageURL' )[0].text)
+ uri.path = '/gp/product/' + asin + '/'
+ uri.query = 'tag=' + @conf['amazon.aid']
+ uri.to_s
+ end
end
def amazon_label( item )
@@ -120,7 +129,7 @@
+ alt="#{h title}" title="#{h title}" />
#{h title} #{h author}
@@ -149,7 +158,7 @@
img = <<-HTML
+ alt="#{h label}" title="#{h label}" />
HTML
img.gsub!( /\t/, '' )
end
@@ -168,7 +177,7 @@
image = <<-HTML
+ alt="#{h label}" title="#{h label}" />
HTML
end
image.gsub!( /\t/, '' )
@@ -248,6 +257,8 @@
end
end
end
+
+ @conf['amazon.preview'] = (@cgi.params['amazon.preview'][0] == 'true')
end
unless @conf['amazon.hideconf'] then
@conf['amazon.aid'] = @cgi.params['amazon.aid'][0]
@@ -278,6 +289,8 @@
#{@amazon_label_clearcache}
+
#{@amazon_label_preview}
+
HTML
end
end
@@ -316,3 +329,18 @@
alias isbnImgRight isbn_image_right
alias isbnImg isbn_image
alias amazon isbn_image
+
+# Imported from http://different-view.jp/~vette/108/amazon_preview.rb.html
+add_footer_proc do
+ aid = @conf['amazon.aid'] || ''
+ if @conf['amazon.preview'] and not aid.empty? and not @cgi.mobile_agent? then
+ <<-SCRIPT
+
+
+
+
+ SCRIPT
+ else
+ ''
+ end
+end
Index: bq.rb
===================================================================
RCS file: /cvsroot/tdiary/plugin/bq.rb,v
retrieving revision 1.4.2.2
diff -u -r1.4.2.2 bq.rb
--- bq.rb 17 Jan 2007 00:39:55 -0000 1.4.2.2
+++ bq.rb 11 Nov 2007 22:54:00 -0000
@@ -26,7 +26,7 @@
else
result = %Q[
\n]
end
- result << %Q[
#{src.gsub( /\n/, "
\n
" )}
\n].sub( %r[], '' )
+ result << %Q[
#{src.gsub( /\n\n/, "
\n
" ).gsub( /\n/, " \n" )}
\n].sub( %r[], '' )
result << %Q[
\n]
if url then
cite = %Q[#{title}]
@@ -35,6 +35,6 @@
cite = %Q[#{title}]
result << %Q[
[#{bq_cite_from( cite )}]
\n]
end
- result
+ %Q[\n] + result + %Q[
]
end
Index: category.rb
===================================================================
RCS file: /cvsroot/tdiary/plugin/category.rb,v
retrieving revision 1.34.2.9
diff -u -r1.34.2.9 category.rb
--- category.rb 28 Sep 2007 09:23:00 -0000 1.34.2.9
+++ category.rb 11 Nov 2007 22:54:01 -0000
@@ -183,8 +183,8 @@
end
params = ''
- params << %Q[] if info.year
- params << %Q[] if info.month
+ params << %Q[] if info.year
+ params << %Q[] if info.month
<
@@ -192,7 +192,7 @@
#{options}
#{params}
-
+
HTML
end
@@ -621,9 +621,9 @@
ret << '
'
ret << "#{@category_conf_label}:\n"
@categories.each do |c|
- ret << %Q!| #{h c}\n!
+ ret << %Q!| #{h c}\n!
end
- ret << "|\n
\n \n"
+ ret << "|\n\n \n"
end
end
Index: edit_today.rb
===================================================================
RCS file: /cvsroot/tdiary/plugin/edit_today.rb,v
retrieving revision 1.2.2.5
diff -u -r1.2.2.5 edit_today.rb
--- edit_today.rb 22 Jul 2007 19:52:39 -0000 1.2.2.5
+++ edit_today.rb 11 Nov 2007 22:54:01 -0000
@@ -19,7 +19,7 @@
unless @conf.mobile_agent?
r = <<-HTML
#{title}\n
- #{caption}
+ [#{caption}]
HTML
else
Index: footnote.rb
===================================================================
RCS file: /cvsroot/tdiary/plugin/footnote.rb,v
retrieving revision 1.9.2.5
diff -u -r1.9.2.5 footnote.rb
--- footnote.rb 21 Feb 2007 03:55:38 -0000 1.9.2.5
+++ footnote.rb 11 Nov 2007 22:54:01 -0000
@@ -36,7 +36,7 @@
r << %Q|#{mark}#{idx}|
else
r << %Q||
r << %Q|#{mark}#{idx}|
@@ -63,7 +63,7 @@
r << %Q|#{h @fn_marks[idx]}#{idx+1}|
else
r << %Q||
r << %Q|#{h @fn_marks[idx]}#{idx+1}|
r << %Q||
Index: highlight.rb
===================================================================
RCS file: /cvsroot/tdiary/plugin/highlight.rb,v
retrieving revision 1.9.2.3
diff -u -r1.9.2.3 highlight.rb
--- highlight.rb 15 Jul 2007 18:41:09 -0000 1.9.2.3
+++ highlight.rb 11 Nov 2007 22:54:01 -0000
@@ -7,9 +7,15 @@
# You can redistribute it and/or modify it under GPL2.
#
if @mode == 'day' and not bot? then
+ is_xhtml = (/application\/xhtml\+xml/ =~ ENV['HTTP_ACCEPT'])
+ is_xhtml = false # for SnapShots (TM)
add_footer_proc do
- <<-SCRIPT
-
+ // -->
+ SCRIPT
+ html << "]]>\n" if is_xhtml
+ html <<<<-SCRIPT
+
SCRIPT
+ html
end
end
Index: makerss.rb
===================================================================
RCS file: /cvsroot/tdiary/plugin/makerss.rb,v
retrieving revision 1.46.2.10
diff -u -r1.46.2.10 makerss.rb
--- makerss.rb 23 Sep 2007 08:31:48 -0000 1.46.2.10
+++ makerss.rb 11 Nov 2007 22:54:01 -0000
@@ -389,7 +389,7 @@
text = rdfsec.section.body
rdf << %Q|#{h makerss_desc_shorten( text )}\n|
unless @conf['makerss.hidecontent']
- rdf << %Q|' ).gsub( /