├── .devcontainer ├── .htpasswd ├── Dockerfile ├── Gemfile.local ├── README.md ├── devcontainer.json ├── run-app.sh ├── setup-app.sh └── tdiary.conf ├── .dockerignore ├── .github └── workflows │ └── ci.yml ├── .gitignore ├── .vscode └── launch.json ├── Gemfile ├── README.en.md ├── README.md ├── Rakefile ├── doc ├── en │ ├── filter │ │ └── spambayes.txt │ ├── plugin.txt │ ├── style │ │ ├── hatena.txt │ │ └── markdown.txt │ └── util.txt └── ja │ ├── filter │ ├── antirefspam.history.txt │ ├── antirefspam.txt │ ├── comment_key.ja.html │ └── spambayes.txt │ ├── plugin.txt │ ├── plugin │ ├── add_bookmark.txt │ ├── category_to_tag.txt │ ├── cocoment.txt │ ├── google_adsense.txt │ ├── google_analytics.txt │ ├── image_gps.txt │ ├── livedoor_weather.txt │ ├── opensearch_ad.txt │ ├── playstore.txt │ ├── section_footer.txt │ └── select_theme.txt │ ├── style │ ├── hatena.txt │ └── markdown.txt │ └── util.txt ├── filter ├── antirefspam.rb ├── commentkey.rb ├── commentsize.rb ├── hidecomment.rb ├── iplookup.rb ├── plugin │ ├── antirefspam.rb │ ├── commentkey.rb │ ├── commentsize.rb │ ├── en │ │ ├── iplookup.rb │ │ └── spambayes.rb │ ├── iplookup.rb │ ├── ja │ │ ├── antirefspam.rb │ │ ├── commentkey.rb │ │ ├── commentsize.rb │ │ ├── iplookup.rb │ │ └── spambayes.rb │ ├── spambayes.rb │ └── zh │ │ └── iplookup.rb ├── rblcheck.rb ├── spambayes.rb └── spamlookup.rb ├── io └── dbi_io │ ├── ChangeLog │ ├── README.ja │ ├── dbi_io.rb │ ├── plugin │ └── refererDbiIO.rb │ └── tdiary_table.sql ├── js ├── appstore.js ├── datepicker.js ├── editor.js ├── flickr.js ├── google_photos.js ├── gyazo.js ├── hide_sidebar_smartphone.js ├── image_ex.js ├── jquery.socialbutton.js ├── nicovideo.js ├── plugin_checker.js ├── referer.js ├── shogizumen.min.js ├── show_and_hide.js ├── slideshow.js ├── socialbutton.js ├── twitter_anywhere.js └── yahoo_kousei.js ├── lib ├── bayes.rb ├── bayes │ └── convert.rb ├── exifparser │ └── README ├── extensions │ └── contrib.rb ├── tdiary-contrib.rb ├── tdiary │ └── contrib │ │ └── version.rb └── wgs2tky.rb ├── misc └── section_footer2 │ ├── buzzurl.yaml │ ├── fc2.yaml │ ├── ldc.yaml │ ├── retweet.yaml │ ├── twitter.yaml │ └── yahoo.yaml ├── plugin ├── add_bookmark.rb ├── apple_webclip.rb ├── appstore.rb ├── bigpresen.rb ├── bitly.rb ├── bootstrap-navi.rb ├── brow_si.rb ├── canonical.rb ├── category_similar.rb ├── category_to_tag.rb ├── category_to_tagcloud.rb ├── chatgpt_elaborate.rb ├── cocomment.rb ├── code-prettify.rb ├── coderay.rb ├── coderwall.rb ├── comment_pushbullet.rb ├── datepicker.rb ├── day2section.rb ├── del_footer.rb ├── description_from_body.rb ├── development.rb ├── editor.rb ├── en │ ├── add_bookmark.rb │ ├── category-lite.rb │ ├── del_footer.rb │ ├── git-register.rb │ ├── livedoor_weather.rb │ ├── microsummary.rb │ ├── nicovideo.rb │ ├── openid.rb │ ├── profile.rb │ ├── section_footer.rb │ ├── section_footer2.rb │ └── socialbutton.rb ├── everytrail.rb ├── facebook_comments.rb ├── flickr.rb ├── gist.rb ├── git-register.rb ├── github_badge.rb ├── github_link.rb ├── goo_gl.rb ├── google_adsense.rb ├── google_analytics.rb ├── google_map.rb ├── google_photos.rb ├── google_sitemaps.rb ├── google_universal_analytics.rb ├── google_webmaster.rb ├── gyazo.rb ├── hatena_bookmark_nocomment.rb ├── hatena_star.rb ├── hb_footer.rb ├── hb_footer4sec.rb ├── hb_footer4sec_js.rb ├── hide_comment_form.rb ├── hide_sidebar_smartphone.rb ├── iddy.rb ├── image_ex.rb ├── image_gps.rb ├── inline_wiki.rb ├── instagr.rb ├── instagram.rb ├── ja │ ├── add_bookmark.rb │ ├── category-lite.rb │ ├── del_footer.rb │ ├── flickr.rb │ ├── git-register.rb │ ├── google_sitemaps.rb │ ├── livedoor_weather.rb │ ├── microsummary.rb │ ├── nicovideo.rb │ ├── openbd.rb │ ├── openid.rb │ ├── section_footer.rb │ ├── section_footer2.rb │ ├── socialbutton.rb │ └── yo_update.rb ├── jdate.rb ├── jholiday.rb ├── jmonth.rb ├── jquery_ui_theme.rb ├── jroku.rb ├── jyear.rb ├── latlonglab_route.rb ├── lazy_referer.rb ├── livedoor_weather.rb ├── make_link.rb ├── makerss_category.rb ├── makerss_comment.rb ├── mathjax.rb ├── microsummary.rb ├── mm_footer.rb ├── monthly_autopagerize.rb ├── my_hotentry.rb ├── navi_day.rb ├── navi_this_month.rb ├── nhk_program_info.rb ├── nicovideo.rb ├── notify_miniblog.rb ├── ogp.rb ├── ohmsha_estore.rb ├── openbd.rb ├── openid.rb ├── opensearch_ad.rb ├── picasa.rb ├── plantuml.rb ├── playstore.rb ├── plugin_checker.rb ├── popit.rb ├── prettify.rb ├── prezi.rb ├── profile.rb ├── puboo.rb ├── pygments_css.rb ├── rating.rb ├── recent_estraier.rb ├── recent_tweet.rb ├── retweet.rb ├── rubykaigi.rb ├── search-bing.rb ├── search-google-custom.rb ├── search-yahoo-websearch.rb ├── search-yahoo.rb ├── section_footer.rb ├── section_footer2.rb ├── section_permalink.rb ├── section_permalink_anchor.rb ├── select-style.rb ├── select_style.rb ├── select_theme.rb ├── shogizumen.rb ├── show_and_hide.rb ├── slideshare.rb ├── slideshow.rb ├── socialbutton.rb ├── squeeze.rb ├── steam.rb ├── tatsu_zine.rb ├── tdiarytimes2.rb ├── tdiarytimes_flashstyle.rb ├── tdiarytimes_textstyle.rb ├── title_anchor.rb ├── tweet_quote.rb ├── twitpic.rb ├── twitter.rb ├── twitter_anywhere.rb ├── twitter_badge.rb ├── twitter_js.rb ├── twitter_summary_card.rb ├── ustream.rb ├── vimeo.rb ├── volatile.rb ├── vote.rb ├── wikiloc.rb ├── windex.rb ├── yahoo_kousei.rb ├── yahoo_map.rb ├── yo_update.rb ├── youtube.rb ├── yshop.rb └── zenback.rb ├── spec ├── apple_webclip_spec.rb ├── fixtures │ ├── flickr │ │ ├── 5950109223.flickr.photos.getInfo.xml │ │ └── 5950109223.flickr.photos.getSizes.xml │ ├── github.json │ ├── gravatar.json │ ├── my_hotentry │ │ ├── entrylist-empty.xml │ │ └── entrylist.xml │ └── twitter.xml ├── flicker_spec.rb ├── gist_spec.rb ├── github_link_spec.rb ├── google_analytics_spec.rb ├── google_universal_analytics_spec.rb ├── jdate_spec.rb ├── jmonth_spec.rb ├── jyear_spec.rb ├── my_hotentry_spec.rb ├── openid_spec.rb ├── opensearch_ad_spec.rb ├── profile_spec.rb ├── rcov.opts ├── spec_helper.rb ├── title_anchor_spec.rb └── youtube_spec.rb ├── style ├── hatena_style.rb ├── markdown_style.rb └── wikiext_style.rb ├── tdiary-contrib.gemspec └── util ├── clean-spam ├── README.ja ├── tdiary-comment-clean ├── tdiary-comment-clean2 └── tdiary-referer-clean ├── convert_pstore.rb ├── estraier-search ├── ChangeLog ├── README.ja ├── en │ └── estraier-register.rb ├── estraier-register.rb ├── estraier-search.rb ├── estraier.rhtml ├── estraier.rxml ├── i.estraier.rhtml └── ja │ └── estraier-register.rb ├── image-gallery ├── README.ja ├── image-gallery.rb ├── js │ └── SmoothGallery │ │ ├── Changelog │ │ ├── css │ │ ├── ReMooz.css │ │ ├── img │ │ │ ├── carrow1.gif │ │ │ ├── carrow2.gif │ │ │ ├── closebox.gif │ │ │ ├── closebox.png │ │ │ ├── fleche1.gif │ │ │ ├── fleche1.png │ │ │ ├── fleche2.gif │ │ │ ├── fleche2.png │ │ │ ├── loading-bar-black.gif │ │ │ ├── open.gif │ │ │ ├── open.png │ │ │ ├── remo_bg_e.png │ │ │ ├── remo_bg_n.png │ │ │ ├── remo_bg_ne.png │ │ │ ├── remo_bg_nw.png │ │ │ ├── remo_bg_s.png │ │ │ ├── remo_bg_se.png │ │ │ ├── remo_bg_sw.png │ │ │ ├── remo_bg_w.png │ │ │ └── spinner.gif │ │ ├── jd.gallery.css │ │ └── layout.css │ │ ├── license.txt │ │ ├── resizer.php │ │ └── scripts │ │ ├── Changelog │ │ ├── History.Routing.js │ │ ├── History.js │ │ ├── ReMooz.js │ │ ├── jd.gallery.js │ │ ├── jd.gallery.set.js │ │ ├── jd.gallery.transitions.js │ │ ├── jdgalleryresize.js │ │ ├── license.txt │ │ ├── mootools-1.2-more.js │ │ ├── mootools-1.2.1-core-yc.js │ │ └── resizer.php ├── misc │ └── plugin │ │ ├── recent_image.rb │ │ └── view_exif.rb ├── tdiary.conf.igsample ├── theme │ └── image-gallery.css └── views │ └── gallery.rhtml ├── image2flickr.rb ├── posttdiary ├── README.ja ├── posttdiary-ex.rb └── posttdiary.rb ├── rast-search ├── ChangeLog ├── README.ja ├── en │ └── rast-register.rb ├── i.rast.rhtml ├── ja │ └── rast-register.rb ├── rast-register.rb ├── rast-search.rb ├── rast.rhtml └── rast.rxml ├── section_link ├── README ├── misc │ └── plugin │ │ ├── section_link.rb │ │ └── section_link_anchor.rb └── tdiary │ ├── tdiary_day_ext.rb │ ├── tdiaryext_style.rb │ └── wikiext_style.rb ├── tdiary-for-ruby1.9 ├── compatible.rb ├── tdiary-2.2.0.patch └── tdiary-2.3.1.patch ├── tdiary-grep ├── README └── grep.rb ├── tdiary-mode ├── http.el └── tdiary-mode.el └── tdiary-vim ├── ChangeLog ├── README └── tdiary.vim /.devcontainer/.htpasswd: -------------------------------------------------------------------------------- 1 | tdiary:JCZpsgS6qdNgQ 2 | -------------------------------------------------------------------------------- /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | # See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.154.0/containers/ruby/.devcontainer/base.Dockerfile 2 | 3 | # [Choice] Ruby version: 2, 2.7, 2.6, 2.5 4 | ARG VARIANT="2" 5 | FROM mcr.microsoft.com/vscode/devcontainers/ruby:0-${VARIANT} 6 | LABEL maintainer "@tdtds " 7 | 8 | # [Option] Install Node.js 9 | ARG INSTALL_NODE="true" 10 | ARG NODE_VERSION="lts/*" 11 | RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi 12 | 13 | # [Optional] Uncomment this section to install additional OS packages. 14 | RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ 15 | && apt-get -y install --no-install-recommends apt-utils libidn11-dev sqlite3 libsqlite3-dev 16 | 17 | # [Optional] Uncomment this line to install additional gems. 18 | ARG CORE="/workspaces/core" 19 | ARG CONTRIB="/workspaces/contrib" 20 | RUN mkdir -p /workspaces \ 21 | && git clone --depth=1 https://github.com/tdiary/tdiary-core.git "${CORE}" \ 22 | && rm ${CORE}/Gemfile.lock 23 | ENV HTPASSWD="${CONTRIB}/.devcontainer/.htpasswd" 24 | COPY ./tdiary.conf "${CORE}" 25 | COPY ./Gemfile.local "${CORE}" 26 | RUN chown -R 1000:1000 "${CORE}" 27 | 28 | # [Optional] Uncomment this line to install global node packages. 29 | # RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 30 | EXPOSE 9292 31 | CMD "${CONTRIB}/.devcontainer/run-app.sh" 32 | -------------------------------------------------------------------------------- /.devcontainer/Gemfile.local: -------------------------------------------------------------------------------- 1 | gem 'tdiary-contrib', path: '/workspaces/contrib' 2 | gem 'puma' 3 | -------------------------------------------------------------------------------- /.devcontainer/README.md: -------------------------------------------------------------------------------- 1 | # Docker image for tdiary-contrib development 2 | 3 | Your editor is vscode? See bottom of this document. 4 | 5 | ## how to build an image 6 | 7 | ``` 8 | % docker build -t tdiary-contrib-devel .devcontainer 9 | ``` 10 | 11 | ## how to run in the Docker 12 | 13 | ``` 14 | % docker run -v $(pwd):/workspace -p 9292:9292 -it --rm tdiary-contrib-devel 15 | ``` 16 | 17 | ## develoment on vscode remote-container 18 | 19 | 1. Open the folder of this repository by Remte-Container Extention, then starting build a image automatically. 20 | 2. Only at first, run `.devcontainer/setup-app.sh` for making `tdiary.conf` and `.htpasswd`. 21 | 3. Open Debug (`Ctrl + Shift + D`) and start "Debug tDiary-contrib". 22 | 4. Open [`http://localhost:9292`](http://localhost:9292) in your browser. -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: 2 | // https://github.com/microsoft/vscode-dev-containers/tree/v0.154.0/containers/ruby 3 | { 4 | "name": "tDiary-contrib", 5 | "build": { 6 | "dockerfile": "Dockerfile", 7 | "args": { 8 | // Update 'VARIANT' to pick a Ruby version: 2, 2.7, 2.6, 2.5 9 | "VARIANT": "2", 10 | // Options 11 | "INSTALL_NODE": "false", 12 | "NODE_VERSION": "lts/*" 13 | } 14 | }, 15 | 16 | // Set *default* container specific settings.json values on container create. 17 | "settings": { 18 | // "terminal.integrated.shell.linux": "/bin/bash" 19 | }, 20 | 21 | // Add the IDs of extensions you want installed when the container is created. 22 | "extensions": [ 23 | "rebornix.Ruby" 24 | ], 25 | 26 | // Use 'forwardPorts' to make a list of ports inside the container available locally. 27 | "forwardPorts": [9292], 28 | 29 | // Use 'postCreateCommand' to run commands after the container is created. 30 | "postCreateCommand": "/workspaces/contrib/.devcontainer/setup-app.sh", 31 | 32 | // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. 33 | "remoteUser": "vscode" 34 | 35 | } -------------------------------------------------------------------------------- /.devcontainer/run-app.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source `dirname $0`/setup-app.sh 3 | bundle exec rackup -o 0.0.0.0 -p 9292 4 | -------------------------------------------------------------------------------- /.devcontainer/setup-app.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd /workspaces/core 3 | bundle install --path=vendor/bundle --jobs=4 --retry=3 4 | bundle exec rake assets:copy 5 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .bundle 2 | .htpasswd 3 | /vendor/bundle 4 | /public/assets/* 5 | tdiary.pid 6 | /data 7 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: ubuntu 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build: 7 | name: build ${{ matrix.ruby }} 8 | strategy: 9 | matrix: 10 | ruby: [ '3.3', '3.2', '3.1', '3.0' ] 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v2 14 | - name: Set up Ruby 15 | uses: ruby/setup-ruby@v1 16 | with: 17 | ruby-version: ${{ matrix.ruby }} 18 | - name: Install dependencies 19 | run: | 20 | bundle install 21 | - name: Run test 22 | run: bundle exec rake spec 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /coverage 2 | pkg 3 | /Gemfile.lock 4 | /data 5 | /vendor/bundle -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Debug tDiary-contrib", 6 | "type": "Ruby", 7 | "request": "launch", 8 | "cwd": "/workspaces/core", 9 | "program": "/workspaces/core/bin/tdiary", 10 | "args": [ 11 | "server", "-p", "9292" 12 | ], 13 | "useBundler": true 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | gemspec 3 | -------------------------------------------------------------------------------- /README.en.md: -------------------------------------------------------------------------------- 1 | # tDiary contrib package 2 | 3 | This package include some utilities and plugins for tDiary. 4 | See documents in each directories. 5 | 6 | To use with tDiary, make "Gemfile.local" file on top of 7 | tDiary, and write a line like below: 8 | 9 | ``` 10 | gem 'tdiary-contrib' 11 | ``` 12 | 13 | ---- 14 | 15 | See licenses and copyrights in each theme files. If no license 16 | or copyright, it can be distoributed by GPL2, and it has a 17 | copyright below: 18 | 19 | ``` 20 | Copyright (c) 2005 TADA Tadashi 21 | ``` 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # tDiary contrib パッケージ 2 | 3 | このパッケージには、tDiaryに関係したいくつかのユーティリティやプラグ 4 | インが収録されています。ドキュメントはそれぞれのツールのディレクトリ 5 | に含まれています。 6 | 7 | tDiaryで使う場合は、tDiaryのトップディレクトリに Gemfile.local という 8 | ファイルを作成し、以下のように記述します: 9 | 10 | ``` 11 | gem 'tdiary-contrib' 12 | ``` 13 | 14 | ---- 15 | 16 | 著作権およびライセンスは各テーマのファイルに記述してあるものに従いま 17 | すが、特に明記されていない場合、配布条件はGPL2、著作権は以下になりま 18 | す。 19 | 20 | ``` 21 | Copyright (c) 2005 TADA Tadashi 22 | ``` 23 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | require 'rake' 3 | require 'rake/clean' 4 | require 'rspec/core/rake_task' 5 | require 'bundler/gem_tasks' 6 | 7 | CLOBBER.include( 8 | "coverage" 9 | ) 10 | 11 | task :default => [:spec] 12 | 13 | desc 'Run the code in specs' 14 | RSpec::Core::RakeTask.new(:spec) do |t| 15 | t.pattern = "spec/**/*_spec.rb" 16 | end 17 | 18 | namespace :spec do 19 | if defined?(RCov) 20 | desc 'Run the code in specs with RCov' 21 | RSpec::Core::RakeTask.new(:report) do |t| 22 | t.pattern = "spec/**/*_spec.rb" 23 | t.rcov = true 24 | t.rcov_opts = IO.readlines(File.join('spec', 'rcov.opts')).map {|line| line.chomp.split(" ") }.flatten 25 | end 26 | else 27 | desc 'Run the code in specs with SimpleCov' 28 | task :report do 29 | ENV['COVERAGE'] = 'simplecov' 30 | Rake::Task["spec"].invoke 31 | end 32 | end 33 | end 34 | 35 | # Local Variables: 36 | # mode: ruby 37 | # indent-tabs-mode: t 38 | # tab-width: 3 39 | # ruby-indent-level: 3 40 | # End: 41 | # vim: ts=3 42 | -------------------------------------------------------------------------------- /doc/en/filter/spambayes.txt: -------------------------------------------------------------------------------- 1 | For detail 2 | English : http://www.hinet.mydns.jp/en/?SpamBayes 3 | Japanese : http://www.hinet.mydns.jp/?SpamBayes 4 | -------------------------------------------------------------------------------- /doc/en/plugin.txt: -------------------------------------------------------------------------------- 1 | == tDiary contrib/plugin == 2 | -------------------------------------------------------------------------------- /doc/en/style/hatena.txt: -------------------------------------------------------------------------------- 1 | == tDiary contrib/sytle/hatena_style == 2 | 3 | Hatena::Diary compatible style 4 | 5 | * How to install 6 | Copy hatena_style.rb into core/tdiary/ directory, where other styles are. 7 | After that, edit tdiary.conf and specify style as 'Hatena'. 8 | 9 | * TextFormattingRules 10 | Refer . All but expression are supported. -------------------------------------------------------------------------------- /doc/en/style/markdown.txt: -------------------------------------------------------------------------------- 1 | == tDiary contrib/sytle/markdown_style == 2 | 3 | Markdown style 4 | 5 | * How to install 6 | require 'BlueCloth'. get & install from 7 | Copy markdown_style.rb into core/tdiary/ directory, where other styles are. 8 | After that, edit tdiary.conf and specify style as 'Markdown'. 9 | 10 | * TextFormattingRules 11 | Refer . 12 | ** tDiary original feature 13 | # =>

& section 14 | ## =>

15 | ### =>

16 | {{my '20041004p01','test'}} => tDiary's plugin 17 | -------------------------------------------------------------------------------- /doc/en/util.txt: -------------------------------------------------------------------------------- 1 | == tDiary contrib/util == 2 | -------------------------------------------------------------------------------- /doc/ja/filter/antirefspam.history.txt: -------------------------------------------------------------------------------- 1 | =begin 2 | 3 | ver 1.0 2005/06/26 4 | ・更新履歴を別ファイルにした 5 | ・リンク元のチェックの有無を設定できるようにした (thanks to Kazuhiro NISHIYAMA) 6 | ・ブロックしたツッコミをログ(spamcomments)に残すようにした 7 | ・一度も設定を行っていない場合にエラーが起きていた不具合を修正 (thanks to Kazuhiro NISHIYAMA) 8 | ・"トップページURL" が相対指定になっているときに、チェックをすり抜けてしまうことがあった 9 |  不具合を修正 (thanks to Kazuhiro NISHIYAMA) 10 | ・"トップページURL" と同様に base_url でもチェックするようにした (thanks to Kazuhiro NISHIYAMA) 11 | ・"「リンク元置換リスト」にマッチするリンク元を信頼する" を有効にしており、かつリンク元の 12 |  URLの長さが50文字以上だった場合に、チェックをすり抜けてしまっていた不具合を修正 13 |   (thanks to Hiroshi Koyasu) 14 | 15 | ver 0.9 2004/11/24 16 | ・リンク元置換リストにマッチするリンク元を信頼する機能を追加 (thanks to Shun-ichi TAHARA) 17 | ・コメントの制限に正規表現を使えるようにした 18 | ・HTTP.version_1_2 系を使えなかった場合に動作がおかしかった不具合を修正 19 | ・spamips に出力される時刻の分/秒部分がおかしかったのを修正 20 | ・その他エラーが起きにくいように処理を変更 21 | 22 | ver 0.8 2004/11/15 23 | ・プロキシーサーバーを指定する機能を追加 24 | ・ver 0.6m〜0.71 で、Ruby 1.6 系でエラーが出ることがあった不具合を修正 25 | 26 | ver 0.71 2004/11/12 27 | ・ver 0.6m と ver 0.7 で、"信頼するリンク元" の指定が適用されなくなっていた不具合を修正 28 | 29 | ver 0.7 2004/11/11 30 | ・一部のアンテナで、設定によって更新日時が取れないことがあった問題に対処 31 | ・コメントスパムに対処するため、コメントに制限をかける機能を追加 32 | 33 | ver 0.6m 2004/11/07 (MoonWolf) 34 | ・ソースのインデント変更 35 | ・if not→unlessへの書き換え等 36 | 37 | ver 0.6 2004/11/07 38 | ・トップページURL以外の許容するリンク先を指定できるようにした。 39 | ・設定画面の言語リソースを分割した。 40 | 41 | ver 0.5 2004/10/31 42 | ・信頼できるURL に正規表現を使えるようにした 43 | ・safeurls, spaurls に、同一の URL が2つ連続で記録される問題に対処した(つもり) 44 | 45 | ver 0.4 2004/10/20 46 | ・Ruby 1.8.2 (preview2) で動作しなかった不具合を修正 47 | ・接続するポートを80からuri.portに変更 (thanks to MoonWolf) 48 | 49 | ver 0.3 2004/09/30 50 | ・負荷を下げるための修正をちょっとだけ入れた 51 | 52 | ver 0.2 2004/09/27 53 | ・信頼できるURLの一覧を設定画面から変更できるようにした 54 | 55 | ver 0.1 2004/09/15 56 | ・最初のバージョン 57 | 58 | =end 59 | 60 | -------------------------------------------------------------------------------- /doc/ja/filter/spambayes.txt: -------------------------------------------------------------------------------- 1 | For detail 2 | Japanese : http://www.hinet.mydns.jp/?SpamBayes 3 | English : http://www.hinet.mydns.jp/en/?SpamBayes 4 | -------------------------------------------------------------------------------- /doc/ja/plugin.txt: -------------------------------------------------------------------------------- 1 | == tDiary contrib/plugin == 2 | 3 | ここに収録されたプラグインは、 4 | 5 | * 汎用性が低い 6 | * 国際化対応されていない(する意味がない) 7 | * tDiaryのバージョンに合わせたアップデートがされていない 8 | * tDiary本体または標準プラグインの動作環境から外れている 9 | 10 | 等の理由でプラグイン集への収録が見送られているものですが、 11 | それぞれはとても有用なプラグインです。 12 | 13 | 個々の説明は、それぞれのプラグインのディレクトリに入っています。 14 | -------------------------------------------------------------------------------- /doc/ja/plugin/add_bookmark.txt: -------------------------------------------------------------------------------- 1 | !概要 2 | subtitleの右にソーシャルブックマークへのリンクを埋め込みます。 3 | 4 | !使い方 5 | プラグインフォルダに配置するだけで使用可能です。 6 | プラグイン選択画面で有効に変更後、設定画面で埋め込みたいブックマークを選択します。 7 | 8 | !ライセンス 9 | GPL2 10 | 11 | !更新履歴 12 | !!20070215 13 | * サービスから MM/Memo を削除 14 | * サービスに livedoor クリップ と Buzzurl を追加 15 | 16 | !!20070109 17 | * サニタイズキャンペーンに伴う修正 18 | 19 | !!20050906 20 | * HTML4.01 Strictに準拠 21 | * セクションのURLをエスケープするように変更 22 | 23 | !!20050901 24 | * はてなブックマークのURLを修正 25 | 26 | !!20050828 27 | * add_subtitle_procに対応 28 | * webshots,LiVEMARK,fc2ブックマークを削除 29 | * 強制的にアイコンを使用するように設定 30 | 31 | !!20050602 32 | * はてなブックマークのアイコンの修正 33 | * del.icio.usのURLの修正 34 | 35 | !!20050601 36 | * LiVEMARKに対応 37 | * はてなブックマーク、del.icio.us、MM/Memoをアイコンで表示できるようにした。 38 | 39 | !!20050528 40 | * @confの値とdayモードの判定方法を変更 41 | * 処理でイテレータを使うように変更 42 | * 英語リソースの追加 43 | * webshotsに対応 44 | * fc2ブックマークに対応 45 | 46 | !!20050525 47 | * 初版公開 48 | 49 | !参考情報 50 | add_conf_procのチェックボックス処理についてはsearch_control.rb、body_enter_procについてはrandom_google.rbを参考にしました。 51 | -------------------------------------------------------------------------------- /doc/ja/plugin/category_to_tag.txt: -------------------------------------------------------------------------------- 1 | category_to_tag.rb - カテゴリをタグ風に表示します。 2 | 3 | ※tDiary 2.1.3.20051012以降でのみ動作します。 4 | 5 | ■使い方 6 | インストールするだけで使えるようになります。日記モードのcategory.rbか、 7 | BlogKitのblog-category.rbのいずれかと併用して使います。 8 | 9 | なお、これらの併用プラグインよりもあとに読み込まれなければいけません。 10 | プラグイン選択を使う場合には@options['sp.path']で指定したパスの最後の 11 | ディレクトリに入れるか、いっそプラグイン選択を使わずに、tDiary本体の 12 | pluginディレクトリに入れてしまうのがよいでしょう。 13 | 14 | なお、タグの一覧はスタイルシートで「div.tags」を指定することで見栄え 15 | を変更できます。append-css.rbを使うといいでしょう。 16 | 17 | 例: 18 | div.day div.tags { 19 | text-align: right; 20 | font-size: 80%; 21 | } 22 | -------------------------------------------------------------------------------- /doc/ja/plugin/cocoment.txt: -------------------------------------------------------------------------------- 1 | ! 名前 2 | coCommentプラグイン 3 | 4 | ! 概要 5 | tDiaryをcoComment(http://www.cocomment.com/)に対応させるプラグイン 6 | 7 | !使い方 8 | プラグインフォルダに入れるだけで動作します。 9 | 10 | !ライセンス 11 | GPL2 12 | 13 | !更新履歴 14 | !!20070309 15 | * mobile_agent? の使用方法を修正 16 | 17 | !!20070213 18 | * ケータイ端末からのアクセスは無視するようにした 19 | 20 | !!20070212 21 | * IE7でのスクリプトエラーに対処(埋め込む Javascript を微調整) 22 | 23 | !!20070118 24 | * postURLとpostTitleを取得するときにjavascriptを使わないようにした。 25 | 26 | !!20070117 27 | * tDiary-contrib 追加に伴って name 属性 comment-form を core に追加 28 | * cocomment-fetchlet を追加 29 | 30 | !!20060527 31 | * 初版公開 32 | -------------------------------------------------------------------------------- /doc/ja/plugin/google_adsense.txt: -------------------------------------------------------------------------------- 1 | google_adsense.rb - Googe AdSenseのバナー広告を挿入するプラグイン 2 | 3 | 4 | 5 | プラグイン選択で選択し、日記のヘッダやフッタなど、任意の場所に以下の 6 | ように指定するだけで使えます。 7 | 8 | <%= google_adsense %> 9 | 10 | バナーのサイズや色は、設定画面から変更可能です。 11 | 12 | なお、配布されているgoogle_adsense.rbには、tDiary.Net 13 | 用のAdSense IDが書かれているので、このまま使うとtDiary.Netの広告収入 14 | になってしまいます。自分のAdSense IDを使いたい場合には、ファイルの最 15 | 初の方にある以下の部分を、自分のIDに合わせて書き換えてください。 16 | 17 | google_ad_client = "pub-3317603667498586" 18 | ~~~~~~~~~~~~~~~~~~~~この部分がID 19 | 20 | 21 | 2005-10-12追記 22 | セクションターゲット(※)に対応しました。タグは日記の各日付の最初と最後に挿入 23 | されます。 24 | 25 | ※https://www.google.com/support/adsense/bin/answer.py?answer=23168&topic=371 26 | -------------------------------------------------------------------------------- /doc/ja/plugin/google_analytics.txt: -------------------------------------------------------------------------------- 1 | google_analytics.rb - Googe Analyticsの解析用コードを挿入する 2 | 3 | 4 | 5 | プラグイン選択で選択し、設定画面でProfile IDを指定すれば使えます。 6 | Profile IDは、Analyticsのページでサイトを登録すると表示されるJavaScript中にある、 7 | 「UA-xxxxx-x」のうち、「xxxxx-x」の部分のことです。 8 | -------------------------------------------------------------------------------- /doc/ja/plugin/image_gps.txt: -------------------------------------------------------------------------------- 1 | image_gps.rb 2 | 3 | 機能 4 | JPEGファイルに含まれるExif情報を解析し、各種撮影条件を表示します。 5 | また、位置情報が含まれる場合、周辺地図ををポップアップ表示し、 6 | Googleマップへのリンクを生成します。 7 | 8 | 前提条件 9 | このPluginはimage.rbが導入されていることを前提としています。 10 | image.rbを有効にしてください。また、image_ex.rbと共存することはできません。 11 | 12 | ・ExifParserの導入 13 | image_gps.rbはExifのパーサとして、ExifParserを使用しています。 14 | 以下のコマンドで導入できます。 15 | #gem install exifparser 16 | 17 | ・Pluginのインストール 18 | image_gps.rbを適切な場所に配置してください。多言語用リソースは存在しません。 19 | 20 | ・Google Maps API Keyの取得 21 | ポップアップでの地図表示を行う場合は、 22 | Google API console( https://code.google.com/apis/console ) 23 | にてStatic Maps APIのAPIキーを生成し、[設定]-[その他]-[image_gpsの設定]の 24 | Google Static Maps API Keyに生成されたAPIキーを設定してください。 25 | 地図のポップアップ表示機能を使用しない場合は、設定する必要はありません。 26 | API Keyに関する詳細は、 27 | https://developers.google.com/maps/documentation/staticmaps/?hl=ja 28 | も参照してください。 29 | 30 | 31 | ・Exif情報の表示 32 | [設定]-[その他]-[image_gpsの設定]のShow Exif Infoに値を設定することにより、 33 | 任意のExif情報を表示することができます。 34 | Exifのタグ名をスペース区切りで記述してください 35 | 例) Model FocalLength FNumber ExposureTime ExposureBiasValue 36 | で、モデル名、焦点距離、F値、露出時間、露出補正が表示されます。 37 | 38 | ・地図サイトへのリンクURLの設定 39 | [設定]-[その他]-[image_gpsの設定]のMap Link URLにURLを記述することにより 40 | 任意の地図サービスサイトへのリンクを設定することができます。 41 | 主要なサービスについては、セレクタから選択することによりデフォルト値が設定されます。 42 | 未設定の場合はGoogleマップへのリンクが設定されます。 43 | 44 | 45 | 46 | ・CSSの追加 47 | 写真と撮影条件をそれっぽく表示するために、CSSを設定する必要があります。 48 | apend_css.rbを使用すると簡単にCSSを追加することができます。 49 | 参考に、作者が設定しているCSSを示します。 50 | 51 | --ここから 52 | img.photo{ 53 | float:left; 54 | clear:both; 55 | } 56 | 57 | div.photo_detail{ 58 | clear:both; 59 | display:block; 60 | margin:0.5em; 61 | padding:0.5em; 62 | } 63 | 64 | 65 | img.map { 66 | outline:solid 5px gray; 67 | } 68 | --ここまで 69 | 70 | 使用方法 71 | プラグインの書式は、image.rbと同じです。 72 | 73 | 制限事項 74 | secureモードには対応していません。 75 | image_ex.rbと同時に使用することはできません。 76 | -------------------------------------------------------------------------------- /doc/ja/plugin/opensearch_ad.txt: -------------------------------------------------------------------------------- 1 | ! 名前 2 | OpenSearch Auto-Discovery プラグイン 3 | 4 | ! 概要 5 | tDiaryをOpenSearch Auto-Discoveryに対応させるプラグイン 6 | 7 | !使い方 8 | 利用するには OpenSearch description XML をあらかじめ作成する必要があります。 9 | サンプルファイルは http://www.opensearch.org/Specifications/OpenSearch/1.1 にあります。 10 | 11 | !ライセンス 12 | GPL2 13 | 14 | !更新履歴 15 | !!20070117 16 | * tDiary-contrib に追加 17 | -------------------------------------------------------------------------------- /doc/ja/plugin/playstore.txt: -------------------------------------------------------------------------------- 1 | playstore.rb 2 | 3 | 機能 4 | GooglePlayのアプリ情報の表示及びリンクの生成を行います。 5 | 6 | 7 | ・market_botの導入 8 | GooglePlayのパーサとして、market_botを使用しています。 9 | 通常は以下のコマンドで導入できます。 10 | #gem install market_bot -v 1.0.4 11 | 12 | Rack環境の場合、Gemfile.localに以下を記述し、bundle installを実行してください。 13 | gem 'market_bot','=1.0.4' 14 | 15 | ・Pluginのインストール 16 | playstore.rbを適切な場所に配置してください。多言語用リソースは存在しません。 17 | 18 | ・使用方法 19 | アプリIDを引数にしてプラグインを呼び出します。 20 | アプリIDはアンドロイドアプリ一つ一つに設定されており、GoogleMapの場合は、 21 | com.google.android.apps.maps 22 | です。 23 | 24 | 例) 25 | tDiary記法 26 | <%= playstore 'com.google.android.apps.maps' %> 27 | wiki記法 28 | {{playstore 'com.google.android.apps.maps'}} 29 | 30 | また、playstoreのかわりにplaystore_txtを呼び出すことにより 31 | テキストのみのリンクを生成することもできます。 32 | 33 | ・制限事項 34 | 現状は英語版のGooglePlayの内容が表示され、リンク先も英語版になります。 35 | -------------------------------------------------------------------------------- /doc/ja/plugin/section_footer.txt: -------------------------------------------------------------------------------- 1 | ! 概要 2 | セクションの後ろにナビゲーションを追加するプラグイン。 3 | 4 | 以下の項目が追加されます。 5 | 6 | * タグ(カテゴリ) 7 | * このエントリを含むはてなブックマーク 8 | * はてなブックマークコメント表示 9 | * このエントリを含む del.icio.us 10 | * このエントリを含む livedoor クリップ 11 | * このエントリを含む Buzzurl 12 | * Permalink 13 | 14 | !注意事項 15 | * blogkitでは動きません 16 | * セキュアな環境では動きません 17 | * category_to_tag.rb と同時に使うことはできません 18 | * Permalinkやアイコンは用途に合わせてadd_section_leave_procから適当に削ってください 19 | * 利用するには [[JSON library for Ruby|http://rubyforge.org/projects/json/]] が必要(lib 以下に配置済み) 20 | 21 | ! 動作事例 22 | http://www.hsbt.org/diary/ 23 | 24 | !ライセンス 25 | GPL2 26 | 27 | ! Changelog 28 | !!20070323 29 | * del.icio.us Image API 使用時に ?aggregate を追加 30 | 31 | !!20070322 32 | * 画像取得API に対応 33 | 34 | !!20070321 35 | * JSON library for Ruby を追加 36 | 37 | !!20070215 38 | * アイコンを本家から持ってくるようにした 39 | 40 | !!20070212 41 | * Buzzurl(http://buzzurl.jp) に対応した 42 | 43 | !!20070210 44 | * Permalink 生成時の余計なエスケープをしないようにした 45 | 46 | !!20070206 47 | * NKFを使うのをやめて @conf.to_native を使うようにした 48 | * to_native の第二引数として utf-8 を指定 49 | 50 | !!20070205 51 | * delicious JSON のキャッシュデータは @cache/delicious/YYYYMM に作成するようにした 52 | 53 | !!20070204 54 | * 全面的に見直し、追加関係のリンクは生成しないようにした 55 | * del.icio.us の JSON API に対応、ブックマーク数を表示できるようにした 56 | * はてなブックマーク、livedoor クリップのブックマーク数画像表示APIに対応させた 57 | * 上記のAPIを使うようにしたため、まちゅさんのブックマークカウントキャッシュは使わないようにした 58 | 59 | !!20060107 60 | * リンク追加処理をメソッドとして分離 61 | 62 | !!20051229 63 | * [[人気の日記プラグイン (はてなブックマーク + MM/Memo) - まちゅダイアリー (2005-12-27)|http://www.machu.jp/diary/20051227.html#p03]]の改造の取り込み 64 | 65 | !!20051227 66 | * [[人気の日記プラグイン (はてなブックマーク) - まちゅダイアリー (2005-12-27)|http://www.machu.jp/diary/20051227.html#p02]]の改造の取り込み 67 | 68 | !!20051207 69 | * 「このエントリを含むdel.icio.us」のリンクを追加 70 | 71 | !!20051129 72 | * 「このエントリを含むMM/Memo」のリンクを追加 73 | 74 | !!20051124 75 | * 「このエントリをdel.icio.usに追加」のリンクを追加 76 | 77 | !!20051121 78 | * 携帯からのアクセスの時には表示しないようにした。 79 | 80 | !!20051114 81 | * 最初のリリース 82 | 83 | ! 謝辞 84 | このプラグインはたださんが作ったcategory_to_tag.rbとえろぺおさんによる[[tDiary の指定したセクションの permalink を求める|http://bigfield.ddo.jp/diary/20051026.html#p01]]をインスパイヤしました。ありがとうございました! 85 | -------------------------------------------------------------------------------- /doc/ja/plugin/select_theme.txt: -------------------------------------------------------------------------------- 1 | See: http://arika.org/diary/20050421#p01 2 | -------------------------------------------------------------------------------- /doc/ja/style/hatena.txt: -------------------------------------------------------------------------------- 1 | == tDiary contrib/sytle/hatena_style == 2 | 3 | はてなダイアリー互換スタイルです。 4 | 5 | * インストール方法 6 | 添付の hatena_style.rb を他のスタイルと同様 core/tdiary/ に投入してください。 7 | その後、 tdiary.conf でスタイルを 'Hatena' と指定すると有効になります 8 | 9 | * 記法 10 | 記法に関してははてなダイアリーのヘルプを参照してください。ここに記載されていることのうち、以外には対応しています。 -------------------------------------------------------------------------------- /doc/ja/style/markdown.txt: -------------------------------------------------------------------------------- 1 | == tDiary contrib/sytle/markdown_style == 2 | 3 | Markdownスタイルです。 4 | 5 | * インストール方法 6 | BlueClothが必要です。から入手してインストールしてください。 7 | 添付の markdown_style.rb を他のスタイルと同様 core/tdiary/ に投入してください。 8 | その後、 tdiary.conf でスタイルを 'Markdown' と指定すると有効になります 9 | 10 | * 記法 11 | 記法に関してはMarkdown文法紹介を参照してください。 12 | tDiaryでの拡張として#が

に##が

になります。セクションの区切りは#で行います。 13 | tDiaryのプラグインを呼び出すには{{〜}}で囲みます。(例: {{my '20041004p01','test'}} ) 14 | -------------------------------------------------------------------------------- /doc/ja/util.txt: -------------------------------------------------------------------------------- 1 | == tDiary contrib/util == 2 | 3 | ここに収録されたツールは、 4 | 5 | * 汎用性が低い 6 | * 国際化対応されていない(する意味がない) 7 | * tDiaryのバージョンに合わせたアップデートがされていない 8 | 9 | 等の理由でcoreへの収録が見送られているものですが、 10 | それぞれはとても有用なユーティリティです。 11 | 12 | 個々の説明は、それぞれのディレクトリに入っています。 13 | -------------------------------------------------------------------------------- /filter/commentkey.rb: -------------------------------------------------------------------------------- 1 | # 2 | # comment_key.rb: Comment-key filter Ver.0.5.0 3 | # included TDiary::Filter::CommentKeyFilter class 4 | # 5 | # caution: 6 | # * This filter must use together plugin 'comment_key.rb'. 7 | # 8 | # see: 9 | # http://www20.big.or.jp/~rin_ne/soft/tdiary/commentkey.htm 10 | # 11 | # Copyright (c) 2005 Hahahaha 12 | # Distributed under the GPL 13 | # 14 | 15 | module TDiary 16 | module Filter 17 | class CommentkeyFilter < Filter 18 | def comment_filter( diary, comment ) 19 | return true unless @conf['comment_key.enable'] 20 | return true if /^(?:TrackBack|Pingback)$/ =~ comment.name 21 | 22 | require 'digest/md5' 23 | keyprefix = @conf['comment_key.prefix'] || 'tdiary' 24 | vkey = Digest::MD5.hexdigest(keyprefix + (@conf['comment_key.nodate'] == 'true' ? "" : @cgi.params['date'][0])) 25 | vkey == @cgi.params['comment_key'][0] 26 | end 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /filter/commentsize.rb: -------------------------------------------------------------------------------- 1 | # 2 | # comment_size.rb: included TDiary::Filter::CommentSizeFilter class 3 | # 4 | 5 | module TDiary 6 | module Filter 7 | class CommentsizeFilter < Filter 8 | def comment_filter( diary, comment ) 9 | return false if comment.body.size > @conf['comment.size'] 10 | true 11 | end 12 | 13 | def referer_filter( referer ) 14 | true 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /filter/hidecomment.rb: -------------------------------------------------------------------------------- 1 | # 2 | # ref. http://www.cozmixng.org/retro/projects/tdiary/ticket/60 3 | # 4 | 5 | module TDiary::Filter 6 | class HidecommentFilter < Filter 7 | def comment_filter( diary, comment ) 8 | comment.show = false # ツッコミを非表示にするが 9 | true # spam扱いにはしない 10 | end 11 | end 12 | end 13 | 14 | -------------------------------------------------------------------------------- /filter/iplookup.rb: -------------------------------------------------------------------------------- 1 | # 2 | # iplookup.rb: included TDiary::Filter::IplookupFilter class 3 | # 4 | # 5 | # Copyright (c) 2008 SHIBATA Hiroshi 6 | # Distributed under the GPL2 7 | # 8 | 9 | require 'resolv' 10 | 11 | module TDiary 12 | module Filter 13 | class IplookupFilter < Filter 14 | def iplookup_init 15 | if @conf.options.include?('iplookup.ip.list') 16 | @iplookup_ip_list = @conf.options['iplookup.ip.list'] 17 | else 18 | @iplookup_ip_list = "bsb.spamlookup.net\nopm.blitzed.org\n" + 19 | "niku.2ch.net\ndnsbl.spam-champuru.livedoor.com" 20 | end 21 | end 22 | 23 | def black_ip?( address ) 24 | chance = 2 25 | ip = address.gsub(/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/, '\4.\3.\2.\1') 26 | @iplookup_ip_list.split(/\n+/).each do |dnsbl| 27 | begin 28 | address = Resolv.getaddress( "#{ip}.#{dnsbl}" ) 29 | return true 30 | rescue Resolv::ResolvTimeout 31 | if chance > 0 32 | chance -= 1 33 | retry 34 | end 35 | rescue Resolv::ResolvError 36 | rescue Exception 37 | end 38 | end 39 | return false 40 | end 41 | 42 | def comment_filter( diary, comment ) 43 | iplookup_init 44 | return false if black_ip?( @cgi.remote_addr ) 45 | return true 46 | end 47 | 48 | def referer_filter( referer ) 49 | iplookup_init 50 | return false if black_ip?( @cgi.remote_addr ) 51 | return true 52 | end 53 | end 54 | end 55 | end 56 | -------------------------------------------------------------------------------- /filter/plugin/commentkey.rb: -------------------------------------------------------------------------------- 1 | # 2 | # comment_key.rb: Comment-key plugin Ver.0.5.0 3 | # 4 | # functions: 5 | # * add "comment_key" key in comment form. 6 | # 7 | # caution: 8 | # * This plugin must use together filter 'comment_key.rb'. 9 | # 10 | # see: 11 | # http://www20.big.or.jp/~rin_ne/soft/tdiary/commentkey.htm 12 | # 13 | # Copyright (c) 2005 Hahahaha 14 | # Distributed under the GPL 15 | # 16 | 17 | alias :orig_comment_name_label :comment_name_label 18 | alias :orig_comment_name_label_short :comment_name_label_short 19 | 20 | def comment_name_label 21 | comment_key( orig_comment_name_label ) 22 | end 23 | 24 | def comment_name_label_short 25 | comment_key( orig_comment_name_label_short ) 26 | end 27 | 28 | def comment_key( label ) 29 | return label unless @conf['comment_key.enable'] 30 | 31 | require 'digest/md5' 32 | keyprefix = @conf['comment_key.prefix'] || 'tdiary' 33 | vkey = Digest::MD5.hexdigest(keyprefix + (@conf['comment_key.nodate'] == 'true' ? "" : @date.strftime( '%Y%m%d' ))) 34 | %Q!\n#{label}! 35 | end 36 | 37 | # configuration 38 | 39 | if TDIARY_VERSION >= '2.1.2.20050826' then 40 | add_conf_proc( 'comment_key', @comment_key_label_conf, 'security' ) do 41 | comment_key_conf 42 | end 43 | else 44 | add_conf_proc( 'comment_key', @comment_key_label_conf ) do 45 | comment_key_conf 46 | end 47 | end 48 | 49 | def comment_key_conf 50 | if @mode == 'saveconf' then 51 | @conf['comment_key.enable'] = 'true' == @cgi.params['comment_key_enable'][0] ? true : false 52 | @conf['comment_key.prefix'] = @cgi.params['comment_key_prefix'][0] 53 | @conf['comment_key.nodate'] = @cgi.params['comment_key_nodate'][0] 54 | end 55 | @conf['comment_key.prefix'] = 'tdiary' unless @conf['comment_key.prefix'] 56 | 57 | comment_key_conf_html 58 | end 59 | -------------------------------------------------------------------------------- /filter/plugin/commentsize.rb: -------------------------------------------------------------------------------- 1 | add_conf_proc( 'comment_size' , @comment_size_conf, 'security') do 2 | if @mode == 'saveconf' then 3 | @conf['comment.size'] = @cgi.params['comment.size'][0] 4 | end 5 | @conf['comment.size'] = 0 unless @conf['comment.size'] 6 | 7 | result = <<-HTML 8 |

#{@comment_size}

9 |

#{@comment_size_desc}

10 |

Bytes

11 | HTML 12 | end 13 | -------------------------------------------------------------------------------- /filter/plugin/en/iplookup.rb: -------------------------------------------------------------------------------- 1 | # en/iplookup.rb 2 | # 3 | # Copyright (c) 2005 SHIBATA Hiroshi 4 | # Distributed under the GPL 5 | 6 | @iplookup_label = 'IP Blacklist' 7 | 8 | @iplookup_ip_label = 'IP Blacklist Services' 9 | @iplookup_ip_label_desc = 'List of IP Blacklist Services' 10 | -------------------------------------------------------------------------------- /filter/plugin/iplookup.rb: -------------------------------------------------------------------------------- 1 | # iplookup.rb 2 | # 3 | # Copyright (c) 2005 SHIBATA Hiroshi 4 | # Distributed under the GPL 5 | # 6 | if TDIARY_VERSION >= '2.1.2.20050825' then 7 | add_conf_proc( 'iplookup', @iplookup_label, 'security' ) do 8 | iplookup_conf_proc 9 | end 10 | else 11 | add_conf_proc( 'iplookup', @iplookup_label ) do 12 | iplookup_conf_proc 13 | end 14 | end 15 | def iplookup_conf_proc 16 | if @mode == 'saveconf' then 17 | if @cgi.params['iplookup.ip.list'] && @cgi.params['iplookup.ip.list'][0] 18 | @conf['iplookup.ip.list'] = @cgi.params['iplookup.ip.list'][0] 19 | else 20 | @conf['iplookup.ip.list'] = nil 21 | end 22 | 23 | if @cgi.params['iplookup.safe_ip.list'] && @cgi.params['iplookup.safe_ip.list'][0] 24 | @conf['iplookup.safe_ip.list'] = @cgi.params['iplookup.safe_ip.list'][0] 25 | else 26 | @conf['iplookup.safe_ip.list'] = nil 27 | end 28 | 29 | end 30 | 31 | # initialize DNSBL list 32 | @conf['iplookup.ip.list'] = "bsb.spamlookup.net\nopm.blitzed.org\nniku.2ch.net" unless @conf['iplookup.ip.list'] 33 | 34 | result = <<-HTML 35 |

#{@iplookup_ip_label}

36 |

#{@iplookup_ip_label_desc}

37 |

38 | HTML 39 | end 40 | -------------------------------------------------------------------------------- /filter/plugin/ja/commentkey.rb: -------------------------------------------------------------------------------- 1 | # Japanese resource of comment_key.rb 2 | # 3 | # Copyright (c) 2005 Hahahaha 4 | # Distributed under the GPL 5 | # 6 | 7 | @comment_key_label_conf = 'コメントキーフィルタ' 8 | 9 | def comment_key_conf_html 10 | <<-"HTML" 11 |

#{@comment_key_label_conf}

12 |

コメントキーフィルタを有効にする

13 |

コメントキーフィルタのために使用される鍵の先頭文字列を指定します。なお、この文字列はMD5にてエンコードされるため、出力HTML内に直接表現されることはありません。

14 |

15 |

常に同一の鍵文字列を生成する

16 | HTML 17 | end 18 | -------------------------------------------------------------------------------- /filter/plugin/ja/commentsize.rb: -------------------------------------------------------------------------------- 1 | if /conf/ =~ @mode then 2 | @comment_size_conf = 'コメントサイズ制限' 3 | @comment_size_desc = 'ツッコミの最大サイズをByteで指定してください。日本語は一文字で約3Bytesとなります。' 4 | @comment_size = 'コメントサイズ制限' 5 | end 6 | 7 | -------------------------------------------------------------------------------- /filter/plugin/ja/iplookup.rb: -------------------------------------------------------------------------------- 1 | # ja/iplookup.rb 2 | # 3 | # Copyright (c) 2008 SHIBATA Hiroshi 4 | # Distributed under the GPL2 5 | 6 | @iplookup_label = 'IPブラックリスト' 7 | 8 | @iplookup_ip_label = 'IPブラックリストサービス' 9 | @iplookup_ip_label_desc = 'IPブラックリストサービスの一覧' 10 | -------------------------------------------------------------------------------- /filter/plugin/ja/spambayes.rb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2007, KURODA Hiraku 2 | # You can redistribute it and/or modify it under GPL2. 3 | 4 | class SpambayesConfig 5 | module Res 6 | module_function 7 | 8 | def title 9 | "Bayesフィルタ" 10 | end 11 | 12 | def check_comment 13 | "ツッコミを確認する" 14 | end 15 | 16 | def check_referer 17 | "リンク元を確認する" 18 | end 19 | 20 | def token_list(type) 21 | "#{type}トークン一覧" 22 | end 23 | 24 | def rebuild_db 25 | "データベースの再構築" 26 | end 27 | 28 | def use_bayes_filter 29 | "Bayesフィルタを使う" 30 | end 31 | 32 | def use_filter_to_referer 33 | "リンク元にBayesフィルタを使う" 34 | end 35 | 36 | def save_error_log 37 | "エラーログをキャッシュディレクトリに保存" 38 | end 39 | 40 | def threshold 41 | "閾値" 42 | end 43 | 44 | def receiver_addr 45 | "宛先メールアドレス" 46 | end 47 | 48 | def register_ham 49 | "ハムとして登録" 50 | end 51 | 52 | def register_spam 53 | "スパムとして登録" 54 | end 55 | 56 | def comment_processed 57 | "ツッコミを処理しました" 58 | end 59 | 60 | def token 61 | "トークン" 62 | end 63 | 64 | def probability(type) 65 | "#{type}率" 66 | end 67 | 68 | def score_in_db(type) 69 | "#{type}データベースでのスコア" 70 | end 71 | 72 | def execute_after_click_OK 73 | "OKを押すと実行します" 74 | end 75 | 76 | def registered_as(type) 77 | "#{type}として登録しました" 78 | end 79 | 80 | def rebuild_db_after_click_OK 81 | "OKを押すとコーパスからデータベースを再作成します" 82 | end 83 | 84 | def processed_referer 85 | "リンク元を処理しました" 86 | end 87 | 88 | def token_of_referer 89 | "リンク元のトークン" 90 | end 91 | 92 | def mail 93 | "メールアドレス" 94 | end 95 | 96 | def posted_host_addr 97 | "投稿ホストのIP" 98 | end 99 | 100 | def name 101 | "名前" 102 | end 103 | 104 | def referer 105 | "リンク元" 106 | end 107 | 108 | def url_in_comment 109 | "コメント中のURL" 110 | end 111 | 112 | def comment_body_and_keyword 113 | "コメント本文と検索リンク元のキーワード" 114 | end 115 | 116 | def no_token_exist 117 | "(トークンがありません)" 118 | end 119 | 120 | def spam_rate 121 | "スパム率" 122 | end 123 | end 124 | end 125 | -------------------------------------------------------------------------------- /filter/plugin/zh/iplookup.rb: -------------------------------------------------------------------------------- 1 | # zh/iplookup.rb 2 | # 3 | # Copyright (c) 2005 SHIBATA Hiroshi 4 | # Distributed under the GPL 5 | 6 | @iplookup_label = 'IP Blacklist' 7 | 8 | @iplookup_ip_label = 'IP Blacklist Services' 9 | @iplookup_ip_label_desc = 'List of IP Blacklist Services' 10 | -------------------------------------------------------------------------------- /filter/rblcheck.rb: -------------------------------------------------------------------------------- 1 | # rblcheck.rb 2 | # Copyright (c) 2004 MoonWolf 3 | # Distributed under the GPL 4 | # 5 | # options: 6 | # @options['rblcheck.list'] = [ 7 | # 'bl.moonwollf.com', # RBL list 8 | # ] 9 | require 'socket' 10 | 11 | module TDiary 12 | module Filter 13 | class RblcheckFilter < Filter 14 | alias :_filter :referer_filter 15 | alias :_filter :comment_filter 16 | 17 | private 18 | 19 | def _filter( *args ) 20 | rev_addr = @cgi.remote_addr.split(".").reverse.join(".") 21 | @conf['rblcheck.list'].each {|rbl| 22 | addr = "#{rev_addr}.#{rbl}" 23 | begin 24 | host = Socket.getaddrinfo(addr, "http")[0][3] 25 | case host 26 | when "127.0.0.2" 27 | return false 28 | end 29 | rescue SocketError 30 | end 31 | } 32 | true 33 | end 34 | end 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /filter/spamlookup.rb: -------------------------------------------------------------------------------- 1 | # 2 | # spamlookup.rb: included TDiary::Filter::SpamlookupFilter class 3 | # 4 | 5 | require 'resolv' 6 | require 'uri' 7 | 8 | module TDiary 9 | module Filter 10 | class SpamlookupFilter < Filter 11 | def black_domain?( domain ) 12 | begin 13 | Resolv.getaddress( "#{domain}.rbl.bulkfeeds.jp" ) 14 | return true 15 | rescue 16 | end 17 | false 18 | end 19 | 20 | def black_url?( body ) 21 | URI.extract( body, %w[http] ) do |url| 22 | domain = URI.parse( url ).host.sub( /\.$/, '' ) 23 | return true if black_domain?( domain ) 24 | end 25 | false 26 | end 27 | 28 | def comment_filter( diary, comment ) 29 | !black_url?( comment.body ) 30 | end 31 | 32 | def referer_filter( referer ) 33 | !black_url?( referer ) 34 | end 35 | end 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /io/dbi_io/ChangeLog: -------------------------------------------------------------------------------- 1 | 2007-02-18 sasasin 2 | * dbi_io.rb: delete restore_referer and store_referer impl. 3 | * tdiary_table.sql: add referervolatile table definition. 4 | * plugin/refererDbiIO.rb: add new plugin for referer. 5 | 6 | 2005-12-27 Kazuhiko 7 | * dbi_io.rb (store_referer): ignore invalid referers. 8 | 9 | 2005-12-20 Kazuhiko 10 | * dbi_io.rb.fast (transaction): lock whole transaction exlusively. 11 | (store_referer): update different entries only. 12 | 13 | 2005-12-11 Kazuhiko 14 | * dbi_io.rb (store_comment): delete possible duplicate comments. 15 | (restore_referer): quote diary_id. 16 | (calendar): fix a bug in a multi-user environment. 17 | 18 | 2005-12-10 Kazuhiko 19 | * dbi_io.rb: code cleanup. 20 | -------------------------------------------------------------------------------- /io/dbi_io/README.ja: -------------------------------------------------------------------------------- 1 | !dbi_io 2 | 3 | データベース名('tDiaryDB') 4 | データベースに接続するユーザ 5 | データベースに接続するパスワード 6 | 作者。今後、マルチユーザ対応するときに使います。 7 | 8 | !!データベースの作成 9 | 10 | !!! PostgreSQLの場合 11 | 12 | $ createdb -h -U -E EUC-JP 13 | Password: 14 | $ psql -h -U -f tdiary_table.sql 15 | Password: 16 | CREATE DATABASE 17 | 18 | !!tdiary.confの編集 19 | 20 | #require 'tdiary/pstoreio' 21 | #@io_class = TDiary::PStoreIO 22 | require 'tdiary/dbi_io' 23 | @io_class = TDiary::DbiIO 24 | #-- dbi_ioの場合の設定 -- 25 | @dbi_driver_url = 'dbi:Pg:' # URLを設定します。 26 | @dbi_user = '' # DBのアカウント 27 | @dbi_passwd = ' # DBのパスワード 28 | @dbi_author = '' # author 29 | 30 | !! プラグインのインストール 31 | リンク元の保存・表示のために、プラグインを以下のいずれかの 32 | 方法でインストールする必要があります 33 | 34 | (1) tdiary.confの@option['sp.path']に、このディレクトリに 35 | あるpluginのパスを追加し、設定画面からrefererDbiIO.rb 36 | を有効にする。 37 | 38 | (2) tDiaryのインストール先にあるpluginディレクトリに、 39 | plugin/refererDbiIO.rbをコピーする。 40 | -------------------------------------------------------------------------------- /io/dbi_io/tdiary_table.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE diarydata ( 2 | author TEXT NOT NULL, 3 | diary_id VARCHAR(8) NOT NULL, 4 | year VARCHAR(4) NOT NULL, 5 | month VARCHAR(2) NOT NULL, 6 | day VARCHAR(2) NOT NULL, 7 | title TEXT NULL, 8 | last_modified INTEGER NOT NULL, 9 | visible BOOLEAN NOT NULL, 10 | body TEXT NOT NULL, 11 | style TEXT NULL, 12 | CONSTRAINT diarydata_pkey PRIMARY KEY (author, diary_id) 13 | ); 14 | 15 | CREATE TABLE commentdata ( 16 | author TEXT NOT NULL, 17 | diary_id VARCHAR(8) NOT NULL, 18 | no INTEGER NOT NULL, 19 | name TEXT NULL, 20 | mail TEXT NULL, 21 | last_modified INTEGER NOT NULL, 22 | visible BOOLEAN NOT NULL, 23 | comment TEXT NULL, 24 | CONSTRAINT commentdata_pkey PRIMARY KEY (author, diary_id, no) 25 | ); 26 | 27 | CREATE TABLE refererdata ( 28 | author TEXT NOT NULL, 29 | diary_id VARCHAR(8) NOT NULL, 30 | no INTEGER NOT NULL, 31 | count INTEGER NOT NULL, 32 | ref TEXT NOT NULL, 33 | CONSTRAINT refererdata_pkey PRIMARY KEY (author, diary_id, no) 34 | ); 35 | CREATE TABLE referervolatile ( 36 | author TEXT NOT NULL, 37 | diary_id VARCHAR(8) NOT NULL, 38 | no INTEGER NOT NULL, 39 | count INTEGER NOT NULL, 40 | ref TEXT NOT NULL, 41 | CONSTRAINT referervolatile_pkey PRIMARY KEY (author, diary_id, no) 42 | ); 43 | -------------------------------------------------------------------------------- /js/datepicker.js: -------------------------------------------------------------------------------- 1 | /* 2 | * datepicker.js : datepicker using jQuery-UI 3 | * http://jqueryui.com/demos/datepicker/ 4 | * 5 | * Copyright (C) 2012 by tamoot 6 | * You can redistribute it and/or modify it under GPL. 7 | */ 8 | 9 | 10 | $( function() { 11 | 12 | function setDateText(date) { 13 | var dates = date.split("/"); 14 | $("#year" ).val(dates[0]); 15 | $("#month").val(dates[1]); 16 | $("#day" ).val(dates[2]); 17 | } 18 | 19 | function dateTextFromField() { 20 | var y = parseInt( $("#year" ).val() ); 21 | var m = parseInt( $("#month").val() ); 22 | var d = parseInt( $("#day" ).val() ); 23 | if( y > 0 && 13 > m && m > 0 && 32 > d && d > 0 ){ 24 | $("#datepicker-input").val(y + "/" + m + "/" + d); 25 | } 26 | } 27 | 28 | var datepicker_dom = $(""); 29 | 30 | var datepicker_trigger = $("") 31 | .addClass("ui-icon") 32 | .addClass("ui-icon-calendar") 33 | .addClass("datepicker-trigger"); 34 | 35 | var datepicker_input = $("", { 36 | id: "datepicker-input", 37 | name: "datepicker", 38 | style: "display: none;", 39 | type: "text" 40 | } 41 | ); 42 | 43 | datepicker_dom.append(datepicker_input); 44 | datepicker_dom.append(datepicker_trigger); 45 | datepicker_dom.insertAfter("span.day"); 46 | 47 | $("#datepicker-input").datepicker({ 48 | onSelect: function(dateText, inst){ 49 | setDateText(dateText); 50 | }, 51 | beforeShow: function(input ,inst){ 52 | dateTextFromField(); 53 | }, 54 | dateFormat: "yy/m/d" 55 | }); 56 | 57 | $(".datepicker-trigger").click(function() { 58 | $("#datepicker-input").datepicker("show"); 59 | }); 60 | 61 | 62 | var icon = $(".ui-icon-calendar"); 63 | icon.css({"display":"inline","position":"absolute","margin-top":"5px"}); 64 | icon.after($("").css({"margin-left":"16px"})); 65 | icon.hover(function(){ 66 | $(this).css({"cursor":"pointer"}); 67 | }); 68 | }); 69 | 70 | -------------------------------------------------------------------------------- /js/gyazo.js: -------------------------------------------------------------------------------- 1 | /* 2 | * gyazo.js: gyazo plugin for tDiary 3 | * 4 | * SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | $(function() { 7 | $('.gyazo-images img') 8 | .on({ 9 | 'mouseenter': function(){ 10 | $(this).css('cursor', 'pointer'); 11 | }, 12 | 'mouseleave': function(){ 13 | $(this).css('cursor', 'default'); 14 | }, 15 | 'click': function(){ 16 | var url = $(this).attr('data-url'); 17 | var text = $.makePluginTag('gyazo', function(){ 18 | return ["'" + url + "'", "'[description]'"] 19 | }) 20 | $('#body').insertAtCaret(text); 21 | } 22 | }) 23 | }) 24 | -------------------------------------------------------------------------------- /js/hide_sidebar_smartphone.js: -------------------------------------------------------------------------------- 1 | /* 2 | * hide_sidebar_smartphone.js 3 | * 4 | * Copyright (C) 2011 by TADA Tadashi 5 | * You can distribute it under GPL2 or any later version. 6 | */ 7 | 8 | $(function(){ 9 | if($(window).width() <= 360) { 10 | $('div.sidebar').hide(); 11 | $('div.main').attr('width', '100%').attr('float', 'none'); 12 | } 13 | }); 14 | 15 | -------------------------------------------------------------------------------- /js/image_ex.js: -------------------------------------------------------------------------------- 1 | /* 2 | image_ex.js: javascript for image_ex.rb plugin of tDiary 3 | 4 | Copyright (C) 2012 by Shugo Maeda 5 | You can redistribute it and/or modify it under GPL2. 6 | */ 7 | 8 | $(function() { 9 | function getWindowSize() { 10 | if (window.innerWidth) { 11 | return { 12 | width: window.innerWidth, 13 | height: window.innerHeight 14 | }; 15 | } 16 | else if (document.documentElement && 17 | document.documentElement.clientWidth != 0 ) { 18 | return { 19 | width: document.documentElement.clientWidth, 20 | height: document.documentElement.clientHeight 21 | }; 22 | } 23 | else if ( document.body ) { 24 | return { 25 | width: document.body.clientWidth, 26 | height: document.body.clientHeight 27 | } 28 | } 29 | return false; 30 | } 31 | 32 | var maxSize = null; 33 | 34 | function getMaxSize() { 35 | if (maxSize != null) { 36 | return maxSize; 37 | } 38 | 39 | var windowSize = getWindowSize(); 40 | if (windowSize == false) { 41 | maxSize = false; 42 | } 43 | else { 44 | maxSize = { 45 | width: windowSize.width * 0.8, 46 | height: windowSize.height * 0.8 47 | }; 48 | } 49 | return maxSize; 50 | } 51 | 52 | function resizeImage(img) { 53 | var maxSize = getMaxSize(); 54 | 55 | if (img.width > maxSize.width || img.height > maxSize.height) { 56 | if (img.width / maxSize.width > img.height / maxSize.height) { 57 | img.width = maxSize.width; 58 | } 59 | else { 60 | img.height = maxSize.height; 61 | } 62 | } 63 | } 64 | 65 | if ($(window).width() <= 360) { 66 | $(document).ready(function() { 67 | $("img.image-ex").on("load", function() { 68 | resizeImage(this); 69 | }); 70 | }); 71 | 72 | // for when images have been cached 73 | $(window).on("load", function() { 74 | $("img.image-ex").each(function() { 75 | resizeImage(this); 76 | }); 77 | }); 78 | } 79 | }); 80 | 81 | // vim: set ts=3 sw=3 noexpandtab : 82 | -------------------------------------------------------------------------------- /js/nicovideo.js: -------------------------------------------------------------------------------- 1 | /* 2 | * nicovideo.js : expandable nico nico douga inline player for tDiary 3 | * 4 | * Copyright (C) 2012 by TADA Tadashi 5 | * You can modify and/or distribute it under GPL. 6 | */ 7 | 8 | function nicovideoPlayer( video_id ) { 9 | $( "#thumbnail-" + video_id ).hide(); 10 | $( "#player-" + video_id ).show(); 11 | return false; 12 | } 13 | function nicovideoThumbnail( video_id ) { 14 | $( "#player-" + video_id ).hide(); 15 | $( "#thumbnail-" + video_id ).show(); 16 | return false; 17 | } 18 | -------------------------------------------------------------------------------- /js/referer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * referer.js: fetch referer with ajax 3 | * 4 | * Copyright (C) 2013 by MATSUOKA Kohei 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 | }); 18 | -------------------------------------------------------------------------------- /js/show_and_hide.js: -------------------------------------------------------------------------------- 1 | /* 2 | * show_and_hide.js : javascript for show_and_hide.rb plugin of tDiary 3 | * 4 | * Copyright (C) 2011 by tamoot 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).on('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 | 40 | -------------------------------------------------------------------------------- /js/twitter_anywhere.js: -------------------------------------------------------------------------------- 1 | /* 2 | * twitter_anywhere.js : use Twitter@Anywhere 3 | * 4 | * Copyright (C) 2012 by tamoot 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 | } 29 | -------------------------------------------------------------------------------- /js/yahoo_kousei.js: -------------------------------------------------------------------------------- 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 | 22 | -------------------------------------------------------------------------------- /lib/bayes/convert.rb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2008, KURODA Hiraku 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 35 | -------------------------------------------------------------------------------- /lib/exifparser/README: -------------------------------------------------------------------------------- 1 | ExifParserは、tdiary-contribの管理から外れました。 2 | 3 | 通常は以下のコマンドによりインストールすることができます。 4 | #gem install exifparser 5 | 6 | もしくは、 7 | $git clone https://github.com/kp1/exifparser.git 8 | でソースコードを取得可能です。 9 | 10 | -------------------------------------------------------------------------------- /lib/extensions/contrib.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | require 'tdiary/extensions' 3 | 4 | module TDiary 5 | module Extensions 6 | class Contrib 7 | def self.sp_path 8 | File.join(TDiary::Contrib.root, 'plugin') 9 | end 10 | 11 | def self.assets_path 12 | File.join(TDiary::Contrib.root, 'js') 13 | end 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /lib/tdiary-contrib.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | require 'extensions/contrib' 3 | 4 | module TDiary 5 | class Contrib 6 | def self.root 7 | File.expand_path('../..', __FILE__) 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /lib/tdiary/contrib/version.rb: -------------------------------------------------------------------------------- 1 | module TDiary 2 | class Contrib 3 | VERSION = "5.3.0" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /lib/wgs2tky.rb: -------------------------------------------------------------------------------- 1 | # 2 | # wgs2tky.rb 3 | # -- GPS data converter 4 | # 5 | # kp 6 | # Destributed under the GPL 7 | 8 | class Wgs2Tky 9 | 10 | Pi = Math::PI 11 | Rd = Pi/180 12 | 13 | # WGS84 14 | A = 6378137.0 # 赤道半径 15 | F = 1/298.257223563 # 扁平率 16 | E2 = F*2 - F*F # 第一離心率 17 | 18 | # Tokyo 19 | A_ = 6378137.0 - 739.845 # 6377397.155 20 | F_ = 1/298.257223563 - 0.000010037483 21 | # 1 / 299.152813 22 | E2_ = F_*2 - F_*F_ 23 | 24 | Dx = +128 25 | Dy = -481 26 | Dz = -664 27 | 28 | def Wgs2Tky.conv!(lat,lon,h = 0) 29 | b = lat[0].to_f + lat[1].to_f/60 + lat[2].to_f/3600 30 | l = lon[0].to_f + lon[1].to_f/60 + lon[2].to_f/3600 31 | 32 | (x,y,z) = Wgs2Tky._llh2xyz(b,l,h,A,E2) 33 | 34 | x+=Dx 35 | y+=Dy 36 | z+=Dz 37 | 38 | (b,l,h) = Wgs2Tky._xyz2llh(x,y,z,A_,E2_) 39 | 40 | lat[0..2]=Wgs2Tky._deg2gdms(b) 41 | lon[0..2]=Wgs2Tky._deg2gdms(l) 42 | end 43 | 44 | private 45 | 46 | include Math 47 | extend Math 48 | 49 | def Wgs2Tky._llh2xyz(b,l,h,a,e2) 50 | 51 | b *= Rd 52 | l *= Rd 53 | 54 | sb = sin(b) 55 | cb = cos(b) 56 | 57 | rn = a / Math.sqrt(1-e2*sb*sb) 58 | 59 | x = (rn+h)*cb*cos(l) 60 | y = (rn+h)*cb*sin(l) 61 | z = (rn*(1-e2)+h) * sb 62 | 63 | return x,y,z 64 | end 65 | 66 | def Wgs2Tky._xyz2llh(x,y,z,a,e2) 67 | 68 | bda = sqrt(1-e2) 69 | 70 | po = sqrt(x*x+y*y) 71 | t = atan2(z,po*bda) 72 | st = sin(t) 73 | ct = cos(t) 74 | b = atan2(z+e2*a/bda*st*st*st,po-e2*a*ct*ct*ct) 75 | l = atan2(y,x) 76 | 77 | sb = sin(b) 78 | rn = a / sqrt(1-e2*sb*sb) 79 | h = po / cos(b) - rn 80 | 81 | return b/Rd,l/Rd,h 82 | end 83 | 84 | def Wgs2Tky._deg2gdms(deg) 85 | sf = deg*3600 86 | s = sf.to_i%60 87 | m = (sf/60).to_i%60 88 | d = (sf/3600).to_i 89 | s += sf - sf.to_i 90 | return d,m,s 91 | end 92 | end 93 | 94 | -------------------------------------------------------------------------------- /misc/section_footer2/buzzurl.yaml: -------------------------------------------------------------------------------- 1 | url: http://buzzurl.jp/entry/ 2 | src: http://buzzurl.jp/static/image/api/icon/add_icon_mini_10.gif 3 | title: 4 | ja: このエントリを含む Buzzurl 5 | =: this entry on Buzzurl 6 | counter: http://buzzurl.jp/api/counter/ 7 | -------------------------------------------------------------------------------- /misc/section_footer2/fc2.yaml: -------------------------------------------------------------------------------- 1 | url: http://bookmark.fc2.com/search/detail?url= 2 | src: http://bookmark.fc2.com/img/add-16.gif 3 | title: 4 | ja: このエントリを含む FC2ブックマーク 5 | =: this entry on FC2 Bookmark 6 | counter: http://bookmark.fc2.com/image/users/ 7 | -------------------------------------------------------------------------------- /misc/section_footer2/ldc.yaml: -------------------------------------------------------------------------------- 1 | url: http://clip.livedoor.com/page/ 2 | src: http://parts.blog.livedoor.jp/img/cmn/clip_16_16_w.gif 3 | title: 4 | ja: このエントリを含む livedoor クリップ 5 | =: this entry on livedoor clip 6 | counter: http://image.clip.livedoor.com/counter/ 7 | -------------------------------------------------------------------------------- /misc/section_footer2/retweet.yaml: -------------------------------------------------------------------------------- 1 | url: 'http://twitter.com/home?status=RT @your-twitter-account: %s ' 2 | src: http://kayakaya.net/parts/tdiary/retweet.gif 3 | title: 4 | ja: このエントリをRetweetする 5 | =: Retweet for this entry 6 | counter: 7 | usesubtitle: !ruby/regexp /%s/ 8 | -------------------------------------------------------------------------------- /misc/section_footer2/twitter.yaml: -------------------------------------------------------------------------------- 1 | url: 'http://twitter.com/home?status=Reading: %s ' 2 | src: http://twitter-badges.s3.amazonaws.com/t_mini-a.png 3 | title: 4 | ja: このエントリをTweetする 5 | =: Tweet this entry 6 | counter: 7 | usesubtitle: !ruby/regexp /%s/ 8 | -------------------------------------------------------------------------------- /misc/section_footer2/yahoo.yaml: -------------------------------------------------------------------------------- 1 | url: http://bookmarks.yahoo.co.jp/url?url= 2 | src: http://i.yimg.jp/images/sicons/ybm16.gif 3 | title: 4 | ja: このエントリを含む Yahoo!ブックマーク 5 | =: this entry on Yahoo! JAPAN Bookmarks 6 | counter: http://num.bookmarks.yahoo.co.jp/image/small/ 7 | -------------------------------------------------------------------------------- /plugin/apple_webclip.rb: -------------------------------------------------------------------------------- 1 | # 2 | # apple_webclip.rb - Add icon information for Apple WebClip. 3 | # 4 | # Copyright (C) 2008, TADA Tadashi 5 | # You can redistribute it and/or modify it under GPL. 6 | # 7 | 8 | add_header_proc do 9 | if @conf['apple_webclip.url'] and @conf['apple_webclip.url'].size > 0 10 | %Q| \n| 11 | else 12 | '' 13 | end 14 | end 15 | 16 | add_conf_proc( 'apple_webclip', 'Apple WebClip' ) do 17 | if @mode == 'saveconf' then 18 | @conf['apple_webclip.url'] = @cgi.params['apple_webclip.url'][0] 19 | end 20 | 21 | <<-HTML 22 |

Icon URL

23 |

24 |

Create and cpecify PNG file 60x60 pixels.

25 | HTML 26 | end 27 | -------------------------------------------------------------------------------- /plugin/appstore.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # appstore.rb - embeded AppStore data for tDiary, 4 | # use App Store Affliate Resources Search API. 5 | # http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html 6 | # 7 | # Copyright (C) 2011, tamoot 8 | # You can redistribute it and/or modify it under GPL2. 9 | # 10 | 11 | require 'uri' 12 | 13 | if /\A(?:latest|day|month|nyear|preview)\z/ =~ @mode 14 | enable_js('appstore.js') 15 | end 16 | 17 | def appstore_detail(url) 18 | appstore_dom = '' 19 | 20 | begin 21 | appstore_dom = appstore_common(url, {:detail => true}) 22 | 23 | rescue 24 | appstore_dom = "Error. message=#{$!.message}." 25 | 26 | end 27 | 28 | end 29 | 30 | def appstore_common(url, params) 31 | return %Q|#{url}| if feed? 32 | 33 | appstore_uri = URI::parse(url) 34 | id = appstore_uri.path.split('/').last.gsub('id', '') 35 | raise StandardError.new("AppStore ID: not found from #{url}..") if id.nil? || id == '' 36 | 37 | return %Q|| 38 | end 39 | 40 | # Local Variables: 41 | # mode: ruby 42 | # indent-tabs-mode: t 43 | # tab-width: 3 44 | # ruby-indent-level: 3 45 | # End: 46 | # vim: ts=3 47 | 48 | -------------------------------------------------------------------------------- /plugin/bitly.rb: -------------------------------------------------------------------------------- 1 | # 2 | # bitly.rb - shorten URL by bit.ly. 3 | # 4 | # usage: shorten_url_you_got = bitly( 'long_url' ) || long_url 5 | # (because bitly returns nil sometime.) 6 | # 7 | # required some options below: 8 | # @options['biyly.login'] : your login ID of bit.ly. 9 | # @options['biyly.key'] : your API key of biy.ly. 10 | # 11 | # Copyright (C) 2010, TADA Tadashi 12 | # You can redistribute it and/or modify it under GPL. 13 | # 14 | 15 | require 'json' 16 | require 'net/http' 17 | 18 | def bitly( long_url ) 19 | return nil if !long_url or long_url.empty? 20 | 21 | @bitly_cache ||= {} # cached only on memory 22 | return @bitly_cache[long_url] if @bitly_cache[long_url] 23 | 24 | login = @conf['bitly.login'] 25 | key = @conf['bitly.key'] 26 | 27 | # proxy 28 | px_host, px_port = (@conf['proxy'] || '').split( /:/ ) 29 | px_port = 80 if px_host and !px_port 30 | 31 | query = "/v3/shorten?longUrl=#{CGI::escape long_url}&login=#{login}&apiKey=#{key}&format=json" 32 | begin 33 | Net::HTTP.version_1_2 34 | res = Net::HTTP::Proxy(px_host, px_port).get('api.bit.ly', "#{query}") 35 | @bitly_cache[long_url] = JSON::parse(res, &:read)['data']['url'] 36 | rescue TypeError => te# biy.ly returns an error. 37 | nil 38 | end 39 | end 40 | -------------------------------------------------------------------------------- /plugin/bootstrap-navi.rb: -------------------------------------------------------------------------------- 1 | # Show navi for twitter-bootstrap theme 2 | # 3 | # Copyright (c) KAOD Masanori 4 | # You can redistribute it and/or modify it under GPL. 5 | 6 | def bootstrap_navi(options = {}) 7 | default_options = { 8 | :navbar_class => nil, 9 | :site_name? => true, 10 | :search_form? => true 11 | } 12 | options = default_options.merge(options) 13 | 14 | body = "" 15 | if options[:site_name?] 16 | body += <<-EOS 17 | #{h @conf.html_title} 18 | EOS 19 | end 20 | 21 | body += <<-EOS 22 | 26 | EOS 27 | 28 | if options[:search_form?] 29 | body += <<-EOS 30 | 38 | EOS 39 | end 40 | 41 | <<-EOS 42 | 49 | EOS 50 | end 51 | 52 | add_header_proc do 53 | %Q|| 54 | end 55 | -------------------------------------------------------------------------------- /plugin/brow_si.rb: -------------------------------------------------------------------------------- 1 | # 2 | # brow_si.rb: insert brow.si code 3 | # 4 | # Copyright (C) 2012 by hb 5 | # 6 | 7 | add_conf_proc( "brow_si", "Brow.si" ) do 8 | if @mode == "saveconf" 9 | @conf["brow.si.site_id"] = @cgi.params["brow.si.site_id"][0] 10 | end 11 | 12 | <<-HTML 13 |

Website Brow.si Site ID

14 |

15 | HTML 16 | end 17 | 18 | add_footer_proc do 19 | if @conf["brow.si.site_id"] and @conf.smartphone? 20 | 21 | <<-SCRIPT 22 | 30 | SCRIPT 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /plugin/canonical.rb: -------------------------------------------------------------------------------- 1 | # canonical.rb 2 | 3 | if /latest/ =~ @mode then 4 | add_header_proc do 5 | <<-HTML 6 | 7 | HTML 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /plugin/category_to_tag.rb: -------------------------------------------------------------------------------- 1 | # 2 | # category_to_tag.rb - show categories list in end of each section 3 | # 4 | # Copyright (C) 2005, TADA Tadashi 5 | # You can redistribute it and/or modify it under GPL2. 6 | # 7 | 8 | if respond_to?( :categorized_title_of_day ) then # BlogKit 9 | def categorized_title_of_day( date, title ) 10 | @category_to_tag_list = {} 11 | cats, stripped = title.scan( /^((?:\[[^\]]+\])+)\s*(.*)/ )[0] 12 | if cats then 13 | cats.scan( /\[([^\]]+)\]+/ ).flatten.each do |tag| 14 | @category_to_tag_list[tag] = true # true when blog 15 | end 16 | else 17 | stripped = title 18 | end 19 | stripped 20 | end 21 | add_body_leave_proc do |date| 22 | feed? ? '' : category_to_tag_list 23 | end 24 | elsif respond_to?( :category_anchor ) # diary 25 | add_section_enter_proc do |date, index| 26 | @category_to_tag_list = {} 27 | '' 28 | end 29 | alias subtitle_link_original subtitle_link 30 | def subtitle_link( date, index, subtitle ) 31 | s = '' 32 | if subtitle then 33 | s = subtitle.sub( /^(\[([^\[]+?)\])+/ ) do 34 | $&.scan( /\[(.*?)\]/ ) do |tag| 35 | @category_to_tag_list[CGI::unescapeHTML(tag[0])] = false # false when diary 36 | end 37 | '' 38 | end 39 | end 40 | subtitle_link_original( date, index, s.strip ) 41 | end 42 | add_section_leave_proc do |date, index| 43 | feed? ? '' : category_to_tag_list 44 | end 45 | end 46 | 47 | def category_to_tag_list 48 | if @category_to_tag_list and not @category_to_tag_list.empty? then 49 | r = '
Tags: ' 50 | @category_to_tag_list.each do |tag, blog| 51 | if blog 52 | r << %Q|#{tag} | 53 | else 54 | r << category_anchor( "#{tag}" ).sub( /^\[/, '' ).sub( /\]$/, '' ) << ' ' 55 | end 56 | end 57 | r << "
\n" 58 | end 59 | end 60 | 61 | -------------------------------------------------------------------------------- /plugin/cocomment.rb: -------------------------------------------------------------------------------- 1 | # cocomment.rb $Revision: 1.6 $ 2 | # 3 | # Copyright (C) 2006 by Hiroshi SHIBATA 4 | # You can redistribute it and/or modify it under GPL2. 5 | # 6 | 7 | if @mode == 'day' and not bot? 8 | add_body_enter_proc do |date| 9 | <<-SCRIPT 10 | 25 | 27 | SCRIPT 28 | end 29 | end 30 | 31 | # Local Variables: 32 | # mode: ruby 33 | # indent-tabs-mode: t 34 | # tab-width: 3 35 | # ruby-indent-level: 3 36 | # End: 37 | # vi: ts=3 sw=3 38 | -------------------------------------------------------------------------------- /plugin/code-prettify.rb: -------------------------------------------------------------------------------- 1 | # Source code embedded plugin for tDiary. 2 | # Copyright (C) 2012 Koichiro Ohba 3 | # License under MIT. 4 | 5 | add_header_proc do 6 | <<-EOS 7 | 8 | EOS 9 | end 10 | 11 | def code(content, lang = nil) 12 | <<-EOS 13 |
14 | #{content}
15 | EOS 16 | end 17 | -------------------------------------------------------------------------------- /plugin/coderwall.rb: -------------------------------------------------------------------------------- 1 | require 'open-uri' 2 | require 'timeout' 3 | require 'json' 4 | 5 | def coderwall(name, size = [60, 60]) 6 | begin 7 | cache = "#{@cache_path}/coderwall.json" 8 | json = File.read(cache) 9 | File::delete(cache) if Time::now > File::mtime( cache ) + 60*60*24 10 | rescue Errno::ENOENT 11 | begin 12 | Timeout.timeout(10) do 13 | json = open( "https://coderwall.com/#{name}.json" ) {|f| f.read } 14 | end 15 | open(cache, 'wb') {|f| f.write(json) } 16 | rescue Timeout::Error 17 | return "" 18 | end 19 | end 20 | 21 | html = '
' 22 | JSON.parse(json)['badges'].each do |badge| 23 | html << %Q|#{badge['name']}| 24 | end 25 | html << '
' 26 | end 27 | 28 | # Local Variables: 29 | # mode: ruby 30 | # indent-tabs-mode: t 31 | # tab-width: 3 32 | # ruby-indent-level: 3 33 | # End: 34 | # vim: ts=3 35 | -------------------------------------------------------------------------------- /plugin/datepicker.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # datepickr.rb - show jQuery UI datepicker 4 | # 5 | # Copyright (C) 2012, tamoot 6 | # You can redistribute it and/or modify it under GPL. 7 | # 8 | 9 | # 10 | # not support 11 | # 12 | return if feed? 13 | 14 | if /\A(?:form|preview|append|edit|update)\z/ =~ @mode 15 | enable_js('//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js') 16 | if @conf.lang == 'ja' 17 | enable_js('//ajax.googleapis.com/ajax/libs/jqueryui/1/i18n/jquery.ui.datepicker-ja.min.js') 18 | end 19 | enable_js('datepicker.js') 20 | end 21 | 22 | # Local Variables: 23 | # mode: ruby 24 | # indent-tabs-mode: t 25 | # tab-width: 3 26 | # ruby-indent-level: 3 27 | # End: 28 | # vim: ts=3 29 | -------------------------------------------------------------------------------- /plugin/day2section.rb: -------------------------------------------------------------------------------- 1 | # 2 | # day2section.rb - tDiary plugin 3 | # 4 | # When a visitor accesses to day page without section anchor, navigate to first section. 5 | # 6 | # Copyright (c) MATSUOKA Kohei 7 | # Distributed under the GPL 8 | # 9 | add_footer_proc do 10 | if @mode == 'day' 11 | <<-SCRIPT 12 | 17 | SCRIPT 18 | end 19 | end 20 | 21 | -------------------------------------------------------------------------------- /plugin/description_from_body.rb: -------------------------------------------------------------------------------- 1 | # 2 | # description_from_body.rb - set meta description by first section's body in day mode 3 | # 4 | # Copyright (C) 2011, TADA Tadashi 5 | # You can redistribute it and/or modify it under GPL. 6 | # 7 | 8 | alias description_tag_dfb_orig description_tag 9 | def description_tag 10 | if @mode == 'day' then 11 | diary = @diaries[@date.strftime '%Y%m%d'] 12 | return '' unless diary 13 | 14 | body = '' 15 | diary.each_section do |sec| 16 | body = remove_tag( apply_plugin( sec.body_to_html ) ).strip 17 | break 18 | end 19 | %Q|| 20 | else 21 | description_tag_dfb_orig 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /plugin/development.rb: -------------------------------------------------------------------------------- 1 | # development.rb - utility methods for plugin developers 2 | # 3 | # Copyright (c) 2011 MATSUOKA Kohei 4 | # You can redistribute it and/or modify it under GPL2. 5 | # 6 | 7 | # load standard version jquery.js instead of jquery.min.js 8 | alias :jquery_tag_original :jquery_tag 9 | def jquery_tag 10 | jquery_tag_original.gsub(/\.min/, '') 11 | end 12 | 13 | # js cache clear by seconds. 14 | def script_tag_query_string 15 | "?#{TDIARY_VERSION}#{Time::now.strftime('%Y%m%d%H%M%S')}" 16 | end 17 | -------------------------------------------------------------------------------- /plugin/editor.rb: -------------------------------------------------------------------------------- 1 | # 2 | # editor.rb - support writing using wiki/gfm notation. 3 | # 4 | # Copyright (c) 2012 MATSUOKA Kohei 5 | # You can distribute it under GPL. 6 | # 7 | 8 | # load javascript 9 | if /\A(form|edit|preview|showcomment)\z/ === @mode then 10 | enable_js('editor.js') 11 | end 12 | -------------------------------------------------------------------------------- /plugin/en/add_bookmark.rb: -------------------------------------------------------------------------------- 1 | # en/add_bookmark.rb $Revision 1.3 $ 2 | # 3 | # English resource of add_bookmark.rb 4 | # You can redistribute it and/or modify it under GPL2. 5 | # 6 | 7 | @add_bookmark_label = 'add to bookmark' 8 | @add_bookmark_desc = 'Please check the link that wants to be displayed.' 9 | 10 | @caption_delicious = 'add to del.icio.us' 11 | @caption_hatena = 'add to Hatena bookmark' 12 | @caption_livedoor = 'add to livedoor clip' 13 | @caption_buzzurl = 'add to Buzzurl' 14 | 15 | @bookmark_label = [ 16 | 'del.icio.us', 17 | 'Hatena bookmark', 18 | 'livedoor Clip', 19 | 'Buzzurl' 20 | ] 21 | -------------------------------------------------------------------------------- /plugin/en/category-lite.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # en/category-lite.rb : tDiary plugin for show category pages (light edition) 4 | # 5 | # Copyright (C) 2015 TADA Tadashi 6 | # Distributed under the GPL2 or any later version. 7 | # 8 | 9 | @category_conf_label = 'Category' 10 | 11 | def category_conf_html 12 | r = <<-HTML 13 |

Build category index

14 |

15 | To use the category feature, you should build category index. 16 | Check the box below and press OK to build category index. 17 |

18 |

21 |

22 | It takes several or several tens of second to create it. But your diaries are many or the server has low spec, it will be timeout. Rebuild index on off-line again. 23 |

24 | 25 |

Edit Support

26 |

27 | Category names can be shown under the 'Article' form. 28 |

29 |

30 | 35 |

36 | HTML 37 | r 38 | end 39 | 40 | # Local Variables: 41 | # mode: ruby 42 | # indent-tabs-mode: t 43 | # tab-width: 3 44 | # ruby-indent-level: 3 45 | # End: 46 | # vim: ts=3 47 | -------------------------------------------------------------------------------- /plugin/en/del_footer.rb: -------------------------------------------------------------------------------- 1 | # 2 | # English resource of delicious plugin $Revision: 1.0 $ 3 | # 4 | # Copyright (C) 2006 SHIBATA Hiroshi 5 | # You can redistribute it and/or modify it under GPL2. 6 | # 7 | 8 | @delicious_label_conf = 'del.icio.us' 9 | @delicious_label_id = 'User ID' 10 | @delicious_label_pw = 'Password' 11 | -------------------------------------------------------------------------------- /plugin/en/git-register.rb: -------------------------------------------------------------------------------- 1 | @estraier_register_conf_label = 'Git' 2 | @estraier_register_conf_header = 'commit all' 3 | @estraier_register_conf_description = 'To commit all, check the box and submit \'OK\'.' 4 | -------------------------------------------------------------------------------- /plugin/en/livedoor_weather.rb: -------------------------------------------------------------------------------- 1 | # 2 | # English resource of livedoor_weather plugin $Revision$ 3 | # 4 | # Copyright (C) 2006 SHIBATA Hiroshi 5 | # You can redistribute it and/or modify it under GPL2. 6 | # 7 | 8 | # 9 | # setting of tdiary.conf 10 | # @options['lwws.city_id'] : City ID where weather information is specified. 11 | # 12 | 13 | @lwws_plugin_name = 'livedoor weather' 14 | @lwws_label_city_id = 'City ID' 15 | @lwws_desc_city_id = 'City ID where weather information is specified. Please select City ID from among Point definition table(RSS)' 16 | @lwws_label_disp_item = 'View items' 17 | @lwws_desc_disp_item = 'Please select the item to want to display.' 18 | @lwws_icon_label = 'Icon' 19 | @lwws_icon_desc = 'Weather information is displayed in the icon. ' 20 | @lwws_max_temp_label = 'Max Tempreture' 21 | @lwws_min_temp_label = 'Min Tempreture' 22 | @celsius_label = 'C' 23 | @lwws_label_cache = 'Auto update of cache' 24 | @lwws_desc_cache = 'Enable auto update.' 25 | @lwws_desc_cache_time = 'Please set number of update time.' 26 | -------------------------------------------------------------------------------- /plugin/en/microsummary.rb: -------------------------------------------------------------------------------- 1 | # ja/microsummary.rb 2 | # 3 | # Japanese resources for microsummary.rb 4 | # 5 | # Copyright (c) 2006 elytsllams 6 | # Distributed under the GPL 7 | # 8 | 9 | if @mode == 'conf' || @mode == 'saveconf' 10 | add_conf_proc( 'microsummary', 'Microsummary Generator' ) do 11 | saveconf_microsummary 12 | microsummary_init 13 | <<-HTML 14 |

URI for microsummary generator XML

15 |

16 | HTML 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /plugin/en/nicovideo.rb: -------------------------------------------------------------------------------- 1 | # 2 | # ja/nicovideo.rb - Japanese resource 3 | # 4 | # Copyright (C) TADA Tadashi 5 | # Distributed under GPL. 6 | # 7 | 8 | def nicovideo_feed( i ) 9 | <<-HTML 10 | 11 | 12 | 13 |
#{h i[:title]}#{h i[:title]} (#{i[:length]})
14 | HTML 15 | end 16 | 17 | def nicovideo_html( i ) 18 | <<-HTML 19 | 20 | 21 | 24 | 31 | 32 |
22 |
#{h i[:title]}
23 |
25 |

#{h i[:title]} (#{i[:length].split(/:/).map{|j|'%02d' % j.to_i}.join(':')})

26 |

#{i[:date][0,10]} Posted
27 | #{i[:view].scan(/\d+?(?=\d{3}*$)/).join(",")} Views
28 | #{i[:comment_num].scan(/\d+?(?=\d{3}*$)/).join(",")} Comments
29 | #{i[:mylist].scan(/\d+?(?=\d{3}*$)/).join(",")} Mylists

30 |
33 | HTML 34 | end 35 | -------------------------------------------------------------------------------- /plugin/en/openid.rb: -------------------------------------------------------------------------------- 1 | # openid.rb: English resource 2 | 3 | @openid_conf_label = 'OpenID' 4 | @openid_service_label = 'OpenID Service' 5 | @openid_service_desc = 'select your OpenID service name.' 6 | @openid_id_label = 'Your ID' 7 | @openid_id_desc = 'Specify your ID of OpenID service selected above.' 8 | 9 | -------------------------------------------------------------------------------- /plugin/en/profile.rb: -------------------------------------------------------------------------------- 1 | # 2 | # profile.rb: english resource of profile plugin for tDiary 3 | # 4 | # Copyright (C) 2017 by Tada, Tadashi 5 | # Distributed under the GPL. 6 | # 7 | module ::Profile 8 | module Service 9 | class Gravatar < Base 10 | HOST = 'en.gravatar.com' 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /plugin/en/section_footer.rb: -------------------------------------------------------------------------------- 1 | # section_footer.rb: English resource 2 | @section_footer_delicious_label = "del.icio.us history for this entry" 3 | @section_footer_hatenabm_label = "this entry on Hatena Bookmark" 4 | @section_footer_ldclip_label = "this entry on livedoor clip" 5 | @section_footer_buzzurl_label = "this entry on Buzzurl" 6 | @section_footer_yahoobm_label = "this entry on Yahoo! JAPAN Bookmark" 7 | -------------------------------------------------------------------------------- /plugin/en/section_footer2.rb: -------------------------------------------------------------------------------- 1 | # section_footer2.rb: English resource 2 | @section_footer2_delicious_label = "Delicious history for this entry" 3 | @section_footer2_locale = 'en_US' 4 | -------------------------------------------------------------------------------- /plugin/en/socialbutton.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # section_footer2.rb: English resource 3 | @socialbutton_label_conf = 'Social buttons' 4 | @socialbutton_label_enables = 'enable social button names' 5 | @socialbutton_label_twitter_via = 'screen name of the user to attribute the tweet to' 6 | -------------------------------------------------------------------------------- /plugin/everytrail.rb: -------------------------------------------------------------------------------- 1 | # 2 | # everytrail.rb: everytrail plugin is obsoleted 3 | # 4 | def everytrail_obsoleted(label = nil) 5 | if label 6 | "
(EveryTrail is obsoleted. [#{h label}])
" 7 | else 8 | "
(EveryTrail is obsoleted.)
" 9 | end 10 | end 11 | 12 | def everytrail( trip_id, label = nil, size = [400, 300] ) 13 | everytrail_obsoleted(label) 14 | end 15 | 16 | def everytrail_flash( trip_id, label = nil, size = [400, 300] ) 17 | everytrail_obsoleted(label) 18 | end 19 | 20 | def everytrail_widget( trip_id, latitude = nil, longtitude = nil, label = nil, size = [400, 300] ) 21 | everytrail_obsoleted() 22 | end 23 | 24 | -------------------------------------------------------------------------------- /plugin/gist.rb: -------------------------------------------------------------------------------- 1 | # show code snippet via gist.github.com 2 | # 3 | # usage: 4 | # gist(gist_id) 5 | # - gist_id: The id of the code snippet on gitst.github.com (e.g. 2056 for http://gist.github.com/2056) 6 | # 7 | # Copyright (c) KAKUTANI Shintaro 8 | # Distributed under the GPL 9 | 10 | def gist( gist_id ) 11 | gist_snippet_url = "http://gist.github.com/#{gist_id}" 12 | return (<<-EOS).chomp 13 | 15 | EOS 16 | end 17 | -------------------------------------------------------------------------------- /plugin/github_badge.rb: -------------------------------------------------------------------------------- 1 | # Github Badge, by drnic plugin. 2 | # http://drnicjavascript.rubyforge.org/github_badge/ 3 | # 4 | # usage: 5 | # github_badge(username, list_length, head, theme, title, show_all) 6 | # - username: user name on github.com 7 | # - list_length: project list length 8 | # - theme: specify theme for badge. "white" or "black". 9 | # - title: top text display on the badge. 10 | # - show_all: 'Show All' message. 11 | # 12 | # Copyright (c) 2008 KAKUTANI Shintaro 13 | # Distributed under the GPL 14 | 15 | def github_badge( username, list_length = 10, head = "div", theme = "white", title = "My Projects", show_all = "Show all" ) 16 | return (<<-EOS).chomp 17 |
18 | 25 | 26 | EOS 27 | end 28 | -------------------------------------------------------------------------------- /plugin/github_link.rb: -------------------------------------------------------------------------------- 1 | def gh_link(gh_identifier, text=nil) 2 | text = gh_identifier.split('/').last if text.nil? 3 | id_and_name, number = gh_identifier.split('#') 4 | 5 | url = "https://github.com/#{id_and_name}" 6 | url = url + "/issues/#{number}" if number 7 | 8 | "#{h text}" 9 | end 10 | -------------------------------------------------------------------------------- /plugin/goo_gl.rb: -------------------------------------------------------------------------------- 1 | # 2 | # goo_gl.rb - shorten URL by goo.gl 3 | # 4 | # usage: shorten_url_you_got = goo_gl( 'long_url' ) || long_url 5 | # 6 | # Copyright (C) 2011, tamoot 7 | # You can redistribute it and/or modify it under GPL. 8 | # 9 | 10 | require 'json' 11 | require 'net/https' 12 | 13 | def goo_gl( long_url ) 14 | return nil if !long_url or long_url.empty? 15 | 16 | # on memory 17 | @goo_gl_cache ||= {} # cached only on memory 18 | return @goo_gl_cache[long_url] if @goo_gl_cache[long_url] 19 | 20 | # proxy 21 | px_host, px_port = (@conf['proxy'] || '').split( /:/ ) 22 | px_port = 80 if px_host and !px_port 23 | 24 | # params 25 | params = {'longUrl' => long_url}.to_json 26 | 27 | https = nil 28 | begin 29 | https = Net::HTTP::Proxy(px_host, px_port).new('www.googleapis.com', 443) 30 | https.use_ssl = true 31 | res, body = https.post("/urlshortener/v1/url", params, {'Content-Type' => 'application/json'}) 32 | @goo_gl_cache[long_url] = JSON::parse(body)["id"] if res.code == '200' 33 | rescue Exception => e 34 | # do nothing.. 35 | 36 | ensure 37 | https.finish if https && https.started? 38 | 39 | end 40 | 41 | return @goo_gl_cache[long_url] 42 | end 43 | -------------------------------------------------------------------------------- /plugin/google_sitemaps.rb: -------------------------------------------------------------------------------- 1 | # google_sitemap.rb 2 | # Copyright (c) 2006 http://d.bulkitem.com/ 3 | # Distributed under the GPL 4 | 5 | add_update_proc do 6 | require 'time' 7 | 8 | headers = Array.new 9 | header = Hash.new 10 | 11 | Dir.glob(@conf.data_path + '/????/*.td2') { |data_file| 12 | File.open(data_file) { |buffer| 13 | buffer.each { |line| 14 | line.strip! 15 | if line == "." then 16 | if header['visible'] then 17 | headers.push(header.clone) 18 | end 19 | header.clear 20 | end 21 | if %r|^Date: ([0-9]+)$|i =~ line then 22 | header['loc'] = sprintf(@conf['google_sitemaps.uri_format'], $1) 23 | end 24 | if %r|^Last-Modified: ([0-9]+)$|i =~ line then 25 | header['lastmod'] = Time.at($1.to_i).iso8601 26 | end 27 | if %r|^Visible: (.+)$|i =~ line then 28 | if $1.upcase == "TRUE" then 29 | header['visible'] = true 30 | else 31 | header['visible'] = false 32 | end 33 | end 34 | } 35 | } 36 | } 37 | 38 | headers.sort! { |a, b| b['loc'] <=> a['loc']} 39 | 40 | top_page_uri = File::dirname(@conf['google_sitemaps.uri_format']) + '/' 41 | now_datetime = Time.now.iso8601 42 | 43 | File.open(@conf['google_sitemaps.output_file'], 'w') do |fp| 44 | fp.write %Q[\n] 45 | fp.write %Q[\n] 46 | fp.write %Q[ #{CGI::escapeHTML(top_page_uri)}#{now_datetime}\n] 47 | headers.each { |entry| 48 | fp.write %Q[ #{CGI::escapeHTML(entry['loc'])}#{entry['lastmod']}\n] 49 | } 50 | fp.write %Q[\n] 51 | end 52 | end 53 | 54 | def saveconf_google_sitemaps 55 | if @mode == 'saveconf' then 56 | @conf['google_sitemaps.uri_format'] = @cgi.params['google_sitemaps.uri_format'][0] 57 | @conf['google_sitemaps.output_file'] = @cgi.params['google_sitemaps.output_file'][0] 58 | end 59 | end 60 | 61 | -------------------------------------------------------------------------------- /plugin/google_universal_analytics.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Google Universal Analytics plugin for tDiary 3 | # 4 | # Copyright (C) 2014 TSUNEMATSU Shinya 5 | # You can redistribute it and/or modify it under GPL2. 6 | # 7 | if /^(?:latest|day|month|nyear|search)$/ =~ @mode then 8 | add_footer_proc do 9 | google_universal_analytics_insert_code 10 | end 11 | end 12 | 13 | def google_universal_analytics_insert_code 14 | return '' unless @conf['google_universal_analytics.profile'] 15 | <<-HTML 16 | 26 | HTML 27 | end 28 | 29 | # UA-53836-1 30 | add_conf_proc( 'google_universal_analytics', 'Google Universal Analytics' ) do 31 | if @mode == 'saveconf' then 32 | @conf['google_universal_analytics.profile'] = @cgi.params['google_universal_analytics.profile'][0] 33 | end 34 | <<-HTML 35 |

Google Universal Analytics Profile

36 |

set your Profile ID (NNNNN-N)

37 |

38 | HTML 39 | end 40 | -------------------------------------------------------------------------------- /plugin/google_webmaster.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # google-webmaster.rb - embed a meta tag to let Google Webmaster tool know your verification code. 3 | # 4 | # Copyright (C) 2012, Tatsuya Sato 5 | # You can redistribute it and/or modify it under GPL2. 6 | # 7 | 8 | add_header_proc do 9 | "" 10 | end 11 | 12 | add_conf_proc('Google Webmaster', 'Google ウェブマスターツール', 'etc') do 13 | if @mode == 'saveconf' 14 | @conf['google_webmaster.verification'] = @cgi.params['google_webmaster.verification'][0] 15 | end 16 | <<-HTML 17 |

Google ウェブマスターツールの検証コード

18 |

19 | 20 |

21 | HTML 22 | end 23 | -------------------------------------------------------------------------------- /plugin/hatena_bookmark_nocomment.rb: -------------------------------------------------------------------------------- 1 | # hatena_bookmark_nocomment.rb 2 | # 3 | # Copyright (c) 2008 SHIBATA Hiroshi 4 | # Distributed under the GPL2 5 | # 6 | 7 | add_header_proc do 8 | %Q|| 9 | end 10 | -------------------------------------------------------------------------------- /plugin/hb_footer4sec_js.rb: -------------------------------------------------------------------------------- 1 | # hb_footer4sec_js.rb $Revision 1.0 $ 2 | # 3 | # Copyright (c) 2008 SHIBATA Hiroshi 4 | # You can redistribute it and/or modify it under GPL2. 5 | # 6 | 7 | def permalink( date, index, escape = true ) 8 | ymd = date.strftime( "%Y%m%d" ) 9 | uri = @conf.index.dup 10 | uri.sub!( %r|\A(?!https?://)|i, @conf.base_url ) 11 | uri.gsub!( %r|/\.(?=/)|, "" ) # /././ -> / 12 | link = uri + anchor( "#{ymd}p%02d" % index ) 13 | link.sub!( "#", "%23" ) if escape 14 | link 15 | end 16 | 17 | add_section_leave_proc do |date, index| 18 | if @mode == 'day' and not bot? 19 | <<-SCRIPT 20 | 26 | 27 |
28 | SCRIPT 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /plugin/hide_comment_form.rb: -------------------------------------------------------------------------------- 1 | def hide_comment_form 2 | @conf.hide_comment_form = true 3 | return '' 4 | end 5 | -------------------------------------------------------------------------------- /plugin/hide_sidebar_smartphone.rb: -------------------------------------------------------------------------------- 1 | # hide_sidebar_smartphone.rb 2 | # 3 | # Copyright (C) 2011 by TADA Tadashi 4 | # You can distribute it under GPL2 or any later version. 5 | # 6 | enable_js( 'hide_sidebar_smartphone.js' ) 7 | -------------------------------------------------------------------------------- /plugin/inline_wiki.rb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009 Hideki Sakamoto 2 | require 'hikidoc' 3 | 4 | def inline_wiki(buf) 5 | HikiDoc::to_html(buf) 6 | end 7 | -------------------------------------------------------------------------------- /plugin/instagr.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # instagr.rb - plugin to insert images on instagr.am 4 | # !! integrated into the instagram.rb. 5 | # !! Please use the instagram.rb 6 | # 7 | # Copyright (C) 2011-2015, tamoot 8 | # You can redistribute it and/or modify it under GPL2. 9 | # 10 | # usage: 11 | # <%= instagr 'short URL instag.ram' => 12 | # <%= instagr 'short URL instag.ram', size} => 13 | # 14 | # available size option: 15 | # :small => 150x150 pixel 16 | # :medium => 306x306 pixel (default) 17 | # :large => 612x612 pixel 18 | 19 | def instagr( short_url, size = :medium) 20 | if respond_to?(:instagram) 21 | instagram( short_url, size ) 22 | else 23 | return %Q|instagr.rb was integrated into instagram.rb. Please use the instagram.rb| 24 | end 25 | end 26 | 27 | 28 | # Local Variables: 29 | # mode: ruby 30 | # indent-tabs-mode: t 31 | # tab-width: 3 32 | # ruby-indent-level: 3 33 | # End: 34 | # vim: ts=3 35 | -------------------------------------------------------------------------------- /plugin/ja/add_bookmark.rb: -------------------------------------------------------------------------------- 1 | # ja/add_bookmark.rb $Revision 1.3 $ 2 | # 3 | # Japanese resource of add_bookmark.rb 4 | # You can redistribute it and/or modify it under GPL2. 5 | # 6 | 7 | @add_bookmark_label = 'ブックマーク追加' 8 | @add_bookmark_desc = 'ページに埋め込みたいリンクをチェックしてください。' 9 | 10 | @caption_delicious = 'del.icio.usに追加' 11 | @caption_hatena = 'はてなブックマークに追加' 12 | @caption_livedoor = 'livedoor クリップに追加' 13 | @caption_buzzurl = 'Buzzurl に追加' 14 | 15 | @bookmark_label = [ 16 | 'del.icio.us', 17 | 'はてなブックマーク', 18 | 'livedoor クリップ', 19 | 'Buzzurl' 20 | ] 21 | -------------------------------------------------------------------------------- /plugin/ja/category-lite.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # ja/category-lite.rb : tDiary plugin for show category pages (light edition) 4 | # 5 | # Copyright (C) 2015 TADA Tadashi 6 | # Distributed under the GPL2 or any later version. 7 | # 8 | 9 | @category_conf_label = 'カテゴリ' 10 | 11 | def category_conf_html 12 | r = <<-HTML 13 |

カテゴリインデックスの作成

14 |

15 | カテゴリの機能を利用するにはカテゴリインデックスをあらかじめ作成しておく必要があります。 16 | カテゴリインデックスを作成するには 17 | 以下のチェックを入れてからOKボタンを押してください。 18 |

19 |

22 |

23 | 数秒から数十秒でインデックスの作成は終了しますが、日記の量が多い場合やサーバの性能が低い場合はタイムアウトしてしまう場合があります。この場合はオフラインで作成して下さい。 24 |

25 | 26 |

日記編集サポート

27 |

28 | 日記編集画面の「本文」の下にカテゴリ名を一覧表示することができます。 29 | カテゴリ名をクリックすると「本文」にそのカテゴリ名が挿入されます(要JavaScript)。 30 |

31 |

32 | 37 |

38 | HTML 39 | r 40 | end 41 | 42 | # Local Variables: 43 | # mode: ruby 44 | # indent-tabs-mode: t 45 | # tab-width: 3 46 | # ruby-indent-level: 3 47 | # End: 48 | # vim: ts=3 49 | -------------------------------------------------------------------------------- /plugin/ja/del_footer.rb: -------------------------------------------------------------------------------- 1 | # 2 | # English resource of delicious plugin $Revision: 1.0 $ 3 | # 4 | # Copyright (C) 2006 SHIBATA Hiroshi 5 | # You can redistribute it and/or modify it under GPL2. 6 | # 7 | 8 | @delicious_label_conf = 'del.icio.us' 9 | @delicious_label_id = 'del.icio.usのユーザーID' 10 | @delicious_label_pw = 'del.icio.usのパスワード' 11 | -------------------------------------------------------------------------------- /plugin/ja/git-register.rb: -------------------------------------------------------------------------------- 1 | @git_register_conf_label = 'Git' 2 | @git_register_conf_header = 'Gitへ再登録' 3 | @git_register_conf_description = 'Gitへ再登録する場合はOKを押してください' 4 | -------------------------------------------------------------------------------- /plugin/ja/google_sitemaps.rb: -------------------------------------------------------------------------------- 1 | # google_sitemap.rb 2 | # Copyright (c) 2006 http://d.bulkitem.com/ 3 | # Distributed under the GPL 4 | 5 | add_conf_proc('google_sitemaps', 'Google sitemap') do 6 | saveconf_google_sitemaps 7 | 8 | request_uri = File::dirname(@cgi.request_uri) 9 | if request_uri == "/" 10 | @conf['google_sitemaps.uri_format'] ||= 'http://' + @cgi.server_name + '/index.cgi?date=%s' 11 | else 12 | @conf['google_sitemaps.uri_format'] ||= 'http://' + @cgi.server_name + request_uri + '/index.cgi?date=%s' 13 | end 14 | @conf['google_sitemaps.output_file'] ||= File::dirname(ENV['SCRIPT_FILENAME']) + '/sitemap.xml' 15 | 16 | if File.writable_real?(@conf['google_sitemaps.output_file']) == false 17 | msg = "[NG] 指定されているファイルの書き込み権限がありません。" 18 | else 19 | msg = "[OK] 指定されているファイルの書き込み権限があります。" 20 | end 21 | 22 | <<-HTML 23 |

Google ウェブマスターツール用のSitemap XMLを出力する設定を行います。

24 |

アドレスフォーマット

25 |

日付別表示時のURLフォーマットを指定します。日付文字列の部分は%sにしてください。

26 |

27 |
eg.
http://www.example.com/inex.cgi?date=%s
http://www.example.com/%s.html
28 | 29 |

XMLファイルの出力先

30 |

出力するファイルを絶対パスで指定します。

31 |

32 |

#{msg}

33 | HTML 34 | 35 | end 36 | -------------------------------------------------------------------------------- /plugin/ja/livedoor_weather.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Japanese resource of livedoor_weather plugin $Revision$ 3 | # 4 | # Copyright (C) 2006 SHIBATA Hiroshi 5 | # You can redistribute it and/or modify it under GPL2. 6 | # 7 | 8 | # 9 | # tdiary.confにおける設定: 10 | # @options['lwws.city_id'] : 天気情報を取得したい都市のIDを指定(設定画面から編集可能) 11 | # 12 | 13 | @lwws_plugin_name = 'livedoor 天気情報' 14 | @lwws_label_city_id = '都市IDの設定' 15 | @lwws_desc_city_id = '天気情報を取得する都市IDを指定します。全国の地点定義表(RSS)内の「1次細分区(cityタグ)」のidから選択してください。(初期設定は東京)' 16 | @lwws_label_disp_item = '表示項目の設定' 17 | @lwws_desc_disp_item = '表示させたい項目を選択してください。' 18 | @lwws_icon_label = 'アイコン表示の設定' 19 | @lwws_icon_desc = '天気情報をアイコン表示にする(詳細へのリンクは画像に設定)' 20 | @lwws_max_temp_label = '最高気温' 21 | @lwws_min_temp_label = '最低気温' 22 | @celsius_label = '℃' 23 | @lwws_label_cache = 'キャッシュの自動更新' 24 | @lwws_desc_cache = '自動更新を有効にする。' 25 | @lwws_desc_cache_time = 'キャッシュの更新間隔を時間で指定します。(初期設定は6時間)' 26 | -------------------------------------------------------------------------------- /plugin/ja/microsummary.rb: -------------------------------------------------------------------------------- 1 | # ja/microsummary.rb 2 | # 3 | # Japanese resources for microsummary.rb 4 | # 5 | # Copyright (c) 2006 elytsllams 6 | # Distributed under the GPL 7 | # 8 | 9 | if @mode == 'conf' || @mode == 'saveconf' 10 | add_conf_proc( 'microsummary', 'Microsummary Generator' ) do 11 | saveconf_microsummary 12 | microsummary_init 13 | <<-HTML 14 |

URI for microsummary generator XML

15 |

16 | HTML 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /plugin/ja/nicovideo.rb: -------------------------------------------------------------------------------- 1 | # 2 | # ja/nicovideo.rb - Japanese resource 3 | # 4 | # Copyright (C) TADA Tadashi 5 | # Distributed under GPL. 6 | # 7 | 8 | def nicovideo_feed( i ) 9 | <<-HTML 10 | 11 | 12 | 13 |
#{h i[:title]}#{h i[:title]} (#{i[:length]})
#{i[:desc]}
14 | HTML 15 | end 16 | 17 | def nicovideo_html( i ) 18 | <<-HTML 19 | 20 | 21 | 28 | 34 | 35 |
22 |
#{h i[:title]}
23 |

#{i[:date][0,10]}
24 | 再生: #{i[:view].scan(/\d+?(?=\d{3}*$)/).join(",")}
25 | コメント: #{i[:comment_num].scan(/\d+?(?=\d{3}*$)/).join(",")}
26 | マイリスト: #{i[:mylist].scan(/\d+?(?=\d{3}*$)/).join(",")}

27 |
29 |

#{h i[:title]} (#{i[:length].split(/:/).map{|j|'%02d' % j.to_i}.join(':')})
#{i[:desc]}

30 |
31 |

#{i[:comment]}

32 |
33 |
36 | HTML 37 | end 38 | -------------------------------------------------------------------------------- /plugin/ja/openbd.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Japanese resource of openBD plugin 3 | # 4 | # Copyright (C) 2020 OGAWA KenIchi 5 | # You can redistribute it and/or modify it under GPL2 or any later version. 6 | # 7 | 8 | @openbd_label_title = 'isbn_imageプラグインで商品名を' 9 | @openbd_label_title_hide = '表示しない' 10 | @openbd_label_title_show = '表示する' 11 | @openbd_label_clearcache = 'キャッシュの削除' 12 | @openbd_label_clearcache_desc = '書籍情報のキャッシュを削除する' 13 | 14 | @openbd_label_default_image = 'デフォルトの画像ファイル' 15 | @openbd_label_default_image_desc = 16 | '書影がない場合に表示する画像ファイルのパスを指定します。' \ 17 | '未指定の場合はデフォルトの画像が表示されます。' 18 | 19 | @openbd_label_image_width = '書影の表示幅' 20 | @openbd_label_image_width_desc = 21 | '数値を指定すると書影を表すimg要素のwidth属性に値が出力されます。' 22 | 23 | @openbd_label_image_height = '書影の表示高' 24 | @openbd_label_image_height_desc = 25 | '数値を指定すると書影を表すimg要素のheight属性に値が出力されます。' 26 | 27 | @openbd_label_detail_image_width = 'isbn_detail使用時の書影の表示幅' 28 | @openbd_label_detail_image_width_desc = 29 | '数値を指定すると書影を表すimg要素のwidth属性に値が出力されます。' 30 | 31 | @openbd_label_detail_image_height = 'isbn_detail使用時の書影の表示高' 32 | @openbd_label_detail_image_height_desc = 33 | '数値を指定すると書影を表すimg要素のheight属性に値が出力されます。' 34 | 35 | # Local Variables: 36 | # mode: ruby 37 | # indent-tabs-mode: t 38 | # tab-width: 3 39 | # ruby-indent-level: 3 40 | # End: 41 | -------------------------------------------------------------------------------- /plugin/ja/openid.rb: -------------------------------------------------------------------------------- 1 | # openid.rb: Japanese resource 2 | 3 | @openid_conf_label = 'OpenID' 4 | @openid_service_label = 'OpenID認証サービス名' 5 | @openid_service_desc = 'あなたが使っているOpenIDの認証サービス名を選んでください' 6 | @openid_id_label = 'あなたのID' 7 | @openid_id_desc = '上で選択した認証サービスに登録してある、あなたのIDを入力してください' 8 | -------------------------------------------------------------------------------- /plugin/ja/section_footer.rb: -------------------------------------------------------------------------------- 1 | # section_footer.rb: Japanese resource 2 | @section_footer_delicious_label = "このエントリの del.icio.us history" 3 | @section_footer_hatenabm_label = "このエントリを含むはてなブックマーク" 4 | @section_footer_ldclip_label = "このエントリを含む livedoor クリップ" 5 | @section_footer_buzzurl_label = "このエントリを含む Buzzurl" 6 | @section_footer_yahoobm_label = "このエントリを含む Yahoo!ブックマーク" 7 | -------------------------------------------------------------------------------- /plugin/ja/section_footer2.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # section_footer2.rb: Japanese resource 3 | @section_footer2_delicious_label = "このエントリの Delicious history" 4 | @section_footer2_locale = 'ja_JP' 5 | -------------------------------------------------------------------------------- /plugin/ja/socialbutton.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # section_footer2.rb: Japanese resource 3 | @socialbutton_label_conf = 'ソーシャルボタン' 4 | @socialbutton_label_enables = 'ボタンを表示するサービス' 5 | @socialbutton_label_twitter_via = 'ツイート時に表示するユーザ名(あなたのTwitterアカウント名)' 6 | 7 | -------------------------------------------------------------------------------- /plugin/ja/yo_update.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # yo_update.rb - Japanese resource 4 | # 5 | # Copyright (C) 2014, zunda 6 | # 7 | # Permission is granted for use, copying, modification, 8 | # distribution, and distribution of modified versions of this 9 | # work under the terms of GPL version 2 or later. 10 | # 11 | 12 | def yo_update_conf_label 13 | '更新時にYoを送る' 14 | end 15 | 16 | def yo_update_test_result_label(username, result) 17 | "- #{h username} に Yo を送りました: #{h result}" 18 | end 19 | 20 | def yo_update_conf_html(conf, n_subscribers, test_result) 21 | action_label = { 22 | 'send_on_update' => '日記が追加された時', 23 | 'send_on_comment' => 'ツッコミされた時', 24 | } 25 | <<-HTML 26 |

API key

27 |

28 |

Username

29 |

30 |

Yo を送るタイミング

31 |
    32 | #{%w(send_on_update send_on_comment).map{|action| 33 | checked = conf["yo_update.#{action}"] ? ' checked' : '' 34 | %Q|
  • | 35 | }.join("\n\t")} 36 |
37 |

Yo をにリンク(不要なら空白)をつけて送ってみる#{test_result}

38 |

現在の受信者数

39 |

#{h n_subscribers}

40 |

Yoボタン

41 |

ページのどこかに下記を追加してください

42 |
<div id="yo-button"></div>
43 |

やり方

44 |
    45 |
  1. 個人用 Yo アカウントで http://dev.justyo.co/ にログインする 46 |
  2. ページ内の指示に従って APIアカウントを作成する。 47 | Callback URL は空白のままにしてください 48 |
  3. API key と API username を上にコピーする 49 |
50 | HTML 51 | end 52 | -------------------------------------------------------------------------------- /plugin/jdate.rb: -------------------------------------------------------------------------------- 1 | # jdate.rb $Revision: 1.1 $ 2 | # 3 | #「%J」で日本語の曜日名を出す 4 | # pluginに入れるだけで動作する。 5 | # 日付フォーマットなどで「%J」を指定するとそこが日本語の曜日になる 6 | # 7 | # Copyright (c) 2003 TADA Tadashi 8 | # You can distribute this file under the GPL. 9 | # 10 | unless Time::new.respond_to?( :strftime_jdate_backup ) then 11 | eval( <<-MODIFY_CLASS, TOPLEVEL_BINDING ) 12 | class Time 13 | alias strftime_jdate_backup strftime 14 | JWDAY = %w(日 月 火 水 木 金 土) 15 | def strftime( format ) 16 | strftime_jdate_backup( format.gsub( /%J/, JWDAY[self.wday] ) ) 17 | end 18 | end 19 | MODIFY_CLASS 20 | end 21 | -------------------------------------------------------------------------------- /plugin/jholiday.rb: -------------------------------------------------------------------------------- 1 | require 'holiday_japan' 2 | require 'date' 3 | unless Time::new.respond_to?( :strftime_holiday_backup ) 4 | then 5 | eval( <<-MODIFY_CLASS, TOPLEVEL_BINDING ) 6 | class Time 7 | alias strftime_holiday_backup strftime 8 | def strftime( format ) 9 | holiday = "" 10 | day = Date.new(self.year, self.month, self.day) 11 | holiday = HolidayJapan.name(day) if HolidayJapan.check(day) 12 | strftime_holiday_backup( format.gsub( /%K/, holiday ) ) 13 | end 14 | end 15 | MODIFY_CLASS 16 | end 17 | -------------------------------------------------------------------------------- /plugin/jmonth.rb: -------------------------------------------------------------------------------- 1 | # jmonth.rb $Revision: 1.1 $ 2 | # 3 | #「%i」で日本語の陰暦月名を出す 4 | # pluginに入れるだけで動作する。 5 | # 日付フォーマットなどで「%i」を指定するとそこが陰暦月名になる 6 | # 7 | # Copyright (c) 2005 sasasin/SuzukiShinnosuke 8 | # You can distribute this file under the GPL. 9 | # 10 | unless Time::new.respond_to?( :strftime_jmonth_backup ) then 11 | eval( <<-MODIFY_CLASS, TOPLEVEL_BINDING ) 12 | class Time 13 | alias strftime_jmonth_backup strftime 14 | JMONTH = %w(睦月 如月 弥生 卯月 皐月 水無月 文月 葉月 長月 神無月 霜月 師走) 15 | def strftime( format ) 16 | strftime_jmonth_backup( format.gsub( /%i/, JMONTH[self.month-1] ) ) 17 | end 18 | end 19 | MODIFY_CLASS 20 | end 21 | -------------------------------------------------------------------------------- /plugin/jquery_ui_theme.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # jquery_ui.rb - use jQuery UI 4 | # 5 | # Copyright (C) 2012, tamoot 6 | # You can redistribute it and/or modify it under GPL. 7 | # 8 | 9 | # 10 | # not support 11 | # 12 | return if feed? 13 | 14 | add_header_proc do 15 | if /\A(?:form|preview|append|edit|update)\z/ =~ @mode 16 | 17 | themes = @conf['jquery_ui.theme'] 18 | if themes.nil? || theme == '' 19 | themes = 'base' 20 | end 21 | 22 | jquery_ui = '' 23 | jquery_ui << %Q|\n| 24 | jquery_ui 25 | 26 | else 27 | '' 28 | 29 | end 30 | 31 | end 32 | 33 | add_conf_proc( 'jquery_ui_theme', 'jQuery UI Theme' ) do 34 | if @mode == 'saveconf' then 35 | @conf['jquery_ui.theme'] = @cgi.params['jquery_ui.theme'][0] 36 | 37 | end 38 | 39 | <<-HTML 40 |

Theme name

41 |

42 |

sample) blitzer, flick .. See JQuery UI Theme.

43 |

default is base.

44 | HTML 45 | 46 | end 47 | 48 | 49 | # Local Variables: 50 | # mode: ruby 51 | # indent-tabs-mode: t 52 | # tab-width: 3 53 | # ruby-indent-level: 3 54 | # End: 55 | # vim: ts=3 56 | -------------------------------------------------------------------------------- /plugin/jroku.rb: -------------------------------------------------------------------------------- 1 | # jroku.rb $Revision: 1.1 $ 2 | # 3 | #「%R」で六曜を出す 4 | # 動かすためには 5 | # http://www.funaba.org/calendar.html#calendar 6 | # で配布されているClendarモジュールと付属しているcalclass.rbが必要 7 | # 日付フォーマットなどで「%R」を指定するとそこが六曜になる 8 | # 9 | # Copyright (c) 2005 SHIBATA Hiroshi 10 | # You can distribute this file under the GPL. 11 | # 12 | require 'calclass.rb' 13 | 14 | unless Time::new.respond_to?( :strftime_jroku_backup ) then 15 | eval( <<-MODIFY_CLASS, TOPLEVEL_BINDING ) 16 | class Time 17 | alias strftime_jroku_backup strftime 18 | JROKU = %w(大安 赤口 先勝 友引 先負 仏滅) 19 | 20 | def strftime( format ) 21 | d=Gregorian.new(self.month, self.day, self.year) 22 | q_d = Calendar.kyureki_from_absolute(d.abs) 23 | index = (q_d[0] + q_d[2]) % 6 24 | strftime_jroku_backup( format.gsub( /%R/, JROKU[index] ) ) 25 | end 26 | end 27 | MODIFY_CLASS 28 | end 29 | -------------------------------------------------------------------------------- /plugin/jyear.rb: -------------------------------------------------------------------------------- 1 | # jyear.rb $Revision: 1.1 $ 2 | # 3 | # 西暦を和暦に変換するプラグイン。 4 | # 日記やツッコミの日付フォーマットで使う。 5 | # 「%Y」で「2005」のところを、「%K」で「平成17」と表示。 6 | # pluginに入れるだけで動作する。 7 | # 8 | # Copyright (c) 2005 sasasin/SuzukiShinnosuke 9 | # You can distribute this file under the GPL. 10 | # 11 | 12 | unless Time::new.respond_to?( :strftime_jyear_backup ) then 13 | eval( <<-MODIFY_CLASS, TOPLEVEL_BINDING ) 14 | class Time 15 | alias strftime_jyear_backup strftime 16 | def strftime( format ) 17 | case self.year 18 | when 0 .. 1926 19 | gengo = "昔々" 20 | if self.year == 1926 && self.month == 12 && self.day >=25 then 21 | gengo = "昭和元年" 22 | end 23 | when 1927 .. 1989 24 | jyear = self.year - 1925 25 | gengo = "昭和" + jyear.to_s 26 | if self.year == 1989 && self.month == 1 && self.day >= 8 then 27 | gengo = "平成元年" 28 | end 29 | else 30 | jyear = self.year - 1988 31 | gengo = "平成" + jyear.to_s 32 | end 33 | strftime_jyear_backup( format.gsub( /%K/, gengo ) ) 34 | end 35 | end 36 | MODIFY_CLASS 37 | end 38 | -------------------------------------------------------------------------------- /plugin/latlonglab_route.rb: -------------------------------------------------------------------------------- 1 | # 2 | # latlonglab_route.rb - tDiary plugin for LatLongLab Route 3 | # 4 | # Copyright (C) 2009, Michitaka Ohno 5 | # Copyright (C) 2010, KAYA Satoshi 6 | # You can redistribute it and/or modify it under GPL2. 7 | # 8 | 9 | def route( id, w = 480, h = 480 ) 10 | 11 | if feed? 12 | return %Q|

Link to LatLongLab Route

| 13 | end 14 | 15 | if @conf.iphone? 16 | w = 240 17 | h = 380 18 | end 19 | 20 | <<-HTML 21 |
22 | 23 |
24 | HTML 25 | end 26 | -------------------------------------------------------------------------------- /plugin/lazy_referer.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8; -*- 2 | # 3 | # lazy_referer.rb: lazy loading referer 4 | # 5 | # Copyright (C) 2013 by MATSUOKA Kohei 6 | # You can distribute it under GPL. 7 | # 8 | if /^(day|form|edit)$/ =~ @mode and not bot? then 9 | enable_js('referer.js') 10 | 11 | # 12 | # overwrite method: draw only referer area (content will feach with ajax) 13 | # 14 | def referer_of_today_long( diary, limit ) 15 | return if limit == 0 16 | return unless diary 17 | date = diary.date.strftime('%Y%m%d') 18 | # FIXME: endpoint is should created by TDiary::Plugin, because easy customize routing 19 | endpoint = "#{@conf.index}?plugin=referer&date=#{date}" 20 | %Q[\n] 21 | end 22 | end 23 | 24 | # 25 | # return referer of date as is (html) 26 | # 27 | add_content_proc('referer') do |date| 28 | diary = @diaries[date] 29 | referer_load_current( diary ) 30 | referer_of_today_long( diary, 100 ) 31 | end 32 | 33 | # Local Variables: 34 | # mode: ruby 35 | # indent-tabs-mode: t 36 | # tab-width: 3 37 | # ruby-indent-level: 3 38 | # End: 39 | -------------------------------------------------------------------------------- /plugin/make_link.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright (C) 2011, KADO Masanori 3 | # You can redistribute it and/or modify it under GPL. 4 | 5 | # needs category.rb plugin 6 | 7 | add_edit_proc do 8 | <<-HTML 9 | 43 | HTML 44 | end 45 | -------------------------------------------------------------------------------- /plugin/makerss_category.rb: -------------------------------------------------------------------------------- 1 | # 2 | # makerss_category.rb: extension for makerss plugin. 3 | # 4 | # Copyright (C) 2007 by SHIBATA Hiroshi 5 | # Distributed under GPL2. 6 | # 7 | # Usage: 8 | # @conf['makerss.category'] = ["mixi", "sns"] 9 | # 10 | 11 | class MakeRssCategory < MakeRssFull 12 | def title 13 | '(category only)' 14 | end 15 | 16 | def item( seq, body, rdfsec ) 17 | return unless rdfsec.section.respond_to?( :body_to_html ) 18 | return if rdfsec.section.categories.length == 0 19 | rdfsec.section.categories.each do |category| 20 | if @conf['makerss.category'].include?(category) 21 | super 22 | end 23 | end 24 | end 25 | 26 | def file 27 | f = @conf['makerss.category.file'] || 'category.rdf' 28 | f = 'category.rdf' if f.length == 0 29 | f =~ %r|^/| ? f : "#{document_root}/#{f}" 30 | end 31 | 32 | def write( encoder ) 33 | super( encoder ) 34 | end 35 | 36 | def url 37 | u = @conf['makerss.category.url'] || "#{@conf.base_url}category.rdf" 38 | u = "#{@conf.base_url}category.rdf" if u.length == 0 39 | u 40 | end 41 | end 42 | 43 | @makerss_rsses << MakeRssCategory::new( @conf, @cgi ) 44 | -------------------------------------------------------------------------------- /plugin/makerss_comment.rb: -------------------------------------------------------------------------------- 1 | # 2 | # makerss_comment.rb: extension for makerss plugin. 3 | # 4 | # Copyright (C) 2007 by SHIBATA Hiroshi 5 | # Distributed under GPL2. 6 | # 7 | 8 | class MakeRssComments < MakeRssFull 9 | def title 10 | '(comments only)' 11 | end 12 | 13 | def item( seq, body, rdfsec ) 14 | return if rdfsec.section.respond_to?( :body_to_html ) 15 | super 16 | end 17 | 18 | def file 19 | f = @conf['makerss.no_comments.file'] || 'comments.rdf' 20 | f = 'comments.rdf' if f.length == 0 21 | f =~ %r|^/| ? f : "#{document_root}/#{f}" 22 | end 23 | 24 | def write( encoder ) 25 | super( encoder ) 26 | end 27 | 28 | def url 29 | u = @conf['makerss.no_comments.url'] || "#{@conf.base_url}comments.rdf" 30 | u = "#{@conf.base_url}comments.rdf" if u.length == 0 31 | u 32 | end 33 | end 34 | 35 | @makerss_rsses << MakeRssComments::new( @conf, @cgi ) 36 | -------------------------------------------------------------------------------- /plugin/mathjax.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # mathjax.rb $Revision: $ 3 | # 4 | # MathJaxを使った数式表示のためのプラグイン 5 | # 6 | # MathJaxでTeXやMathMLを使った数式を埋め込むことができます。 7 | # 8 | # MathJaxについては、http://www.mathjax.org/ を参照のこと 9 | # 10 | # Copyright (C) 2014 by Yuh Ohmura 11 | # 12 | =begin ChangeLog 13 | 2017-06-05 Yuh Ohmura 14 | * Modity MathJax address. 15 | 2014-12-17 Yuh Ohmura 16 | * created. 17 | =end 18 | add_header_proc do 19 | ' 28 | ' 30 | end 31 | -------------------------------------------------------------------------------- /plugin/microsummary.rb: -------------------------------------------------------------------------------- 1 | # microsummary.rb 2 | # 3 | # Copyright (c) 2006 elytsllams 4 | # Distributed under the GPL 5 | # 6 | 7 | add_header_proc do 8 | generator_xml = @conf['generator.xml'] 9 | 10 | if generator_xml != nil and @mode == 'latest' and !@cgi.valid?( 'date' ) 11 | %Q|\t\n| 12 | end 13 | end 14 | 15 | def create_xml file_name 16 | xml = <<-XML 17 | 18 | 20 | 38 | 39 | 40 | ^#{@conf.base_url.gsub(/\./, '\\.')}$ 41 | 42 | 43 | XML 44 | 45 | begin 46 | File::open( file_name, 'w' ) do |f| 47 | f.print to_utf8( xml ) 48 | end 49 | rescue 50 | end 51 | end 52 | 53 | def microsummary_init 54 | @conf['generator.xml'] ||= "" 55 | create_xml( @conf['generator.xml'] ) unless File::exist? @conf['generator.xml'] 56 | end 57 | 58 | if @mode == 'saveconf' 59 | def saveconf_microsummary 60 | @conf['generator.xml'] = @cgi.params['generator.xml'][0] 61 | end 62 | end 63 | -------------------------------------------------------------------------------- /plugin/monthly_autopagerize.rb: -------------------------------------------------------------------------------- 1 | # 2 | # monthly_autopagerize.rb - tDiary plugin 3 | # 4 | # add and tags for AutoPagerize at monthly mode 5 | # 6 | # Copyright (C) 2009 MATSUI Shinsuke 7 | # You can redistribute it and/or modify it under GPL2. 8 | # 9 | 10 | if @mode == 'month' then 11 | add_header_proc do 12 | stream = @conf['monthly_autopagerize.stream'] || 0 13 | result = String.new 14 | 15 | ym = [] 16 | @years.keys.each do |y| 17 | ym += @years[y].collect {|m| y + m} 18 | end 19 | ym.sort! 20 | now = @date.strftime( '%Y%m' ) 21 | return '' unless ym.index( now ) 22 | prev_month = ym.index( now ) == 0 ? nil : ym[ym.index( now )-1] 23 | next_month = ym[ym.index( now )+1] 24 | 25 | case stream 26 | #when 0 27 | # rel_prev_month = 'next' 28 | # rel_next_month = 'prev' 29 | when 1 30 | rel_prev_month = 'prev' 31 | rel_next_month = 'next' 32 | else 33 | rel_prev_month = 'next' 34 | rel_next_month = 'prev' 35 | end 36 | 37 | if prev_month then 38 | result << %Q[\n\t] 39 | end 40 | if next_month then 41 | result << %Q[\n\t] 42 | end 43 | 44 | result.chop.chop 45 | end 46 | end 47 | 48 | add_conf_proc( 'monthly_autopagerize', 'Monthly AutoPagerize' ) do 49 | if @mode == 'saveconf' then 50 | @conf['monthly_autopagerize.stream'] = @cgi.params['monthly_autopagerize.stream'][0].to_i 51 | end 52 | <<-HTML 53 |

Stream of Monthly AutoPagerize

54 |

58 | HTML 59 | end 60 | 61 | # Local Variables: 62 | # mode: ruby 63 | # indent-tabs-mode: t 64 | # tab-width: 3 65 | # ruby-indent-level: 3 66 | # End: 67 | # vi: ts=3 sw=3 68 | -------------------------------------------------------------------------------- /plugin/navi_this_month.rb: -------------------------------------------------------------------------------- 1 | # navi-this-month.rb 2 | # ref. http://www.tom.sfc.keio.ac.jp/~sakai/d/?date=20080628#p01 3 | # 4 | alias navi_this_month__orig__navi_user_day navi_user_day 5 | 6 | def navi_user_day 7 | result = navi_this_month__orig__navi_user_day 8 | if @mode=='day' 9 | this_month = @date.strftime( '%Y%m' ) 10 | result << navi_item( "#{@index}#{anchor this_month}", "#{navi_this_month}" ) 11 | end 12 | result 13 | end 14 | 15 | def navi_this_month; "月表示"; end 16 | -------------------------------------------------------------------------------- /plugin/ohmsha_estore.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # You can redistribute it and/or modify it under the same license as tDiary. 3 | # 4 | # display book info in https://estore.ohmsha.co.jp/ like amazon.rb 5 | # USAGE: {{ohmsha_estore '978427406694P'}} 6 | 7 | def ohmsha_estore( id, doc = nil ) 8 | "

Ohmsha eBook Store is no longer available.

\n" 9 | end 10 | 11 | # Local Variables: 12 | # mode: ruby 13 | # indent-tabs-mode: t 14 | # tab-width: 3 15 | # ruby-indent-level: 3 16 | # End: 17 | -------------------------------------------------------------------------------- /plugin/opensearch_ad.rb: -------------------------------------------------------------------------------- 1 | # opensearch_ad.rb $Revision: 1.1 $ 2 | # 3 | # Copyright (c) 2008 SHIBATA Hiroshi 4 | # Distributed under the GPL 5 | # 6 | 7 | if /\A(?:latest|day)\z/ =~ @mode then 8 | if @conf['opensearch.xml'] and @conf['opensearch.title'] then 9 | opensearch_xml = @conf['opensearch.xml'] 10 | opensearch_title = @conf['opensearch.title'] 11 | 12 | add_header_proc do 13 | result = <<-HTML 14 | 15 | HTML 16 | result.gsub( /^\t\t/, '' ) 17 | end 18 | end 19 | end 20 | 21 | add_conf_proc( 'opensearch_ad', 'OpenSearch Auto-Discovery' ) do 22 | if @mode == 'saveconf' 23 | @conf['opensearch.xml'] = @cgi.params['opensearch.xml'][0] 24 | @conf['opensearch.title'] = @cgi.params['opensearch.title'][0] 25 | end 26 | 27 | <<-HTML 28 |

Tilte for OpenSearch

29 |

30 |

URI for OpenSearch description XML

31 |

32 | HTML 33 | end 34 | -------------------------------------------------------------------------------- /plugin/picasa.rb: -------------------------------------------------------------------------------- 1 | # show photo image on Picasa Web Album 2 | # 3 | # usage: 4 | # picasa( src[, title[, place]] ) 5 | # - src: The url of the photo to show. 6 | # - title: title of photo. (optional) 7 | # - place: class name of img element. default is 'photo'. 8 | # 9 | # picasa_left( src[, title] ) 10 | # 11 | # picasa_right( src[, title] ) 12 | # 13 | # options configurable through settings: 14 | # @conf['picasa.user'] : picasa username 15 | # @conf['picasa.default_size'] : default image size 16 | # 17 | # Copyright (c) hb 18 | # Distributed under the GPL. 19 | # 20 | 21 | def picasa( src, alt = "photo", place = 'photo' ) 22 | %Q|#{alt}| 23 | end 24 | 25 | def picasa_left( src, alt = "photo" ) 26 | picasa( src, alt, 'left' ) 27 | end 28 | 29 | def picasa_right( src, alt = "photo" ) 30 | picasa( src, alt, 'right' ) 31 | end 32 | -------------------------------------------------------------------------------- /plugin/plantuml.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # create image by PlantUML http://plantuml.com/ 3 | # 4 | # Copyright (c) tamoot 5 | # Distributed under the GPL 6 | # 7 | 8 | require 'uri' 9 | require 'zlib' 10 | require 'digest/md5' 11 | 12 | module ::PlantUML 13 | module Deflate 14 | 15 | CHARS ||= ('0'..'9').to_a + ('A'..'Z').to_a + ('a'..'z').to_a + ['-', '_'] 16 | 17 | def self.compress(text) 18 | compressed = Zlib::Deflate.deflate(text, Zlib::BEST_COMPRESSION) 19 | compressed.chars.each_slice(3).map do |chars| 20 | append3bytes(chars[0].ord, chars[1]&.ord.to_i, chars[2]&.ord.to_i) 21 | end.join 22 | end 23 | 24 | private 25 | 26 | def self.append3bytes(b1, b2, b3) 27 | [ 28 | b1 >> 2, 29 | ((b1 & 0x3) << 4) | (b2 >> 4), 30 | ((b2 & 0xF) << 2) | (b3 >> 6), 31 | b3 & 0x3F, 32 | ].map { |c| CHARS[c & 0x3F] || '?' }.join 33 | end 34 | end 35 | 36 | end 37 | 38 | def plantuml(text) 39 | html = %Q|
| 40 | 41 | begin 42 | uri = URI::parse( @conf['plantuml.server'] ) 43 | uri.path.gsub!(/\/+$/, "") 44 | uri.path << '/png/' << PlantUML::Deflate::compress(text) 45 | html << %Q|| 46 | rescue 47 | html << %Q|Error: #{$!.message}| 48 | end 49 | 50 | html << %Q|
| 51 | 52 | end 53 | 54 | add_conf_proc('plantuml_server', 'PlantUMLサーバ') do 55 | if @mode == 'saveconf' 56 | @conf['plantuml.server'] = @cgi.params['plantuml.server'][0] 57 | end 58 | 59 | r = <<-_HTML 60 |

Summary

61 |

The image is generated by using specified PlantUML server.

62 |

URL

63 |

Please specify the PlantUML server URL (official site or your own PlantUML server) 64 |

  • Official PlantUML server: http://www.plantuml.com/plantuml/
  • 65 |

    66 | _HTML 67 | 68 | r 69 | end 70 | 71 | -------------------------------------------------------------------------------- /plugin/plugin_checker.rb: -------------------------------------------------------------------------------- 1 | # plugin_checker.rb 2 | # 3 | # Copyright (c) 2012 MATSUOKA Kohei 4 | # You can redistribute it and/or modify it under GPL2. 5 | # 6 | 7 | def plugin_checker_js_settings 8 | enable_js('plugin_checker.js') 9 | add_js_setting('$tDiary.plugins', plugins.to_json) 10 | add_js_setting('$tDiary.mode', @mode.to_json) 11 | end 12 | 13 | if /\A(form|edit|preview|showcomment)\z/ === @mode 14 | add_header_proc do 15 | <<-STYLE 16 | 38 | STYLE 39 | end 40 | plugin_checker_js_settings 41 | end 42 | -------------------------------------------------------------------------------- /plugin/popit.rb: -------------------------------------------------------------------------------- 1 | # popit.rb:plugin embedding POP on POPit(http://pop-it.jp) 2 | # 3 | # usage: 4 | # popit(pop_id) - pop_id: The id of the POP on POPit (e.g. 2000 http://pop-it.jp/item/amazon/1989/pop/2000 ) 5 | # 6 | # Copyright (c) KAYA Satoshi 7 | # You can redistributed it and/or modify if under GPL2. 8 | # 9 | def popit(pop_id, size = "large") 10 | return unless pop_id 11 | 12 | width_size = {"large" => "260", "small" => "180" } 13 | height_size = {"large" => "380", "small" => "220" } 14 | width_style = {"large" => "220px", "small" => "160px" } 15 | 16 | sizequery = size == "large" ? "?size=large" : '' 17 | r = "" 18 | r << %Q|| 19 | r << %Q|
    Powered by POPit
    | 20 | 21 | return r 22 | end 23 | -------------------------------------------------------------------------------- /plugin/prettify.rb: -------------------------------------------------------------------------------- 1 | # prettify.rb 2 | 3 | if /\A(?:latest|day|month|nyear)\z/ =~ @mode then 4 | add_header_proc do 5 | <<-HTML 6 | 7 | 23 | HTML 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /plugin/prezi.rb: -------------------------------------------------------------------------------- 1 | # 2 | # prezi.rb: plugin embedding presentation on prezi.com 3 | # 4 | # Copyright (C) 2010 TADA Tadashi 5 | # You can redistribute it and/or modify it under GPL2. 6 | # 7 | 8 | def prezi( prezi_id, label = 'Link to presentation', size = [512,384] ) 9 | %Q|| 10 | end 11 | -------------------------------------------------------------------------------- /plugin/recent_estraier.rb: -------------------------------------------------------------------------------- 1 | # recent_estraier.rb $Revision 1.1 $ 2 | # 3 | # recent_estraier: Estraier検索語新しい順 4 | # estsearch.cgiが作成する検索キーワードログから 5 | # 最新xx件分の検索語を表示します。 6 | # パラメタ: 7 | # file: 検索キーワードログファイル名(絶対パス表記) 8 | # estraier: estseach.cgiのパス 9 | # limit: 表示件数(未指定時:5) 10 | # make_link: を生成するか?(未指定時:生成する) 11 | # 12 | # 13 | # Copyright (c) 2005 SHIBATA Hiroshi 14 | # Distributed under the GPL2. 15 | # 16 | 17 | require 'nkf' 18 | 19 | def recent_estraier(file, estraier, limit = 5, make_link = true) 20 | begin 21 | lines = [] 22 | log = open(file) 23 | if log.stat.size > 300 * limit then 24 | log.seek(-300 * limit,IO::SEEK_END) 25 | end 26 | log.each_line do |line| 27 | lines << line 28 | end 29 | 30 | result = "
      " 31 | lines.reverse.each_with_index do |line,idx| 32 | break if idx >= limit 33 | word = NKF::nkf('-We -m0', line.split(/\t/)[2]) 34 | if word.empty? then 35 | limit += 1 36 | else 37 | if make_link 38 | result << %Q|
    1. #{h word}
    2. | 39 | else 40 | result << %Q|#{h word}| 41 | end 42 | end 43 | end 44 | 45 | result << %Q[
    ] 46 | 47 | rescue 48 | %Q[

    #$! (#{$!.class})
    cannot read #{file}.

    ] 49 | end 50 | end 51 | -------------------------------------------------------------------------------- /plugin/section_permalink.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright (C) 2011, KADO Masanori 3 | # You can redistribute it and/or modify it under GPL. 4 | # 5 | # section_permalink.rb 6 | # - enables section permalink and shows section title 7 | 8 | def section_mode? 9 | @mode == 'day' and @cgi.params['p'][0].to_s != "" 10 | end 11 | 12 | # Change permalink 13 | def anchor( s ) 14 | if /^([\-\d]+)#?([pct]\d*)?$/ =~ s then 15 | if $2 then 16 | s1 = $1 17 | s2 = $2 18 | if $2 =~ /^p/ 19 | "?date=#{s1}&p=#{s2.gsub(/p/, '')}" 20 | else 21 | "?date=#{s1}.html##{s2}" 22 | end 23 | else 24 | "?date=#$1" 25 | end 26 | else 27 | "" 28 | end 29 | end 30 | 31 | # Change HTML title to section name 32 | alias :_orig_title_tag :title_tag 33 | def title_tag 34 | if section_mode? and diary = @diaries[@date.strftime('%Y%m%d')] 35 | sections = diary.instance_variable_get(:@sections) 36 | 37 | title = "" 38 | section = sections[@cgi.params['p'][0].to_i - 1].stripped_subtitle_to_html 39 | title << apply_plugin(section, true).chomp 40 | title << " - #{h @html_title}" 41 | title << "(#{@date.strftime( '%Y-%m-%d' )})" if @date 42 | title << "" 43 | return title 44 | else 45 | _orig_title_tag 46 | end 47 | rescue 48 | _orig_title_tag 49 | end 50 | 51 | add_header_proc do 52 | if section_mode? and diary = @diaries[@date.strftime('%Y%m%d')] 53 | index = @cgi.params['p'][0] 54 | <<-EOS 55 | 63 | EOS 64 | end 65 | end 66 | 67 | # Local Variables: 68 | # mode: ruby 69 | # indent-tabs-mode: t 70 | # tab-width: 3 71 | # ruby-indent-level: 3 72 | # End: 73 | # vim: ts=3 74 | -------------------------------------------------------------------------------- /plugin/section_permalink_anchor.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright (C) 2011, KADO Masanori 3 | # You can redistribute it and/or modify it under GPL. 4 | # 5 | # section_permalink_anchor.rb 6 | # - enables section permalink with mod_rewrite 7 | # - depends on section_permalink.rb 8 | # 9 | # sample .htaccess: 10 | # 11 | # RewriteEngine on 12 | # RewriteRule ^([0-9\-]+)p?([0-9]*)\.html$ ?date=$1&p=$2 [L] 13 | # 14 | 15 | def anchor( s ) 16 | if /^([\-\d]+)#?([pct]\d*)?$/ =~ s then 17 | if $2 then 18 | s1 = $1 19 | s2 = $2 20 | if $2 =~ /^p/ 21 | "#{s1}#{s2}.html" 22 | else 23 | "#{s1}.html##{s2}" 24 | end 25 | else 26 | "#$1.html" 27 | end 28 | else 29 | "" 30 | end 31 | end 32 | 33 | # Local Variables: 34 | # mode: ruby 35 | # indent-tabs-mode: t 36 | # tab-width: 3 37 | # ruby-indent-level: 3 38 | # End: 39 | # vim: ts=3 40 | -------------------------------------------------------------------------------- /plugin/select-style.rb: -------------------------------------------------------------------------------- 1 | # 2 | # select-style.rb: select a style from installed styles 3 | # 4 | # add a line below, after load_cgi_conf in tdiary.conf: 5 | # @style = @options2['style'] if @options2 && @options2['style'] 6 | # 7 | 8 | def saveconf_style 9 | if @mode == 'saveconf' then 10 | @conf['style'] = @cgi.params['style'][0] 11 | end 12 | end 13 | 14 | def enum_styles 15 | TDiary::Style.constants(false).grep(/Diary$/).delete_if{|s| 16 | s =~ /Base|Categorizable|Uncategorizable/ 17 | }.map{|s| 18 | s.to_s.sub(/Diary$/, '').downcase 19 | }.each{|s| 20 | yield s 21 | } 22 | end 23 | 24 | add_conf_proc( 'style', 'スタイル', 'update' ) do 25 | saveconf_style 26 | 27 | labels = { 28 | 'tdiary' => 'tDiary', 29 | 'wiki' => 'Wiki', 30 | 'gfm' => 'GFM', 31 | 'etdiary' => 'etDiary', 32 | 'emptdiary' => 'emptDiary', 33 | 'rd' => 'RD', 34 | } 35 | 36 | r = <<-HTML 37 |

    スタイルの指定

    38 |

    スタイル (日記の文法) を指定します。

    39 |

    40 | 53 |

    54 |

    スタイルについての詳細はスタイル - tDiary の記法をごらんください。

    55 | HTML 56 | end 57 | -------------------------------------------------------------------------------- /plugin/select_style.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # select_style.rb: a plugin for selecting styles 4 | # Distributed under the GPL 5 | # 6 | # [CAUTION] You need to insert a line to tdiary.conf after "load_cgi_conf" 7 | # @style = @options2['style'] if @options2['style'] 8 | # 9 | 10 | # styles 11 | def saveconf_style 12 | if @mode == 'saveconf' then 13 | @conf['style'] = @cgi.params['style'][0] 14 | end 15 | end 16 | 17 | if @mode =~ /^(conf|saveconf)$/ then 18 | @conf_style_list = [] 19 | Dir::glob( "#{::TDiary::PATH}/tdiary/{style/,}*_style.rb" ) do |style_file| 20 | style = File::basename( style_file ).sub( /_style\.rb$/, '' ) 21 | @conf_style_list << style 22 | end 23 | end 24 | 25 | add_conf_proc( 'style', 'スタイル' ) do 26 | saveconf_style 27 | 28 | r = <<-HTML 29 |

    スタイルの指定

    30 |

    スタイル (日記の文法) を指定します。

    31 |

    32 | 39 |

    40 |

    スタイルについての詳細はスタイル - tDiary の記法をごらんください。

    41 | HTML 42 | end 43 | -------------------------------------------------------------------------------- /plugin/shogizumen.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # shogizumen.rb -- Just enable shogizumen.min 4 | # 5 | # Copyright (c) KITADAI, Yukinori 6 | # MIT License 7 | # 8 | # shogizumen.min.js is under MIT license. 9 | 10 | enable_js('shogizumen.min.js') 11 | 12 | def shogizumen(zumen_string) 13 | '
    ' + zumen_string + '
    ' 14 | end 15 | -------------------------------------------------------------------------------- /plugin/show_and_hide.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # show_and_hide.rb - Show or hide the elements with a sliding motion using jQuery. 4 | # 5 | # Copyright (C) 2011, tamoot 6 | # You can redistribute it and/or modify it under GPL2. 7 | # 8 | 9 | require 'digest/md5' 10 | 11 | if /\A(?:latest|day|month|nyear|preview)\z/ =~ @mode 12 | enable_js('show_and_hide.js') 13 | 14 | end 15 | 16 | def show_and_hide(contents, title = 'Show contents', 17 | type = :link, 18 | rss_title = '(Hide contents on RSS. See my page...)') 19 | 20 | data_id = show_and_hide_id(contents) 21 | 22 | toggle_attr = {:class => 'show_and_hide_toggle', 23 | :"data-showandhideid" => data_id} 24 | 25 | dom_contents = '' 26 | 27 | if feed? # RSS 28 | dom_contents = h(rss_title) 29 | 30 | elsif type.to_s == 'button' 31 | toggle_attr.merge!(:value => title, :type => "button") 32 | dom_contents = %Q|| + 33 | show_and_hide_contents(contents, data_id) 34 | 35 | else 36 | toggle_attr.merge!(:href => 'javascript:void(0)') 37 | dom_contents = %Q|#{h(title)}| + 38 | show_and_hide_contents(contents, data_id) 39 | 40 | end 41 | 42 | dom_contents 43 | 44 | end 45 | 46 | def show_and_hide_id(contents) 47 | @@show_and_hide_counter ||= 0 48 | @@show_and_hide_counter += 1 49 | 50 | "#{Time::now.strftime("%s")}_#{@@show_and_hide_counter}_#{ Digest::MD5.hexdigest(contents)}" 51 | 52 | end 53 | 54 | def show_and_hide_contents(contents, id) 55 | %Q|
    #{h(contents)}
    | 56 | 57 | end 58 | 59 | def hash2attr(hash) 60 | attrs = [] 61 | 62 | hash.keys.each do |k| 63 | attrs << %Q|#{k}="#{hash[k]}"| 64 | end 65 | 66 | attrs.join(" ") 67 | 68 | end 69 | 70 | # Local Variables: 71 | # mode: ruby 72 | # indent-tabs-mode: t 73 | # tab-width: 3 74 | # ruby-indent-level: 3 75 | # End: 76 | # vim: ts=3 77 | 78 | -------------------------------------------------------------------------------- /plugin/slideshare.rb: -------------------------------------------------------------------------------- 1 | # 2 | # slideshare.rb - insert some services of slideshare.net 3 | # 4 | # Copyright (C) 2011, Kiwamu Okabe . 5 | # You can redistribute it and/or modify it under GPL2. 6 | # 7 | 8 | def slideshare( embed_code ) 9 | %Q|| 10 | end 11 | -------------------------------------------------------------------------------- /plugin/slideshow.rb: -------------------------------------------------------------------------------- 1 | # 2 | # slideshow.rb : tDiary plugin for show slides 3 | # 4 | # Copyright (C) 2016 TADA Tadashi 5 | # Distributed under the GPL2 or any later version. 6 | # 7 | # @options['slideshow.css'] = "URL of CSS" 8 | # 9 | 10 | enable_js('slideshow.js') 11 | 12 | def slideshow 13 | %Q|| 14 | end 15 | 16 | if @conf['slideshow.css'] 17 | add_header_proc do 18 | %Q[] 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /plugin/steam.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # steam.rb $Revision: 1.0 $ 3 | # 4 | # 概要: 5 | # steam(store.steampowered.com)のゲームのウィジェットを 6 | # 貼るプラグインです。 7 | # 8 | # 使い方: 9 | # steamの任意のゲームのID(store.steampowered.com/app/{id}) 10 | # を指定することにより、ウィジェットが貼り付けられます。 11 | # 12 | # Copyright (c) 2016 kp 13 | # Distributed under the GPL 14 | # 15 | 16 | =begin ChangeLog 17 | =end 18 | 19 | def steam( id ) 20 | %Q[] 21 | end 22 | -------------------------------------------------------------------------------- /plugin/title_anchor.rb: -------------------------------------------------------------------------------- 1 | # 2 | # title_anchor.rb: 3 | # 4 | # Copyright (C) 2007 by SHIBATA Hiroshi 5 | # Distributed under GPL2. 6 | # 7 | 8 | def title_anchor 9 | r = '' 10 | if /^latest$/ =~ @mode 11 | r << %Q|

    #{h @conf.html_title}

    | 12 | else 13 | r << %Q|

    #{h @conf.html_title}

    | 14 | end 15 | r 16 | end 17 | -------------------------------------------------------------------------------- /plugin/twitpic.rb: -------------------------------------------------------------------------------- 1 | # 2 | # twitpic.rb: plugin to insert images on twitpic.com. 3 | # 4 | # Copyright (C) 2010 TADA Tadashi 5 | # You can redistribute it and/or modify it under GPL2. 6 | # 7 | 8 | def twitpic(image_id, label = 'Image on Twitpic', place = 'photo') 9 | %Q|

    #{h label}

    | 10 | end 11 | -------------------------------------------------------------------------------- /plugin/twitter.rb: -------------------------------------------------------------------------------- 1 | # 2 | # twitter plugin is deprecate 3 | # 4 | add_body_leave_proc do |date| 5 | if @mode == 'preview' 6 | %Q[

    twitter plugin was deprecated.

    ] 7 | else 8 | '' 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /plugin/twitter_badge.rb: -------------------------------------------------------------------------------- 1 | # 2 | # twitter_badge.rb: insert 'Follow me' badge of Twitter. 3 | # 4 | # Copyright (C) 2010 TADA Tadashi 5 | # You can redistribute it and/or modify it under GPL2. 6 | # 7 | 8 | def twitter_badge( account, opt = {} ) 9 | return '' unless account 10 | @twitter_badge_setting = { 11 | :account => account, 12 | :label => (opt[:label] || 'follow-me'), 13 | :color => (opt[:color] || '#35ccff'), 14 | :side => (opt[:side] || 'right')[0,1], 15 | :top => (opt[:top] || 136).to_i, 16 | :delay => (opt[:delay] || 5).to_i * 1000, 17 | } 18 | '' # do nothing in this method. 19 | end 20 | 21 | add_footer_proc do 22 | if @twitter_badge_setting then 23 | t = @twitter_badge_setting 24 | <<-TEXT 25 | 26 | 27 | 36 | 37 | TEXT 38 | else 39 | '' 40 | end 41 | end 42 | 43 | -------------------------------------------------------------------------------- /plugin/twitter_js.rb: -------------------------------------------------------------------------------- 1 | # 2 | # twitter_js plugin is deprecate 3 | # 4 | add_body_leave_proc do |date| 5 | if @mode == 'preview' 6 | %Q[

    twitter_js plugin was deprecated.

    ] 7 | else 8 | '' 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /plugin/ustream.rb: -------------------------------------------------------------------------------- 1 | # 2 | # ustream.rb - insert some services of Ustream.tv 3 | # 4 | # Copyright (C) 2010, TADA Tadashi . 5 | # You can redistribute it and/or modify it under GPL2. 6 | # 7 | 8 | def ustream( id, type = :recorded ) 9 | if type == :live then 10 | return '' 11 | end 12 | 13 | # insert recorded video 14 | if feed? then 15 | return %Q|Link to Ustream ##{id}

    | 16 | end 17 | 18 | %Q|| 19 | end 20 | -------------------------------------------------------------------------------- /plugin/vimeo.rb: -------------------------------------------------------------------------------- 1 | # 2 | # vimeo.rb - insert some services of vimeo.com 3 | # 4 | # Copyright (C) 2011, Kiwamu Okabe . 5 | # You can redistribute it and/or modify it under GPL2. 6 | # 7 | 8 | def vimeo( id ) 9 | if feed? then 10 | return %Q|Link to vimeo ##{id}

    | 11 | end 12 | 13 | %Q|| 14 | end 15 | -------------------------------------------------------------------------------- /plugin/wikiloc.rb: -------------------------------------------------------------------------------- 1 | # 2 | # wikiloc.rb: plugin embedding trip map on wikiloc. 3 | # 4 | # Copyright (C) 2008 MUNEDA Takahiro 5 | # You can redistribute it and/or modify it under GPL2. 6 | # 7 | # derived from everytrail.rb, Copyright (C) 2008 TADA Tadashi 8 | # 9 | # Parameters: 10 | # @trip_id : your trip id 11 | # @measures : on/off 12 | # @maptype : M/S/H/T 13 | # @size : [width,height] 14 | # 15 | # Please see the following address about the details: 16 | # http://www.wikiloc.com/forum/posts/list/14.page 17 | # 18 | # ChangeLog: 19 | # 20080706: Initial release 20 | # 20080713: Change default parameters 21 | # 22 | def wikiloc( trip_id, measures = "off", maptype = "M", size = [500,400] ) 23 | size.collect! {|i| i.to_i } 24 | size[0] = 500 if size[0] == 0 25 | size[1] = 400 if size[1] == 0 26 | %Q|| 27 | end 28 | -------------------------------------------------------------------------------- /plugin/youtube.rb: -------------------------------------------------------------------------------- 1 | # 2 | # youtube.rb: YouTube plugin for tDiary 3 | # 4 | # Copyright (C) 2010 by TADA Tadashi 5 | # 6 | # usage: <%= youtube 'VIDEO_ID' %> 7 | # 8 | def youtube( video_id, size = [425,350] ) 9 | if feed? 10 | %Q|

    | 11 | else 12 | <<-TAG 13 |
    14 | 16 |
    17 | TAG 18 | end 19 | end 20 | 21 | def youtube_custom( video_id, size = [416,337] ) 22 | <<-TAG 23 |
    24 | 25 | 26 | 27 | 28 |
    29 | TAG 30 | end 31 | -------------------------------------------------------------------------------- /plugin/zenback.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright (C) 2011, KADO Masanori 3 | # You can redistribute it and/or modify it under GPL. 4 | def insert_zenback 5 | return if feed? 6 | @conf['zenback.script'] || '' 7 | end 8 | 9 | if @mode == 'day' and (respond_to?(:section_mode?) ? section_mode? : true) 10 | add_title_proc do |date, title| 11 | "#{title}" 12 | end 13 | add_body_enter_proc do 14 | "" 15 | end 16 | if defined? add_comment_leave_proc 17 | add_comment_leave_proc do 18 | "" + 19 | insert_zenback 20 | end 21 | else 22 | add_body_leave_proc do 23 | "" + 24 | insert_zenback 25 | end 26 | end 27 | end 28 | 29 | add_conf_proc( 'zenback', 'zenback', 'etc' ) do 30 | if @mode == 'saveconf' then 31 | @conf['zenback.script'] = @cgi.params['zenback.script'][0] 32 | end 33 | 34 | <<-HTML 35 |

    Script Code

    36 |

    37 | HTML 38 | end 39 | 40 | # Local Variables: 41 | # mode: ruby 42 | # indent-tabs-mode: t 43 | # tab-width: 3 44 | # ruby-indent-level: 3 45 | # End: 46 | # vim: ts=3 47 | -------------------------------------------------------------------------------- /spec/apple_webclip_spec.rb: -------------------------------------------------------------------------------- 1 | $:.unshift(File.dirname(__FILE__)) 2 | require 'spec_helper' 3 | 4 | describe "apple_webclip plugin" do 5 | def setup_apple_webclip_plugin( url ) 6 | fake_plugin(:apple_webclip) { |plugin| 7 | plugin.conf['apple_webclip.url'] = url 8 | } 9 | end 10 | 11 | describe "url is enabled" do 12 | before do 13 | plugin = setup_apple_webclip_plugin('http://example.com/example.png') 14 | @header_snippet = plugin.header_proc 15 | end 16 | 17 | it "header include url" do 18 | expect(@header_snippet).to eq(%Q|\t|) 19 | end 20 | end 21 | 22 | describe "url is disabled" do 23 | describe "url is empty" do 24 | before do 25 | plugin = setup_apple_webclip_plugin('') 26 | @header_snippet = plugin.header_proc 27 | end 28 | 29 | it "header is empty" do 30 | expect(@header_snippet).to be_empty 31 | end 32 | end 33 | 34 | describe "url is nil" do 35 | before do 36 | plugin = setup_apple_webclip_plugin(nil) 37 | @header_snippet = plugin.header_proc 38 | end 39 | 40 | it "header is empty" do 41 | expect(@header_snippet).to be_empty 42 | end 43 | end 44 | end 45 | 46 | end 47 | -------------------------------------------------------------------------------- /spec/fixtures/flickr/5950109223.flickr.photos.getInfo.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | RubyKaigi 2011 6 | 7 | 8 | 9 | 10 | 11 | 12 | 0 13 | 14 | 15 | 16 | rubykaigi 17 | 18 | 19 | https://www.flickr.com/photos/machu/5950109223/ 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /spec/fixtures/flickr/5950109223.flickr.photos.getSizes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /spec/fixtures/github.json: -------------------------------------------------------------------------------- 1 | {"type":"User","login":"schacon","public_repos":150,"public_gists":80,"followers":5328,"html_url":"https://github.com/schacon","created_at":"2008-01-27T17:19:28Z","blog":"http://scottchacon.com","company":"GitHub","email":"schacon@gmail.com","avatar_url":"https://avatars.githubusercontent.com/u/70?v=3","hireable":false,"following":19,"name":"Scott Chacon","bio":null,"id":70,"location":"San Francisco, CA","url":"https://api.github.com/users/schacon","gravatar_id":"9375a9529679f1b42b567a640d775e7d"} 2 | -------------------------------------------------------------------------------- /spec/fixtures/gravatar.json: -------------------------------------------------------------------------------- 1 | {"entry":[{"id":"7329339","hash":"3b3be63a4c2a439b013787725dfce802","requestHash":"3b3be63a4c2a439b013787725dfce802","profileUrl":"http:\/\/gravatar.com\/tdiary","preferredUsername":"tdiary","thumbnailUrl":"http:\/\/2.gravatar.com\/avatar\/3b3be63a4c2a439b013787725dfce802","photos":[{"value":"http:\/\/2.gravatar.com\/avatar\/3b3be63a4c2a439b013787725dfce802","type":"thumbnail"},{"value":"http:\/\/2.gravatar.com\/userimage\/7329339\/3b3be63a4c2a439b013787725dfce802"}],"profileBackground":{"color":"#e78736"},"name":{"givenName":"diary","familyName":"t","formatted":"tDiary"},"displayName":"tDiary","aboutMe":"The tDiary system","currentLocation":"JAPAN","emails":[{"primary":"true","value":"iHaveAn@email.com"}],"urls":[{"value":"http:\/\/www.tdiary.org","title":"tDiary"}]}]} -------------------------------------------------------------------------------- /spec/fixtures/my_hotentry/entrylist-empty.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | はてなブックマーク - 新着エントリー - empty-url.example.com 14 | http://b.hatena.ne.jp/entrylist?sort=eid&threshold=3&url=http%3A%2F%2Fempty-url.example.com 15 | empty-url.example.com の新着エントリー 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /spec/flicker_spec.rb: -------------------------------------------------------------------------------- 1 | $:.unshift(File.dirname(__FILE__)) 2 | require 'spec_helper' 3 | 4 | describe "flickr plugin" do 5 | let(:plugin) { fake_plugin(:flickr) } 6 | 7 | before(:all) do 8 | stub_request(:get, "https://www.flickr.com/services/rest/?api_key=f7e7fb8cc34e52db3e5af5e1727d0c0b&method=flickr.photos.getInfo&photo_id=5950109223") 9 | .to_return(status: 200, body: File.new('spec/fixtures/flickr/5950109223.flickr.photos.getInfo.xml')) 10 | stub_request(:get, "https://www.flickr.com/services/rest/?api_key=f7e7fb8cc34e52db3e5af5e1727d0c0b&method=flickr.photos.getSizes&photo_id=5950109223") 11 | .to_return(status: 200, body: File.new('spec/fixtures/flickr/5950109223.flickr.photos.getSizes.xml')) 12 | end 13 | 14 | describe '#flickr' do 15 | subject { plugin.flickr('5950109223', size = nil) } 16 | 17 | it do 18 | expect(subject).to eq %Q|\"RubyKaigi| 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /spec/gist_spec.rb: -------------------------------------------------------------------------------- 1 | $:.unshift(File.dirname(__FILE__)) 2 | require 'spec_helper' 3 | 4 | describe "gist plugin" do 5 | DUMMY_GIST_ID = 1234567890 6 | 7 | it 'should render javascript tag with specified gist-id' do 8 | plugin = fake_plugin(:gist) 9 | snippet = plugin.gist(DUMMY_GIST_ID) 10 | expected = (<<-EOS).chomp 11 | 13 | EOS 14 | expect(snippet).to eq(expected) 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /spec/github_link_spec.rb: -------------------------------------------------------------------------------- 1 | $:.unshift(File.dirname(__FILE__)) 2 | require 'spec_helper' 3 | 4 | describe "github link plugin" do 5 | let(:plugin) { fake_plugin(:github_link) } 6 | subject { plugin.gh_link(*args) } 7 | 8 | describe 'repository page' do 9 | let(:args) { ['tdiary/tdiary-contrib'] } 10 | 11 | it 'should render repository a tag' do 12 | is_expected.to eq(%(tdiary-contrib)) 13 | end 14 | end 15 | 16 | describe 'issues page' do 17 | let(:args) { ['tdiary/tdiary-contrib#100'] } 18 | 19 | it 'should render issues a tag' do 20 | is_expected.to eq(%(tdiary-contrib#100)) 21 | end 22 | end 23 | context "When given altenative text" do 24 | let(:text) { 'This project' } 25 | let(:github_identifier) { 'tdiary/tdiary-contrib' } 26 | let(:args) { [github_identifier, text] } 27 | 28 | it 'should render repository a tag with the specified text' do 29 | is_expected.to eq(%(#{text})) 30 | end 31 | context "but the text is including ' } 33 | 34 | it 'should render a link text after sanitizing.' do 35 | is_expected.not_to eq(%(#{text})) 36 | end 37 | end 38 | end 39 | end 40 | -------------------------------------------------------------------------------- /spec/google_analytics_spec.rb: -------------------------------------------------------------------------------- 1 | $:.unshift(File.dirname(__FILE__)) 2 | require 'spec_helper' 3 | 4 | describe "google_analytics plugin" do 5 | def setup_google_analytics_plugin(profile_id, mode) 6 | fake_plugin(:google_analytics) { |plugin| 7 | plugin.mode = mode 8 | plugin.conf['google_analytics.profile'] = profile_id 9 | } 10 | end 11 | 12 | describe "should render javascript" do 13 | before do 14 | @plugin = setup_google_analytics_plugin('53836-1', 'latest') 15 | end 16 | 17 | it "for footer" do 18 | snippet = @plugin.footer_proc 19 | expect(snippet).to eq(expected_html_footer_snippet) 20 | end 21 | end 22 | 23 | describe "should render javascript" do 24 | before do 25 | @plugin = setup_google_analytics_plugin('53836-1', 'conf') 26 | end 27 | 28 | it "for footer" do 29 | snippet = @plugin.footer_proc 30 | expect(snippet).to be_empty 31 | end 32 | end 33 | 34 | describe "should not render when profile_id is empty" do 35 | before do 36 | @plugin = setup_google_analytics_plugin(nil, 'latest') 37 | end 38 | 39 | it "for footer" do 40 | snippet = @plugin.footer_proc 41 | expect(snippet).to be_empty 42 | end 43 | end 44 | 45 | def expected_html_footer_snippet 46 | expected = <<-SCRIPT 47 | 48 | 49 | 56 | SCRIPT 57 | expected.gsub( /^\t/, '' ).chomp 58 | end 59 | end 60 | -------------------------------------------------------------------------------- /spec/google_universal_analytics_spec.rb: -------------------------------------------------------------------------------- 1 | $:.unshift(File.dirname(__FILE__)) 2 | require 'spec_helper' 3 | 4 | describe "google_universal_analytics plugin" do 5 | def setup_google_universal_analytics_plugin(profile_id, mode) 6 | fake_plugin(:google_universal_analytics) { |plugin| 7 | plugin.mode = mode 8 | plugin.conf['google_universal_analytics.profile'] = profile_id 9 | } 10 | end 11 | 12 | describe "should render javascript" do 13 | before do 14 | @plugin = setup_google_universal_analytics_plugin('53836-1', 'latest') 15 | end 16 | 17 | it "for footer" do 18 | snippet = @plugin.footer_proc 19 | expect(snippet).to eq(expected_html_footer_snippet) 20 | end 21 | end 22 | 23 | describe "should render javascript" do 24 | before do 25 | @plugin = setup_google_universal_analytics_plugin('53836-1', 'conf') 26 | end 27 | 28 | it "for footer" do 29 | snippet = @plugin.footer_proc 30 | expect(snippet).to be_empty 31 | end 32 | end 33 | 34 | describe "should not render when profile_id is empty" do 35 | before do 36 | @plugin = setup_google_universal_analytics_plugin(nil, 'latest') 37 | end 38 | 39 | it "for footer" do 40 | snippet = @plugin.footer_proc 41 | expect(snippet).to be_empty 42 | end 43 | end 44 | 45 | def expected_html_footer_snippet 46 | expected = <<-SCRIPT 47 | 57 | SCRIPT 58 | expected.gsub( /^\t/, '' ).chomp 59 | end 60 | end 61 | -------------------------------------------------------------------------------- /spec/jdate_spec.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | $:.unshift(File.dirname(__FILE__)) 4 | require 'spec_helper' 5 | require 'time' 6 | 7 | describe "jdate plugin" do 8 | { 9 | '20080121' => '月', 10 | '20080122' => '火', 11 | '20080123' => '水', 12 | '20080124' => '木', 13 | '20080125' => '金', 14 | '20080126' => '土', 15 | '20080127' => '日', 16 | }.each do |k,v| 17 | it { expect(setup_jdate_plugin(Time.parse(k)).date.strftime('%J')).to eq(v) } 18 | end 19 | 20 | def setup_jdate_plugin(date) 21 | fake_plugin(:jdate) {|plugin| plugin.date = date} 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /spec/jmonth_spec.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | $:.unshift(File.dirname(__FILE__)) 4 | require 'spec_helper' 5 | require 'time' 6 | 7 | describe "jmonth plugin" do 8 | { 9 | '2007/01/01' => '睦月', 10 | '2007/02/01' => '如月', 11 | '2007/03/01' => '弥生', 12 | '2007/04/01' => '卯月', 13 | '2007/05/01' => '皐月', 14 | '2007/06/01' => '水無月', 15 | '2007/07/01' => '文月', 16 | '2007/08/01' => '葉月', 17 | '2007/09/01' => '長月', 18 | '2007/10/01' => '神無月', 19 | '2007/11/01' => '霜月', 20 | '2007/12/01' => '師走' 21 | }.each do |k,v| 22 | it { expect(setup_jmonth_plugin(Time.parse(k)).date.strftime('%i')).to eq(v) } 23 | end 24 | 25 | def setup_jmonth_plugin(date) 26 | fake_plugin(:jmonth) { |plugin| plugin.date = date } 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /spec/jyear_spec.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | $:.unshift(File.dirname(__FILE__)) 4 | require 'spec_helper' 5 | require 'time' 6 | 7 | describe "jyear plugin" do 8 | { 9 | '1925/01/01' => '昔々', 10 | '1926/12/25' => '昭和元年', 11 | '1927/01/01' => '昭和2', 12 | '1989/01/08' => '平成元年', 13 | '1990/01/01' => '平成2', 14 | }.each do |k,v| 15 | it { expect(setup_jyear_plugin(Time.parse(k)).date.strftime('%K')).to eq(v) } 16 | end 17 | 18 | def setup_jyear_plugin(date) 19 | fake_plugin(:jyear) { |plugin| plugin.date = date } 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /spec/opensearch_ad_spec.rb: -------------------------------------------------------------------------------- 1 | $:.unshift(File.dirname(__FILE__)) 2 | require 'spec_helper' 3 | 4 | describe "opensearch_ad plugin w/" do 5 | def setup_opensearch_ad_plugin(title, xml, mode) 6 | fake_plugin(:opensearch_ad) { |plugin| 7 | plugin.mode = mode 8 | plugin.conf['opensearch.title'] = title 9 | plugin.conf['opensearch.xml'] = xml 10 | } 11 | end 12 | 13 | describe "in day mode" do 14 | before do 15 | plugin = setup_opensearch_ad_plugin('OpenSearch', 'http://example.com/opensearch.xml', 'day') 16 | @header_snippet = plugin.header_proc 17 | end 18 | 19 | it { expect(@header_snippet).to eq(expected_link_tag_with( 20 | :title => 'OpenSearch', 21 | :xml => 'http://example.com/opensearch.xml'))} 22 | end 23 | 24 | describe "in latest mode" do 25 | before do 26 | plugin = setup_opensearch_ad_plugin('OpenSearch', 'http://example.com/opensearch.xml', 'latest') 27 | @header_snippet = plugin.header_proc 28 | end 29 | 30 | it { expect(@header_snippet).to eq(expected_link_tag_with( 31 | :title => 'OpenSearch', 32 | :xml => 'http://example.com/opensearch.xml'))} 33 | end 34 | 35 | describe "in edit mode" do 36 | before do 37 | plugin = setup_opensearch_ad_plugin('OpenSearch', 'http://example.com/opensearch.xml', 'edit') 38 | @header_snippet = plugin.header_proc 39 | end 40 | 41 | it { expect(@header_snippet).to be_empty } 42 | end 43 | 44 | def expected_link_tag_with(options) 45 | result = <<-HTML 46 | 47 | HTML 48 | result.gsub( /^\t/, '' ).chomp 49 | end 50 | end 51 | -------------------------------------------------------------------------------- /spec/rcov.opts: -------------------------------------------------------------------------------- 1 | -x /var/lib/gem 2 | -x spec/spec_helper.rb 3 | -------------------------------------------------------------------------------- /spec/title_anchor_spec.rb: -------------------------------------------------------------------------------- 1 | $:.unshift(File.dirname(__FILE__)) 2 | require 'spec_helper' 3 | 4 | describe "title_anchor plugin" do 5 | def setup_title_anchor_plugin(mode) 6 | fake_plugin(:title_anchor) { |plugin| 7 | plugin.mode = mode 8 | plugin.conf.index = '' 9 | plugin.conf.html_title = "HsbtDiary" 10 | } 11 | end 12 | 13 | describe "in day mode" do 14 | before do 15 | @plugin = setup_title_anchor_plugin('day') 16 | end 17 | 18 | it { expect(@plugin.title_anchor).to eq(expected_html_title_in_day( 19 | :index => '', 20 | :html_title => 'HsbtDiary'))} 21 | end 22 | 23 | describe "in latest mode" do 24 | before do 25 | @plugin = setup_title_anchor_plugin('latest') 26 | end 27 | 28 | it { expect(@plugin.title_anchor).to eq(expected_html_title_in_latest( 29 | :html_title => 'HsbtDiary'))} 30 | end 31 | 32 | def expected_html_title_in_day(options) 33 | expected = %{

    #{options[:html_title]}

    } 34 | end 35 | 36 | def expected_html_title_in_latest(options) 37 | expected = %{

    #{options[:html_title]}

    } 38 | end 39 | end 40 | -------------------------------------------------------------------------------- /spec/youtube_spec.rb: -------------------------------------------------------------------------------- 1 | $:.unshift(File.dirname(__FILE__)) 2 | require 'spec_helper' 3 | 4 | describe "youtube plugin" do 5 | DUMMY_YOUTUBE_VIDEO_ID = 1234567890 6 | 7 | { 8 | 'Mozilla' => %|\t\t
    \n\t\t\n\t\t
    \n| 9 | }.each do |k,v| 10 | it 'should render object tag in :user_agent' do 11 | plugin = fake_plugin(:youtube) 12 | cgi = CGIFake.new 13 | cgi.user_agent = k 14 | plugin.conf.cgi = cgi 15 | expect(plugin.youtube(DUMMY_YOUTUBE_VIDEO_ID)).to eq(v) 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /style/wikiext_style.rb: -------------------------------------------------------------------------------- 1 | # wikiext_style.rb: when using wiki style, extends behavior. 2 | # 3 | # Just place this file into tdiary/style directory. 4 | # 5 | # Copyright (C) 2012, kdmsnr 6 | # You can distribute this under GPL. 7 | # 8 | 9 | module TDiary 10 | class WikiextDiary # dummy class 11 | end 12 | end 13 | 14 | require "hikidoc" 15 | class HikiDoc 16 | class HTMLOutput 17 | def paragraph(lines) 18 | @f.puts "

    #{lines.join("")}

    " 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /tdiary-contrib.gemspec: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | lib = File.expand_path('../lib', __FILE__) 3 | $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 4 | require 'tdiary/contrib/version' 5 | 6 | Gem::Specification.new do |spec| 7 | spec.name = "tdiary-contrib" 8 | spec.version = TDiary::Contrib::VERSION 9 | spec.authors = ["tDiary contributors"] 10 | spec.email = ["support@tdiary.org"] 11 | spec.summary = %q{tDiary contributions package} 12 | spec.description = %q{tDiary contributions package that includes plugins, styles, utilities, libraries, filters, and extended io.} 13 | spec.homepage = "http://www.tdiary.org/" 14 | spec.license = "GPL-2 and/or others" 15 | 16 | spec.files = Dir[ 17 | 'README.md', 18 | 'README.en.md', 19 | 'Rakefile', 20 | 'doc/**/*', 21 | 'filter/**/*', 22 | 'io/**/*', 23 | 'js/**/*', 24 | 'lib/**/*', 25 | 'misc/**/*', 26 | 'plugin/**/*', 27 | 'spec/**/*', 28 | 'style/**/*', 29 | 'util/**/*' 30 | ] 31 | spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } 32 | spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) 33 | spec.require_paths = ["lib"] 34 | 35 | spec.add_dependency 'tdiary', '~> 5.0' 36 | spec.add_dependency 'pushbullet_ruby' 37 | spec.add_dependency 'holiday_japan' 38 | spec.add_dependency 'coderay' 39 | 40 | spec.add_development_dependency "bundler", ">= 1.3", "< 3.0" 41 | spec.add_development_dependency "rake" 42 | spec.add_development_dependency "rspec" 43 | spec.add_development_dependency "simplecov" 44 | spec.add_development_dependency "webmock" 45 | spec.add_development_dependency "debug" 46 | end 47 | -------------------------------------------------------------------------------- /util/clean-spam/README.ja: -------------------------------------------------------------------------------- 1 | See http://www.namazu.org/~satoru/diary/20040923.html#p01 2 | -------------------------------------------------------------------------------- /util/clean-spam/tdiary-comment-clean: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # Copyright (C) 2004 Satoru Takabayashi 4 | # You can redistribute it and/or modify it under GPL2. 5 | # 6 | puts "Usage: tdiary-comment-clean PATTERN FILE..." if ARGV.length == 0 7 | pattern = Regexp.new(ARGV.shift) 8 | file_names = ARGV 9 | 10 | deleted_comments = [] 11 | file_names.each {|file_name| 12 | i = File.open(file_name) 13 | first_line = i.gets 14 | 15 | comments = [] 16 | comment = "" 17 | while line = i.gets 18 | if line == ".\n" 19 | comments.push(comment) 20 | comment = "" 21 | else 22 | comment << line 23 | end 24 | end 25 | i.close 26 | 27 | tmp_name = "tmp.#{Process.pid}" 28 | File.open(tmp_name, "w") {|o| 29 | o.print first_line 30 | comments.each {|comment| 31 | if pattern.match(comment) 32 | deleted_comments.push(comment) 33 | else 34 | o.print comment 35 | o.puts "." 36 | end 37 | } 38 | } 39 | File.rename(file_name, file_name + ".bak") 40 | File.rename(tmp_name, file_name) 41 | } 42 | 43 | deleted_comments.each {|comment| 44 | print comment 45 | puts "." 46 | } 47 | -------------------------------------------------------------------------------- /util/clean-spam/tdiary-comment-clean2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # Copyright (C) 2004 Satoru Takabayashi 4 | # You can redistribute it and/or modify it under GPL2. 5 | # 6 | # Modified by machu ( http://www.machu.jp/diary/ ) 7 | # 2008-03-07: adding last-modified filter with -a and -b option 8 | # 9 | require 'optparse' 10 | after_date = Time.at(0) 11 | before_date = Time.now 12 | test = false 13 | 14 | opt = OptionParser.new 15 | opt.on('-a AFTER_HOUR') {|v| 16 | after_date = Time.at(Time.now - 60 * 60 * v.to_i) 17 | } 18 | opt.on('-b BEFORE_HOUR') {|v| 19 | before_date = Time.at(Time.now - 60 * 60 * v.to_i) 20 | } 21 | opt.on('-t') {|v| 22 | test = true 23 | } 24 | opt.parse!(ARGV) 25 | 26 | puts "Usage: tdiary-comment-clean [-a AFTER_HOUR] [-b BEFORE_HOUR] PATTERN FILE..." if ARGV.length == 0 27 | pattern = Regexp.new(ARGV.shift) 28 | file_names = ARGV 29 | 30 | class Comment 31 | attr_accessor :body, :date 32 | 33 | def initialize 34 | @body = "" 35 | end 36 | 37 | def <<(body) 38 | if body.match(/^Last-Modified: (\d+)$/) 39 | @date = Time.at($1.to_i) 40 | end 41 | @body << body 42 | end 43 | end 44 | 45 | deleted_comments = [] 46 | file_names.each {|file_name| 47 | i = File.open(file_name) 48 | first_line = i.gets 49 | 50 | comments = [] 51 | comment = Comment.new 52 | while line = i.gets 53 | if line == ".\n" 54 | comments.push(comment) 55 | comment = Comment.new 56 | else 57 | comment << line 58 | end 59 | end 60 | i.close 61 | 62 | tmp_name = "tmp.#{Process.pid}" 63 | File.open(tmp_name, "w") {|o| 64 | o.print first_line 65 | comments.each {|comment| 66 | if pattern.match(comment.body) and (before_date > comment.date) and (after_date < comment.date) 67 | deleted_comments.push(comment) 68 | else 69 | o.print comment.body 70 | o.puts "." 71 | end 72 | } 73 | } 74 | File.rename(file_name, file_name + ".bak") unless test 75 | File.rename(tmp_name, file_name) unless test 76 | } 77 | 78 | deleted_comments.each {|comment| 79 | print comment.body 80 | puts "." 81 | } 82 | -------------------------------------------------------------------------------- /util/clean-spam/tdiary-referer-clean: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # Copyright (C) 2004 Satoru Takabayashi 4 | # You can redistribute it and/or modify it under GPL2. 5 | # 6 | puts "Usage: tdiary-referer-clean PATTERN FILE..." if ARGV.length == 0 7 | pattern = Regexp.new(ARGV.shift) 8 | file_names = ARGV 9 | 10 | deleted_referers = [] 11 | file_names.each {|file_name| 12 | tmp_name = "tmp.#{Process.pid}" 13 | i = File.open(file_name) 14 | o = File.open(tmp_name, "w") 15 | 16 | first_line = i.gets 17 | o.print first_line 18 | 19 | while true 20 | date_line = i.gets 21 | break if date_line.nil? 22 | raise unless /^Date: /.match(date_line) 23 | blank_line = i.gets 24 | raise unless blank_line == "\n" 25 | 26 | o.print date_line 27 | o.print blank_line 28 | while line = i.gets 29 | if line == ".\n" 30 | o.print line 31 | next 32 | end 33 | if pattern.match(line) 34 | deleted_referers.push(line) 35 | else 36 | o.print line 37 | end 38 | end 39 | end 40 | i.close 41 | o.close 42 | 43 | File.rename(file_name, file_name + ".bak") 44 | File.rename(tmp_name, file_name) 45 | } 46 | deleted_referers.each {|referer| print referer } 47 | -------------------------------------------------------------------------------- /util/convert_pstore.rb: -------------------------------------------------------------------------------- 1 | # 2 | # convert utf-8 in pstore. 3 | # 4 | # usage: convert_pstore.rb file1 5 | # 6 | 7 | $KCODE = 'u' 8 | 9 | require 'nkf' 10 | require "pstore" 11 | begin 12 | require "iconv" 13 | rescue LoadError 14 | end 15 | 16 | def convert_pstore( file ) 17 | db = PStore.new( file ) 18 | begin 19 | roots = db.transaction{ db.roots } 20 | rescue ArgumentError 21 | if /\Aundefined class\/module (.+?)(::)?\z/ =~ $!.message 22 | klass = $1 23 | if /EmptdiaryString\z/ =~ klass 24 | eval( "class #{klass} < String; end" ) 25 | else 26 | eval( "class #{ klass}; end" ) 27 | end 28 | retry 29 | end 30 | end 31 | db.transaction do 32 | roots.each do |root| 33 | convert_element( db[root] ) 34 | end 35 | end 36 | end 37 | 38 | def convert_element( data ) 39 | case data 40 | when Hash, Array 41 | data.each_with_index do |e, i| 42 | if String === e 43 | data[i] = migrate_to_utf8( e ) 44 | else 45 | convert_element( e ) 46 | end 47 | end 48 | else 49 | data.instance_variables.each do |e| 50 | var = data.instance_variable_get( e ) 51 | if String === var 52 | data.instance_variable_set( e, migrate_to_utf8( var ) ) 53 | else 54 | convert_element( var ) 55 | end 56 | end 57 | end 58 | end 59 | 60 | def migrate_to_utf8( str ) 61 | to_native( str, 'EUC-JP' ) 62 | end 63 | 64 | def to_native( str, charset = nil ) 65 | begin 66 | Iconv.conv('utf-8', charset || 'utf-8', str) 67 | rescue 68 | from = case charset 69 | when /^utf-8$/i 70 | 'W' 71 | when /^shift_jis/i 72 | 'S' 73 | when /^EUC-JP/i 74 | 'E' 75 | else 76 | '' 77 | end 78 | NKF::nkf("-m0 -#{from}w", str) 79 | end 80 | end 81 | 82 | convert_pstore( ARGV[0] ) 83 | -------------------------------------------------------------------------------- /util/estraier-search/ChangeLog: -------------------------------------------------------------------------------- 1 | 2007-02-23 SHIBATA Hiroshi 2 | 3 | * estraier-search.rb: add override whatsnew plugin. 4 | 5 | 2007-02-18 Kazuhiko 6 | 7 | * estraier-search.rb: add 'require "date"'. 8 | 9 | 2007-02-16 Kazuhiko 10 | 11 | * estraier-register.rb, estraier-search.rb: rename 12 | @last_modified attribute to @mdate. 13 | 14 | * estraier-register.rb: register all visible comments (ie. not 15 | limit to 100). 16 | 17 | 2007-02-15 Kazuhiko 18 | 19 | * estraier-search.rb, estraier.rhtml: support similarity search. 20 | 21 | * estraier-register.rb, estraier-search.rb: support 22 | "estraier.with_user_name" option. 23 | * estraier-search.rb, estraier.rhtml: support changing a phrase 24 | format. 25 | 26 | 2007-02-14 Kazuhiko 27 | 28 | * estraier.rxml: add guid elements and escape contents of 29 | description elements. 30 | * estraier-register.rb, estraier-search.rb: add the 31 | 'estraier.path' variable. 32 | * estraier.rhtml: revise for more tdiary-like outputs. 33 | 34 | 2007-02-13 Kazuhiko 35 | 36 | * initial release: ported from rast-search. 37 | -------------------------------------------------------------------------------- /util/estraier-search/en/estraier-register.rb: -------------------------------------------------------------------------------- 1 | @estraier_register_conf_label = 'Estraier Search' 2 | @estraier_register_conf_header = 'Rebuild Estraier search index' 3 | @estraier_register_conf_description = 'To rebuild Estraier search index, check the box and submit \'OK\'.' 4 | -------------------------------------------------------------------------------- /util/estraier-search/estraier.rxml: -------------------------------------------------------------------------------- 1 | "?> 2 | 3 | 4 | <%= _( @conf.html_title ) %> [全文検索]: <%= _(@query) %> 5 | <%= @conf.base_url.sub(%r|/[^/]*$|, '/') %><%= _(@cgi.script_name ? File.basename(@cgi.script_name) : "") %><%= format_anchor(@start, @num) %> 6 | HyperEstraier 検索: <%= _(@query) %> 7 | ja-JP 8 | <%= @result.doc_num %> 9 | <%= @start + 1 %> 10 | <%= @num %> 11 | <% for i in @start...@start+@num %> 12 | <% item = @result.get_doc(i) || next %> 13 | <% format_result_item(item) %> 14 | 15 | <%= _(@date.sub(/^(\d{4})(\d{2})(\d{2}).*/, "\\1-\\2-\\3")) %> <%= _(@conf.to_native(@title)) %> 16 | <%= @conf.base_url %><%= @plugin.anchor(@date) %> 17 | <%= _(CGI.rfc1123_date(Time.parse(@last_modified))) %> 18 | <%= _(@conf.to_native(@summary)) %> 19 | <%= @conf.base_url %><%= @plugin.anchor(@date) %> 20 | 21 | <% end %> 22 | 23 | 24 | -------------------------------------------------------------------------------- /util/estraier-search/i.estraier.rhtml: -------------------------------------------------------------------------------- 1 |

    <%= _(@conf.html_title) %> [全文検索]

    2 |
    3 |

    4 | 5 | 6 |

    7 |

    8 | 並べ替え: 9 | 12 | 15 | 表示件数: 16 | 19 |

    20 |
    21 | <% if @msg %> 22 |

    <%= @msg %>

    23 | <% else %> 24 |

    <%= @result.doc_num %>件中<%= @start + 1 %>-<%= [@result.doc_num, @start + @num].min %>件目

    25 | <% for i in @start...@start+@num %><% item = @result.get_doc(i) || next %><% format_result_item(item) %> 26 |

    <%= _(@date.sub(/^(\d{4})(\d{2})(\d{2}).*/, "\\1-\\2-\\3")) %><%= @conf.to_native(@title) %>(スコア:<%= item.attr("#nodescore") %>)

    27 | <% end %> 28 | <% if @result.doc_num > @num %> 29 | <%= format_links(@result) %> 30 | <% end %> 31 | <% end %> 32 | -------------------------------------------------------------------------------- /util/estraier-search/ja/estraier-register.rb: -------------------------------------------------------------------------------- 1 | @estraier_register_conf_label = 'Estraier検索' 2 | @estraier_register_conf_header = 'Estraier検索インデックスの再構築' 3 | @estraier_register_conf_description = 'Estraier検索のインデックスを再構築する場合は、チェックボックスをチェックしてOKを押してください。' 4 | -------------------------------------------------------------------------------- /util/image-gallery/README.ja: -------------------------------------------------------------------------------- 1 | tDiary Image Gallery Ver 2.1.0 -- README.ja -- 2 | 3 | Copyright (c) 2005-2014 N.KASHIJUKU 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://exception.rash.jp/tdiary/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 | 28 | -------------------------------------------------------------------------------- /util/image-gallery/js/SmoothGallery/css/img/carrow1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tdiary/tdiary-contrib/98a9a99c772dbabac8bebe22e020dce9064a4e1d/util/image-gallery/js/SmoothGallery/css/img/carrow1.gif -------------------------------------------------------------------------------- /util/image-gallery/js/SmoothGallery/css/img/carrow2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tdiary/tdiary-contrib/98a9a99c772dbabac8bebe22e020dce9064a4e1d/util/image-gallery/js/SmoothGallery/css/img/carrow2.gif -------------------------------------------------------------------------------- /util/image-gallery/js/SmoothGallery/css/img/closebox.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tdiary/tdiary-contrib/98a9a99c772dbabac8bebe22e020dce9064a4e1d/util/image-gallery/js/SmoothGallery/css/img/closebox.gif -------------------------------------------------------------------------------- /util/image-gallery/js/SmoothGallery/css/img/closebox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tdiary/tdiary-contrib/98a9a99c772dbabac8bebe22e020dce9064a4e1d/util/image-gallery/js/SmoothGallery/css/img/closebox.png -------------------------------------------------------------------------------- /util/image-gallery/js/SmoothGallery/css/img/fleche1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tdiary/tdiary-contrib/98a9a99c772dbabac8bebe22e020dce9064a4e1d/util/image-gallery/js/SmoothGallery/css/img/fleche1.gif -------------------------------------------------------------------------------- /util/image-gallery/js/SmoothGallery/css/img/fleche1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tdiary/tdiary-contrib/98a9a99c772dbabac8bebe22e020dce9064a4e1d/util/image-gallery/js/SmoothGallery/css/img/fleche1.png -------------------------------------------------------------------------------- /util/image-gallery/js/SmoothGallery/css/img/fleche2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tdiary/tdiary-contrib/98a9a99c772dbabac8bebe22e020dce9064a4e1d/util/image-gallery/js/SmoothGallery/css/img/fleche2.gif -------------------------------------------------------------------------------- /util/image-gallery/js/SmoothGallery/css/img/fleche2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tdiary/tdiary-contrib/98a9a99c772dbabac8bebe22e020dce9064a4e1d/util/image-gallery/js/SmoothGallery/css/img/fleche2.png -------------------------------------------------------------------------------- /util/image-gallery/js/SmoothGallery/css/img/loading-bar-black.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tdiary/tdiary-contrib/98a9a99c772dbabac8bebe22e020dce9064a4e1d/util/image-gallery/js/SmoothGallery/css/img/loading-bar-black.gif -------------------------------------------------------------------------------- /util/image-gallery/js/SmoothGallery/css/img/open.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tdiary/tdiary-contrib/98a9a99c772dbabac8bebe22e020dce9064a4e1d/util/image-gallery/js/SmoothGallery/css/img/open.gif -------------------------------------------------------------------------------- /util/image-gallery/js/SmoothGallery/css/img/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tdiary/tdiary-contrib/98a9a99c772dbabac8bebe22e020dce9064a4e1d/util/image-gallery/js/SmoothGallery/css/img/open.png -------------------------------------------------------------------------------- /util/image-gallery/js/SmoothGallery/css/img/remo_bg_e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tdiary/tdiary-contrib/98a9a99c772dbabac8bebe22e020dce9064a4e1d/util/image-gallery/js/SmoothGallery/css/img/remo_bg_e.png -------------------------------------------------------------------------------- /util/image-gallery/js/SmoothGallery/css/img/remo_bg_n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tdiary/tdiary-contrib/98a9a99c772dbabac8bebe22e020dce9064a4e1d/util/image-gallery/js/SmoothGallery/css/img/remo_bg_n.png -------------------------------------------------------------------------------- /util/image-gallery/js/SmoothGallery/css/img/remo_bg_ne.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tdiary/tdiary-contrib/98a9a99c772dbabac8bebe22e020dce9064a4e1d/util/image-gallery/js/SmoothGallery/css/img/remo_bg_ne.png -------------------------------------------------------------------------------- /util/image-gallery/js/SmoothGallery/css/img/remo_bg_nw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tdiary/tdiary-contrib/98a9a99c772dbabac8bebe22e020dce9064a4e1d/util/image-gallery/js/SmoothGallery/css/img/remo_bg_nw.png -------------------------------------------------------------------------------- /util/image-gallery/js/SmoothGallery/css/img/remo_bg_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tdiary/tdiary-contrib/98a9a99c772dbabac8bebe22e020dce9064a4e1d/util/image-gallery/js/SmoothGallery/css/img/remo_bg_s.png -------------------------------------------------------------------------------- /util/image-gallery/js/SmoothGallery/css/img/remo_bg_se.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tdiary/tdiary-contrib/98a9a99c772dbabac8bebe22e020dce9064a4e1d/util/image-gallery/js/SmoothGallery/css/img/remo_bg_se.png -------------------------------------------------------------------------------- /util/image-gallery/js/SmoothGallery/css/img/remo_bg_sw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tdiary/tdiary-contrib/98a9a99c772dbabac8bebe22e020dce9064a4e1d/util/image-gallery/js/SmoothGallery/css/img/remo_bg_sw.png -------------------------------------------------------------------------------- /util/image-gallery/js/SmoothGallery/css/img/remo_bg_w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tdiary/tdiary-contrib/98a9a99c772dbabac8bebe22e020dce9064a4e1d/util/image-gallery/js/SmoothGallery/css/img/remo_bg_w.png -------------------------------------------------------------------------------- /util/image-gallery/js/SmoothGallery/css/img/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tdiary/tdiary-contrib/98a9a99c772dbabac8bebe22e020dce9064a4e1d/util/image-gallery/js/SmoothGallery/css/img/spinner.gif -------------------------------------------------------------------------------- /util/image-gallery/js/SmoothGallery/css/layout.css: -------------------------------------------------------------------------------- 1 | body { 2 | color: #ccc; 3 | font-family: "Trebuchet MS", "Lucida Grande", Arial, Helvetica, sans-serif; 4 | margin: 0 auto; 5 | padding: 0; 6 | font-size: 0.6em; 7 | background: #111 url('../images/bg/gradient1.gif') top left repeat-x; 8 | } 9 | 10 | h1 11 | { 12 | color: #fff; 13 | font-size: 47px; 14 | font-weight: bolder; 15 | margin: 0 40px; 16 | padding: 0.08em 0; 17 | } 18 | 19 | h1 sup 20 | { 21 | color: #ddd; 22 | } 23 | 24 | h1 a 25 | { 26 | color: #fff; 27 | text-decoration: none; 28 | } 29 | 30 | h1 .company, h1 a .company 31 | { 32 | color: #d01a71; 33 | } 34 | 35 | h2 36 | { 37 | color: #ddd; 38 | font-size: 2.5em; 39 | } 40 | 41 | h3 42 | { 43 | color: #fff; 44 | font-size: 1.5em; 45 | } 46 | 47 | h4 48 | { 49 | font-size: 1.3em; 50 | } 51 | 52 | .content 53 | { 54 | margin: 0 20px; 55 | } 56 | 57 | .content a 58 | { 59 | color: #fff; 60 | } 61 | 62 | 63 | .content p.linkage 64 | { 65 | margin-top: 2em; 66 | text-align: right; 67 | font-size: 1.7em; 68 | color: #ddd; 69 | } 70 | 71 | .content p.linkage a { color: #fff; } 72 | 73 | /*.content p.linkage a 74 | { 75 | color: #fff; 76 | background: url('../images/bg/biglink_off.gif') center right no-repeat; 77 | padding: 10px 20px; 78 | text-decoration: none; 79 | } 80 | 81 | .content p.linkage a:hover 82 | { 83 | background: url('../images/bg/biglink_on.gif') center right no-repeat; 84 | font-style: italic; 85 | }*/ 86 | 87 | #myGallery 88 | { 89 | text-align: left; 90 | margin: 0 auto; 91 | } -------------------------------------------------------------------------------- /util/image-gallery/misc/plugin/view_exif.rb: -------------------------------------------------------------------------------- 1 | # view_exif.rb $Revision: 1.0.0 $ 2 | # 3 | # Copyright (c) 2013 N.KASHIJUKU 4 | # You can redistribute it and/or modify it under GPL2. 5 | # 6 | # http://www1.whi.m-net.ne.jp/n-kashi/recent_image.htm 7 | # 8 | # !caution! view_exif.rb needs recent_image.rb 9 | # 10 | require 'exifparser' 11 | 12 | # PLUGIN body 13 | # view_exif() ... input EXIF datas of images in your diary. 14 | # 15 | def view_exif(id = 0, exifparam ="") 16 | init_rcimg if @recent_image_hash == nil or @recent_image_hash.length == 0 17 | 18 | begin 19 | @image_date_exif ||= @date.strftime("%Y%m%d") 20 | @exifparser = ExifParser.new(%Q[#{@image_dir}/#{@recent_image_hash[@image_date_exif+"_"+id.to_s].file}].untaint) 21 | 22 | if exifparam == "" # return a formatted string. 23 | model = @exifparser['Model'].to_s 24 | focallength = @exifparser['FocalLength'].to_s 25 | fnumber = @exifparser['FNumber'].to_s 26 | exposuretime = @exifparser['ExposureTime'].to_s 27 | isospeedratings = @exifparser['ISOSpeedRatings'].to_s 28 | exposurebiasvalue = @exifparser['ExposureBiasValue'].to_s 29 | if @exifparser.tag?('LensParameters') 30 | lensname = "("+ @exifparser['LensParameters'].to_s + ")" 31 | else 32 | lensname = "" 33 | end 34 | return %Q[

    #{model}, #{focallength}, #{fnumber}, #{exposuretime}, ISO#{isospeedratings}, #{exposurebiasvalue}EV #{lensname}

    ] 35 | else # return the requested value. 36 | return @exifparser[exifparam.untaint].to_s 37 | end 38 | 39 | rescue 40 | exp = ($!).to_s + "
    " 41 | ($!).backtrace.each do |btinfo| 42 | exp += btinfo 43 | exp += "
    " 44 | end 45 | return exp 46 | end 47 | end 48 | 49 | 50 | # Callback Functions 51 | 52 | add_body_enter_proc do |date| 53 | @image_date_exif = date.strftime("%Y%m%d") 54 | "" 55 | end 56 | -------------------------------------------------------------------------------- /util/image-gallery/tdiary.conf.igsample: -------------------------------------------------------------------------------- 1 | # 2 | # tDiary configuration file 3 | # 4 | 5 | @options['image-gallery.show_exif'] = true 6 | @options['image-gallery.column'] = 4 7 | @options['image-gallery.line'] = 10 8 | @options['image-gallery.width'] = "160" 9 | -------------------------------------------------------------------------------- /util/image-gallery/theme/image-gallery.css: -------------------------------------------------------------------------------- 1 | /* css for tDiary Image Gallery */ 2 | /* for List mode */ 3 | table.imagelist { 4 | margin: 0 auto; 5 | text-align: center; 6 | } 7 | 8 | table.imagelist p.imagetitle { 9 | margin-top: 0px; 10 | margin-bottom: 0px; 11 | } 12 | 13 | table.imagelist td { 14 | width: 33%; 15 | } 16 | 17 | table.imageview td { 18 | width: 50%; 19 | } 20 | 21 | table.imagelist p.imagedate { 22 | margin-top: 0px; 23 | } 24 | 25 | table.imageview { 26 | margin-left: auto; 27 | margin-right: auto; 28 | } 29 | 30 | table.imageview td { 31 | text-align: center; 32 | } 33 | 34 | p.exiftitle { 35 | text-align: left; 36 | } 37 | 38 | table.imageview li { 39 | text-align: left; 40 | } 41 | 42 | img.imagebody { 43 | border-style: solid; 44 | border-width: 1px; 45 | border-color: #fff; 46 | padding: 4px; 47 | margin: 0 auto; 48 | } 49 | 50 | p.infobar { 51 | text-align: center; 52 | } 53 | 54 | div.categorylink { 55 | font-size: small; 56 | text-align: right; 57 | margin-right: 0.3em; 58 | } 59 | 60 | 61 | /* for SlideShow mode */ 62 | .content { 63 | margin: 0 20px; 64 | } 65 | 66 | .content a { 67 | color: #fff; 68 | } 69 | 70 | 71 | .content p.linkage { 72 | margin-top: 2em; 73 | text-align: right; 74 | font-size: 1.7em; 75 | color: #ddd; 76 | } 77 | 78 | .content p.linkage a { color: #fff; } 79 | 80 | #myGallery 81 | { 82 | text-align: left; 83 | margin: 0 auto; 84 | } 85 | 86 | -------------------------------------------------------------------------------- /util/posttdiary/README.ja: -------------------------------------------------------------------------------- 1 | posttdiary.rb is a updater of diary via E-mail with images. 2 | 3 | see: 4 | http://tdiary-users.sourceforge.jp/cgi-bin/wiki.cgi?posttdiary%2Erb 5 | 6 | -- 7 | 8 | posttdiary-ex.rb is a more enhanced posttdiary.rb. 9 | 10 | see: 11 | http://ks.nwr.jp/wiki/wiki.cgi?posttdiary%2erb%b2%fe%c2%a4 (Japanese) 12 | http://ks.nwr.jp/prog/posttdiary.html (English) 13 | -------------------------------------------------------------------------------- /util/rast-search/ChangeLog: -------------------------------------------------------------------------------- 1 | 2007-01-08 Kazuhiko 2 | * rast-register.rb, rast-search.rb: revise for UTF8. 3 | 4 | 2005-12-10 Kazuhiko 5 | * rast-register.rb: set 'diaries' for the 'my-ex' plugin. 6 | 7 | * rast-register.rb: revise attributes of the 'date' property. 8 | rebuilding indices is necessary. 9 | * rast-search.rb: revise for mod_ruby. 10 | 11 | 2005-12-06 Kazuhiko 12 | * rast.rhtml: remove a dummy link. 13 | 14 | 2005-12-05 Kazuhiko 15 | * rast-register.rb: revise attributes of the 'date' property. 16 | remove indices before rebuilding. 17 | 18 | 2005-12-04 Kazuhiko 19 | * rast-register.rb: support tDiary-2.0.x. 20 | * en/rast-register.rb, ja/rast-register.rb: add resources. 21 | 22 | 2005-11-24 Kazuhiko 23 | * rast-register.rb: fix a bug in command-line mode (reported by 24 | YAA). set 'cache_path' for the 'tlink' plugin (reported by YAA). 25 | 26 | * rast-register.rb: support rebuilding index by conf mode. abolish 27 | 'CGI' mode. 28 | 29 | 2005-11-23 Kazuhiko 30 | * rast-register.rb: use 'require' instead of 'autoload'. 31 | 32 | 2005-11-21 Kazuhiko 33 | * rast-register.rb: add a plugin file. 34 | * rast-search.rb, rast.rxml: support opensearch rss. 35 | * rast.rhtml: revise for more valid HTML output. 36 | 37 | 2005-05-11 Kazuhiko 38 | * rast.rhtml, i.rast.rhtml: use @num instead of 10. 39 | 40 | 2005-05-11 TADA Tadashi 41 | * rast.rhtml, i.rast.rhtml: set title to h2 element, and copy format_links 42 | plugin on top of results. 43 | 44 | 2005-05-10 TADA Tadashi 45 | * README.ja: fix typo. 46 | 47 | 2005-04-16 Kazuhiko 48 | * rast.rhtml: convert the encoding of @query. 49 | 50 | 2005-04-15 Kazuhiko 51 | * rast-search.rb: never use Rast::LocalDB. fix a bug in running 52 | from a shell. 53 | 54 | 2005-04-14 Kazuhiko 55 | * initial release of rast-search. 56 | -------------------------------------------------------------------------------- /util/rast-search/en/rast-register.rb: -------------------------------------------------------------------------------- 1 | @rast_register_conf_label = 'Rast Search' 2 | @rast_register_conf_header = 'Rebuild Rast search index' 3 | @rast_register_conf_description = 'To rebuild Rast search index, check the box and submit \'OK\'.' 4 | -------------------------------------------------------------------------------- /util/rast-search/i.rast.rhtml: -------------------------------------------------------------------------------- 1 | <%# i.rast.rhtml $Revision: 1.5.2.1 $ %> 2 |

    <%= CGI::escapeHTML( @conf.html_title ) %> [全文検索]

    3 |
    4 |

    5 | 6 | 7 | 検索方法 8 |

    9 |

    10 | 並べ替え: 11 | 14 | 17 | 表示件数: 18 | 21 |

    22 |
    23 | <% if @msg %> 24 |

    <%= @msg %>

    25 | <% else %> 26 |

    <%= @result.hit_count %>件中<%= @start + 1 %>-<%= @start + @result.items.length %>件目

    27 | <% for item in @result.items %><% format_result_item(item) %> 28 |

    <%= _(@conf.to_native(@title)) %>(スコア:<%= item.score %>)

    29 | <% end %> 30 | <% if @result.hit_count > @num %> 31 | <%= format_links(@result) %> 32 | <% end %> 33 | <% end %> 34 | -------------------------------------------------------------------------------- /util/rast-search/ja/rast-register.rb: -------------------------------------------------------------------------------- 1 | @rast_register_conf_label = 'Rast検索' 2 | @rast_register_conf_header = 'Rast検索インデックスの再構築' 3 | @rast_register_conf_description = 'Rast検索のインデックスを再構築する場合は、チェックボックスをチェックしてOKを押してください。' 4 | -------------------------------------------------------------------------------- /util/rast-search/rast.rhtml: -------------------------------------------------------------------------------- 1 | <%# rast.rhtml $Revision: 1.7.2.1 $ %> 2 |
    <%%=navi_user%>
    3 | 4 |

    <%= CGI::escapeHTML( @conf.html_title ) %> [全文検索]

    5 | 6 |
    7 |

    8 | 9 | 10 | 検索方法 11 |

    12 |

    13 | 並べ替え: 14 | 17 | 20 | 21 | 表示件数: 22 | 25 |

    26 |
    27 | 28 | <% if @msg %> 29 |

    <%= @msg %>

    30 | <% else %> 31 |

    32 | <%= _(@conf.to_native(@query)) %> の検索結果 33 | <%= @result.hit_count %> 件中 <%= @start + 1 %> - <%= @start + @result.items.length %> 件目 34 | (<%= @secs %> 秒) 35 |

    36 | <% if @result.hit_count > @num %> 37 | <%= format_links(@result) %> 38 | <% end %> 39 | <% for item in @result.items %> 40 | <% format_result_item(item) %> 41 |
    42 |

    <%= _(@conf.to_native(@title)) %>

    43 |
    44 |
    45 |

    46 | <%= @conf.to_native(@summary) %> 47 |

    48 |
    49 |
    50 |
    51 |
    52 |

    <%= @conf.comment_anchor %> 53 |  (スコア:<%= item.score %>)

    54 |
    55 |
    56 |
    57 |
    58 |
    59 | <% end %> 60 | <% if @result.hit_count > @num %> 61 | <%= format_links(@result) %> 62 | <% end %> 63 | <% end %> 64 | 65 | 67 | -------------------------------------------------------------------------------- /util/rast-search/rast.rxml: -------------------------------------------------------------------------------- 1 | "?> 2 | 3 | 4 | <%= _( @conf.html_title ) %> [全文検索]: <%= _(@query) %> 5 | <%= @conf.base_url.sub(%r|/[^/]*$|, '/') %><%= _(@cgi.script_name ? File.basename(@cgi.script_name) : "") %><%= format_anchor(@start, @num) %> 6 | Rast 検索: <%= _(@query) %> 7 | ja-JP 8 | <%= @result.hit_count %> 9 | <%= @start + 1 %> 10 | <%= @num %> 11 | <% for item in @result.items %> 12 | <% format_result_item(item) %> 13 | 14 | <%= _(@conf.to_native(@title)) %> 15 | <%= @conf.base_url %><%= @plugin.anchor(@date) %> 16 | <%= _(CGI.rfc1123_date(Time.parse(@last_modified))) %> 17 | <%= @conf.to_native(@summary) %> 18 | 19 | <% end %> 20 | 21 | 22 | -------------------------------------------------------------------------------- /util/section_link/README: -------------------------------------------------------------------------------- 1 | はてなダイアリーの「日記モード・見出し別ページ」のように、「1見出しが1ページになる日記形式、日付ごとにコメント・トラックバックを表示」になるようにします。 2 | 3 | * tdiary以下のファイル3つ:tdiary以下に入れます(wikiとtdiary記法に対応しています) 4 | * misc/plugin/section_link.rb を設定画面から有効にします 5 | * mod_rewriteを使って拡張子を書き換えているひとは、misc/plugin/section_link_anchor.rbも有効にします 6 | ** mod_rewriteを書き換えます 7 | 8 | 9 | RewriteEngine on 10 | RewriteRule ^([0-9\-]+)p?([0-9]*)\.html$ ?date=$1§ion=$2 [L] 11 | 12 | -------------------------------------------------------------------------------- /util/section_link/misc/plugin/section_link.rb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2011, KADO Masanori 2 | # You can redistribute it and/or modify it under GPL. 3 | # 4 | # section_link.rb 5 | # - enables section link and shows section title 6 | # - depends on: 7 | # - tdiary/tdiary_day_ext.rb 8 | # - tdiary/tdiaryext_style.rb 9 | # - tdiary/wikiext_style.rb 10 | 11 | alias :_orig_subtitle_link :subtitle_link 12 | def subtitle_link( date, index, subtitle ) 13 | if @cgi.params['section'].join('') != '' 14 | index = @cgi.params['section'][0] 15 | end 16 | r = _orig_subtitle_link( date, index, subtitle ) 17 | r.gsub(/#p(\d+)/){"§ion=#{$1}"} 18 | end 19 | 20 | alias :_orig_title_tag :title_tag 21 | def title_tag 22 | if @cgi.params['section'].join('') != '' and 23 | @mode == 'day' and diary = @diaries[@date.strftime('%Y%m%d')] 24 | sec = [] 25 | diary.each_section do |s| 26 | sec << s 27 | end 28 | site_title = " - #{_orig_title_tag.gsub( /<.*?>/, '')}" 29 | title = sec[@cgi.params['section'][0].to_i - 1].stripped_subtitle_to_html 30 | return "#{apply_plugin(title, true).gsub(/[\r\n]/, '')}#{h site_title }" 31 | 32 | else 33 | _orig_title_tag 34 | end 35 | end 36 | 37 | if @cgi.params["section"].join('') != "" 38 | add_section_leave_proc do 39 | diary = @diaries[@date.strftime("%Y%m%d")] 40 | 41 | i = 1 42 | sections = [] 43 | diary.each_section do |s| 44 | unless i == @cgi.params["section"][0].to_i 45 | sections << [i, s] 46 | end 47 | i += 1 48 | end 49 | 50 | unless sections.empty? 51 | "
    \n
      \n" + 52 | sections.map{|i, s| 53 | [i, my(@date.strftime("%Y%m%d") + "p" + sprintf("%02d", i), 54 | apply_plugin(s.stripped_subtitle_to_html, true))] 55 | }.map{|i, s| 56 | "
    1. #{s}
    2. " 57 | }.join("\n") + "\n
    \n" 58 | end 59 | end 60 | end 61 | 62 | # Local Variables: 63 | # mode: ruby 64 | # indent-tabs-mode: t 65 | # tab-width: 3 66 | # ruby-indent-level: 3 67 | # End: 68 | # vim: ts=3 69 | -------------------------------------------------------------------------------- /util/section_link/misc/plugin/section_link_anchor.rb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2011, KADO Masanori 2 | # You can redistribute it and/or modify it under GPL. 3 | # 4 | # section_link_anchor.rb 5 | # - enables section link with mod_rewrite 6 | # - depends on section_link.rb 7 | # 8 | # sample .htaccess: 9 | # 10 | # RewriteEngine on 11 | # RewriteRule ^([0-9\-]+)p?([0-9]*)\.html$ ?date=$1§ion=$2 [L] 12 | # 13 | 14 | def anchor( s ) 15 | if /^([\-\d]+)#?([pct]\d*)?$/ =~ s then 16 | if $2 then 17 | s1 = $1 18 | s2 = $2 19 | if $2 =~ /^p/ 20 | "#{s1}p#{s2.gsub(/p/, '')}.html" 21 | else 22 | "#{s1}.html##{s2}" 23 | end 24 | else 25 | "#$1.html" 26 | end 27 | else 28 | "" 29 | end 30 | end 31 | 32 | # Local Variables: 33 | # mode: ruby 34 | # indent-tabs-mode: t 35 | # tab-width: 3 36 | # ruby-indent-level: 3 37 | # End: 38 | # vim: ts=3 39 | -------------------------------------------------------------------------------- /util/section_link/tdiary/tdiary_day_ext.rb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2011, KADO Masanori 2 | # You can redistribute it and/or modify it under GPL. 3 | module TDiary 4 | class TDiaryDay 5 | alias :_orig_eval_rhtml :eval_rhtml 6 | def eval_rhtml 7 | if @cgi.params['section'].join('') != "" 8 | @diary.section_no = @cgi.params['section'][0] 9 | end 10 | _orig_eval_rhtml 11 | end 12 | end 13 | end 14 | 15 | # Local Variables: 16 | # mode: ruby 17 | # indent-tabs-mode: t 18 | # tab-width: 3 19 | # ruby-indent-level: 3 20 | # End: 21 | # vim: ts=3 22 | -------------------------------------------------------------------------------- /util/section_link/tdiary/tdiaryext_style.rb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2011, KADO Masanori 2 | # You can redistribute it and/or modify it under GPL. 3 | require 'tdiary/tdiary_day_ext' 4 | 5 | module TDiary 6 | class TdiaryextDiary; end 7 | 8 | class TdiaryDiary 9 | attr_accessor :section_no 10 | alias :_orig_to_html4 :to_html4 11 | def to_html4( opt ) 12 | if @section_no 13 | idx = @section_no.to_i 14 | @sections = [@sections[idx - 1]] 15 | end 16 | _orig_to_html4 opt 17 | end 18 | 19 | alias :_orig_to_chtml :to_chtml 20 | def to_chtml( opt ) 21 | if @section_no 22 | idx = @section_no.to_i 23 | @sections = [@sections[idx - 1]] 24 | end 25 | _orig_to_chtml opt 26 | end 27 | end 28 | end 29 | 30 | # Local Variables: 31 | # mode: ruby 32 | # indent-tabs-mode: t 33 | # tab-width: 3 34 | # ruby-indent-level: 3 35 | # End: 36 | # vim: ts=3 37 | -------------------------------------------------------------------------------- /util/section_link/tdiary/wikiext_style.rb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2011, KADO Masanori 2 | # You can redistribute it and/or modify it under GPL. 3 | require 'tdiary/tdiary_day_ext' 4 | 5 | module TDiary 6 | class WikiextDiary; end 7 | 8 | class WikiDiary 9 | attr_accessor :section_no 10 | alias :_orig_to_html4 :to_html4 11 | def to_html4( opt ) 12 | if @section_no 13 | idx = @section_no.to_i 14 | return @sections[idx - 1].html4( date, idx, opt ) 15 | end 16 | _orig_to_html4 opt 17 | end 18 | 19 | alias :_orig_to_chtml :to_chtml 20 | def to_chtml( opt ) 21 | if @section_no 22 | idx = @section_no.to_i 23 | return @sections[idx - 1].html4( date, idx, opt ) 24 | end 25 | _orig_to_chtml opt 26 | end 27 | end 28 | end 29 | 30 | # Local Variables: 31 | # mode: ruby 32 | # indent-tabs-mode: t 33 | # tab-width: 3 34 | # ruby-indent-level: 3 35 | # End: 36 | # vim: ts=3 37 | -------------------------------------------------------------------------------- /util/tdiary-for-ruby1.9/compatible.rb: -------------------------------------------------------------------------------- 1 | # = for Ruby1.9.0 compatible = 2 | # 3 | # == 前提条件 == 4 | # 5 | # * Ruby1.9 の場合は --encoding=Binary オプションで動作させること 6 | 7 | # -------------------------------------------------------- 8 | # 汎用的な設定 9 | # -------------------------------------------------------- 10 | 11 | # for Ruby1.9.0 12 | 13 | unless "".respond_to?('to_a') 14 | class String 15 | def to_a 16 | [ self ] 17 | end 18 | end 19 | end 20 | 21 | unless "".respond_to?('each') 22 | class String 23 | alias each each_line 24 | end 25 | end 26 | 27 | # Ruby1.9では String が Enumerable ではなくなった 28 | class String 29 | def method_missing(name, *args, &block) 30 | each_line.__send__(name, *args, &block) 31 | end 32 | end 33 | 34 | 35 | # for Ruby1.8.X 36 | 37 | unless "".respond_to?('force_encoding') 38 | class String 39 | def force_encoding(encoding) 40 | self 41 | end 42 | end 43 | end 44 | 45 | unless "".respond_to?('bytesize') 46 | class String 47 | alias bytesize size 48 | end 49 | end 50 | 51 | unless "".respond_to?('ord') 52 | class String 53 | def ord 54 | self[0] 55 | end 56 | end 57 | 58 | class Integer 59 | def ord 60 | self 61 | end 62 | end 63 | end 64 | 65 | # -------------------------------------------------------- 66 | # tDiary 用の設定 67 | # -------------------------------------------------------- 68 | 69 | # Ruby1.9でNKF::nkfを呼ぶと文字列のencodingが変わってしまう。 70 | # そのため、encodingがBinaryの環境で動かすと 71 | # "character encodings differ" エラーとなる。 72 | begin 73 | require 'nkf' 74 | module NKF 75 | alias :_nkf :nkf 76 | def nkf(option, src) 77 | r = _nkf(option, src) 78 | r.force_encoding('Binary') 79 | end 80 | module_function :nkf, :_nkf 81 | end 82 | rescue 83 | end 84 | 85 | # 日本語を含むツッコミを入れると diary.last_modified が String になる (原因不明) 86 | # (PStore 保存前は Time だが, 保存後に String となる) 87 | # 暫定的に String だったら Time へ変換する 88 | module TDiary 89 | class WikiDiary 90 | def last_modified 91 | if @last_modified.instance_of? String 92 | @last_modified = Time.at(0) 93 | end 94 | @last_modified 95 | end 96 | end 97 | end 98 | -------------------------------------------------------------------------------- /util/tdiary-grep/README: -------------------------------------------------------------------------------- 1 | ■■このツールは最新のtDiaryに追従していません。 2 | ■■検索機能はプラグインとして実装されるようになったため、 3 | ■■同等の機能はplugin/search-default.rbで実現しています。 4 | ■■このツールは近々削除する予定です。 5 | -------------------------------------------------------------------------------- /util/tdiary-vim/ChangeLog: -------------------------------------------------------------------------------- 1 | 2005-07-29 Fri UECHI Yasumasa 2 | * echo site name and url when select a diary site. 3 | * allow to set update script each diary. 4 | * use CSRF protection key if exits. 5 | 6 | 2005-07-28 Thu UECHI Yasumasa 7 | * send referer when update a diary. 8 | 9 | 2004-11-08 Mon UECHI Yasumasa 10 | * change substitution order of character entity in TdiaryReplace(). thanx やえもん. 11 | 12 | 2004-02-25 Wed UECHI Yasumasa 13 | * support TrackBack 14 | 15 | 2004-02-19 Thu UECHI Yasumasa 16 | * quote argument of curl's -u option. 17 | 18 | 2004-02-17 Tue UECHI Yasumasa 19 | * use .netrc when g:tdiary_use_netrc = 1 20 | 21 | 2004-02-16 Mon UECHI Yasumasa 22 | * change editing mode, date, title in diary buffer. 23 | 24 | 2004-02-13 Fri UECHI Yasumasa 25 | * commit to CVS repository 26 | -------------------------------------------------------------------------------- /util/tdiary-vim/README: -------------------------------------------------------------------------------- 1 | = tdiary.vim 2 | tdiary.vim は vim から日記を更新するための vimスクリプトです。 3 | 4 | == 必要なもの 5 | tdiary.vim を使用するには以下のものが必要です。 6 | 7 | * cURL - コマンドラインから http や ftp で通信するためのツール 8 | * iconv ライブラリ 9 | * vim (+iconv でコンパイルしたもの) 10 | 11 | cURL は (()) から入手できます。 12 | 13 | == インストール 14 | tdiary.vim を $HOME/.vim/plugin ディレクトリにコピーするだけです。 15 | 16 | == 設定 17 | $HOME/.vimrc で次のように tDiary サイトの URL を設定します。 18 | 19 | let tdiary_site1_url = "http://www.example.com/tdiary/" 20 | 21 | 最低限必要な設定はこれだけですが、複数の日記を更新するなら以下のような設定を追加してください。 22 | 23 | let tdiary_site1_name = "ほげほげ日記" 24 | let tdiary_site2_url = "http://www.example.net/tdiary/" 25 | let tdiary_site2_name = "foobar日記" 26 | 27 | tDiary を設置するときに update.rb を update.cgi 等に変更している場合は以下も追加してください。 28 | 29 | let tdiary_site1_updatescript = "update.cgi" 30 | let tdiary_site2_updatescript = "update.cgi" 31 | 32 | == パスワードの保存 33 | cURL は $HOME/.netrc を読めるので、パスワードの保存にその機能を使います。ユーザ名とパスワードを .netrc に保存し、$HOME/.vimrc に 34 | 35 | let tdiary_use_netrc = 1 36 | 37 | と設定すると有効になります。 38 | 39 | == 使い方 40 | tdiary.vim では次のコマンドが使えます。 41 | 42 | * :TDiaryNew - 日記を書くための空のバッファを開きます 43 | * :TDiaryReplace - 指定した日付の日記を読み込んだバッファを開きます 44 | * :TDiaryUpdate - 日記を更新します 45 | * :TDiarySelect - 更新する tDiary サイトを選択するためのバッファを開きます 46 | * :TDiaryTrackback - TrackBack の excerpt を編修するためのバッファを開きます 47 | 48 | === 日記に追記 49 | :TDiaryNew すると日付が YYYYMMDD 形式で表示されますので、適宜修正してリターンキーを押してください。日記を書いたら :TDiaryUpdate で更新してください。 50 | 51 | === 日記を修正 52 | :TDiaryReplace すると日付が YYYYMMDD 形式で表示されますので、修正したい日付に直してリターンキーを押してください。指定した日の日記が読み込まれます。修正後に :TDiaryUpdate で更新してください。 53 | 54 | === tDiary サイトの選択 55 | :TDiarySelect すると日記の一覧が表示されます。日記にカーソルを合わせてリターンキーを押すことで書き込み先が切り替わります。 56 | 57 | === TrackBack 58 | 日記の編修バッファに表示されている TrackBackURL: に TrackBack 先の URL を記 59 | 入することで TrackBack が送られます。excerpt を編修する場合は :TDiaryTrackback 60 | することで編修用のバッファが開きます。 61 | --------------------------------------------------------------------------------