tdiary-contrib 3.2.2.20130518

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (393) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -0
  3. data/.travis.yml +7 -0
  4. data/Gemfile +13 -0
  5. data/Gemfile.lock +35 -0
  6. data/README.en.md +12 -0
  7. data/README.md +13 -0
  8. data/Rakefile +41 -0
  9. data/doc/en/filter/spambayes.txt +3 -0
  10. data/doc/en/plugin.txt +1 -0
  11. data/doc/en/style/hatena.txt +10 -0
  12. data/doc/en/style/markdown.txt +16 -0
  13. data/doc/en/util.txt +1 -0
  14. data/doc/ja/filter/antirefspam.history.txt +59 -0
  15. data/doc/ja/filter/antirefspam.txt +86 -0
  16. data/doc/ja/filter/comment_key.ja.html +182 -0
  17. data/doc/ja/filter/spambayes.txt +3 -0
  18. data/doc/ja/plugin/add_bookmark.txt +50 -0
  19. data/doc/ja/plugin/category_to_tag.txt +21 -0
  20. data/doc/ja/plugin/cocoment.txt +31 -0
  21. data/doc/ja/plugin/google_adsense.txt +25 -0
  22. data/doc/ja/plugin/google_analytics.txt +7 -0
  23. data/doc/ja/plugin/image_detail.txt +69 -0
  24. data/doc/ja/plugin/image_gps.txt +36 -0
  25. data/doc/ja/plugin/image_gps2.txt +41 -0
  26. data/doc/ja/plugin/livedoor_weather.txt +105 -0
  27. data/doc/ja/plugin/opensearch_ad.txt +16 -0
  28. data/doc/ja/plugin/section_footer.txt +84 -0
  29. data/doc/ja/plugin/select_theme.txt +1 -0
  30. data/doc/ja/plugin.txt +13 -0
  31. data/doc/ja/style/hatena.txt +10 -0
  32. data/doc/ja/style/markdown.txt +13 -0
  33. data/doc/ja/util.txt +12 -0
  34. data/filter/antirefspam.rb +263 -0
  35. data/filter/commentkey.rb +29 -0
  36. data/filter/commentsize.rb +18 -0
  37. data/filter/hidecomment.rb +13 -0
  38. data/filter/iplookup.rb +55 -0
  39. data/filter/plugin/antirefspam.rb +59 -0
  40. data/filter/plugin/commentkey.rb +58 -0
  41. data/filter/plugin/commentsize.rb +12 -0
  42. data/filter/plugin/en/iplookup.rb +9 -0
  43. data/filter/plugin/en/spambayes.rb +123 -0
  44. data/filter/plugin/iplookup.rb +39 -0
  45. data/filter/plugin/ja/antirefspam.rb +91 -0
  46. data/filter/plugin/ja/commentkey.rb +17 -0
  47. data/filter/plugin/ja/commentsize.rb +6 -0
  48. data/filter/plugin/ja/iplookup.rb +9 -0
  49. data/filter/plugin/ja/spambayes.rb +124 -0
  50. data/filter/plugin/spambayes.rb +501 -0
  51. data/filter/plugin/zh/iplookup.rb +9 -0
  52. data/filter/rblcheck.rb +36 -0
  53. data/filter/spambayes.rb +535 -0
  54. data/filter/spamlookup.rb +37 -0
  55. data/io/dbi_io/ChangeLog +19 -0
  56. data/io/dbi_io/README.ja +39 -0
  57. data/io/dbi_io/dbi_io.rb +181 -0
  58. data/io/dbi_io/plugin/refererDbiIO.rb +76 -0
  59. data/io/dbi_io/tdiary_table.sql +42 -0
  60. data/js/appstore.js +109 -0
  61. data/js/datepicker.js +69 -0
  62. data/js/editor.js +82 -0
  63. data/js/flickr.js +157 -0
  64. data/js/image_ex.js +79 -0
  65. data/js/jquery.socialbutton.js +842 -0
  66. data/js/nicovideo.js +17 -0
  67. data/js/picasa.js +322 -0
  68. data/js/plugin_checker.js +71 -0
  69. data/js/prettify/lang-apollo.js +2 -0
  70. data/js/prettify/lang-clj.js +18 -0
  71. data/js/prettify/lang-css.js +2 -0
  72. data/js/prettify/lang-go.js +1 -0
  73. data/js/prettify/lang-hs.js +2 -0
  74. data/js/prettify/lang-lisp.js +3 -0
  75. data/js/prettify/lang-lua.js +2 -0
  76. data/js/prettify/lang-ml.js +2 -0
  77. data/js/prettify/lang-n.js +4 -0
  78. data/js/prettify/lang-proto.js +1 -0
  79. data/js/prettify/lang-scala.js +2 -0
  80. data/js/prettify/lang-sql.js +2 -0
  81. data/js/prettify/lang-tex.js +1 -0
  82. data/js/prettify/lang-vb.js +2 -0
  83. data/js/prettify/lang-vhdl.js +3 -0
  84. data/js/prettify/lang-wiki.js +2 -0
  85. data/js/prettify/lang-xq.js +3 -0
  86. data/js/prettify/lang-yaml.js +2 -0
  87. data/js/prettify/prettify.css +1 -0
  88. data/js/prettify/prettify.js +28 -0
  89. data/js/referer.js +17 -0
  90. data/js/show_and_hide.js +39 -0
  91. data/js/socialbutton.js +126 -0
  92. data/js/twitter_anywhere.js +28 -0
  93. data/js/yahoo_kousei.js +21 -0
  94. data/lib/bayes/convert.rb +34 -0
  95. data/lib/bayes.rb +232 -0
  96. data/lib/exifparser/BUGS +1 -0
  97. data/lib/exifparser/ChangeLog +169 -0
  98. data/lib/exifparser/README +15 -0
  99. data/lib/exifparser/install.rb +1015 -0
  100. data/lib/exifparser/lib/exifparser/makernote/canon.rb +502 -0
  101. data/lib/exifparser/lib/exifparser/makernote/fujifilm.rb +415 -0
  102. data/lib/exifparser/lib/exifparser/makernote/minolta.rb +84 -0
  103. data/lib/exifparser/lib/exifparser/makernote/mk_nikonflensname.rb +39 -0
  104. data/lib/exifparser/lib/exifparser/makernote/nikon.rb +267 -0
  105. data/lib/exifparser/lib/exifparser/makernote/nikon2.rb +581 -0
  106. data/lib/exifparser/lib/exifparser/makernote/nikonflensname.rb +438 -0
  107. data/lib/exifparser/lib/exifparser/makernote/olympus.rb +225 -0
  108. data/lib/exifparser/lib/exifparser/makernote/prove.rb +84 -0
  109. data/lib/exifparser/lib/exifparser/makernote/sigma.rb +237 -0
  110. data/lib/exifparser/lib/exifparser/pre-setup.rb +1 -0
  111. data/lib/exifparser/lib/exifparser/scan.rb +278 -0
  112. data/lib/exifparser/lib/exifparser/tag.rb +2298 -0
  113. data/lib/exifparser/lib/exifparser/thumbnail.rb +76 -0
  114. data/lib/exifparser/lib/exifparser/utils.rb +88 -0
  115. data/lib/exifparser/lib/exifparser.rb +265 -0
  116. data/lib/exifparser/sample/exifview.rb +279 -0
  117. data/lib/tdiary-contrib.rb +19 -0
  118. data/lib/wgs2tky.rb +93 -0
  119. data/misc/section_footer2/buzzurl.yaml +6 -0
  120. data/misc/section_footer2/fc2.yaml +6 -0
  121. data/misc/section_footer2/ldc.yaml +6 -0
  122. data/misc/section_footer2/retweet.yaml +7 -0
  123. data/misc/section_footer2/twitter.yaml +7 -0
  124. data/misc/section_footer2/yahoo.yaml +6 -0
  125. data/misc/tdiarygraph/tdiarygraph120x90e.swf +0 -0
  126. data/misc/tdiarygraph/tdiarygraph125x125e.swf +0 -0
  127. data/misc/tdiarygraph/tdiarygraph240x180e.swf +0 -0
  128. data/misc/tdiarygraph/tdiarygraph468x60e.swf +0 -0
  129. data/misc/tdiarygraph/tdiarygraph728x90e.swf +0 -0
  130. data/misc/tdiarytimes/tdiarytimes125x125r.swf +0 -0
  131. data/misc/tdiarytimes/tdiarytimes125x125r7.swf +0 -0
  132. data/misc/tdiarytimes/tdiarytimes125x125s.swf +0 -0
  133. data/misc/tdiarytimes/tdiarytimes125x30.swf +0 -0
  134. data/misc/tdiarytimes/tdiarytimes234x30.swf +0 -0
  135. data/misc/tdiarytimes/tdiarytimes468x30.swf +0 -0
  136. data/plugin/add_bookmark.rb +89 -0
  137. data/plugin/apple_webclip.rb +26 -0
  138. data/plugin/appstore.rb +47 -0
  139. data/plugin/bigpresen.rb +86 -0
  140. data/plugin/bitly.rb +39 -0
  141. data/plugin/bootstrap-navi.rb +54 -0
  142. data/plugin/canonical.rb +9 -0
  143. data/plugin/category_similar.rb +73 -0
  144. data/plugin/category_to_tag.rb +60 -0
  145. data/plugin/category_to_tagcloud.rb +172 -0
  146. data/plugin/cocomment.rb +37 -0
  147. data/plugin/code-prettify.rb +23 -0
  148. data/plugin/coderwall.rb +34 -0
  149. data/plugin/datepicker.rb +28 -0
  150. data/plugin/day2section.rb +20 -0
  151. data/plugin/del_footer.rb +111 -0
  152. data/plugin/description_from_body.rb +23 -0
  153. data/plugin/development.rb +16 -0
  154. data/plugin/editor.rb +11 -0
  155. data/plugin/en/add_bookmark.rb +20 -0
  156. data/plugin/en/del_footer.rb +10 -0
  157. data/plugin/en/git-register.rb +3 -0
  158. data/plugin/en/livedoor_weather.rb +25 -0
  159. data/plugin/en/microsummary.rb +18 -0
  160. data/plugin/en/nicovideo.rb +38 -0
  161. data/plugin/en/openid.rb +8 -0
  162. data/plugin/en/section_footer.rb +6 -0
  163. data/plugin/en/section_footer2.rb +3 -0
  164. data/plugin/en/socialbutton.rb +5 -0
  165. data/plugin/everytrail.rb +39 -0
  166. data/plugin/facebook_comments.rb +59 -0
  167. data/plugin/flickr.rb +209 -0
  168. data/plugin/gist.rb +16 -0
  169. data/plugin/git-register.rb +240 -0
  170. data/plugin/github_badge.rb +27 -0
  171. data/plugin/github_link.rb +9 -0
  172. data/plugin/goo_gl.rb +42 -0
  173. data/plugin/google_adsense.rb +132 -0
  174. data/plugin/google_analytics.rb +39 -0
  175. data/plugin/google_map.rb +168 -0
  176. data/plugin/google_sitemaps.rb +60 -0
  177. data/plugin/google_webmaster.rb +22 -0
  178. data/plugin/hatena_bookmark_nocomment.rb +9 -0
  179. data/plugin/hatena_star.rb +66 -0
  180. data/plugin/hb_footer.rb +255 -0
  181. data/plugin/hb_footer4sec.rb +244 -0
  182. data/plugin/hb_footer4sec_js.rb +30 -0
  183. data/plugin/hide_comment_form.rb +4 -0
  184. data/plugin/hide_sidebar_iphone.rb +21 -0
  185. data/plugin/iddy.rb +81 -0
  186. data/plugin/image_detail.rb +143 -0
  187. data/plugin/image_ex.rb +462 -0
  188. data/plugin/image_gps.rb +128 -0
  189. data/plugin/inline_wiki.rb +6 -0
  190. data/plugin/instagr.rb +64 -0
  191. data/plugin/ja/add_bookmark.rb +20 -0
  192. data/plugin/ja/del_footer.rb +10 -0
  193. data/plugin/ja/flickr.rb +62 -0
  194. data/plugin/ja/git-register.rb +3 -0
  195. data/plugin/ja/google_sitemaps.rb +35 -0
  196. data/plugin/ja/livedoor_weather.rb +25 -0
  197. data/plugin/ja/microsummary.rb +18 -0
  198. data/plugin/ja/nicovideo.rb +41 -0
  199. data/plugin/ja/openid.rb +7 -0
  200. data/plugin/ja/section_footer.rb +6 -0
  201. data/plugin/ja/section_footer2.rb +4 -0
  202. data/plugin/ja/socialbutton.rb +6 -0
  203. data/plugin/jdate.rb +20 -0
  204. data/plugin/jholiday.rb +16 -0
  205. data/plugin/jmonth.rb +20 -0
  206. data/plugin/jquery_ui_theme.rb +55 -0
  207. data/plugin/jroku.rb +28 -0
  208. data/plugin/jyear.rb +37 -0
  209. data/plugin/latlonglab_route.rb +25 -0
  210. data/plugin/lazy_referer.rb +38 -0
  211. data/plugin/livedoor_weather.rb +180 -0
  212. data/plugin/make_link.rb +44 -0
  213. data/plugin/makerss_category.rb +43 -0
  214. data/plugin/makerss_comment.rb +35 -0
  215. data/plugin/microsummary.rb +62 -0
  216. data/plugin/mm_footer.rb +215 -0
  217. data/plugin/monthly_autopagerize.rb +67 -0
  218. data/plugin/my_hotentry.rb +132 -0
  219. data/plugin/navi_day.rb +118 -0
  220. data/plugin/navi_this_month.rb +15 -0
  221. data/plugin/nicovideo.rb +115 -0
  222. data/plugin/notify_miniblog.rb +134 -0
  223. data/plugin/ogp.rb +55 -0
  224. data/plugin/ohmsha_estore.rb +71 -0
  225. data/plugin/openid.rb +90 -0
  226. data/plugin/opensearch_ad.rb +33 -0
  227. data/plugin/picasa.rb +56 -0
  228. data/plugin/plugin_checker.rb +41 -0
  229. data/plugin/popit.rb +22 -0
  230. data/plugin/prettify.rb +19 -0
  231. data/plugin/prezi.rb +10 -0
  232. data/plugin/profile.rb +222 -0
  233. data/plugin/puboo.rb +93 -0
  234. data/plugin/pygments_css.rb +76 -0
  235. data/plugin/rating.rb +419 -0
  236. data/plugin/recent_estraier.rb +50 -0
  237. data/plugin/recent_tweet.rb +71 -0
  238. data/plugin/retweet.rb +86 -0
  239. data/plugin/rubykaigi.rb +99 -0
  240. data/plugin/search-bing.rb +87 -0
  241. data/plugin/search-default.rb +264 -0
  242. data/plugin/search-google-custom.rb +60 -0
  243. data/plugin/search-yahoo-websearch.rb +121 -0
  244. data/plugin/search-yahoo.rb +109 -0
  245. data/plugin/section_footer.rb +195 -0
  246. data/plugin/section_footer2.rb +278 -0
  247. data/plugin/section_permalink.rb +73 -0
  248. data/plugin/section_permalink_anchor.rb +39 -0
  249. data/plugin/select_style.rb +42 -0
  250. data/plugin/select_theme.rb +90 -0
  251. data/plugin/show_and_hide.rb +77 -0
  252. data/plugin/slideshare.rb +10 -0
  253. data/plugin/socialbutton.rb +60 -0
  254. data/plugin/tatsu_zine.rb +93 -0
  255. data/plugin/tdiarygraph_flashstyle.rb +296 -0
  256. data/plugin/tdiarytimes.rb +166 -0
  257. data/plugin/tdiarytimes2.rb +406 -0
  258. data/plugin/tdiarytimes_flashstyle.rb +263 -0
  259. data/plugin/tdiarytimes_textstyle.rb +290 -0
  260. data/plugin/title_anchor.rb +16 -0
  261. data/plugin/tweet_quote.rb +106 -0
  262. data/plugin/twitpic.rb +10 -0
  263. data/plugin/twitter.rb +46 -0
  264. data/plugin/twitter_anywhere.rb +209 -0
  265. data/plugin/twitter_badge.rb +42 -0
  266. data/plugin/twitter_js.rb +59 -0
  267. data/plugin/ustream.rb +19 -0
  268. data/plugin/vimeo.rb +14 -0
  269. data/plugin/volatile.rb +89 -0
  270. data/plugin/vote.rb +100 -0
  271. data/plugin/wikiloc.rb +27 -0
  272. data/plugin/windex.rb +512 -0
  273. data/plugin/yahoo_kousei.rb +79 -0
  274. data/plugin/yahoo_map.rb +97 -0
  275. data/plugin/youtube.rb +33 -0
  276. data/plugin/yshop.rb +189 -0
  277. data/plugin/zenback.rb +46 -0
  278. data/spec/apple_webclip_spec.rb +46 -0
  279. data/spec/fixtures/friendfeed.xml +2 -0
  280. data/spec/fixtures/github.json +1 -0
  281. data/spec/fixtures/twitter.xml +73 -0
  282. data/spec/gist_spec.rb +16 -0
  283. data/spec/github_link_spec.rb +39 -0
  284. data/spec/google_analytics_spec.rb +60 -0
  285. data/spec/jdate_spec.rb +23 -0
  286. data/spec/jmonth_spec.rb +28 -0
  287. data/spec/jyear_spec.rb +21 -0
  288. data/spec/my_hotentry_spec.rb +78 -0
  289. data/spec/openid_spec.rb +246 -0
  290. data/spec/opensearch_ad_spec.rb +50 -0
  291. data/spec/profile_spec.rb +88 -0
  292. data/spec/rcov.opts +2 -0
  293. data/spec/spec_helper.rb +223 -0
  294. data/spec/title_anchor_spec.rb +39 -0
  295. data/spec/twitter_js_spec.rb +116 -0
  296. data/spec/youtube_spec.rb +20 -0
  297. data/style/hatena_style.rb +1011 -0
  298. data/style/markdown_style.rb +239 -0
  299. data/style/wikiext_style.rb +21 -0
  300. data/tdiary-contrib.gemspec +25 -0
  301. data/util/clean-spam/README.ja +1 -0
  302. data/util/clean-spam/tdiary-comment-clean +46 -0
  303. data/util/clean-spam/tdiary-comment-clean2 +81 -0
  304. data/util/clean-spam/tdiary-referer-clean +46 -0
  305. data/util/convert_pstore.rb +82 -0
  306. data/util/estraier-search/ChangeLog +36 -0
  307. data/util/estraier-search/README.ja +114 -0
  308. data/util/estraier-search/en/estraier-register.rb +3 -0
  309. data/util/estraier-search/estraier-register.rb +298 -0
  310. data/util/estraier-search/estraier-search.rb +273 -0
  311. data/util/estraier-search/estraier.rhtml +73 -0
  312. data/util/estraier-search/estraier.rxml +23 -0
  313. data/util/estraier-search/i.estraier.rhtml +31 -0
  314. data/util/estraier-search/ja/estraier-register.rb +3 -0
  315. data/util/image-gallery/README.ja +27 -0
  316. data/util/image-gallery/image-gallery.rb +523 -0
  317. data/util/image-gallery/image-gallery.rb.euc-jp +523 -0
  318. data/util/image-gallery/js/SmoothGallery/Changelog +52 -0
  319. data/util/image-gallery/js/SmoothGallery/css/ReMooz.css +186 -0
  320. data/util/image-gallery/js/SmoothGallery/css/img/carrow1.gif +0 -0
  321. data/util/image-gallery/js/SmoothGallery/css/img/carrow2.gif +0 -0
  322. data/util/image-gallery/js/SmoothGallery/css/img/closebox.gif +0 -0
  323. data/util/image-gallery/js/SmoothGallery/css/img/closebox.png +0 -0
  324. data/util/image-gallery/js/SmoothGallery/css/img/fleche1.gif +0 -0
  325. data/util/image-gallery/js/SmoothGallery/css/img/fleche1.png +0 -0
  326. data/util/image-gallery/js/SmoothGallery/css/img/fleche2.gif +0 -0
  327. data/util/image-gallery/js/SmoothGallery/css/img/fleche2.png +0 -0
  328. data/util/image-gallery/js/SmoothGallery/css/img/loading-bar-black.gif +0 -0
  329. data/util/image-gallery/js/SmoothGallery/css/img/open.gif +0 -0
  330. data/util/image-gallery/js/SmoothGallery/css/img/open.png +0 -0
  331. data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_e.png +0 -0
  332. data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_n.png +0 -0
  333. data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_ne.png +0 -0
  334. data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_nw.png +0 -0
  335. data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_s.png +0 -0
  336. data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_se.png +0 -0
  337. data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_sw.png +0 -0
  338. data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_w.png +0 -0
  339. data/util/image-gallery/js/SmoothGallery/css/img/spinner.gif +0 -0
  340. data/util/image-gallery/js/SmoothGallery/css/jd.gallery.css +371 -0
  341. data/util/image-gallery/js/SmoothGallery/css/layout.css +91 -0
  342. data/util/image-gallery/js/SmoothGallery/license.txt +621 -0
  343. data/util/image-gallery/js/SmoothGallery/resizer.php +113 -0
  344. data/util/image-gallery/js/SmoothGallery/scripts/Changelog +52 -0
  345. data/util/image-gallery/js/SmoothGallery/scripts/History.Routing.js +126 -0
  346. data/util/image-gallery/js/SmoothGallery/scripts/History.js +109 -0
  347. data/util/image-gallery/js/SmoothGallery/scripts/ReMooz.js +364 -0
  348. data/util/image-gallery/js/SmoothGallery/scripts/jd.gallery.js +843 -0
  349. data/util/image-gallery/js/SmoothGallery/scripts/jd.gallery.set.js +183 -0
  350. data/util/image-gallery/js/SmoothGallery/scripts/jd.gallery.transitions.js +90 -0
  351. data/util/image-gallery/js/SmoothGallery/scripts/jdgalleryresize.js +828 -0
  352. data/util/image-gallery/js/SmoothGallery/scripts/license.txt +621 -0
  353. data/util/image-gallery/js/SmoothGallery/scripts/mootools-1.2-more.js +103 -0
  354. data/util/image-gallery/js/SmoothGallery/scripts/mootools-1.2.1-core-yc.js +349 -0
  355. data/util/image-gallery/js/SmoothGallery/scripts/resizer.php +113 -0
  356. data/util/image-gallery/misc/plugin/recent_image.rb +406 -0
  357. data/util/image-gallery/skel/gallery.rhtml +154 -0
  358. data/util/image-gallery/skel/gallery.rhtml.euc-jp +154 -0
  359. data/util/image-gallery/tdiary.conf.igsample +8 -0
  360. data/util/image-gallery/theme/image-gallery.css +85 -0
  361. data/util/image2flickr.rb +282 -0
  362. data/util/posttdiary/README.ja +12 -0
  363. data/util/posttdiary/posttdiary-ex.rb +1155 -0
  364. data/util/posttdiary/posttdiary.rb +245 -0
  365. data/util/rast-search/ChangeLog +55 -0
  366. data/util/rast-search/README.ja +99 -0
  367. data/util/rast-search/en/rast-register.rb +3 -0
  368. data/util/rast-search/i.rast.rhtml +33 -0
  369. data/util/rast-search/ja/rast-register.rb +3 -0
  370. data/util/rast-search/rast-register.rb +326 -0
  371. data/util/rast-search/rast-search.rb +249 -0
  372. data/util/rast-search/rast.rhtml +66 -0
  373. data/util/rast-search/rast.rxml +21 -0
  374. data/util/section_link/README +11 -0
  375. data/util/section_link/misc/plugin/section_link.rb +68 -0
  376. data/util/section_link/misc/plugin/section_link_anchor.rb +38 -0
  377. data/util/section_link/tdiary/tdiary_day_ext.rb +21 -0
  378. data/util/section_link/tdiary/tdiaryext_style.rb +36 -0
  379. data/util/section_link/tdiary/wikiext_style.rb +36 -0
  380. data/util/tdiary-for-ruby1.9/compatible.rb +97 -0
  381. data/util/tdiary-for-ruby1.9/tdiary-2.2.0.patch +98 -0
  382. data/util/tdiary-for-ruby1.9/tdiary-2.3.1.patch +212 -0
  383. data/util/tdiary-grep/README +4 -0
  384. data/util/tdiary-grep/grep.rb +445 -0
  385. data/util/tdiary-mode/http.el +130 -0
  386. data/util/tdiary-mode/tdiary-mode.el +613 -0
  387. data/util/tdiary-vim/ChangeLog +25 -0
  388. data/util/tdiary-vim/README +60 -0
  389. data/util/tdiary-vim/tdiary.vim +350 -0
  390. data/util/tdiarysearch/README.en +53 -0
  391. data/util/tdiarysearch/README.ja +99 -0
  392. data/util/tdiarysearch/search.rb +504 -0
  393. 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("&laquo;先頭へ&nbsp;", 0, 0, @mode)
230
+ buf << format_link("&lt;前へ", @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("次へ&gt;", @start + @num, @num, @mode)
247
+ buf.concat(format_link("&nbsp;最後へ&raquo;", (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 << "&laquo;前へ"
265
+ else
266
+ buf << format_link_viewer("&laquo;前へ", @image_keys[@start - 1])
267
+ end
268
+ buf << "&nbsp;&nbsp;|&nbsp;&nbsp;"
269
+ buf << format_link("一覧へ", (@start / @num) * @num, 0, "list")
270
+ buf << "&nbsp;&nbsp;|&nbsp;&nbsp;"
271
+ if @start == @image_keys.length - 1
272
+ buf << "次へ&raquo;"
273
+ else
274
+ buf << format_link_viewer("次へ&raquo;", @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[&laquo;#{(@page_date - 1).to_s}], yesterday)
303
+ buf << format('&nbsp;&nbsp;|&nbsp;&nbsp;<a href="%s?mode=%s;order=%s">%s</a>&nbsp;&nbsp;|&nbsp;&nbsp;', _(@cgi.script_name ? @cgi.script_name : ''), _(@mode), _(@order), '全画像')
304
+ buf << format_link_date(%Q[#{(@page_date + 1).to_s}&raquo;], 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[&laquo;#{(@page_date << 1).to_s[0,7]}], prevmonth)
317
+ buf << format('&nbsp;&nbsp;|&nbsp;&nbsp;<a href="%s?mode=%s;order=%s">%s</a>&nbsp;&nbsp;|&nbsp;&nbsp;', _(@cgi.script_name ? @cgi.script_name : ''), _(@mode), _(@order), '全画像')
318
+ buf << format_link_date(%Q[#{(@page_date >> 1).to_s[0,7]}&raquo;], nextmonth)
319
+
320
+ elsif @page_year != ""
321
+ year = @page_year.to_i
322
+ buf << format_link_date(%Q[&laquo;#{(year - 1).to_s}], "^"+(year - 1).to_s)
323
+ buf << format('&nbsp;&nbsp;|&nbsp;&nbsp;<a href="%s?mode=%s;order=%s">%s</a>&nbsp;&nbsp;|&nbsp;&nbsp;', _(@cgi.script_name ? @cgi.script_name : ''), _(@mode), _(@order), '全画像')
324
+ buf << format_link_date(%Q[#{(year + 1).to_s}&raquo;], "^"+(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