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,28 @@
|
|
1
|
+
var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
|
2
|
+
(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
|
3
|
+
[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.push("^");b.push.apply(b,a);for(c=0;c<
|
4
|
+
f.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j==="("?++i:"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j==="("?(++i,d[i]===void 0&&(f[c]="(?:")):"\\"===j.charAt(0)&&
|
5
|
+
(j=+j.substring(1))&&j<=i&&(f[c]="\\"+d[i]);for(i=c=0;c<b;++c)"^"===f[c]&&"^"!==f[c+1]&&(f[c]="");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){s=!0;l=!1;break}}for(var r=
|
6
|
+
{b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(""+g);n.push("(?:"+y(g)+")")}return RegExp(n.join("|"),l?"gi":"g")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if("BR"===g||"LI"===g)h[s]="\n",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\r\n?/g,"\n"):g.replace(/[\t\n\r ]+/g," "),h[s]=g,t[s<<1]=y,y+=g.length,
|
7
|
+
t[s++<<1|1]=a)}}var e=/(?:^|\s)nocode(?:\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);m(a);return{a:h.join("").replace(/\n$/,""),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,"pln"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b===
|
8
|
+
"string")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b="pln")}if((c=b.length>=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
|
9
|
+
l=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
|
10
|
+
q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
|
11
|
+
q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
|
12
|
+
"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
|
13
|
+
a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
|
14
|
+
for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute("value",
|
15
|
+
m);var r=s.createElement("OL");r.className="linenums";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className="L"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode("\xa0")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m=
|
16
|
+
a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue=
|
17
|
+
j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
|
18
|
+
"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
|
19
|
+
H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
|
20
|
+
J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
|
21
|
+
I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),
|
22
|
+
["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",
|
23
|
+
/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),
|
24
|
+
["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
|
25
|
+
hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b=
|
26
|
+
!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,
|
27
|
+
250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",
|
28
|
+
PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();
|
data/js/referer.js
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
/**
|
2
|
+
* referer.js: fetch referer with ajax
|
3
|
+
*
|
4
|
+
* Copyright (C) 2013 by MATSUOKA Kohei <kmachu@gmail.com>
|
5
|
+
* You can distribute it under GPL.
|
6
|
+
*/
|
7
|
+
|
8
|
+
$(function() {
|
9
|
+
$('div.main').on('click', 'button.lazy_referer', function(e) {
|
10
|
+
var button = $(this);
|
11
|
+
button.attr("disabled", "disabled");
|
12
|
+
$.get(button.data('endpoint'), function (data) {
|
13
|
+
button.after($(data));
|
14
|
+
button.hide();
|
15
|
+
}, 'html');
|
16
|
+
});
|
17
|
+
});
|
data/js/show_and_hide.js
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
/*
|
2
|
+
* show_and_hide.js : javascript for show_and_hide.rb plugin of tDiary
|
3
|
+
*
|
4
|
+
* Copyright (C) 2011 by tamoot <tamoot+tdiary@gmail.com>
|
5
|
+
* You can distribute it under GPL.
|
6
|
+
*/
|
7
|
+
|
8
|
+
$( function() {
|
9
|
+
|
10
|
+
function show_and_hide(target) {
|
11
|
+
$('.show_and_hide_toggle', target).each( function() {
|
12
|
+
$(this).click( function() {
|
13
|
+
$('.show_and_hide#'+$(this).attr('data-showandhideid')).slideToggle(400);
|
14
|
+
});
|
15
|
+
});
|
16
|
+
};
|
17
|
+
|
18
|
+
// for AutoPagerize
|
19
|
+
$(window).bind('AutoPagerize_DOMNodeInserted', function(event) {
|
20
|
+
show_and_hide(event.target);
|
21
|
+
});
|
22
|
+
|
23
|
+
// for AuthPatchWork
|
24
|
+
// NOTE: jQuery.bind() cannot handle an event that include a dot charactor.
|
25
|
+
// see http://todayspython.blogspot.com/2011/06/autopager-autopagerize.html
|
26
|
+
if(window.addEventListener) {
|
27
|
+
window.addEventListener('AutoPatchWork.DOMNodeInserted', function(event) {
|
28
|
+
show_and_hide(event.target);
|
29
|
+
}, false);
|
30
|
+
} else if(window.attachEvent) {
|
31
|
+
window.attachEvent('onAutoPatchWork.DOMNodeInserted', function(event) {
|
32
|
+
show_and_hide(event.target);
|
33
|
+
});
|
34
|
+
};
|
35
|
+
|
36
|
+
show_and_hide(document)
|
37
|
+
$('.show_and_hide').hide();
|
38
|
+
});
|
39
|
+
|
data/js/socialbutton.js
ADDED
@@ -0,0 +1,126 @@
|
|
1
|
+
/**
|
2
|
+
* socialbutton.js -
|
3
|
+
*
|
4
|
+
* Copyright (C) 2011 by MATSUOKA Kohei <kmachu@gmail.com>
|
5
|
+
* You can distribute it under GPL.
|
6
|
+
*/
|
7
|
+
|
8
|
+
/**
|
9
|
+
* SYNOPSIS
|
10
|
+
*
|
11
|
+
* you can set options at socialbutton.rb
|
12
|
+
*
|
13
|
+
* $tDiary.plugin.socialbutton.enables =
|
14
|
+
* ['twitter', 'hatena', 'facebook_like', 'evernote'];
|
15
|
+
*
|
16
|
+
* $tDiary.plugin.socialbutton.options = {
|
17
|
+
* twitter: { via: 'machu' }
|
18
|
+
* };
|
19
|
+
*
|
20
|
+
*/
|
21
|
+
|
22
|
+
$(function() {
|
23
|
+
|
24
|
+
// load config from tDiary plugin (socialbutton.rb)
|
25
|
+
var config = $tDiary.plugin.socialbutton;
|
26
|
+
|
27
|
+
// set options for jQuery.socialbutton
|
28
|
+
var callbacks = {
|
29
|
+
twitter: function(url, title) {
|
30
|
+
return {
|
31
|
+
url: url,
|
32
|
+
text: title,
|
33
|
+
button: 'horizontal',
|
34
|
+
lang: $('html').attr('lang').substr(0,2)
|
35
|
+
};
|
36
|
+
},
|
37
|
+
|
38
|
+
hatena: function(url, title) {
|
39
|
+
return {
|
40
|
+
url: url,
|
41
|
+
title: title,
|
42
|
+
button: 'standard'
|
43
|
+
};
|
44
|
+
},
|
45
|
+
|
46
|
+
facebook_like: function(url, title) {
|
47
|
+
return {
|
48
|
+
url: url,
|
49
|
+
button: 'button_count',
|
50
|
+
locale: $('html').attr('lang').replace('-', '_')
|
51
|
+
};
|
52
|
+
},
|
53
|
+
|
54
|
+
evernote: function(url, title) {
|
55
|
+
return {
|
56
|
+
url: url,
|
57
|
+
title: title,
|
58
|
+
button: 'article-clipper-jp'
|
59
|
+
};
|
60
|
+
},
|
61
|
+
|
62
|
+
google_plusone: function(url, title) {
|
63
|
+
return {
|
64
|
+
href: url,
|
65
|
+
size: 'medium',
|
66
|
+
lang: $('html').attr('lang')
|
67
|
+
};
|
68
|
+
},
|
69
|
+
|
70
|
+
pinterest: function(url, title) {
|
71
|
+
return {
|
72
|
+
url: url,
|
73
|
+
media: $('p img:first', $('div.section h3 a[name=' + url.substr(-3) + ']').parent().parent()).attr('src'),
|
74
|
+
description: title,
|
75
|
+
button: 'horizontal',
|
76
|
+
};
|
77
|
+
},
|
78
|
+
|
79
|
+
};
|
80
|
+
|
81
|
+
function socialbutton(target) {
|
82
|
+
$('.socialbuttons').css('height', '1em')
|
83
|
+
var bottom = $(window).height() + $(window).scrollTop();
|
84
|
+
|
85
|
+
$($tDiary.blogkit ? '.day' : '.section')
|
86
|
+
.filter(function() {
|
87
|
+
return bottom > $(this).offset().top;
|
88
|
+
})
|
89
|
+
.filter(function() {
|
90
|
+
return $(this).find('.socialbutton').size() == 0
|
91
|
+
})
|
92
|
+
.each(function() {
|
93
|
+
if ($tDiary.blogkit) {
|
94
|
+
var link = $(this).children('h2').find('a:first').get(0);
|
95
|
+
var url = link ? link.href : document.URL;
|
96
|
+
var title = $(this).children('h2').find('.title').text();
|
97
|
+
} else {
|
98
|
+
var url = $(this).children('h3').children('a').get(0).href;
|
99
|
+
var title = $(this).children('h3').children('a').attr('title');
|
100
|
+
}
|
101
|
+
if (url && title) {
|
102
|
+
// console.debug('loading socialbutton: ' + title);
|
103
|
+
var socialbuttons = $(this).find('.socialbuttons');
|
104
|
+
append_button(url, title, socialbuttons);
|
105
|
+
}
|
106
|
+
});
|
107
|
+
}
|
108
|
+
|
109
|
+
function append_button(url, title, socialbuttons) {
|
110
|
+
$.each(config.enables, function(i, service) {
|
111
|
+
var options = callbacks[service](url, title.replace(/"/g, '"'));
|
112
|
+
$.extend(options, config.options[service]);
|
113
|
+
$('<div class="socialbutton"></div>')
|
114
|
+
.css("float", "left")
|
115
|
+
.css("margin-right", "0.5em")
|
116
|
+
.appendTo(socialbuttons)
|
117
|
+
.socialbutton(service, options);
|
118
|
+
});
|
119
|
+
}
|
120
|
+
|
121
|
+
$(window).bind('scroll', function(event) {
|
122
|
+
socialbutton(document);
|
123
|
+
});
|
124
|
+
|
125
|
+
socialbutton(document);
|
126
|
+
});
|
@@ -0,0 +1,28 @@
|
|
1
|
+
/*
|
2
|
+
* twitter_anywhere.js : use Twitter@Anywhere
|
3
|
+
*
|
4
|
+
* Copyright (C) 2012 by tamoot <tamoot+tdiary@gmail.com>
|
5
|
+
* You can distribute it under GPL.
|
6
|
+
*/
|
7
|
+
|
8
|
+
$( function() {
|
9
|
+
|
10
|
+
// load config from tDiary plugin (twitter_anywhere.rb)
|
11
|
+
var config = $tDiary.plugin.twitter_anywhere;
|
12
|
+
|
13
|
+
// hovarcards
|
14
|
+
var expand = config.hovercards.expand_default;
|
15
|
+
$.each(config.selectors, function(i, css){
|
16
|
+
twttr.anywhere(function(twitter) {
|
17
|
+
twitter(css).hovercards(expand);
|
18
|
+
});
|
19
|
+
});
|
20
|
+
|
21
|
+
});
|
22
|
+
|
23
|
+
// tweet box
|
24
|
+
function showTweetBox(option) {
|
25
|
+
twttr.anywhere(function (T) {
|
26
|
+
T("#tweetbox").tweetBox(option);
|
27
|
+
});
|
28
|
+
}
|
data/js/yahoo_kousei.js
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
$( function() {
|
2
|
+
$( '.plugin_yahoo_search_result_raw' ).each( function( index ) {
|
3
|
+
$(this).click( function() {
|
4
|
+
var pos = $($('td', $(this)).get(3)).text().split(',');
|
5
|
+
sp = parseInt(pos[0]);
|
6
|
+
ep = parseInt(pos[1]);
|
7
|
+
var o = $( 'textarea[name="body"]' ).get( 0 );
|
8
|
+
o.focus();
|
9
|
+
if ( jQuery.browser.msie ) {
|
10
|
+
var range = document.selection.createRange();
|
11
|
+
range.collapse();
|
12
|
+
range.moveStart( 'character', sp );
|
13
|
+
range.moveEnd( 'character', ep );
|
14
|
+
range.select();
|
15
|
+
} else {
|
16
|
+
o.setSelectionRange( sp , sp + ep );
|
17
|
+
}
|
18
|
+
} );
|
19
|
+
} );
|
20
|
+
} );
|
21
|
+
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# Copyright (C) 2008, KURODA Hiraku <hiraku@hinet.mydns.jp>
|
2
|
+
# You can redistribute it and/or modify it under GPL2.
|
3
|
+
|
4
|
+
require "bayes"
|
5
|
+
require "kconv"
|
6
|
+
|
7
|
+
module Bayes
|
8
|
+
module CHARSET
|
9
|
+
module EUC
|
10
|
+
KCONV = Kconv::EUC
|
11
|
+
end
|
12
|
+
|
13
|
+
module UTF8
|
14
|
+
KCONV = Kconv::UTF8
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
class FilterBase
|
19
|
+
def convert_corpus(corpus, to_code, from_code)
|
20
|
+
r = self.class::Corpus.new
|
21
|
+
corpus.each do |k, v|
|
22
|
+
r[k.kconv(to_code::KCONV, from_code::KCONV)] = v
|
23
|
+
end
|
24
|
+
r
|
25
|
+
end
|
26
|
+
private :convert_corpus
|
27
|
+
|
28
|
+
def convert(to_code, from_code)
|
29
|
+
@charset = to_code
|
30
|
+
@ham = convert_corpus(@ham, to_code, from_code)
|
31
|
+
@spam = convert_corpus(@spam, to_code, from_code)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/lib/bayes.rb
ADDED
@@ -0,0 +1,232 @@
|
|
1
|
+
# Copyright (C) 2007, KURODA Hiraku <hiraku@hinet.mydns.jp>
|
2
|
+
# You can redistribute it and/or modify it under GPL2.
|
3
|
+
|
4
|
+
require "pstore"
|
5
|
+
|
6
|
+
module Bayes
|
7
|
+
module CHARSET
|
8
|
+
def self.setup_re(m)
|
9
|
+
o = $KCODE
|
10
|
+
$KCODE = m::KCODE
|
11
|
+
m.const_set(:RE_MESSAGE_TOKEN, Regexp.union(m::RE_KATAKANA, m::RE_KANJI, /[a-zA-Z]+/))
|
12
|
+
$KCODE=o
|
13
|
+
end
|
14
|
+
|
15
|
+
module EUC
|
16
|
+
KCODE = "e"
|
17
|
+
KATAKANA = "\xa5\xa2-\xa5\xf3"
|
18
|
+
BAR = "\xa1\xbc"
|
19
|
+
KANJI = "\xb0\xa1-\xfc\xfe"
|
20
|
+
RE_KATAKANA = /[#{KATAKANA}#{BAR}]{2,}/eo
|
21
|
+
RE_KANJI = /[#{KANJI}]{2,}/eo
|
22
|
+
|
23
|
+
CHARSET.setup_re(self)
|
24
|
+
end
|
25
|
+
|
26
|
+
module UTF8
|
27
|
+
KCODE = "u"
|
28
|
+
def self.c2u(c)
|
29
|
+
[c].pack("U")
|
30
|
+
end
|
31
|
+
def self.utf_range(a, b)
|
32
|
+
"#{c2u(a)}-#{c2u(b)}"
|
33
|
+
end
|
34
|
+
KATAKANA = utf_range(0x30a0, 0x30ff)
|
35
|
+
BAR = c2u(0x30fc)
|
36
|
+
KANJI = utf_range(0x4e00, 0x9faf)
|
37
|
+
RE_KATAKANA = /[#{KATAKANA}#{BAR}]{2,}/uo
|
38
|
+
RE_KANJI = /[#{KANJI}]{2,}/uo
|
39
|
+
|
40
|
+
CHARSET.setup_re(self)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
class TokenList < Array
|
45
|
+
attr_reader :charset
|
46
|
+
|
47
|
+
def initialize(charset=nil)
|
48
|
+
unless charset
|
49
|
+
charset =
|
50
|
+
case $KCODE
|
51
|
+
when /^e/i
|
52
|
+
CHARSET::EUC
|
53
|
+
else
|
54
|
+
CHARSET::UTF8
|
55
|
+
end
|
56
|
+
end
|
57
|
+
@charset = charset
|
58
|
+
end
|
59
|
+
|
60
|
+
alias _concat concat
|
61
|
+
def concat(array, prefix=nil)
|
62
|
+
if prefix
|
63
|
+
_concat(array.map{|i| "#{prefix} #{i.to_s}"})
|
64
|
+
else
|
65
|
+
_concat(array)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
alias _push push
|
70
|
+
def push(item, prefix=nil)
|
71
|
+
if prefix
|
72
|
+
_push("#{prefix} #{item.to_s}")
|
73
|
+
else
|
74
|
+
_push(item)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def add_host(host, prefix=nil)
|
79
|
+
if /^(?:\d{1,3}\.){3}\d{1,3}$/ =~ host
|
80
|
+
while host.size>0
|
81
|
+
push(host, prefix)
|
82
|
+
host = host[/^(.*?)\.?\d+$/, 1]
|
83
|
+
end
|
84
|
+
else
|
85
|
+
push(host, prefix)
|
86
|
+
|
87
|
+
h = host
|
88
|
+
while /^(.*?)[-_.](.*)$/=~h
|
89
|
+
h = $2
|
90
|
+
push($1, prefix)
|
91
|
+
push(h, prefix)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
self
|
95
|
+
end
|
96
|
+
|
97
|
+
def add_url(url, prefix=nil)
|
98
|
+
if %r[^(?:https?|ftp)://(.*?)(?::\d+)?/(.*?)\/?(\?.*)?$] =~ url
|
99
|
+
host, path = $1, $2
|
100
|
+
|
101
|
+
add_host(host, prefix)
|
102
|
+
|
103
|
+
if path.size>0
|
104
|
+
push(path, prefix)
|
105
|
+
|
106
|
+
p = path
|
107
|
+
re = %r[^(.*)[-_./](.*?)$]
|
108
|
+
while re=~p
|
109
|
+
p = $1
|
110
|
+
push($2, prefix)
|
111
|
+
push(p, prefix)
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
self
|
116
|
+
end
|
117
|
+
|
118
|
+
def add_message(message, prefix=nil)
|
119
|
+
concat(message.scan(@charset::RE_MESSAGE_TOKEN), prefix)
|
120
|
+
self
|
121
|
+
end
|
122
|
+
|
123
|
+
def add_mail_addr(addr, prefix=nil)
|
124
|
+
push(addr, prefix)
|
125
|
+
|
126
|
+
name, host = addr.split(/@/)
|
127
|
+
return self if (name||"").empty?
|
128
|
+
host ||= ""
|
129
|
+
push(name, prefix)
|
130
|
+
add_host(host, prefix)
|
131
|
+
self
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
class FilterBase
|
136
|
+
attr_reader :spam, :ham, :db_name, :charset
|
137
|
+
|
138
|
+
def initialize(db_name=nil, charset=nil)
|
139
|
+
@spam = self.class::Corpus.new
|
140
|
+
@ham = self.class::Corpus.new
|
141
|
+
@charset = charset
|
142
|
+
|
143
|
+
@db_name = db_name
|
144
|
+
if db_name && File.exist?(db_name)
|
145
|
+
PStore.new(db_name).transaction(true) do |db|
|
146
|
+
@spam = db["spam"]
|
147
|
+
@ham = db["ham"]
|
148
|
+
@charset = db["charset"]
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
def save(db_name=nil)
|
154
|
+
db_name ||= @db_name
|
155
|
+
@db_name ||= db_name
|
156
|
+
return unless @db_name
|
157
|
+
PStore.new(@db_name).transaction do |db|
|
158
|
+
db["spam"] = @spam
|
159
|
+
db["ham"] = @ham
|
160
|
+
db["charset"] = @charset
|
161
|
+
yield(db) if block_given?
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
def [](token)
|
166
|
+
score(token)
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
class PlainBayes < FilterBase
|
171
|
+
class Corpus < Hash
|
172
|
+
def initialize
|
173
|
+
super(0.0)
|
174
|
+
end
|
175
|
+
|
176
|
+
def <<(src)
|
177
|
+
s = src.size.to_f
|
178
|
+
src.each do |i|
|
179
|
+
self[i] += 1/s
|
180
|
+
end
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
def score(token)
|
185
|
+
return nil unless @spam.include?(token) || @ham.include?(token)
|
186
|
+
s = @spam[token]
|
187
|
+
h = @ham[token]
|
188
|
+
s/(s+h)
|
189
|
+
end
|
190
|
+
|
191
|
+
def estimate(tokens, take=15)
|
192
|
+
s = tokens.uniq.map{|i| score(i)}.compact.sort{|a, b| (0.5-a).abs <=> (0.5-b)}.reverse[0...take]
|
193
|
+
return nil if s.empty? || s.include?(1.0) && s.include?(0.0)
|
194
|
+
|
195
|
+
prod = s.inject(1.0){|r, i| r*i}
|
196
|
+
return prod/(prod+s.inject(1.0){|r, i| r*(1-i)})
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
class PaulGraham < FilterBase
|
201
|
+
class Corpus < Hash
|
202
|
+
attr_reader :count
|
203
|
+
def initialize
|
204
|
+
super(0)
|
205
|
+
@count = 0
|
206
|
+
end
|
207
|
+
|
208
|
+
def <<(src)
|
209
|
+
@count += 1
|
210
|
+
src.each do |i|
|
211
|
+
self[i] += 1
|
212
|
+
end
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
def score(token)
|
217
|
+
return 0.4 unless @spam.include?(token) or @ham.include?(token)
|
218
|
+
g = @ham.count==0 ? 0.0 : [1.0, 2*@ham[token]/@ham.count.to_f].min
|
219
|
+
b = @spam.count==0 ? 0.0 : [1.0, @spam[token]/@spam.count.to_f].min
|
220
|
+
r = [0.01, [0.99, b/(g+b)].min].max
|
221
|
+
r
|
222
|
+
end
|
223
|
+
|
224
|
+
def estimate(tokens, take=15)
|
225
|
+
s = tokens.uniq.map{|i| score(i)}.compact.sort{|a, b| (0.5-a).abs <=> (0.5-b)}.reverse[0...take]
|
226
|
+
return nil if s.empty? || s.include?(1.0) && s.include?(0.0)
|
227
|
+
|
228
|
+
prod = s.inject(1.0){|r, i| r*i}
|
229
|
+
return prod/(prod+s.inject(1.0){|r, i| r*(1-i)})
|
230
|
+
end
|
231
|
+
end
|
232
|
+
end
|
data/lib/exifparser/BUGS
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
* DO NOT USE WITH ruby-libexif!
|