diff -Nru tdiary-contrib-3.1.20120506/.travis.yml tdiary-contrib-3.2.2/.travis.yml --- tdiary-contrib-3.1.20120506/.travis.yml 2012-05-06 16:18:59.000000000 +0000 +++ tdiary-contrib-3.2.2/.travis.yml 2013-04-25 22:33:04.000000000 +0000 @@ -1,8 +1,7 @@ rvm: - - 1.8.7 + - ree - 1.9.2 - 1.9.3 - ruby-head - - ree script: bundle exec rake spec diff -Nru tdiary-contrib-3.1.20120506/Gemfile tdiary-contrib-3.2.2/Gemfile --- tdiary-contrib-3.1.20120506/Gemfile 2012-05-06 16:18:59.000000000 +0000 +++ tdiary-contrib-3.2.2/Gemfile 2013-04-25 22:33:04.000000000 +0000 @@ -2,5 +2,10 @@ gem 'rake' gem 'rspec' -gem 'rcov', :platforms => :ruby_18 + +platforms :ruby_18 do + gem 'json' + gem 'rcov' +end + gem 'simplecov', :platforms => :ruby_19 diff -Nru tdiary-contrib-3.1.20120506/Gemfile.lock tdiary-contrib-3.2.2/Gemfile.lock --- tdiary-contrib-3.1.20120506/Gemfile.lock 2012-05-06 16:18:59.000000000 +0000 +++ tdiary-contrib-3.2.2/Gemfile.lock 2013-04-25 22:33:04.000000000 +0000 @@ -1,27 +1,29 @@ GEM remote: http://rubygems.org/ specs: - diff-lcs (1.1.3) - multi_json (1.0.4) - rake (0.9.2.2) + diff-lcs (1.2.1) + json (1.7.7) + multi_json (1.7.1) + rake (10.0.3) rcov (1.0.0) - rspec (2.8.0) - rspec-core (~> 2.8.0) - rspec-expectations (~> 2.8.0) - rspec-mocks (~> 2.8.0) - rspec-core (2.8.0) - rspec-expectations (2.8.0) - diff-lcs (~> 1.1.2) - rspec-mocks (2.8.0) - simplecov (0.5.4) - multi_json (~> 1.0.3) - simplecov-html (~> 0.5.3) - simplecov-html (0.5.3) + rspec (2.13.0) + rspec-core (~> 2.13.0) + rspec-expectations (~> 2.13.0) + rspec-mocks (~> 2.13.0) + rspec-core (2.13.1) + rspec-expectations (2.13.0) + diff-lcs (>= 1.1.3, < 2.0) + rspec-mocks (2.13.0) + simplecov (0.7.1) + multi_json (~> 1.0) + simplecov-html (~> 0.7.1) + simplecov-html (0.7.1) PLATFORMS ruby DEPENDENCIES + json rake rcov rspec diff -Nru tdiary-contrib-3.1.20120506/README.en.md tdiary-contrib-3.2.2/README.en.md --- tdiary-contrib-3.1.20120506/README.en.md 1970-01-01 00:00:00.000000000 +0000 +++ tdiary-contrib-3.2.2/README.en.md 2013-04-25 22:33:04.000000000 +0000 @@ -0,0 +1,12 @@ +# tDiary contrib package + +This package include some utilities and plugins for tDiary. +See documents in each directories. + +See licenses and copyrights in each theme files. If no license +or copyright, it can be distoributed by GPL2, and it has a +copyright below: + +``` +Copyright (c) 2005 TADA Tadashi +``` diff -Nru tdiary-contrib-3.1.20120506/README.md tdiary-contrib-3.2.2/README.md --- tdiary-contrib-3.1.20120506/README.md 1970-01-01 00:00:00.000000000 +0000 +++ tdiary-contrib-3.2.2/README.md 2013-04-25 22:33:04.000000000 +0000 @@ -0,0 +1,13 @@ +# tDiary contrib パッケージ + +このパッケージには、tDiaryに関係したいくつかのユーティリティやプラグ +インが収録されています。ドキュメントはそれぞれのツールのディレクトリ +に含まれています。 + +著作権およびライセンスは各テーマのファイルに記述してあるものに従いま +すが、特に明記されていない場合、配布条件はGPL2、著作権は以下になりま +す。 + +``` +Copyright (c) 2005 TADA Tadashi +``` diff -Nru tdiary-contrib-3.1.20120506/Rakefile tdiary-contrib-3.2.2/Rakefile --- tdiary-contrib-3.1.20120506/Rakefile 2012-05-06 16:18:59.000000000 +0000 +++ tdiary-contrib-3.2.2/Rakefile 2013-04-25 22:33:04.000000000 +0000 @@ -1,7 +1,12 @@ require 'rubygems' require 'rake' +require 'rake/clean' require 'rspec/core/rake_task' +CLOBBER.include( + "coverage" +) + task :default => [:spec] desc 'Run the code in specs' diff -Nru tdiary-contrib-3.1.20120506/debian/changelog tdiary-contrib-3.2.2/debian/changelog --- tdiary-contrib-3.1.20120506/debian/changelog 2012-05-19 15:56:00.000000000 +0000 +++ tdiary-contrib-3.2.2/debian/changelog 2013-06-12 22:59:51.000000000 +0000 @@ -1,3 +1,15 @@ +tdiary-contrib (3.2.2-1) unstable; urgency=low + + * New upstream release + * debian/control + - add me as Uploaders + - set Standards-Vesrion: 3.9.4 + - fix "vcs-field-not-canonical" lintian warning + - adjust Dependency for tdiary, not restrict to << 3.2 but >= 3.2.2 + * add debian/watch file, thanks to Bart Martens + + -- Hideki Yamane Thu, 13 Jun 2013 07:49:48 +0900 + tdiary-contrib (3.1.20120506-3) unstable; urgency=low * tdiary-mode: create .el symlink to beside the flavored elcs diff -Nru tdiary-contrib-3.1.20120506/debian/control tdiary-contrib-3.2.2/debian/control --- tdiary-contrib-3.1.20120506/debian/control 2012-05-19 15:56:00.000000000 +0000 +++ tdiary-contrib-3.2.2/debian/control 2013-06-12 22:59:03.000000000 +0000 @@ -2,16 +2,16 @@ Section: web Priority: extra Maintainer: Debian Ruby Extras Maintainers -Uploaders: Daigo Moriwaki , Taku YASUI +Uploaders: Daigo Moriwaki , Taku YASUI , Hideki Yamane Build-Depends: debhelper (>= 8), cdbs, quilt, rsync -Standards-Version: 3.9.3 +Standards-Version: 3.9.4 Homepage: http://www.tdiary.org/ -Vcs-Git: git://git.debian.org/pkg-ruby-extras/tdiary-contrib.git -Vcs-Browser: http://git.debian.org/?p=pkg-ruby-extras/tdiary-contrib.git;a=summary +Vcs-Git: git://anonscm.debian.org/pkg-ruby-extras/tdiary-contrib.git +Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-ruby-extras/tdiary-contrib.git;a=summary Package: tdiary-contrib Architecture: all -Depends: ${misc:Depends}, ruby | ruby-interpreter, tdiary (>= 3.1), tdiary (<< 3.2), curl +Depends: ${misc:Depends}, ruby | ruby-interpreter, tdiary (>= 3.2.2), curl Suggests: libestraier-ruby1.8, hyperestraier Description: Plugins of tDiary to add functionalities This package includes optional utilities and plugins for tDiary. They are diff -Nru tdiary-contrib-3.1.20120506/debian/watch tdiary-contrib-3.2.2/debian/watch --- tdiary-contrib-3.1.20120506/debian/watch 1970-01-01 00:00:00.000000000 +0000 +++ tdiary-contrib-3.2.2/debian/watch 2013-06-12 22:52:24.000000000 +0000 @@ -0,0 +1,3 @@ +version=3 +opts=uversionmangle=s/_/./g \ +https://github.com/tdiary/tdiary-contrib/tags .*/(?:v||tdiary-contrib[_\-])(\d.*)\.(?:tgz|tbz2|txz|tar\.(?:gz|bz2|xz)) diff -Nru tdiary-contrib-3.1.20120506/doc/en/README.txt tdiary-contrib-3.2.2/doc/en/README.txt --- tdiary-contrib-3.1.20120506/doc/en/README.txt 2012-05-06 16:18:59.000000000 +0000 +++ tdiary-contrib-3.2.2/doc/en/README.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -== tDiary contrib package == - -This package include some utilities and plugins for tDiary. -See documents in each directories. - -See licenses and copyrights in each theme files. If no license -or copyright, it can be distoributed by GPL2, and it has a -copyright below: - - Copyright (c) 2005 TADA Tadashi diff -Nru tdiary-contrib-3.1.20120506/doc/ja/README.txt tdiary-contrib-3.2.2/doc/ja/README.txt --- tdiary-contrib-3.1.20120506/doc/ja/README.txt 2012-05-06 16:18:59.000000000 +0000 +++ tdiary-contrib-3.2.2/doc/ja/README.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -== tDiary contrib パッケージ == - -このパッケージには、tDiaryに関係したいくつかのユーティリティやプラグ -インが収録されています。ドキュメントはそれぞれのツールのディレクトリ -に含まれています。 - -著作権およびライセンスは各テーマのファイルに記述してあるものに従いま -すが、特に明記されていない場合、配布条件はGPL2、著作権は以下になりま -す。 - - Copyright (c) 2005 TADA Tadashi - diff -Nru tdiary-contrib-3.1.20120506/io/dbi_io/dbi_io.rb tdiary-contrib-3.2.2/io/dbi_io/dbi_io.rb --- tdiary-contrib-3.1.20120506/io/dbi_io/dbi_io.rb 2012-05-06 16:18:59.000000000 +0000 +++ tdiary-contrib-3.2.2/io/dbi_io/dbi_io.rb 2013-04-25 22:33:04.000000000 +0000 @@ -1,5 +1,6 @@ +# -*- coding: utf-8 -*- # -# dbi_io.rb: DBI IO for tDiary 2.x. $Revision: 1.6 $ +# dbi_io.rb: DBI IO for tDiary 2.x. # # NAME dbi_io # @@ -9,85 +10,87 @@ # Copyright (C) 2003 ma2tak # (C) 2004 moonwolf # (C) 2005 Kazuhiko +# (C) 2012 hsbt # # You can distribute this under GPL. +require 'tdiary/io/base' +require 'tempfile' require 'dbi' module TDiary - - class DbiIO < IOBase - module CommentIO - def restore_comment(diaries) - begin - diaries.each {|date, diary_object| - @dbh.select_all("SELECT diary_id, name, mail, last_modified, visible, no, author, comment FROM commentdata WHERE author=? AND diary_id=? ORDER BY no;", @dbi_author, date) {|diary_id, name, mail, last_modified, visible, no, author, comment| - comment = Comment::new(name, mail, comment, Time::at(last_modified.to_i)) - comment.show = visible - diary_object.add_comment(comment) - } - } - rescue Errno::ENOENT + module CommentIO + def restore_comment(diaries) + begin + diaries.each do |date, diary_object| + @dbh.select_all("SELECT diary_id, name, mail, last_modified, visible, no, author, comment FROM commentdata WHERE author=? AND diary_id=? ORDER BY no;", @dbi_author, date) do |diary_id, name, mail, last_modified, visible, no, author, comment| + comment = Comment.new(name, mail, comment, Time.at(last_modified.to_i)) + comment.show = visible + diary_object.add_comment(comment) + end end + rescue Errno::ENOENT end + end - def store_comment(diaries) - begin - diaries.each {|date, diary| - no = 0 - diary.each_comment(diary.count_comments(true)) {|com| - no += 1 - param = [com.name, com.mail, com.date.to_i, com.visible?, com.body, @dbi_author, date, no] - sth = @dbh.execute("UPDATE commentdata SET name=?, mail=?, last_modified=?, visible=?, comment=? WHERE author=? AND diary_id=? AND no=?;", *param) - if sth.rows == 0 - @dbh.execute("INSERT INTO commentdata (name, mail, last_modified, visible, comment, author, diary_id, no) VALUES (?,?,?,?,?,?,?,?);", *param) - end - } - @dbh.execute("DELETE FROM commentdata where author=? AND diary_id=? AND no>?", @dbi_author, date, no) - } - rescue Errno::ENOENT + def store_comment(diaries) + begin + diaries.each do |date, diary| + no = 0 + diary.each_comment(diary.count_comments(true)) do |com| + no += 1 + param = [com.name, com.mail, com.date.to_i, com.visible?, com.body, @dbi_author, date, no] + sth = @dbh.execute("UPDATE commentdata SET name=?, mail=?, last_modified=?, visible=?, comment=? WHERE author=? AND diary_id=? AND no=?;", *param) + if sth.rows == 0 + @dbh.execute("INSERT INTO commentdata (name, mail, last_modified, visible, comment, author, diary_id, no) VALUES (?,?,?,?,?,?,?,?);", *param) + end + end + @dbh.execute("DELETE FROM commentdata where author=? AND diary_id=? AND no>?", @dbi_author, date, no) end + rescue Errno::ENOENT end end + end - module RefererIO - def restore_referer(diaries) - return - end + module RefererIO + def restore_referer(diaries) + return + end - def store_referer(diaries) - return - end + def store_referer(diaries) + return end - + end + + + class DbiIO < BaseIO include CommentIO include RefererIO - + def initialize(tdiary) - @tdiary = tdiary + @tdiary = tdiary @dbi_url = tdiary.conf.dbi_driver_url @dbi_user = tdiary.conf.dbi_user @dbi_passwd = tdiary.conf.dbi_passwd @dbi_author = tdiary.conf.dbi_author || 'default' - @dbh = DBI.connect(@dbi_url, @dbi_user, @dbi_passwd) + @dbh = DBI.connect(@dbi_url, @dbi_user, @dbi_passwd) load_styles end - - def calendar - calendar = Hash.new{|hash, key| hash[key] = []} - sql = "SELECT year, month FROM diarydata WHERE author=? GROUP BY year, month ORDER BY year, month;" - @dbh.select_all(sql, @dbi_author) {|year, month| - calendar[year] << month - } - calendar + + class << self + def load_cgi_conf(conf) + end + + def save_cgi_conf(conf, result) + end end - + # # block must be return boolean which dirty diaries. # def transaction(date) - File.open("#{@tdiary.conf.data_path}/dbi_io.lock", 'w') {|file| + File.open("#{Dir.tmpdir}/dbi_io.lock", 'w') do |file| file.flock(File::LOCK_EX) - @dbh.transaction { + @dbh.transaction do date_string = date.strftime("%Y%m%d") diaries = {} cache = @tdiary.restore_parser_cache(date, 'defaultio') @@ -107,22 +110,32 @@ if dirty or not cache @tdiary.store_parser_cache(date, 'defaultio', diaries) end - } - } + end + end + end + + def calendar + calendar = Hash.new{|hash, key| hash[key] = []} + sql = "SELECT year, month FROM diarydata WHERE author=? GROUP BY year, month ORDER BY year, month;" + @dbh.select_all(sql, @dbi_author) do |year, month| + calendar[year] << month + end + calendar end - + def diary_factory(date, title, body, style = 'tDiary') styled_diary_factory(date, title, body, style) end - + # HNF移行ツールのため、作成 def restore_diary(date) diaries = {} restore(date, diaries, false) diaries end - - private + + private + def restore(date, diaries, month=true) sql = "SELECT diary_id, title, last_modified, visible, body, style FROM DiaryData WHERE author='#{@dbi_author}' and diary_id='#{date}';" if month == true @@ -130,17 +143,17 @@ sql = "SELECT diary_id, title, last_modified, visible, body, style FROM DiaryData WHERE author='#{@dbi_author}' AND year='#{$1}' AND month='#{$2}';" end end - @dbh.select_all(sql) {|diary_id, title, last_modified, visible, body, style| + @dbh.select_all(sql) do |diary_id, title, last_modified, visible, body, style| style = 'tdiary' if style.nil? || style.empty? style = style.downcase diary = eval("#{style(style)}::new(diary_id, title, body, Time::at(last_modified.to_i))") diary.show(visible) diaries[diary_id] = diary - } + end end - + def store(diaries) - diaries.each {|date, diary| + diaries.each do |date, diary| # save diaries if /(\d\d\d\d)(\d\d)(\d\d)/ =~ date year = $1 @@ -154,17 +167,15 @@ if sth.rows == 0 @dbh.execute("INSERT INTO diarydata (year, month, day, title, last_modified, visible, body, style, author, diary_id) VALUES (?,?,?,?,?,?,?,?,?,?);", *param) end - } + end end - + # 追加メソッド for test def delete(diaries) - diaries.each {|date, diary| + diaries.each do |date, diary| sql = "DELETE FROM diarydata WHERE author=#{@dbi_author} AND diary_id=#{date};" @dbh.execute(sql) - } + end end - end - end diff -Nru tdiary-contrib-3.1.20120506/js/comment_emoji_autocomplete.js tdiary-contrib-3.2.2/js/comment_emoji_autocomplete.js --- tdiary-contrib-3.1.20120506/js/comment_emoji_autocomplete.js 1970-01-01 00:00:00.000000000 +0000 +++ tdiary-contrib-3.2.2/js/comment_emoji_autocomplete.js 2013-04-25 22:33:04.000000000 +0000 @@ -0,0 +1,139 @@ +/* + * emoji_autocomplete.js : Support the automatic input of the emoji, + * using jQuery UI autocomplete. + * + * Copyright (C) 2013 by tamoot + * You can distribute it under GPL. + */ + +$(function() { + var config = new Object(); + config.candidates = [":blush:",":scream:",":smirk:",":smiley:",":stuck_out_tongue_closed_eyes:",":stuck_out_tongue_winking_eye:",":rage:",":disappointed:",":sob:",":kissing_heart:",":wink:",":pensive:",":confounded:",":flushed:",":relaxed:",":mask:",":heart:",":broken_heart:",":sunny:",":umbrella:",":cloud:",":snowflake:",":snowman:",":zap:",":cyclone:",":foggy:",":ocean:",":cat:",":dog:",":mouse:",":hamster:",":rabbit:",":wolf:",":frog:",":tiger:",":koala:",":bear:",":pig:",":pig_nose:",":cow:",":boar:",":monkey_face:",":monkey:",":horse:",":racehorse:",":camel:",":sheep:",":elephant:",":panda_face:",":snake:",":bird:",":baby_chick:",":hatched_chick:",":hatching_chick:",":chicken:",":penguin:",":turtle:",":bug:",":honeybee:",":ant:",":beetle:",":snail:",":octopus:",":tropical_fish:",":fish:",":whale:",":whale2:",":dolphin:",":cow2:",":ram:",":rat:",":water_buffalo:",":tiger2:",":rabbit2:",":dragon:",":goat:",":rooster:",":dog2:",":pig2:",":mouse2:",":ox:",":dragon_face:",":blowfish:",":crocodile:",":dromedary_camel:",":leopard:",":cat2:",":poodle:",":paw_prints:",":bouquet:",":cherry_blossom:",":tulip:",":four_leaf_clover:",":rose:",":sunflower:",":hibiscus:",":maple_leaf:",":leaves:",":fallen_leaf:",":herb:",":mushroom:",":cactus:",":palm_tree:",":evergreen_tree:",":deciduous_tree:",":chestnut:",":seedling:",":blossom:",":ear_of_rice:",":shell:",":globe_with_meridians:",":sun_with_face:",":full_moon_with_face:",":new_moon_with_face:",":new_moon:",":waxing_crescent_moon:",":first_quarter_moon:",":waxing_gibbous_moon:",":full_moon:",":waning_gibbous_moon:",":last_quarter_moon:",":waning_crescent_moon:",":last_quarter_moon_with_face:",":first_quarter_moon_with_face:",":moon:",":earth_africa:",":earth_americas:",":earth_asia:",":volcano:",":milky_way:",":partly_sunny:",":octocat:",":squirrel:",":bamboo:",":gift_heart:",":dolls:",":school_satchel:",":mortar_board:",":flags:",":fireworks:",":sparkler:",":wind_chime:",":rice_scene:",":jack_o_lantern:",":ghost:",":santa:",":christmas_tree:",":gift:",":bell:",":no_bell:",":tanabata_tree:",":tada:",":confetti_ball:",":balloon:",":crystal_ball:",":cd:",":dvd:",":floppy_disk:",":camera:",":video_camera:",":movie_camera:",":computer:",":tv:",":iphone:",":phone:",":telephone:",":telephone_receiver:",":pager:",":fax:",":minidisc:",":vhs:",":sound:",":speaker:",":mute:",":loudspeaker:",":mega:",":hourglass:",":hourglass_flowing_sand:",":alarm_clock:",":watch:",":radio:",":satellite:",":loop:",":mag:",":mag_right:",":unlock:",":lock:",":lock_with_ink_pen:",":closed_lock_with_key:",":key:",":bulb:",":flashlight:",":high_brightness:",":low_brightness:",":electric_plug:",":battery:",":calling:",":email:",":mailbox:",":postbox:",":bath:",":bathtub:",":shower:",":toilet:",":wrench:",":nut_and_bolt:",":hammer:",":seat:",":moneybag:",":yen:",":dollar:",":pound:",":euro:",":credit_card:",":money_with_wings:",":e-mail:",":inbox_tray:",":outbox_tray:",":envelope:",":incoming_envelope:",":postal_horn:",":mailbox_closed:",":mailbox_with_mail:",":mailbox_with_no_mail:",":door:",":smoking:",":bomb:",":gun:",":hocho:",":pill:",":syringe:",":page_facing_up:",":page_with_curl:",":bookmark_tabs:",":bar_chart:",":chart_with_upwards_trend:",":chart_with_downwards_trend:",":scroll:",":clipboard:",":calendar:",":date:",":card_index:",":file_folder:",":open_file_folder:",":scissors:",":pushpin:",":paperclip:",":black_nib:",":pencil2:",":straight_ruler:",":triangular_ruler:",":closed_book:",":green_book:",":blue_book:",":orange_book:",":notebook:",":notebook_with_decorative_cover:",":ledger:",":books:",":bookmark:",":name_badge:",":microscope:",":telescope:",":newspaper:",":football:",":basketball:",":soccer:",":baseball:",":tennis:",":8ball:",":rugby_football:",":bowling:",":golf:",":mountain_bicyclist:",":bicyclist:",":horse_racing:",":snowboarder:",":swimmer:",":surfer:",":ski:",":spades:",":hearts:",":clubs:",":diamonds:",":gem:",":ring:",":trophy:",":musical_score:",":musical_keyboard:",":violin:",":space_invader:",":video_game:",":black_joker:",":flower_playing_cards:",":game_die:",":dart:",":mahjong:",":clapper:",":memo:",":pencil:",":book:",":art:",":microphone:",":headphones:",":trumpet:",":saxophone:",":guitar:",":shoe:",":sandal:",":high_heel:",":lipstick:",":boot:",":shirt:",":tshirt:",":necktie:",":womans_clothes:",":dress:",":running_shirt_with_sash:",":jeans:",":kimono:",":bikini:",":ribbon:",":tophat:",":crown:",":womans_hat:",":mans_shoe:",":closed_umbrella:",":briefcase:",":handbag:",":pouch:",":purse:",":eyeglasses:",":fishing_pole_and_fish:",":coffee:",":tea:",":sake:",":baby_bottle:",":beer:",":beers:",":cocktail:",":tropical_drink:",":wine_glass:",":fork_and_knife:",":pizza:",":hamburger:",":fries:",":poultry_leg:",":meat_on_bone:",":spaghetti:",":curry:",":fried_shrimp:",":bento:",":sushi:",":fish_cake:",":rice_ball:",":rice_cracker:",":rice:",":ramen:",":stew:",":oden:",":dango:",":egg:",":bread:",":doughnut:",":custard:",":icecream:",":ice_cream:",":shaved_ice:",":birthday:",":cake:",":cookie:",":chocolate_bar:",":candy:",":lollipop:",":honey_pot:",":apple:",":green_apple:",":tangerine:",":lemon:",":cherries:",":grapes:",":watermelon:",":strawberry:",":peach:",":melon:",":banana:",":pear:",":pineapple:",":sweet_potato:",":eggplant:",":tomato:",":corn:",":alien:",":angel:",":anger:",":angry:",":anguished:",":astonished:",":baby:",":blue_heart:",":blush:",":boom:",":bow:",":bowtie:",":boy:",":bride_with_veil:",":broken_heart:",":bust_in_silhouette:",":busts_in_silhouette:",":clap:",":cold_sweat:",":collision:",":confounded:",":confused:",":construction_worker:",":cop:",":couple_with_heart:",":couple:",":couplekiss:",":cry:",":crying_cat_face:",":cupid:",":dancer:",":dancers:",":dash:",":disappointed:",":dizzy_face:",":dizzy:",":droplet:",":ear:",":exclamation:",":expressionless:",":eyes:",":facepunch:",":family:",":fearful:",":feelsgood:",":feet:",":finnadie:",":fire:",":fist:",":flushed:",":frowning:",":girl:",":goberserk:",":godmode:",":green_heart:",":grey_exclamation:",":grey_question:",":grimacing:",":grin:",":grinning:",":guardsman:",":haircut:",":hand:",":hankey:",":hear_no_evil:",":heart_eyes_cat:",":heart_eyes:",":heart:",":heartbeat:",":heartpulse:",":hurtrealbad:",":hushed:",":imp:",":information_desk_person:",":innocent:",":japanese_goblin:",":japanese_ogre:",":joy_cat:",":joy:",":kiss:",":kissing_cat:",":kissing_closed_eyes:",":kissing_heart:",":kissing_smiling_eyes:",":kissing:",":laughing:",":lips:",":love_letter:",":man_with_gua_pi_mao:",":man_with_turban:",":man:",":mask:",":massage:",":metal:",":muscle:",":musical_note:",":nail_care:",":neckbeard:",":neutral_face:",":no_good:",":no_mouth:",":nose:",":notes:",":ok_hand:",":ok_woman:",":older_man:",":older_woman:",":open_hands:",":open_mouth:",":pensive:",":persevere:",":person_frowning:",":person_with_blond_hair:",":person_with_pouting_face:",":point_down:",":point_left:",":point_right:",":point_up_2:",":point_up:",":poop:",":pouting_cat:",":pray:",":princess:",":punch:",":purple_heart:",":question:",":rage:",":rage1:",":rage2:",":rage3:",":rage4:",":raised_hand:",":raised_hands:",":relaxed:",":relieved:",":revolving_hearts:",":runner:",":running:",":satisfied:",":scream_cat:",":scream:",":see_no_evil:",":shit:",":skull:",":sleeping:",":sleepy:",":smile_cat:",":smile:",":smiley_cat:",":smiley:",":smiling_imp:",":smirk_cat:",":smirk:",":sob:",":sparkling_heart:",":sparkles:",":speak_no_evil:",":speech_balloon:",":star:",":star2:",":stuck_out_tongue_closed_eyes:",":stuck_out_tongue_winking_eye:",":stuck_out_tongue:",":sunglasses:",":suspect:",":sweat_drops:",":sweat_smile:",":sweat:",":thought_balloon:",":-1:",":thumbsdown:",":thumbsup:",":+1:",":tired_face:",":tongue:",":triumph:",":trollface:",":two_hearts:",":two_men_holding_hands:",":two_women_holding_hands:",":unamused:",":v:",":walking:",":wave:",":weary:",":wink2:",":wink:",":woman:",":worried:",":yellow_heart:",":yum:",":zzz:",":109:",":house:",":house_with_garden:",":school:",":office:",":post_office:",":hospital:",":bank:",":convenience_store:",":love_hotel:",":hotel:",":wedding:",":church:",":department_store:",":european_post_office:",":city_sunrise:",":city_sunset:",":japanese_castle:",":european_castle:",":tent:",":factory:",":tokyo_tower:",":japan:",":mount_fuji:",":sunrise_over_mountains:",":sunrise:",":stars:",":statue_of_liberty:",":bridge_at_night:",":carousel_horse:",":rainbow:",":ferris_wheel:",":fountain:",":roller_coaster:",":ship:",":speedboat:",":boat:",":sailboat:",":rowboat:",":anchor:",":rocket:",":airplane:",":helicopter:",":steam_locomotive:",":tram:",":mountain_railway:",":bike:",":aerial_tramway:",":suspension_railway:",":mountain_cableway:",":tractor:",":blue_car:",":oncoming_automobile:",":car:",":red_car:",":taxi:",":oncoming_taxi:",":articulated_lorry:",":bus:",":oncoming_bus:",":rotating_light:",":police_car:",":oncoming_police_car:",":fire_engine:",":ambulance:",":minibus:",":truck:",":train:",":station:",":train2:",":bullettrain_front:",":bullettrain_side:",":light_rail:",":monorail:",":railway_car:",":trolleybus:",":ticket:",":fuelpump:",":vertical_traffic_light:",":traffic_light:",":warning:",":construction:",":beginner:",":atm:",":slot_machine:",":busstop:",":barber:",":hotsprings:",":checkered_flag:",":crossed_flags:",":izakaya_lantern:",":moyai:",":circus_tent:",":performing_arts:",":round_pushpin:",":triangular_flag_on_post:",":jp:",":kr:",":cn:",":us:",":fr:",":es:",":it:",":ru:",":gb:",":uk:",":de:",":100:",":1234:",":one:",":two:",":three:",":four:",":five:",":six:",":seven:",":eight:",":nine:",":keycap_ten:",":zero:",":hash:",":symbols:",":arrow_backward:",":arrow_down:",":arrow_forward:",":arrow_left:",":capital_abcd:",":abcd:",":abc:",":arrow_lower_left:",":arrow_lower_right:",":arrow_right:",":arrow_up:",":arrow_upper_left:",":arrow_upper_right:",":arrow_double_down:",":arrow_double_up:",":arrow_down_small:",":arrow_heading_down:",":arrow_heading_up:",":leftwards_arrow_with_hook:",":arrow_right_hook:",":left_right_arrow:",":arrow_up_down:",":arrow_up_small:",":arrows_clockwise:",":arrows_counterclockwise:",":rewind:",":fast_forward:",":information_source:",":ok:",":twisted_rightwards_arrows:",":repeat:",":repeat_one:",":new:",":top:",":up:",":cool:",":free:",":ng:",":cinema:",":koko:",":signal_strength:",":u5272:",":u5408:",":u55b6:",":u6307:",":u6708:",":u6709:",":u6e80:",":u7121:",":u7533:",":u7a7a:",":u7981:",":sa:",":restroom:",":mens:",":womens:",":baby_symbol:",":no_smoking:",":parking:",":wheelchair:",":metro:",":baggage_claim:",":accept:",":wc:",":potable_water:",":put_litter_in_its_place:",":secret:",":congratulations:",":m:",":passport_control:",":left_luggage:",":customs:",":ideograph_advantage:",":cl:",":sos:",":id:",":no_entry_sign:",":underage:",":no_mobile_phones:",":do_not_litter:",":non-potable_water:",":no_bicycles:",":no_pedestrians:",":children_crossing:",":no_entry:",":eight_spoked_asterisk:",":eight_pointed_black_star:",":heart_decoration:",":vs:",":vibration_mode:",":mobile_phone_off:",":chart:",":currency_exchange:",":aries:",":taurus:",":gemini:",":cancer:",":leo:",":virgo:",":libra:",":scorpius:",":sagittarius:",":capricorn:",":aquarius:",":pisces:",":ophiuchus:",":six_pointed_star:",":negative_squared_cross_mark:",":a:",":b:",":ab:",":o2:",":diamond_shape_with_a_dot_inside:",":recycle:",":end:",":on:",":soon:",":clock1:",":clock130:",":clock10:",":clock1030:",":clock11:",":clock1130:",":clock12:",":clock1230:",":clock2:",":clock230:",":clock3:",":clock330:",":clock4:",":clock430:",":clock5:",":clock530:",":clock6:",":clock630:",":clock7:",":clock730:",":clock8:",":clock830:",":clock9:",":clock930:",":heavy_dollar_sign:",":copyright:",":registered:",":tm:",":x:",":heavy_exclamation_mark:",":bangbang:",":interrobang:",":o:",":heavy_multiplication_x:",":heavy_plus_sign:",":heavy_minus_sign:",":heavy_division_sign:",":white_flower:",":heavy_check_mark:",":ballot_box_with_check:",":radio_button:",":link:",":curly_loop:",":wavy_dash:",":part_alternation_mark:",":trident:",":black_square:",":white_square:",":white_check_mark:",":black_square_button:",":white_square_button:",":black_circle:",":white_circle:",":red_circle:",":large_blue_circle:",":large_blue_diamond:",":large_orange_diamond:",":small_blue_diamond:",":small_orange_diamond:",":small_red_triangle:",":small_red_triangle_down:",":shipit:"]; + var regrep = ":.+$"; + + function widgetPosition(){ + var caretPosition = Measurement.caretPos($("textarea[name=body]")); + return { + left: caretPosition.left + "px", + top: caretPosition.top + 20 + "px", + width: "auto" + }; + + } + + function matchedEmoji(val){ + terms = val.split("\n"); + term = terms[ terms.length - 1]; + + var matched = term.match(regrep); + + if( matched == null ){ + return false; + + } + + return true; + + } + + function typedEmoji( term ) { + var array = term.split(":"); + return array[ array.length - 1 ]; + } + + $( "textarea[name=body]" ) + .bind( "keydown", function( event ) { + if ( event.keyCode === $.ui.keyCode.TAB && + $( this ).data( "autocomplete" ).menu.active ) { + event.preventDefault(); + + } + }) + .autocomplete({ + delay: 500, + + //filtering + source: function( request, response ) { + if(matchedEmoji(request.term)){ + response( $.ui.autocomplete.filter( + config.candidates, typedEmoji( request.term ) ) ); + } + }, + + // prevent value inserted on focus + focus: function() { + return false; + }, + + // replace textarea + select: function( event, ui ) { + // no match data ... + if (ui.item.value == null){ + return false; + } + + var terms = this.value.split(":"); + // remove the current typed emoji + terms.pop(); + // add the selected item + terms.push( ui.item.value.replace(/:/g, "") ); + this.value = terms.join( ":" ) + ":"; + + return false; + }, + + // re-positioning supports excluding IE. + open: function(){ + if (! document.uniqueID) { + $(".ui-autocomplete").css(widgetPosition()) + + } + } + + }) + + // customize autocomplate item + $.ui.autocomplete.prototype._renderItem = function( ul, item ) { + var icon_img = null; + + if (item.value != null){ + png_basename = item.value.replace(/:/g, ""); + + if (png_basename == '+1'){ png_basename = 'plus1' } + + icon_img = $("").attr('src', 'http://www.emoji-cheat-sheet.com/graphics/emojis/' + png_basename + '.png') + .css('width', '20').css('height', '20'); + + } + + var label_a = $("") + .append(icon_img) + .append(item.label) + + return $( "
  • " ) + .data( "item.autocomplete", item ) + .append(label_a) + .appendTo( ul ); + }; + + // customize filter and result + $.ui.autocomplete.filter = function(array, term) { + var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" ); + + var aryMatches = $.grep( array, function(value) { + return matcher.test(value.label || value.value || value); + + }); + + if (aryMatches.length == 0){ + aryMatches.push({ + label: 'no match found', + value: null + }); + + } + + return aryMatches; + }; +}); + diff -Nru tdiary-contrib-3.1.20120506/js/datepicker.js tdiary-contrib-3.2.2/js/datepicker.js --- tdiary-contrib-3.1.20120506/js/datepicker.js 1970-01-01 00:00:00.000000000 +0000 +++ tdiary-contrib-3.2.2/js/datepicker.js 2013-04-25 22:33:04.000000000 +0000 @@ -0,0 +1,69 @@ +/* + * datepicker.js : datepicker using jQuery-UI + * http://jqueryui.com/demos/datepicker/ + * + * Copyright (C) 2012 by tamoot + * You can redistribute it and/or modify it under GPL. +*/ + + +$( function() { + + function setDateText(date) { + var dates = date.split("/"); + $("#year" ).val(dates[0]); + $("#month").val(dates[1]); + $("#day" ).val(dates[2]); + } + + function dateTextFromField() { + var y = parseInt( $("#year" ).val() ); + var m = parseInt( $("#month").val() ); + var d = parseInt( $("#day" ).val() ); + if( y > 0 && 13 > m && m > 0 && 32 > d && d > 0 ){ + $("#datepicker-input").val(y + "/" + m + "/" + d); + } + } + + var datepicker_dom = $(""); + + var datepicker_trigger = $("") + .addClass("ui-icon") + .addClass("ui-icon-calendar") + .addClass("datepicker-trigger"); + + var datepicker_input = $("", { + id: "datepicker-input", + name: "datepicker", + style: "display: none;", + type: "text" + } + ); + + datepicker_dom.append(datepicker_input); + datepicker_dom.append(datepicker_trigger); + datepicker_dom.insertAfter("span.day"); + + $("#datepicker-input").datepicker({ + onSelect: function(dateText, inst){ + setDateText(dateText); + }, + beforeShow: function(input ,inst){ + dateTextFromField(); + }, + dateFormat: "yy/m/d" + }); + + $(".datepicker-trigger").click(function() { + $("#datepicker-input").datepicker("show"); + }); + + + var icon = $(".ui-icon-calendar"); + icon.css({"display":"inline","position":"absolute","margin-top":"5px"}); + icon.after($("").css({"margin-left":"16px"})); + icon.hover(function(){ + $(this).css({"cursor":"pointer"}); + }); +}); + diff -Nru tdiary-contrib-3.1.20120506/js/editor.js tdiary-contrib-3.2.2/js/editor.js --- tdiary-contrib-3.1.20120506/js/editor.js 2012-05-06 16:18:59.000000000 +0000 +++ tdiary-contrib-3.2.2/js/editor.js 2013-04-25 22:33:04.000000000 +0000 @@ -58,7 +58,7 @@ ul: function(){ form.insertAtCaret("* ") }, ol: function(){ form.insertAtCaret("1. ") }, table: function(){ form.insertAtCaret( - "\nhead1|head2\n---------\nbody1|body2\nbody3|body4\n") }, + "\nhead1|head2\n----|----\nbody1|body2\nbody3|body4\n") }, plugin: function(){ form.insertAtCaret2( "", $.makePluginTag("plugin_name")) } } diff -Nru tdiary-contrib-3.1.20120506/js/flickr.js tdiary-contrib-3.2.2/js/flickr.js --- tdiary-contrib-3.1.20120506/js/flickr.js 2012-05-06 16:18:59.000000000 +0000 +++ tdiary-contrib-3.2.2/js/flickr.js 2013-04-25 22:33:04.000000000 +0000 @@ -39,7 +39,7 @@ .attr({id: photo.id, src: src, title: photo.title}) .css({margin: "2px", border: "1px solid #999", cursor: "pointer"}) .click(function(event) { - var size = $('input[@name=flickr_to_blog_photo_size]:checked').val(); + var size = $('input[name=flickr_photo_size]:checked').val(); var tag = $.makePluginTag("flickr '" + event.target.id + "', '" + size + "'"); $('#body').insertAtCaret(tag); }) diff -Nru tdiary-contrib-3.1.20120506/js/jquery.socialbutton.js tdiary-contrib-3.2.2/js/jquery.socialbutton.js --- tdiary-contrib-3.1.20120506/js/jquery.socialbutton.js 2012-05-06 16:18:59.000000000 +0000 +++ tdiary-contrib-3.2.2/js/jquery.socialbutton.js 2013-04-25 22:33:04.000000000 +0000 @@ -160,6 +160,16 @@ * count: true * }); * + * + * Pintarest Button + * http://pinterest.com/about/goodies/ + * + * $('#pinterest').socialbutton('pinterest', { + * button: 'horizontal', // or 'vertical', 'none' + * url: 'http://itra.jp', + * media: 'http://itra.jp/image.jpg', + * description: 'This is an image.', + * }); */ (function($) { @@ -274,7 +284,13 @@ parsetags: '', // none(onload), explicit callback: '', count: true // true, false - } + }, + pinterest: { + button: 'horizontal', // horizontal, vertical, none + url: '', + media: '', + description: '' + }, }; var max_index = this.size() - 1; @@ -322,6 +338,10 @@ socialbutton_google_plusone(this, options, defaults.google_plusone, index, max_index); break; + case 'pinterest': + socialbutton_pinterest(this, options, defaults.pinterest, index, max_index); + break; + default: break; } @@ -740,6 +760,32 @@ } } +function socialbutton_pinterest(target, options, defaults, index, max_index) +{ + var url = options.url || defaults.url; + var button = options.button || defaults.button; + var media = options.media != undefined ? options.media : defaults.media; + var description = options.description != undefined ? options.description : defaults.description; + + url = url_encode_rfc3986(decodeURIComponent(url)); + media = url_encode_rfc3986(decodeURIComponent(media)); + description = decodeURIComponent(description); + + var params = merge_parameters({ + 'url': url, + 'media': media, + 'description': description + }); + + var tag = '' + + $(target).html(tag); + + if (index == max_index) { + $('body').append(''); + } +} + function merge_attributes(attr) { var merged = ''; diff -Nru tdiary-contrib-3.1.20120506/js/plugin_checker.js tdiary-contrib-3.2.2/js/plugin_checker.js --- tdiary-contrib-3.1.20120506/js/plugin_checker.js 1970-01-01 00:00:00.000000000 +0000 +++ tdiary-contrib-3.2.2/js/plugin_checker.js 2013-04-25 22:33:04.000000000 +0000 @@ -0,0 +1,71 @@ +/** + * plugin_checker.js - Notify plugin updates + * + * Copyright (C) 2012 by MATSUOKA Kohei + * You can distribute it under GPL. + */ + +$(function() { + var url = 'http://tdiary-plugin-checker.herokuapp.com/t_diary_plugin_files.json'; + + function saveCheckedDate(date) { + if (!localStorage) { return; } + var pluginChecker = localStorage.pluginChecker ? JSON.parse(localStorage.pluginChecker) : {}; + pluginChecker.checkedDate = date; + localStorage.pluginChecker = JSON.stringify(pluginChecker); + } + + function loadCheckedDate() { + if (!localStorage || !localStorage.pluginChecker) { + return null; + } + return (JSON.parse(localStorage.pluginChecker)).checkedDate; + } + + function createNotify(plugins) { + var ul = $('