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 @@ #{h title} + alt="#{h title}" title="#{h title}" /> #{h title}
#{h author}
@@ -149,7 +158,7 @@ img = <<-HTML #{h label} + alt="#{h label}" title="#{h label}" /> HTML img.gsub!( /\t/, '' ) end @@ -168,7 +177,7 @@ image = <<-HTML #{h label} + 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( /

\Z/, '' ).gsub( /\]\]>/, ']]]]>' )}]]>
\n| + rdf << %Q|' ).gsub( /

\Z/, '' ).gsub( /\]\]>/, ']]]]>' )}]]>
\n| end rdf << "\n" end @@ -408,7 +408,7 @@ html = '' @makerss_rsses.each do |rss| next unless rss.url - html << %Q|\t\n| + html << %Q|\t\n| end html } @@ -432,10 +432,10 @@ end add_edit_proc do - checked = @cgi.params['makerss_update'][0] == 'false' ? ' checked' : '' + checked = @cgi.params['makerss_update'][0] == 'false' ? ' checked="checked"' : '' r = <<-HTML
HTML Index: search_control.rb =================================================================== RCS file: /cvsroot/tdiary/plugin/search_control.rb,v retrieving revision 1.8.2.2 diff -u -r1.8.2.2 search_control.rb --- search_control.rb 4 May 2007 04:02:24 -0000 1.8.2.2 +++ search_control.rb 11 Nov 2007 22:54:01 -0000 @@ -212,7 +212,7 @@ # output sw = @conf[_sc_vkey( view, number )] if sw then - %Q|\t\n| + %Q|\t\n| else '' end Index: en/amazon.rb =================================================================== RCS file: /cvsroot/tdiary/plugin/en/amazon.rb,v retrieving revision 1.11.2.2 diff -u -r1.11.2.2 amazon.rb --- en/amazon.rb 9 Feb 2007 16:13:01 -0000 1.11.2.2 +++ en/amazon.rb 11 Nov 2007 22:54:01 -0000 @@ -61,3 +61,5 @@ @amazon_label_usedefault = 'Use default image' @amazon_label_clearcache = 'Clear Cache' @amazon_label_clearcache_desc = 'Delete local cache file about book images' +@amazon_label_preview = 'Use Preview' +@amazon_label_preview_desc = 'Check if preview is used' Index: ja/amazon.rb =================================================================== RCS file: /cvsroot/tdiary/plugin/ja/amazon.rb,v retrieving revision 1.11.2.3 diff -u -r1.11.2.3 amazon.rb --- ja/amazon.rb 9 Feb 2007 16:13:01 -0000 1.11.2.3 +++ ja/amazon.rb 11 Nov 2007 22:54:01 -0000 @@ -77,3 +77,5 @@ @amazon_label_usedefault = 'デフォルトのイメージを使う' @amazon_label_clearcache = 'キャッシュの削除' @amazon_label_clearcache_desc = 'イメージ関連情報のキャッシュを削除する(Amazon上の表示と矛盾がある場合に試して下さい)' +@amazon_label_preview = '商品プレビューを使う' +@amazon_label_preview_desc = '商品プレビュー機能を使う場合はチェックして下さい' Index: zh/amazon.rb =================================================================== RCS file: /cvsroot/tdiary/plugin/zh/amazon.rb,v retrieving revision 1.6.2.2 diff -u -r1.6.2.2 amazon.rb --- zh/amazon.rb 9 Feb 2007 16:13:01 -0000 1.6.2.2 +++ zh/amazon.rb 11 Nov 2007 22:54:02 -0000 @@ -61,3 +61,5 @@ @amazon_label_usedefault = 'Use default image' @amazon_label_clearcache = 'Clear Cache' @amazon_label_clearcache_desc = 'Delete local cache file about book images' +@amazon_label_preview = 'Use Preview' +@amazon_label_preview_desc = 'Check if preview is used'