tdiary-contrib 3.2.2.20130518
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/.travis.yml +7 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +35 -0
- data/README.en.md +12 -0
- data/README.md +13 -0
- data/Rakefile +41 -0
- data/doc/en/filter/spambayes.txt +3 -0
- data/doc/en/plugin.txt +1 -0
- data/doc/en/style/hatena.txt +10 -0
- data/doc/en/style/markdown.txt +16 -0
- data/doc/en/util.txt +1 -0
- data/doc/ja/filter/antirefspam.history.txt +59 -0
- data/doc/ja/filter/antirefspam.txt +86 -0
- data/doc/ja/filter/comment_key.ja.html +182 -0
- data/doc/ja/filter/spambayes.txt +3 -0
- data/doc/ja/plugin/add_bookmark.txt +50 -0
- data/doc/ja/plugin/category_to_tag.txt +21 -0
- data/doc/ja/plugin/cocoment.txt +31 -0
- data/doc/ja/plugin/google_adsense.txt +25 -0
- data/doc/ja/plugin/google_analytics.txt +7 -0
- data/doc/ja/plugin/image_detail.txt +69 -0
- data/doc/ja/plugin/image_gps.txt +36 -0
- data/doc/ja/plugin/image_gps2.txt +41 -0
- data/doc/ja/plugin/livedoor_weather.txt +105 -0
- data/doc/ja/plugin/opensearch_ad.txt +16 -0
- data/doc/ja/plugin/section_footer.txt +84 -0
- data/doc/ja/plugin/select_theme.txt +1 -0
- data/doc/ja/plugin.txt +13 -0
- data/doc/ja/style/hatena.txt +10 -0
- data/doc/ja/style/markdown.txt +13 -0
- data/doc/ja/util.txt +12 -0
- data/filter/antirefspam.rb +263 -0
- data/filter/commentkey.rb +29 -0
- data/filter/commentsize.rb +18 -0
- data/filter/hidecomment.rb +13 -0
- data/filter/iplookup.rb +55 -0
- data/filter/plugin/antirefspam.rb +59 -0
- data/filter/plugin/commentkey.rb +58 -0
- data/filter/plugin/commentsize.rb +12 -0
- data/filter/plugin/en/iplookup.rb +9 -0
- data/filter/plugin/en/spambayes.rb +123 -0
- data/filter/plugin/iplookup.rb +39 -0
- data/filter/plugin/ja/antirefspam.rb +91 -0
- data/filter/plugin/ja/commentkey.rb +17 -0
- data/filter/plugin/ja/commentsize.rb +6 -0
- data/filter/plugin/ja/iplookup.rb +9 -0
- data/filter/plugin/ja/spambayes.rb +124 -0
- data/filter/plugin/spambayes.rb +501 -0
- data/filter/plugin/zh/iplookup.rb +9 -0
- data/filter/rblcheck.rb +36 -0
- data/filter/spambayes.rb +535 -0
- data/filter/spamlookup.rb +37 -0
- data/io/dbi_io/ChangeLog +19 -0
- data/io/dbi_io/README.ja +39 -0
- data/io/dbi_io/dbi_io.rb +181 -0
- data/io/dbi_io/plugin/refererDbiIO.rb +76 -0
- data/io/dbi_io/tdiary_table.sql +42 -0
- data/js/appstore.js +109 -0
- data/js/datepicker.js +69 -0
- data/js/editor.js +82 -0
- data/js/flickr.js +157 -0
- data/js/image_ex.js +79 -0
- data/js/jquery.socialbutton.js +842 -0
- data/js/nicovideo.js +17 -0
- data/js/picasa.js +322 -0
- data/js/plugin_checker.js +71 -0
- data/js/prettify/lang-apollo.js +2 -0
- data/js/prettify/lang-clj.js +18 -0
- data/js/prettify/lang-css.js +2 -0
- data/js/prettify/lang-go.js +1 -0
- data/js/prettify/lang-hs.js +2 -0
- data/js/prettify/lang-lisp.js +3 -0
- data/js/prettify/lang-lua.js +2 -0
- data/js/prettify/lang-ml.js +2 -0
- data/js/prettify/lang-n.js +4 -0
- data/js/prettify/lang-proto.js +1 -0
- data/js/prettify/lang-scala.js +2 -0
- data/js/prettify/lang-sql.js +2 -0
- data/js/prettify/lang-tex.js +1 -0
- data/js/prettify/lang-vb.js +2 -0
- data/js/prettify/lang-vhdl.js +3 -0
- data/js/prettify/lang-wiki.js +2 -0
- data/js/prettify/lang-xq.js +3 -0
- data/js/prettify/lang-yaml.js +2 -0
- data/js/prettify/prettify.css +1 -0
- data/js/prettify/prettify.js +28 -0
- data/js/referer.js +17 -0
- data/js/show_and_hide.js +39 -0
- data/js/socialbutton.js +126 -0
- data/js/twitter_anywhere.js +28 -0
- data/js/yahoo_kousei.js +21 -0
- data/lib/bayes/convert.rb +34 -0
- data/lib/bayes.rb +232 -0
- data/lib/exifparser/BUGS +1 -0
- data/lib/exifparser/ChangeLog +169 -0
- data/lib/exifparser/README +15 -0
- data/lib/exifparser/install.rb +1015 -0
- data/lib/exifparser/lib/exifparser/makernote/canon.rb +502 -0
- data/lib/exifparser/lib/exifparser/makernote/fujifilm.rb +415 -0
- data/lib/exifparser/lib/exifparser/makernote/minolta.rb +84 -0
- data/lib/exifparser/lib/exifparser/makernote/mk_nikonflensname.rb +39 -0
- data/lib/exifparser/lib/exifparser/makernote/nikon.rb +267 -0
- data/lib/exifparser/lib/exifparser/makernote/nikon2.rb +581 -0
- data/lib/exifparser/lib/exifparser/makernote/nikonflensname.rb +438 -0
- data/lib/exifparser/lib/exifparser/makernote/olympus.rb +225 -0
- data/lib/exifparser/lib/exifparser/makernote/prove.rb +84 -0
- data/lib/exifparser/lib/exifparser/makernote/sigma.rb +237 -0
- data/lib/exifparser/lib/exifparser/pre-setup.rb +1 -0
- data/lib/exifparser/lib/exifparser/scan.rb +278 -0
- data/lib/exifparser/lib/exifparser/tag.rb +2298 -0
- data/lib/exifparser/lib/exifparser/thumbnail.rb +76 -0
- data/lib/exifparser/lib/exifparser/utils.rb +88 -0
- data/lib/exifparser/lib/exifparser.rb +265 -0
- data/lib/exifparser/sample/exifview.rb +279 -0
- data/lib/tdiary-contrib.rb +19 -0
- data/lib/wgs2tky.rb +93 -0
- data/misc/section_footer2/buzzurl.yaml +6 -0
- data/misc/section_footer2/fc2.yaml +6 -0
- data/misc/section_footer2/ldc.yaml +6 -0
- data/misc/section_footer2/retweet.yaml +7 -0
- data/misc/section_footer2/twitter.yaml +7 -0
- data/misc/section_footer2/yahoo.yaml +6 -0
- data/misc/tdiarygraph/tdiarygraph120x90e.swf +0 -0
- data/misc/tdiarygraph/tdiarygraph125x125e.swf +0 -0
- data/misc/tdiarygraph/tdiarygraph240x180e.swf +0 -0
- data/misc/tdiarygraph/tdiarygraph468x60e.swf +0 -0
- data/misc/tdiarygraph/tdiarygraph728x90e.swf +0 -0
- data/misc/tdiarytimes/tdiarytimes125x125r.swf +0 -0
- data/misc/tdiarytimes/tdiarytimes125x125r7.swf +0 -0
- data/misc/tdiarytimes/tdiarytimes125x125s.swf +0 -0
- data/misc/tdiarytimes/tdiarytimes125x30.swf +0 -0
- data/misc/tdiarytimes/tdiarytimes234x30.swf +0 -0
- data/misc/tdiarytimes/tdiarytimes468x30.swf +0 -0
- data/plugin/add_bookmark.rb +89 -0
- data/plugin/apple_webclip.rb +26 -0
- data/plugin/appstore.rb +47 -0
- data/plugin/bigpresen.rb +86 -0
- data/plugin/bitly.rb +39 -0
- data/plugin/bootstrap-navi.rb +54 -0
- data/plugin/canonical.rb +9 -0
- data/plugin/category_similar.rb +73 -0
- data/plugin/category_to_tag.rb +60 -0
- data/plugin/category_to_tagcloud.rb +172 -0
- data/plugin/cocomment.rb +37 -0
- data/plugin/code-prettify.rb +23 -0
- data/plugin/coderwall.rb +34 -0
- data/plugin/datepicker.rb +28 -0
- data/plugin/day2section.rb +20 -0
- data/plugin/del_footer.rb +111 -0
- data/plugin/description_from_body.rb +23 -0
- data/plugin/development.rb +16 -0
- data/plugin/editor.rb +11 -0
- data/plugin/en/add_bookmark.rb +20 -0
- data/plugin/en/del_footer.rb +10 -0
- data/plugin/en/git-register.rb +3 -0
- data/plugin/en/livedoor_weather.rb +25 -0
- data/plugin/en/microsummary.rb +18 -0
- data/plugin/en/nicovideo.rb +38 -0
- data/plugin/en/openid.rb +8 -0
- data/plugin/en/section_footer.rb +6 -0
- data/plugin/en/section_footer2.rb +3 -0
- data/plugin/en/socialbutton.rb +5 -0
- data/plugin/everytrail.rb +39 -0
- data/plugin/facebook_comments.rb +59 -0
- data/plugin/flickr.rb +209 -0
- data/plugin/gist.rb +16 -0
- data/plugin/git-register.rb +240 -0
- data/plugin/github_badge.rb +27 -0
- data/plugin/github_link.rb +9 -0
- data/plugin/goo_gl.rb +42 -0
- data/plugin/google_adsense.rb +132 -0
- data/plugin/google_analytics.rb +39 -0
- data/plugin/google_map.rb +168 -0
- data/plugin/google_sitemaps.rb +60 -0
- data/plugin/google_webmaster.rb +22 -0
- data/plugin/hatena_bookmark_nocomment.rb +9 -0
- data/plugin/hatena_star.rb +66 -0
- data/plugin/hb_footer.rb +255 -0
- data/plugin/hb_footer4sec.rb +244 -0
- data/plugin/hb_footer4sec_js.rb +30 -0
- data/plugin/hide_comment_form.rb +4 -0
- data/plugin/hide_sidebar_iphone.rb +21 -0
- data/plugin/iddy.rb +81 -0
- data/plugin/image_detail.rb +143 -0
- data/plugin/image_ex.rb +462 -0
- data/plugin/image_gps.rb +128 -0
- data/plugin/inline_wiki.rb +6 -0
- data/plugin/instagr.rb +64 -0
- data/plugin/ja/add_bookmark.rb +20 -0
- data/plugin/ja/del_footer.rb +10 -0
- data/plugin/ja/flickr.rb +62 -0
- data/plugin/ja/git-register.rb +3 -0
- data/plugin/ja/google_sitemaps.rb +35 -0
- data/plugin/ja/livedoor_weather.rb +25 -0
- data/plugin/ja/microsummary.rb +18 -0
- data/plugin/ja/nicovideo.rb +41 -0
- data/plugin/ja/openid.rb +7 -0
- data/plugin/ja/section_footer.rb +6 -0
- data/plugin/ja/section_footer2.rb +4 -0
- data/plugin/ja/socialbutton.rb +6 -0
- data/plugin/jdate.rb +20 -0
- data/plugin/jholiday.rb +16 -0
- data/plugin/jmonth.rb +20 -0
- data/plugin/jquery_ui_theme.rb +55 -0
- data/plugin/jroku.rb +28 -0
- data/plugin/jyear.rb +37 -0
- data/plugin/latlonglab_route.rb +25 -0
- data/plugin/lazy_referer.rb +38 -0
- data/plugin/livedoor_weather.rb +180 -0
- data/plugin/make_link.rb +44 -0
- data/plugin/makerss_category.rb +43 -0
- data/plugin/makerss_comment.rb +35 -0
- data/plugin/microsummary.rb +62 -0
- data/plugin/mm_footer.rb +215 -0
- data/plugin/monthly_autopagerize.rb +67 -0
- data/plugin/my_hotentry.rb +132 -0
- data/plugin/navi_day.rb +118 -0
- data/plugin/navi_this_month.rb +15 -0
- data/plugin/nicovideo.rb +115 -0
- data/plugin/notify_miniblog.rb +134 -0
- data/plugin/ogp.rb +55 -0
- data/plugin/ohmsha_estore.rb +71 -0
- data/plugin/openid.rb +90 -0
- data/plugin/opensearch_ad.rb +33 -0
- data/plugin/picasa.rb +56 -0
- data/plugin/plugin_checker.rb +41 -0
- data/plugin/popit.rb +22 -0
- data/plugin/prettify.rb +19 -0
- data/plugin/prezi.rb +10 -0
- data/plugin/profile.rb +222 -0
- data/plugin/puboo.rb +93 -0
- data/plugin/pygments_css.rb +76 -0
- data/plugin/rating.rb +419 -0
- data/plugin/recent_estraier.rb +50 -0
- data/plugin/recent_tweet.rb +71 -0
- data/plugin/retweet.rb +86 -0
- data/plugin/rubykaigi.rb +99 -0
- data/plugin/search-bing.rb +87 -0
- data/plugin/search-default.rb +264 -0
- data/plugin/search-google-custom.rb +60 -0
- data/plugin/search-yahoo-websearch.rb +121 -0
- data/plugin/search-yahoo.rb +109 -0
- data/plugin/section_footer.rb +195 -0
- data/plugin/section_footer2.rb +278 -0
- data/plugin/section_permalink.rb +73 -0
- data/plugin/section_permalink_anchor.rb +39 -0
- data/plugin/select_style.rb +42 -0
- data/plugin/select_theme.rb +90 -0
- data/plugin/show_and_hide.rb +77 -0
- data/plugin/slideshare.rb +10 -0
- data/plugin/socialbutton.rb +60 -0
- data/plugin/tatsu_zine.rb +93 -0
- data/plugin/tdiarygraph_flashstyle.rb +296 -0
- data/plugin/tdiarytimes.rb +166 -0
- data/plugin/tdiarytimes2.rb +406 -0
- data/plugin/tdiarytimes_flashstyle.rb +263 -0
- data/plugin/tdiarytimes_textstyle.rb +290 -0
- data/plugin/title_anchor.rb +16 -0
- data/plugin/tweet_quote.rb +106 -0
- data/plugin/twitpic.rb +10 -0
- data/plugin/twitter.rb +46 -0
- data/plugin/twitter_anywhere.rb +209 -0
- data/plugin/twitter_badge.rb +42 -0
- data/plugin/twitter_js.rb +59 -0
- data/plugin/ustream.rb +19 -0
- data/plugin/vimeo.rb +14 -0
- data/plugin/volatile.rb +89 -0
- data/plugin/vote.rb +100 -0
- data/plugin/wikiloc.rb +27 -0
- data/plugin/windex.rb +512 -0
- data/plugin/yahoo_kousei.rb +79 -0
- data/plugin/yahoo_map.rb +97 -0
- data/plugin/youtube.rb +33 -0
- data/plugin/yshop.rb +189 -0
- data/plugin/zenback.rb +46 -0
- data/spec/apple_webclip_spec.rb +46 -0
- data/spec/fixtures/friendfeed.xml +2 -0
- data/spec/fixtures/github.json +1 -0
- data/spec/fixtures/twitter.xml +73 -0
- data/spec/gist_spec.rb +16 -0
- data/spec/github_link_spec.rb +39 -0
- data/spec/google_analytics_spec.rb +60 -0
- data/spec/jdate_spec.rb +23 -0
- data/spec/jmonth_spec.rb +28 -0
- data/spec/jyear_spec.rb +21 -0
- data/spec/my_hotentry_spec.rb +78 -0
- data/spec/openid_spec.rb +246 -0
- data/spec/opensearch_ad_spec.rb +50 -0
- data/spec/profile_spec.rb +88 -0
- data/spec/rcov.opts +2 -0
- data/spec/spec_helper.rb +223 -0
- data/spec/title_anchor_spec.rb +39 -0
- data/spec/twitter_js_spec.rb +116 -0
- data/spec/youtube_spec.rb +20 -0
- data/style/hatena_style.rb +1011 -0
- data/style/markdown_style.rb +239 -0
- data/style/wikiext_style.rb +21 -0
- data/tdiary-contrib.gemspec +25 -0
- data/util/clean-spam/README.ja +1 -0
- data/util/clean-spam/tdiary-comment-clean +46 -0
- data/util/clean-spam/tdiary-comment-clean2 +81 -0
- data/util/clean-spam/tdiary-referer-clean +46 -0
- data/util/convert_pstore.rb +82 -0
- data/util/estraier-search/ChangeLog +36 -0
- data/util/estraier-search/README.ja +114 -0
- data/util/estraier-search/en/estraier-register.rb +3 -0
- data/util/estraier-search/estraier-register.rb +298 -0
- data/util/estraier-search/estraier-search.rb +273 -0
- data/util/estraier-search/estraier.rhtml +73 -0
- data/util/estraier-search/estraier.rxml +23 -0
- data/util/estraier-search/i.estraier.rhtml +31 -0
- data/util/estraier-search/ja/estraier-register.rb +3 -0
- data/util/image-gallery/README.ja +27 -0
- data/util/image-gallery/image-gallery.rb +523 -0
- data/util/image-gallery/image-gallery.rb.euc-jp +523 -0
- data/util/image-gallery/js/SmoothGallery/Changelog +52 -0
- data/util/image-gallery/js/SmoothGallery/css/ReMooz.css +186 -0
- data/util/image-gallery/js/SmoothGallery/css/img/carrow1.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/carrow2.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/closebox.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/closebox.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/fleche1.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/fleche1.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/fleche2.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/fleche2.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/loading-bar-black.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/open.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/open.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_e.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_n.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_ne.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_nw.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_s.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_se.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_sw.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_w.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/spinner.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/jd.gallery.css +371 -0
- data/util/image-gallery/js/SmoothGallery/css/layout.css +91 -0
- data/util/image-gallery/js/SmoothGallery/license.txt +621 -0
- data/util/image-gallery/js/SmoothGallery/resizer.php +113 -0
- data/util/image-gallery/js/SmoothGallery/scripts/Changelog +52 -0
- data/util/image-gallery/js/SmoothGallery/scripts/History.Routing.js +126 -0
- data/util/image-gallery/js/SmoothGallery/scripts/History.js +109 -0
- data/util/image-gallery/js/SmoothGallery/scripts/ReMooz.js +364 -0
- data/util/image-gallery/js/SmoothGallery/scripts/jd.gallery.js +843 -0
- data/util/image-gallery/js/SmoothGallery/scripts/jd.gallery.set.js +183 -0
- data/util/image-gallery/js/SmoothGallery/scripts/jd.gallery.transitions.js +90 -0
- data/util/image-gallery/js/SmoothGallery/scripts/jdgalleryresize.js +828 -0
- data/util/image-gallery/js/SmoothGallery/scripts/license.txt +621 -0
- data/util/image-gallery/js/SmoothGallery/scripts/mootools-1.2-more.js +103 -0
- data/util/image-gallery/js/SmoothGallery/scripts/mootools-1.2.1-core-yc.js +349 -0
- data/util/image-gallery/js/SmoothGallery/scripts/resizer.php +113 -0
- data/util/image-gallery/misc/plugin/recent_image.rb +406 -0
- data/util/image-gallery/skel/gallery.rhtml +154 -0
- data/util/image-gallery/skel/gallery.rhtml.euc-jp +154 -0
- data/util/image-gallery/tdiary.conf.igsample +8 -0
- data/util/image-gallery/theme/image-gallery.css +85 -0
- data/util/image2flickr.rb +282 -0
- data/util/posttdiary/README.ja +12 -0
- data/util/posttdiary/posttdiary-ex.rb +1155 -0
- data/util/posttdiary/posttdiary.rb +245 -0
- data/util/rast-search/ChangeLog +55 -0
- data/util/rast-search/README.ja +99 -0
- data/util/rast-search/en/rast-register.rb +3 -0
- data/util/rast-search/i.rast.rhtml +33 -0
- data/util/rast-search/ja/rast-register.rb +3 -0
- data/util/rast-search/rast-register.rb +326 -0
- data/util/rast-search/rast-search.rb +249 -0
- data/util/rast-search/rast.rhtml +66 -0
- data/util/rast-search/rast.rxml +21 -0
- data/util/section_link/README +11 -0
- data/util/section_link/misc/plugin/section_link.rb +68 -0
- data/util/section_link/misc/plugin/section_link_anchor.rb +38 -0
- data/util/section_link/tdiary/tdiary_day_ext.rb +21 -0
- data/util/section_link/tdiary/tdiaryext_style.rb +36 -0
- data/util/section_link/tdiary/wikiext_style.rb +36 -0
- data/util/tdiary-for-ruby1.9/compatible.rb +97 -0
- data/util/tdiary-for-ruby1.9/tdiary-2.2.0.patch +98 -0
- data/util/tdiary-for-ruby1.9/tdiary-2.3.1.patch +212 -0
- data/util/tdiary-grep/README +4 -0
- data/util/tdiary-grep/grep.rb +445 -0
- data/util/tdiary-mode/http.el +130 -0
- data/util/tdiary-mode/tdiary-mode.el +613 -0
- data/util/tdiary-vim/ChangeLog +25 -0
- data/util/tdiary-vim/README +60 -0
- data/util/tdiary-vim/tdiary.vim +350 -0
- data/util/tdiarysearch/README.en +53 -0
- data/util/tdiarysearch/README.ja +99 -0
- data/util/tdiarysearch/search.rb +504 -0
- metadata +497 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
tDiary Image Gallery Ver 2.0.4 -- README.ja --
|
2
|
+
|
3
|
+
Copyright (c) 2005-2013 N.KASHIJUKU <n-kashi[at]whi.m-net.ne.jp>
|
4
|
+
You can redistribute it and/or modify it under GPL2.
|
5
|
+
===================
|
6
|
+
|
7
|
+
■概要
|
8
|
+
image or image_ex プラグインで日記に貼り付けた画像ファイルの一覧表示ページを生成する、
|
9
|
+
tDiaryの拡張機能(プラグイン & Ruby CGI)です。
|
10
|
+
|
11
|
+
■使い方の詳細は…
|
12
|
+
以下のサイトをご覧下さい。
|
13
|
+
・配布サイト
|
14
|
+
http://www1.whi.m-net.ne.jp/n-kashi/image-gallery2.html
|
15
|
+
・作者の日記のサポート・ページ
|
16
|
+
http://exception.rash.jp/diary/?date=20010101
|
17
|
+
|
18
|
+
■サンプルは…
|
19
|
+
・作者の日記
|
20
|
+
http://exception.rash.jp/diary/
|
21
|
+
・Image Gallery Listモード
|
22
|
+
http://exception.rash.jp/diary/image-gallery.rb
|
23
|
+
・Image Gallery SideShowモード
|
24
|
+
http://exception.rash.jp/diary/image-gallery.rb?mode=slide
|
25
|
+
・Image Gallery Viewerモード
|
26
|
+
http://exception.rash.jp/diary/image-gallery.rb?mode=viewer;key=20090222_0
|
27
|
+
|
@@ -0,0 +1,523 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
# image-gallery.rb $Revision: 2.0.4 $
|
4
|
+
#
|
5
|
+
# Copyright (c) 2005-2013 N.KASHIJUKU <n-kashi[at]whi.m-net.ne.jp>
|
6
|
+
# You can redistribute it and/or modify it under GPL2.
|
7
|
+
|
8
|
+
if RUBY_VERSION >= '1.9.0'
|
9
|
+
Encoding::default_external = 'UTF-8'
|
10
|
+
$LOAD_PATH.push('./')
|
11
|
+
end
|
12
|
+
|
13
|
+
if FileTest::symlink?( __FILE__ ) then
|
14
|
+
org_path = File::dirname( File::readlink( __FILE__ ) )
|
15
|
+
else
|
16
|
+
org_path = File::dirname( __FILE__ )
|
17
|
+
end
|
18
|
+
$:.unshift( org_path.untaint )
|
19
|
+
require 'tdiary'
|
20
|
+
require 'pstore'
|
21
|
+
require 'date'
|
22
|
+
|
23
|
+
|
24
|
+
# class TDiaryGallery
|
25
|
+
#
|
26
|
+
module TDiary
|
27
|
+
class ImageData
|
28
|
+
attr_reader :file, :url, :title, :subtitle, :date, :width, :height, :type
|
29
|
+
attr_writer :file, :url, :title, :subtitle, :date, :width, :height, :type
|
30
|
+
end
|
31
|
+
|
32
|
+
|
33
|
+
class TDiaryGallery < ::TDiary::TDiaryBase
|
34
|
+
MAX_PAGES = 20
|
35
|
+
ORDER_OPTIONS = [
|
36
|
+
["asc", "新しい順"],
|
37
|
+
["desc", "古い順"],
|
38
|
+
]
|
39
|
+
MODE_OPTIONS = [
|
40
|
+
["list", "リスト"],
|
41
|
+
["slide", "スライド"],
|
42
|
+
]
|
43
|
+
|
44
|
+
def initialize( cgi, rhtml, conf )
|
45
|
+
super
|
46
|
+
@img_version = "2.0.4"
|
47
|
+
@image_hash = Hash[]
|
48
|
+
@image_num = 0
|
49
|
+
@image_keys = []
|
50
|
+
@images = []
|
51
|
+
@exifstr = []
|
52
|
+
@t_page_title = ""
|
53
|
+
|
54
|
+
get_conf(conf)
|
55
|
+
parse_args(cgi)
|
56
|
+
format_form
|
57
|
+
read_cache
|
58
|
+
make_image_data
|
59
|
+
check_name_filter_dateformat
|
60
|
+
make_page_title
|
61
|
+
end
|
62
|
+
|
63
|
+
private
|
64
|
+
|
65
|
+
def get_conf(conf)
|
66
|
+
@column = conf.options['image-gallery.column'].to_i
|
67
|
+
@column = 3 if @column == 0
|
68
|
+
@line = conf.options['image-gallery.line'].to_i
|
69
|
+
@line = 4 if @line == 0
|
70
|
+
@num = @line * @column
|
71
|
+
@width = conf.options['image-gallery.width']
|
72
|
+
@width = "160" if @width == nil
|
73
|
+
@vwidth = conf.options['image-gallery.vwidth']
|
74
|
+
@vwidth = "640" if @vwidth == nil
|
75
|
+
@show_exif = conf.options['image-gallery.show_exif']
|
76
|
+
@show_exif = false if @show_exif == nil
|
77
|
+
@use_mid_image = conf.options['image-gallery.use_mid_image']
|
78
|
+
@use_mid_image = false if @use_mid_image == nil
|
79
|
+
end
|
80
|
+
|
81
|
+
def parse_args(cgi)
|
82
|
+
@start = cgi["start"].to_i
|
83
|
+
@order = @cgi["order"].empty? ? "asc" : @cgi["order"]
|
84
|
+
@name_filter = @cgi["name"].empty? ? "" : @cgi["name"].strip
|
85
|
+
@title_filter = @cgi["title"].empty? ? "" : @cgi["title"].strip
|
86
|
+
@subtitle_filter = @cgi["subtitle"].empty? ? "" : @cgi["subtitle"].strip
|
87
|
+
@mode = @cgi["mode"].empty? ? "list" : @cgi["mode"].strip
|
88
|
+
@mode = "list" if @mode != "viewer" and @mode != "slide" and @mode != "fslide"
|
89
|
+
@key = cgi["key"].empty? ? "" : cgi["key"].strip
|
90
|
+
@page_title = cgi["pagetitle"].empty? ? "" : @cgi["pagetitle"].strip
|
91
|
+
@show_inputfield = true;
|
92
|
+
show_inputfield = @cgi["showinputfield"].strip
|
93
|
+
@show_inputfield = false if show_inputfield == "false"
|
94
|
+
end
|
95
|
+
|
96
|
+
def read_cache
|
97
|
+
begin
|
98
|
+
db = PStore.new("#{@io.cache_path}/gallery/image-gallery2.dat") # for tDiary 3.1.3 or later
|
99
|
+
rescue
|
100
|
+
db = PStore.new("#{cache_path}/gallery/image-gallery2.dat") # for tDiary 3.1.2 or faster
|
101
|
+
end
|
102
|
+
db.transaction do
|
103
|
+
@image_hash = db["recent_image_hash"]
|
104
|
+
@image_keys = db["recent_image_keys"]
|
105
|
+
@image_url = db["recent_image_url"]
|
106
|
+
@image_dir = db["recent_image_dir"]
|
107
|
+
db.abort
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
def make_image_data
|
112
|
+
if @name_filter != "" or @title_filter != "" or @subtitle_filter != ""
|
113
|
+
@image_keys.reject! { |key|
|
114
|
+
image = @image_hash[key]
|
115
|
+
(@name_filter != "" and image.file.match(@name_filter) == nil) or
|
116
|
+
(@title_filter != "" and image.title.match(@title_filter) == nil) or
|
117
|
+
(@subtitle_filter != "" and image.subtitle.match(@subtitle_filter) == nil)
|
118
|
+
}
|
119
|
+
end
|
120
|
+
@image_num = @image_keys.length
|
121
|
+
@image_keys = @image_keys.reverse if @order == "asc"
|
122
|
+
|
123
|
+
if @mode == "list" or @mode == "slide" or @mode == "fslide"
|
124
|
+
if @key != ""
|
125
|
+
index = @image_keys.index(@key)
|
126
|
+
if index != nil
|
127
|
+
@start = (index / @num) * @num
|
128
|
+
else
|
129
|
+
return
|
130
|
+
end
|
131
|
+
end
|
132
|
+
@num.times do |i|
|
133
|
+
index = @start + i
|
134
|
+
break if @image_keys[index] == nil
|
135
|
+
@images.push(@image_hash[@image_keys[index]])
|
136
|
+
end
|
137
|
+
elsif @mode == "viewer"
|
138
|
+
if @key != ""
|
139
|
+
index = @image_keys.index(@key)
|
140
|
+
if index != nil
|
141
|
+
@start = index
|
142
|
+
else
|
143
|
+
@start = 0
|
144
|
+
end
|
145
|
+
end
|
146
|
+
@images.push(@image_hash[@image_keys[@start]])
|
147
|
+
width, height = @images[0].width.to_i, @images[0].height.to_i
|
148
|
+
size = ((width > height ? width : height) > @vwidth.to_i) ? @vwidth : width
|
149
|
+
if width > height
|
150
|
+
@sizestr = %Q[width="#{size}" height="#{(size.to_i*height/width).to_s}"]
|
151
|
+
else
|
152
|
+
@sizestr = %Q[width="#{(size.to_i*width/height).to_s}" height="#{size}"]
|
153
|
+
end
|
154
|
+
if @show_exif and @images[0].type == "jpg"
|
155
|
+
begin
|
156
|
+
require 'exifparser'
|
157
|
+
@exifstr = read_exif_data("#{@image_dir}/#{@images[0].file}")
|
158
|
+
rescue
|
159
|
+
exp = []
|
160
|
+
exp.push(($!).to_s)
|
161
|
+
($!).backtrace.each do |btinfo|
|
162
|
+
exp.push(btinfo)
|
163
|
+
end
|
164
|
+
@exifstr = exp
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
def check_name_filter_dateformat
|
171
|
+
@page_year = ""
|
172
|
+
@page_month = ""
|
173
|
+
@page_day = ""
|
174
|
+
@page_date = nil
|
175
|
+
return if @name_filter == ""
|
176
|
+
t_name_filter = @name_filter.dup
|
177
|
+
t_name_filter["^"] = "" if t_name_filter[0] == ?^
|
178
|
+
t_name_filter = t_name_filter[5,8] if t_name_filter[4] == ?/
|
179
|
+
begin
|
180
|
+
if t_name_filter.index(/[\d]{8}/) != nil
|
181
|
+
@page_year = t_name_filter[0,4]
|
182
|
+
@page_month = t_name_filter[4,2]
|
183
|
+
@page_day = t_name_filter[6,2]
|
184
|
+
@page_date = Date.new(@page_year.to_i, @page_month.to_i, @page_day.to_i)
|
185
|
+
|
186
|
+
elsif t_name_filter.index(/[\d]{6}/) != nil
|
187
|
+
@page_year = t_name_filter[0,4]
|
188
|
+
@page_month = t_name_filter[4,2]
|
189
|
+
@page_date = Date.new(@page_year.to_i, @page_month.to_i, 1)
|
190
|
+
|
191
|
+
elsif t_name_filter.index(/[\d]{4}/) != nil and t_name_filter[0,4].to_i >= 1970
|
192
|
+
@page_year = t_name_filter[0,4]
|
193
|
+
@page_date = Date.new(@page_year.to_i, 1, 1)
|
194
|
+
end
|
195
|
+
rescue
|
196
|
+
@page_year = ""
|
197
|
+
@page_month = ""
|
198
|
+
@page_day = ""
|
199
|
+
@page_date = nil
|
200
|
+
return
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
def make_page_title
|
205
|
+
return if @page_title == ""
|
206
|
+
@t_page_title = String.new(@page_title)
|
207
|
+
@t_page_title.gsub!("@year", @page_year)
|
208
|
+
@t_page_title.gsub!("@month", @page_month)
|
209
|
+
@t_page_title.gsub!("@day", @page_day)
|
210
|
+
begin
|
211
|
+
@t_page_title.gsub!("@subtitle", @images[0].subtitle)
|
212
|
+
rescue
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
def format_links(count)
|
217
|
+
page_count = (count - 1) / @num + 1
|
218
|
+
current_page = @start / @num + 1
|
219
|
+
first_page = current_page - (MAX_PAGES / 2 - 1)
|
220
|
+
if first_page < 1
|
221
|
+
first_page = 1
|
222
|
+
end
|
223
|
+
last_page = first_page + MAX_PAGES - 1
|
224
|
+
if last_page > page_count
|
225
|
+
last_page = page_count
|
226
|
+
end
|
227
|
+
buf = "<p id=\"navi\" class=\"infobar\">\n"
|
228
|
+
if current_page > 1
|
229
|
+
buf << format_link("«先頭へ ", 0, 0, @mode)
|
230
|
+
buf << format_link("<前へ", @start - @num, @num, @mode)
|
231
|
+
end
|
232
|
+
if first_page > 1
|
233
|
+
buf << "... "
|
234
|
+
end
|
235
|
+
for i in first_page..last_page
|
236
|
+
if i == current_page
|
237
|
+
buf << "#{i} "
|
238
|
+
else
|
239
|
+
buf << format_link(i.to_s, (i - 1) * @num, @num, @mode)
|
240
|
+
end
|
241
|
+
end
|
242
|
+
if last_page < page_count
|
243
|
+
buf << "... "
|
244
|
+
end
|
245
|
+
if current_page < page_count
|
246
|
+
buf << format_link("次へ>", @start + @num, @num, @mode)
|
247
|
+
buf.concat(format_link(" 最後へ»", (page_count - 1) * @num, 0, @mode))
|
248
|
+
end
|
249
|
+
buf << "</p>\n"
|
250
|
+
return buf
|
251
|
+
end
|
252
|
+
|
253
|
+
def format_link(label, start, num, mode)
|
254
|
+
return format('<a href="%s?mode=%s;%sstart=%d">%s</a> ',
|
255
|
+
_(@cgi.script_name ? @cgi.script_name : ''),
|
256
|
+
mode,
|
257
|
+
make_cgi_param,
|
258
|
+
start, label)
|
259
|
+
end
|
260
|
+
|
261
|
+
def format_links_viewer
|
262
|
+
buf = "<p id=\"vnavi\" class=\"infobar\">\n"
|
263
|
+
if @start == 0
|
264
|
+
buf << "«前へ"
|
265
|
+
else
|
266
|
+
buf << format_link_viewer("«前へ", @image_keys[@start - 1])
|
267
|
+
end
|
268
|
+
buf << " | "
|
269
|
+
buf << format_link("一覧へ", (@start / @num) * @num, 0, "list")
|
270
|
+
buf << " | "
|
271
|
+
if @start == @image_keys.length - 1
|
272
|
+
buf << "次へ»"
|
273
|
+
else
|
274
|
+
buf << format_link_viewer("次へ»", @image_keys[@start + 1])
|
275
|
+
end
|
276
|
+
buf << "</p>\n"
|
277
|
+
return buf
|
278
|
+
end
|
279
|
+
|
280
|
+
def format_link_viewer(label, key)
|
281
|
+
return format('<a href="%s?%smode=viewer;key=%s">%s</a>',
|
282
|
+
_(@cgi.script_name ? @cgi.script_name : ''),
|
283
|
+
make_cgi_param,
|
284
|
+
key, label)
|
285
|
+
end
|
286
|
+
|
287
|
+
def format_link_viewer_image(key)
|
288
|
+
return format('%s?%smode=viewer;key=%s',
|
289
|
+
_(@cgi.script_name ? @cgi.script_name : ''),
|
290
|
+
make_cgi_param,
|
291
|
+
key)
|
292
|
+
end
|
293
|
+
|
294
|
+
def format_links_date
|
295
|
+
return "" unless @name_filter != "" and @title_filter == "" and @subtitle_filter == ""
|
296
|
+
|
297
|
+
begin
|
298
|
+
buf = "<p id=\"ynavi\" class=\"infobar\">\n"
|
299
|
+
if @page_day != ""
|
300
|
+
yesterday = (@page_date - 1).strftime("%Y%m%d")
|
301
|
+
tomorrow = (@page_date + 1).strftime("%Y%m%d")
|
302
|
+
buf << format_link_date(%Q[«#{(@page_date - 1).to_s}], yesterday)
|
303
|
+
buf << format(' | <a href="%s?mode=%s;order=%s">%s</a> | ', _(@cgi.script_name ? @cgi.script_name : ''), _(@mode), _(@order), '全画像')
|
304
|
+
buf << format_link_date(%Q[#{(@page_date + 1).to_s}»], tomorrow)
|
305
|
+
|
306
|
+
elsif @page_month != ""
|
307
|
+
prevmonth = (@page_date << 1).strftime("%Y%m")
|
308
|
+
nextmonth = (@page_date >> 1).strftime("%Y%m")
|
309
|
+
if @name_filter[0] == ?^ and @name_filter[5] == ?/
|
310
|
+
prevmonth = %Q[^#{prevmonth[0,4]}/#{prevmonth}]
|
311
|
+
nextmonth = %Q[^#{nextmonth[0,4]}/#{nextmonth}]
|
312
|
+
elsif @name_filter[0] == ?^
|
313
|
+
prevmonth = %Q[^#{prevmonth[0,4]}]
|
314
|
+
nextmonth = %Q[^#{nextmonth[0,4]}]
|
315
|
+
end
|
316
|
+
buf << format_link_date(%Q[«#{(@page_date << 1).to_s[0,7]}], prevmonth)
|
317
|
+
buf << format(' | <a href="%s?mode=%s;order=%s">%s</a> | ', _(@cgi.script_name ? @cgi.script_name : ''), _(@mode), _(@order), '全画像')
|
318
|
+
buf << format_link_date(%Q[#{(@page_date >> 1).to_s[0,7]}»], nextmonth)
|
319
|
+
|
320
|
+
elsif @page_year != ""
|
321
|
+
year = @page_year.to_i
|
322
|
+
buf << format_link_date(%Q[«#{(year - 1).to_s}], "^"+(year - 1).to_s)
|
323
|
+
buf << format(' | <a href="%s?mode=%s;order=%s">%s</a> | ', _(@cgi.script_name ? @cgi.script_name : ''), _(@mode), _(@order), '全画像')
|
324
|
+
buf << format_link_date(%Q[#{(year + 1).to_s}»], "^"+(year + 1).to_s)
|
325
|
+
end
|
326
|
+
|
327
|
+
buf << "</p>\n"
|
328
|
+
return buf
|
329
|
+
rescue
|
330
|
+
return ""
|
331
|
+
end
|
332
|
+
end
|
333
|
+
|
334
|
+
def format_link_date(label, name_filter)
|
335
|
+
cgi_params = make_cgi_param
|
336
|
+
if cgi_params.gsub!(/name=[^;]*;/, "name=#{CGI::escape(name_filter)};") == nil
|
337
|
+
cgi_params = "name=" + CGI::escape(name_filter) + ";" + cgi_params
|
338
|
+
end
|
339
|
+
return format('<a href="%s?mode=%s;%s">%s</a>',
|
340
|
+
_(@cgi.script_name ? @cgi.script_name : ''),
|
341
|
+
@mode,
|
342
|
+
cgi_params,
|
343
|
+
label)
|
344
|
+
end
|
345
|
+
|
346
|
+
def format_link_viewer_date(label, name_filter)
|
347
|
+
return format('<a href="%s?mode=list;order=desc;name=%s">%s</a>',
|
348
|
+
_(@cgi.script_name ? @cgi.script_name : ''),
|
349
|
+
CGI::escape(name_filter),
|
350
|
+
label)
|
351
|
+
end
|
352
|
+
|
353
|
+
def format_link_viewer_category(subtitle)
|
354
|
+
buf = ""
|
355
|
+
subtitle.scan(/\[[^\]]*\]/).each do |category|
|
356
|
+
tag = category[1..-2]
|
357
|
+
next if tag[0] == ?[
|
358
|
+
buf << format('[<a href="%s?mode=list;order=desc;subtitle=%s">%s</a>]',
|
359
|
+
_(@cgi.script_name ? @cgi.script_name : ''),
|
360
|
+
CGI::escape("\\[" + tag + "\\]"), tag)
|
361
|
+
end
|
362
|
+
return buf
|
363
|
+
end
|
364
|
+
|
365
|
+
def format_link_list_category(images)
|
366
|
+
categories = []
|
367
|
+
images.each do |image|
|
368
|
+
categories |= image.subtitle.scan(/\[[^\]]*\]/)
|
369
|
+
end
|
370
|
+
buf = ""
|
371
|
+
categories.each do |category|
|
372
|
+
tag = category[1..-2]
|
373
|
+
next if tag[0] == ?[
|
374
|
+
buf << format('[<a href="%s?mode=list;order=desc;subtitle=%s">%s</a>]',
|
375
|
+
_(@cgi.script_name ? @cgi.script_name : ''),
|
376
|
+
CGI::escape("\\[" + tag + "\\]"), tag)
|
377
|
+
end
|
378
|
+
return buf
|
379
|
+
end
|
380
|
+
|
381
|
+
def get_other_mode_link
|
382
|
+
case @mode
|
383
|
+
when "list"
|
384
|
+
format_link("[SLIDESHOW]", @start, @num, "slide") + format_link("[SLIDESHOW(FullScreen)]", @start, @num, "fslide")
|
385
|
+
when "slide"
|
386
|
+
format_link("[LIST]", @start, @num, "list") + format_link("[SLIDESHOW(FullScreen)]", @start, @num, "fslide")
|
387
|
+
when "fslide"
|
388
|
+
format_link("[LIST]", @start, @num, "list") + format_link("[SLIDESHOW]", @start, @num, "slide")
|
389
|
+
end
|
390
|
+
end
|
391
|
+
|
392
|
+
def make_cgi_param
|
393
|
+
buf = ""
|
394
|
+
buf << "name=#{CGI::escape(@name_filter)};" if @name_filter != ""
|
395
|
+
buf << "title=#{CGI::escape(@title_filter)};" if @title_filter != ""
|
396
|
+
buf << "subtitle=#{CGI::escape(@subtitle_filter)};" if @subtitle_filter != ""
|
397
|
+
buf << "pagetitle=#{CGI::escape(@page_title)};" if @page_title != ""
|
398
|
+
buf << "showinputfield=false;" if not @show_inputfield
|
399
|
+
buf << "order=#{@order};"
|
400
|
+
return buf
|
401
|
+
end
|
402
|
+
|
403
|
+
def format_options(options, value)
|
404
|
+
return options.collect { |val, label|
|
405
|
+
if val == value
|
406
|
+
"<option value=\"#{_(val)}\" selected>#{_(label)}</option>"
|
407
|
+
else
|
408
|
+
"<option value=\"#{_(val)}\">#{_(label)}</option>"
|
409
|
+
end
|
410
|
+
}.join("\n")
|
411
|
+
end
|
412
|
+
|
413
|
+
def format_form
|
414
|
+
@order_options = format_options(ORDER_OPTIONS, @order)
|
415
|
+
@mode_options = format_options(MODE_OPTIONS, @mode )
|
416
|
+
end
|
417
|
+
|
418
|
+
def _(str)
|
419
|
+
CGI::escapeHTML(str)
|
420
|
+
end
|
421
|
+
|
422
|
+
def read_exif_data(file)
|
423
|
+
exifstr = []
|
424
|
+
str = ""
|
425
|
+
exif = ExifParser.new(file)
|
426
|
+
return exifstr if exif == nil
|
427
|
+
|
428
|
+
exifstr.push("-- IFD0 (main image) --")
|
429
|
+
exif.each(:IFD0) do |tag|
|
430
|
+
next if tag.name == "Unknown"
|
431
|
+
str = "#{tag.name} : #{tag.to_s}"
|
432
|
+
exifstr.push(str)
|
433
|
+
end
|
434
|
+
|
435
|
+
exifstr.push("-- Exif SubIFD --")
|
436
|
+
exif.each(:Exif) do |tag|
|
437
|
+
next if tag.name == "Unknown"
|
438
|
+
str = "#{tag.name} : #{tag.to_s}"
|
439
|
+
exifstr.push(str)
|
440
|
+
end
|
441
|
+
|
442
|
+
exifstr.push("-- MakerNote --")
|
443
|
+
exif.each(:MakerNote) do |tag|
|
444
|
+
next if tag.name == "Unknown" or tag.name == "NikonCameraSerialNumber"
|
445
|
+
str = "#{tag.name} : #{tag.to_s}"
|
446
|
+
exifstr.push(str)
|
447
|
+
end
|
448
|
+
|
449
|
+
exifstr.push("-- GPS --")
|
450
|
+
exif.each(:GPS) do |tag|
|
451
|
+
next if tag.name == "Unknown"
|
452
|
+
str = "#{tag.name} : #{tag.to_s}"
|
453
|
+
exifstr.push(str)
|
454
|
+
end
|
455
|
+
|
456
|
+
return exifstr
|
457
|
+
|
458
|
+
end
|
459
|
+
|
460
|
+
|
461
|
+
def js_start_gallery
|
462
|
+
if @mode == "fslide"
|
463
|
+
<<-EOS
|
464
|
+
<script type="text/javascript">
|
465
|
+
function startGallery() {
|
466
|
+
var myGallery = new gallery($('myGallery'), {
|
467
|
+
timed: true,
|
468
|
+
fullScreen: true
|
469
|
+
});
|
470
|
+
}
|
471
|
+
window.addEvent('domready',startGallery);
|
472
|
+
</script>
|
473
|
+
EOS
|
474
|
+
elsif @mode == "slide"
|
475
|
+
<<-EOS2
|
476
|
+
<script type="text/javascript">
|
477
|
+
function startGallery() {
|
478
|
+
var myGallery = new gallery($('myGallery'), {
|
479
|
+
timed: true,
|
480
|
+
});
|
481
|
+
}
|
482
|
+
window.addEvent('domready',startGallery);
|
483
|
+
</script>
|
484
|
+
EOS2
|
485
|
+
end
|
486
|
+
end
|
487
|
+
end
|
488
|
+
end
|
489
|
+
|
490
|
+
begin
|
491
|
+
@cgi = CGI::new
|
492
|
+
if TDiary::Config.instance_method(:initialize).arity == 0
|
493
|
+
# for tDiary 2.0 or earlier
|
494
|
+
conf = TDiary::Config::new
|
495
|
+
else
|
496
|
+
# for tDiary 2.1 or later
|
497
|
+
request = TDiary::Request.new( ENV, @cgi )
|
498
|
+
conf = TDiary::Config::new(@cgi, request)
|
499
|
+
end
|
500
|
+
tdiary = TDiary::TDiaryGallery::new( @cgi, 'gallery.rhtml', conf )
|
501
|
+
|
502
|
+
head = {
|
503
|
+
'type' => 'text/html',
|
504
|
+
'Vary' => 'User-Agent'
|
505
|
+
}
|
506
|
+
body = tdiary.eval_rhtml
|
507
|
+
head['charset'] = conf.encoding
|
508
|
+
head['Content-Length'] = body.bytesize.to_s
|
509
|
+
head['Pragma'] = 'no-cache'
|
510
|
+
head['Cache-Control'] = 'no-cache'
|
511
|
+
|
512
|
+
print @cgi.header( head )
|
513
|
+
print body
|
514
|
+
rescue Exception
|
515
|
+
if @cgi then
|
516
|
+
print @cgi.header( 'type' => 'text/plain' )
|
517
|
+
else
|
518
|
+
print "Content-Type: text/plain\n\n"
|
519
|
+
end
|
520
|
+
puts "#$! (#{$!.class})"
|
521
|
+
puts ""
|
522
|
+
puts $@.join( "\n" )
|
523
|
+
end
|