tdiary 5.6.0 → 5.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +7 -0
- data/Gemfile.lock +61 -59
- data/doc/HOWTO-authenticate-in-rack.md +3 -3
- data/doc/HOWTO-make-theme.md +3 -3
- data/js/00default.js +22 -12
- data/js/caretposition.js +1 -0
- data/js/draft.js +228 -51
- data/js/image.js +126 -29
- data/js/preview.js +12 -50
- data/js/update.js +54 -0
- data/js/update_preview.js +79 -0
- data/lib/aws/pa_api.rb +7 -7
- data/lib/tdiary/admin.rb +66 -3
- data/lib/tdiary/cli.rb +14 -10
- data/lib/tdiary/core_ext.rb +46 -8
- data/lib/tdiary/dispatcher/update_main.rb +6 -0
- data/lib/tdiary/io/plugin_pstore.rb +2 -1
- data/lib/tdiary/plugin/00default.rb +3 -0
- data/lib/tdiary/rack/auth/basic.rb +72 -9
- data/lib/tdiary/tasks/auth.rake +2 -4
- data/lib/tdiary/tasks/release.rake +5 -4
- data/lib/tdiary/version.rb +1 -1
- data/lib/tdiary.rb +3 -0
- data/misc/plugin/amazon.rb +48 -11
- data/misc/plugin/amazon_rakuten.rb +79 -0
- data/misc/plugin/draft.rb +83 -0
- data/misc/plugin/en/image.rb +5 -0
- data/misc/plugin/en/makerss.rb +4 -0
- data/misc/plugin/en/preview.rb +0 -2
- data/misc/plugin/image.rb +19 -13
- data/misc/plugin/ja/makerss.rb +3 -0
- data/misc/plugin/ja/preview.rb +0 -2
- data/misc/plugin/makerss.rb +5 -4
- data/misc/plugin/my-sequel.rb +1 -0
- data/misc/plugin/preview.rb +0 -8
- data/theme/base.css +32 -2
- data/theme/conf.css +60 -0
- data/theme/default/default.css +33 -8
- data/vendor/bundle/ruby/3.4.0/cache/bcrypt-3.1.22.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/date-3.6.0.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/fastimage-2.4.3.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/net-imap-0.6.8.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/net-protocol-0.4.0.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/net-smtp-0.5.2.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/pstore-0.3.0.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/rack-3.2.8.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/bcrypt-3.1.22/bcrypt_ext.so +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/bcrypt-3.1.22/gem_make.out +28 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/cgi-0.5.2/cgi/escape.so +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/cgi-0.5.2/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.6.0/date_core.so +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.6.0/gem.build_complete +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.6.0/gem_make.out +26 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.6.0/mkmf.log +140 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/CHANGELOG +127 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/COPYING +28 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/README.md +192 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/jruby/bcrypt_jruby/BCrypt.java +926 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/Makefile +273 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/bcrypt_ext.c +125 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/crypt.c +57 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/crypt.h +24 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/crypt_blowfish.c +903 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/crypt_blowfish.h +27 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/crypt_gensalt.c +124 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/crypt_gensalt.h +30 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/extconf.rb +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/ow-crypt.h +43 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/wrapper.c +554 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/x86.S +203 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/lib/bcrypt/engine.rb +134 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/lib/bcrypt/error.rb +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/lib/bcrypt/password.rb +106 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/lib/bcrypt.rb +16 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/lib/bcrypt_ext.so +0 -0
- data/vendor/bundle/ruby/3.4.0/gems/cgi-0.5.2/ext/cgi/escape/Makefile +3 -3
- data/vendor/bundle/ruby/3.4.0/gems/cgi-0.5.2/lib/cgi/escape.so +0 -0
- data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/Makefile +4 -4
- data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_core.c +293 -77
- data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_parse.c +14 -4
- data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_strptime.c +13 -13
- data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/extconf.rb +6 -0
- data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/lib/date.rb +1 -1
- data/vendor/bundle/ruby/3.4.0/gems/date-3.6.0/lib/date_core.so +0 -0
- data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/avif.rb +1 -0
- data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/fiber_stream.rb +6 -1
- data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/heic.rb +1 -0
- data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/iso_bmff.rb +15 -5
- data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/jxl.rb +1 -0
- data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/version.rb +1 -1
- data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/Gemfile +3 -3
- data/vendor/bundle/ruby/3.4.0/gems/net-imap-0.6.8/README.md +103 -0
- data/vendor/bundle/ruby/3.4.0/gems/net-imap-0.6.8/Rakefile +74 -0
- data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/command_data.rb +13 -10
- data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/config/attr_accessors.rb +2 -2
- data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/config/attr_type_coercion.rb +14 -26
- data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/config.rb +63 -3
- data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/esearch_result.rb +2 -2
- data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/fetch_data.rb +5 -5
- data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/response_data.rb +79 -79
- data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/response_parser/parser_utils.rb +1 -1
- data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/response_parser.rb +2 -1
- data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/client_adapter.rb +6 -6
- data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/search_result.rb +4 -6
- data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sequence_set.rb +413 -52
- data/vendor/bundle/ruby/3.4.0/gems/net-imap-0.6.8/lib/net/imap/utils.rb +49 -0
- data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap.rb +195 -46
- data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/rakelib/rdoc.rake +24 -0
- data/vendor/bundle/ruby/3.4.0/gems/{net-protocol-0.3.0 → net-protocol-0.4.0}/lib/net/protocol.rb +38 -23
- data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/lib/net/smtp.rb +5 -8
- data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/lib/pstore.rb +52 -31
- data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/pstore.gemspec +1 -0
- data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/CHANGELOG.md +34 -0
- data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/multipart/parser.rb +7 -2
- data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/multipart/uploaded_file.rb +1 -0
- data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/request.rb +5 -2
- data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/static.rb +1 -1
- data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/version.rb +1 -1
- data/vendor/bundle/ruby/3.4.0/specifications/bcrypt-3.1.22.gemspec +33 -0
- data/vendor/bundle/ruby/3.4.0/specifications/{date-3.5.1.gemspec → date-3.6.0.gemspec} +3 -3
- data/vendor/bundle/ruby/3.4.0/specifications/{fastimage-2.4.1.gemspec → fastimage-2.4.3.gemspec} +3 -3
- data/vendor/bundle/ruby/3.4.0/specifications/{net-imap-0.6.6.gemspec → net-imap-0.6.8.gemspec} +3 -3
- data/vendor/bundle/ruby/3.4.0/specifications/{net-protocol-0.3.0.gemspec → net-protocol-0.4.0.gemspec} +2 -2
- data/vendor/bundle/ruby/3.4.0/specifications/{net-smtp-0.5.1.gemspec → net-smtp-0.5.2.gemspec} +4 -4
- data/vendor/bundle/ruby/3.4.0/specifications/{pstore-0.2.1.gemspec → pstore-0.3.0.gemspec} +3 -2
- data/vendor/bundle/ruby/3.4.0/specifications/{rack-3.2.7.gemspec → rack-3.2.8.gemspec} +2 -2
- data/views/preview.rhtml +2 -1
- data/views/preview.rhtml.en +2 -1
- data/views/update.rhtml +10 -1
- data/views/update.rhtml.en +10 -1
- metadata +242 -200
- data/misc/plugin/amp.rb +0 -118
- data/vendor/bundle/ruby/3.4.0/cache/date-3.5.1.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/fastimage-2.4.1.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/net-imap-0.6.6.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/net-protocol-0.3.0.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/net-smtp-0.5.1.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/pstore-0.2.1.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/rack-3.2.7.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.5.1/date_core.so +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.5.1/gem_make.out +0 -24
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.5.1/mkmf.log +0 -93
- data/vendor/bundle/ruby/3.4.0/gems/date-3.5.1/lib/date_core.so +0 -0
- data/vendor/bundle/ruby/3.4.0/gems/net-imap-0.6.6/README.md +0 -77
- data/vendor/bundle/ruby/3.4.0/gems/net-imap-0.6.6/Rakefile +0 -24
- data/views/amp.rhtml +0 -34
- /data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/{date-3.5.1 → bcrypt-3.1.22}/gem.build_complete +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/BSDL +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/COPYING +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/README.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_strftime.c +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_tmx.h +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/prereq.mk +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/zonetab.h +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/zonetab.list +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/MIT-LICENSE +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/README.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/bmp.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/exif.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/gif.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/ico.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/image_base.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/jpeg.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/jxlc.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/png.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/psd.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/stream_util.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/svg.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/tiff.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/type_parser.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/webp.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/BSDL +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/COPYING +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/LICENSE.txt +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/docs/styles.css +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/authenticators.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/config/attr_inheritance.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/config/attr_version_defaults.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/connection_state.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/data_encoding.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/deprecated_client_options.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/errors.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/flags.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/response_reader.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/anonymous_authenticator.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/authentication_exchange.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/authenticators.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/cram_md5_authenticator.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/digest_md5_authenticator.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/external_authenticator.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/gs2_header.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/login_authenticator.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/oauthbearer_authenticator.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/plain_authenticator.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/protocol_adapters.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/scram_algorithm.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/scram_authenticator.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/stringprep.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/xoauth2_authenticator.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl_adapter.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/stringprep/nameprep.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/stringprep/saslprep.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/stringprep/saslprep_tables.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/stringprep/tables.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/stringprep/trace.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/stringprep.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/uidplus_data.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/vanished_data.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/net-imap.gemspec +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/rakelib/benchmarks.rake +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/rakelib/rfcs.rake +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/rakelib/saslprep.rake +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/rakelib/string_prep_tables_generator.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/sample/net-imap.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-protocol-0.3.0 → net-protocol-0.4.0}/BSDL +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-protocol-0.3.0 → net-protocol-0.4.0}/COPYING +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-protocol-0.3.0 → net-protocol-0.4.0}/README.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/LICENSE.txt +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/NEWS.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/README.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/lib/net/smtp/auth_cram_md5.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/lib/net/smtp/auth_login.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/lib/net/smtp/auth_plain.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/lib/net/smtp/auth_xoauth2.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/lib/net/smtp/authenticator.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/net-smtp.gemspec +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/BSDL +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/COPYING +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/Gemfile +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/README.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/Rakefile +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/bin/console +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/bin/setup +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/CONTRIBUTING.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/MIT-LICENSE +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/README.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/SPEC.rdoc +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/auth/abstract/handler.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/auth/abstract/request.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/auth/basic.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/bad_request.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/body_proxy.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/builder.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/cascade.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/common_logger.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/conditional_get.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/config.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/constants.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/content_length.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/content_type.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/deflater.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/directory.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/etag.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/events.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/files.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/head.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/headers.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/lint.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/lock.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/media_type.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/method_override.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/mime.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/mock.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/mock_request.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/mock_response.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/multipart/generator.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/multipart.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/null_logger.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/query_parser.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/recursive.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/reloader.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/response.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/rewindable_input.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/runtime.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/sendfile.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/show_exceptions.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/show_status.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/tempfile_reaper.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/urlmap.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/utils.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack.rb +0 -0
data/misc/plugin/amazon.rb
CHANGED
|
@@ -92,11 +92,12 @@ def amazon_detail_html(item)
|
|
|
92
92
|
image = amazon_image(item)
|
|
93
93
|
@conf['amazon.imgsize'] = size_orig
|
|
94
94
|
|
|
95
|
+
size = %Q|height="#{h image[:height]}" width="#{h image[:width]}"| if image[:height]
|
|
95
96
|
url = amazon_url(item)
|
|
96
97
|
<<-HTML
|
|
97
98
|
<a class="amazon-detail" href="#{url}"><span class="amazon-detail">
|
|
98
99
|
<img class="amazon-detail left" src="#{h image[:src]}"
|
|
99
|
-
|
|
100
|
+
#{size}
|
|
100
101
|
alt="">
|
|
101
102
|
<span class="amazon-detail-desc">
|
|
102
103
|
<span class="amazon-title">#{h title}</span><br>
|
|
@@ -125,7 +126,7 @@ def amazon_to_html(item, with_image = true, label = nil, pos = 'amazon')
|
|
|
125
126
|
unless image[:src] then
|
|
126
127
|
img = ''
|
|
127
128
|
else
|
|
128
|
-
size = %Q|height="#{h image[:height]}" width="#{h image[:width]}"|
|
|
129
|
+
size = %Q|height="#{h image[:height]}" width="#{h image[:width]}"| if image[:height]
|
|
129
130
|
img = <<-HTML
|
|
130
131
|
<img class="#{h pos}" src="#{h image[:src]}"
|
|
131
132
|
#{size} alt="#{h alt}">
|
|
@@ -138,6 +139,28 @@ def amazon_to_html(item, with_image = true, label = nil, pos = 'amazon')
|
|
|
138
139
|
%Q|<a href="#{h url}">#{img}#{h label}</a>|
|
|
139
140
|
end
|
|
140
141
|
|
|
142
|
+
# Items given by ISBN or JAN code that Amazon doesn't answer for are asked of a plugin defining amazon_book_item(code), like amazon_rakuten.rb.
|
|
143
|
+
def amazon_book_json(item_id)
|
|
144
|
+
return nil unless defined?(amazon_book_item) && /\A(?:\d{9}[\dX]|\d{13})\z/i =~ item_id
|
|
145
|
+
item = amazon_book_item(item_id)
|
|
146
|
+
{'ItemsResult' => {'Items' => [item]}}.to_json if item
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# PA-API and the pages of Amazon take an ASIN, which is the ISBN-10 for a book and which a JAN code doesn't have
|
|
150
|
+
def amazon_asin(item_id)
|
|
151
|
+
case item_id
|
|
152
|
+
when /\A978\d{10}\z/ then AWS::PAAPI.isbn13to10(item_id)
|
|
153
|
+
when /\A\d{13}\z/ then nil
|
|
154
|
+
else item_id
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
def amazon_link(item_id, label)
|
|
159
|
+
asin = amazon_asin(item_id)
|
|
160
|
+
url = asin ? "https://www.amazon.co.jp/dp/#{asin}" : "https://www.amazon.co.jp/s?k=#{item_id}"
|
|
161
|
+
%Q|<a href="#{h url}">#{h(label || url)}</a>|
|
|
162
|
+
end
|
|
163
|
+
|
|
141
164
|
def amazon_get(asin, with_image = true, label = nil, pos = 'amazon')
|
|
142
165
|
asin = asin.to_s.strip.gsub(/-/, '')
|
|
143
166
|
country, item_id = asin.scan(/\A(..):(.*)/).flatten
|
|
@@ -149,16 +172,32 @@ def amazon_get(asin, with_image = true, label = nil, pos = 'amazon')
|
|
|
149
172
|
begin
|
|
150
173
|
cache = "#{@cache_path}/amazon"
|
|
151
174
|
Dir::mkdir( cache ) unless File::directory?( cache )
|
|
175
|
+
file = "#{cache}/#{country}#{item_id}.json"
|
|
152
176
|
begin
|
|
153
|
-
json = File::read(
|
|
177
|
+
json = File::read(file)
|
|
178
|
+
# PA-API answered a code without an ASIN with an error, which was cached before such codes went to amazon_book_json
|
|
179
|
+
raise Errno::ENOENT if json.empty? || !amazon_asin(item_id) && !JSON.parse(json)['ItemsResult']
|
|
154
180
|
rescue Errno::ENOENT
|
|
155
181
|
access_key = @conf['amazon.access_key']
|
|
156
182
|
secret_key = @conf['amazon.secret_key']
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
183
|
+
if access_key && secret_key && !File::exist?(file) && amazon_asin(item_id)
|
|
184
|
+
begin
|
|
185
|
+
partner_tag = @conf['amazon.aid']
|
|
186
|
+
paapi = AWS::PAAPI.new(access_key, secret_key, partner_tag)
|
|
187
|
+
json = paapi.get_items(item_id, country.to_sym)
|
|
188
|
+
rescue Net::HTTPExceptions => e
|
|
189
|
+
# An empty cache records a 403, which PA-API keeps answering, so the item isn't asked about again until the cache is cleared
|
|
190
|
+
File::write(file, '') if e.response.code == '403'
|
|
191
|
+
json = amazon_book_json(item_id)
|
|
192
|
+
raise unless json
|
|
193
|
+
end
|
|
194
|
+
else
|
|
195
|
+
json = amazon_book_json(item_id)
|
|
196
|
+
unless json
|
|
197
|
+
return (access_key && secret_key || File::exist?(file)) ? amazon_link(item_id, label) : asin
|
|
198
|
+
end
|
|
199
|
+
end
|
|
200
|
+
File::open(file, 'wb'){|f| f.write(json)}
|
|
162
201
|
end
|
|
163
202
|
item = JSON.parse(json)["ItemsResult"]["Items"][0]
|
|
164
203
|
if pos == 'detail' then
|
|
@@ -185,9 +224,7 @@ def amazon_get(asin, with_image = true, label = nil, pos = 'amazon')
|
|
|
185
224
|
message = ''
|
|
186
225
|
# Handle 429 "Too Many Requests" and 403 "Forbidden"
|
|
187
226
|
if /^429|^403/ =~ e.message then
|
|
188
|
-
|
|
189
|
-
label ||= url
|
|
190
|
-
message << %Q|<a href="#{h url}">#{h label}</a>|
|
|
227
|
+
message << amazon_link(item_id, label)
|
|
191
228
|
end
|
|
192
229
|
if @mode == 'preview' then
|
|
193
230
|
message << %Q|<span class="message">(#{h e.message})</span>|
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
#
|
|
2
|
+
# amazon_rakuten.rb: look books of amazon.rb up in Rakuten Books
|
|
3
|
+
#
|
|
4
|
+
# PA-API refuses Associates accounts that don't meet its eligibility
|
|
5
|
+
# requirements, which leaves amazon.rb without titles and images. With
|
|
6
|
+
# this plugin, books given by ISBN come from Rakuten Books Book Search
|
|
7
|
+
# API instead, and magazines, DVDs, games and other items given by JAN
|
|
8
|
+
# code from Rakuten Books Total Search API. They link to Rakuten Books
|
|
9
|
+
# as its terms require.
|
|
10
|
+
#
|
|
11
|
+
# options:
|
|
12
|
+
# @options['rakuten.app_id'] : application ID of Rakuten Web Service
|
|
13
|
+
# @options['rakuten.access_key'] : access key of the application
|
|
14
|
+
# @options['rakuten.affiliate_id'] : Rakuten Affiliate ID for the links (optional)
|
|
15
|
+
#
|
|
16
|
+
# Register the application as an API/backend service allowing the IP
|
|
17
|
+
# address of the server. Rakuten requires the credit this plugin puts in
|
|
18
|
+
# the footer.
|
|
19
|
+
#
|
|
20
|
+
# Copyright (c) 2026 Hiroshi SHIBATA <hsbt@ruby-lang.org>
|
|
21
|
+
# Distributed under the GPL2 or any later version.
|
|
22
|
+
#
|
|
23
|
+
require 'json'
|
|
24
|
+
require 'net/http'
|
|
25
|
+
|
|
26
|
+
def amazon_book_item(code)
|
|
27
|
+
app_id = @conf['rakuten.app_id']
|
|
28
|
+
access_key = @conf['rakuten.access_key']
|
|
29
|
+
return nil unless app_id && access_key
|
|
30
|
+
|
|
31
|
+
api, key = /\A(?:\d{9}[\dX]|97[89]\d{10})\z/i =~ code ? ['BooksBook', :isbn] : ['BooksTotal', :isbnjan]
|
|
32
|
+
uri = URI("https://openapi.rakuten.co.jp/services/api/#{api}/Search/20170404")
|
|
33
|
+
params = {applicationId: app_id, accessKey: access_key, key => code, outOfStockFlag: 1, formatVersion: 2}
|
|
34
|
+
params[:affiliateId] = @conf['rakuten.affiliate_id'] if @conf['rakuten.affiliate_id']
|
|
35
|
+
uri.query = URI.encode_www_form(params)
|
|
36
|
+
# Rakuten answers 429 to more than one request a second
|
|
37
|
+
sleep 1 if @amazon_rakuten_requested
|
|
38
|
+
@amazon_rakuten_requested = true
|
|
39
|
+
response = Net::HTTP.get_response(uri)
|
|
40
|
+
response.value
|
|
41
|
+
book = JSON.parse(response.body)['Items'][0]
|
|
42
|
+
return nil unless book
|
|
43
|
+
|
|
44
|
+
{
|
|
45
|
+
'DetailPageURL' => book['affiliateUrl'].to_s.empty? ? book['itemUrl'] : book['affiliateUrl'],
|
|
46
|
+
'ItemInfo' => {
|
|
47
|
+
'Title' => {'DisplayValue' => book['title']},
|
|
48
|
+
'ByLineInfo' => {
|
|
49
|
+
# DVDs and CDs have artistName and label in place of author and publisherName
|
|
50
|
+
'Contributors' => [{'Name' => [book['author'], book['artistName']].find {|name| !name.to_s.empty? }.to_s[%r{[^/]*}]}],
|
|
51
|
+
'Manufacturer' => {'DisplayValue' => [book['publisherName'], book['label']].find {|name| !name.to_s.empty? }}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
'Images' => {
|
|
55
|
+
'Primary' => {
|
|
56
|
+
'Small' => {'URL' => book['smallImageUrl']},
|
|
57
|
+
'Medium' => {'URL' => book['mediumImageUrl']},
|
|
58
|
+
'Large' => {'URL' => book['largeImageUrl']}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
'OffersV2' => {
|
|
62
|
+
'Listings' => [{'Price' => {'Money' => {'DisplayAmount' => "¥#{book['itemPrice'].to_s.gsub(/(\d)(?=(\d{3})+\z)/, '\1,')}"}}}]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
rescue => e
|
|
66
|
+
@logger.error "amazon_rakuten.rb: #{e.message}"
|
|
67
|
+
nil
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
add_footer_proc do
|
|
71
|
+
%Q|<div class="footer"><a href="https://developers.rakuten.com/">Supported by Rakuten Developers</a></div>|
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Local Variables:
|
|
75
|
+
# mode: ruby
|
|
76
|
+
# indent-tabs-mode: t
|
|
77
|
+
# tab-width: 3
|
|
78
|
+
# ruby-indent-level: 3
|
|
79
|
+
# End:
|
data/misc/plugin/draft.rb
CHANGED
|
@@ -1,11 +1,93 @@
|
|
|
1
1
|
#
|
|
2
2
|
# draft.rb: save draft data to Web Storage automatically
|
|
3
|
+
# and keep a copy of them on the server
|
|
4
|
+
#
|
|
5
|
+
# options:
|
|
6
|
+
# @options['draft.sync_interval'] : seconds between uploads to the server (default 300)
|
|
3
7
|
#
|
|
4
8
|
# Copyright (c) MATSUOKA Kohei <http://www.machu.jp/>
|
|
5
9
|
# Distributed under the GPL2 or any later version.
|
|
6
10
|
#
|
|
11
|
+
require 'json'
|
|
12
|
+
|
|
13
|
+
def draft_max_count
|
|
14
|
+
10
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def draft_restore( db )
|
|
18
|
+
%w(drafts deleted).map {|key| JSON.parse( db.get( key ) || '[]' ) }
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def draft_id?( id )
|
|
22
|
+
id.kind_of?( String ) and /\A[0-9a-z]{1,32}\z/.match?( id )
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def draft_valid?( item )
|
|
26
|
+
item.kind_of?( Hash ) and
|
|
27
|
+
draft_id?( item['id'] ) and
|
|
28
|
+
item['date'].kind_of?( Integer ) and
|
|
29
|
+
item['value'].kind_of?( String ) and !item['value'].empty? and
|
|
30
|
+
( item['form'].nil? or /\A(append|replace):\d{0,8}\z/.match?( item['form'].to_s ) )
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def draft_sync( items )
|
|
34
|
+
transaction( 'draft' ) do |db|
|
|
35
|
+
drafts, deleted = draft_restore( db )
|
|
36
|
+
items.each do |item|
|
|
37
|
+
# a draft submitted as a diary must not come back from another browser
|
|
38
|
+
next if !draft_valid?( item ) or deleted.include?( item['id'] )
|
|
39
|
+
stored = drafts.find {|d| d['id'] == item['id'] }
|
|
40
|
+
if !stored
|
|
41
|
+
drafts << item.slice( 'id', 'date', 'value', 'form' )
|
|
42
|
+
elsif stored['date'] < item['date']
|
|
43
|
+
stored.update( item.slice( 'date', 'value', 'form' ) )
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
db.set( 'drafts', drafts.sort_by {|d| d['date'] }.last( draft_max_count ).to_json )
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def draft_delete( id )
|
|
51
|
+
transaction( 'draft' ) do |db|
|
|
52
|
+
drafts, deleted = draft_restore( db )
|
|
53
|
+
db.set( 'drafts', drafts.reject {|d| d['id'] == id }.to_json )
|
|
54
|
+
db.set( 'deleted', (deleted - [id] + [id]).last( 100 ).to_json )
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
7
58
|
if /\A(form|edit|preview|showcomment)\z/ === @mode then
|
|
8
59
|
enable_js('draft.js')
|
|
60
|
+
server = nil
|
|
61
|
+
transaction( 'draft' ) do |db|
|
|
62
|
+
drafts, deleted = draft_restore( db )
|
|
63
|
+
server = { 'drafts' => drafts, 'deleted' => deleted, 'max' => draft_max_count }
|
|
64
|
+
end
|
|
65
|
+
add_js_setting( '$tDiary.plugin.draft' )
|
|
66
|
+
# keep the drafts from closing the script element
|
|
67
|
+
add_js_setting( '$tDiary.plugin.draft.server', server.to_json.gsub( '<', '\\u003c' ) )
|
|
68
|
+
add_js_setting( '$tDiary.plugin.draft.interval', (@conf['draft.sync_interval'] || 300).to_i )
|
|
69
|
+
add_js_setting( '$tDiary.plugin.draft.label', {
|
|
70
|
+
'saved' => '下書きを保存しました (このブラウザ %local、サーバー %server)',
|
|
71
|
+
'unsent' => '未送信',
|
|
72
|
+
'found' => '未投稿の下書きがあります: %title',
|
|
73
|
+
'restore' => '復元する',
|
|
74
|
+
'dismiss' => '閉じる'
|
|
75
|
+
}.to_json )
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if @mode == 'formplugin' and @cgi.params['plugin_draft_sync'][0] then
|
|
79
|
+
begin
|
|
80
|
+
items = JSON.parse( @cgi.params['plugin_draft_sync'][0] )
|
|
81
|
+
draft_sync( items ) if items.kind_of?( Array )
|
|
82
|
+
rescue JSON::ParserError
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
add_update_proc do
|
|
87
|
+
id = @cgi.params['plugin_draft_id'][0]
|
|
88
|
+
if /\A(append|replace)\z/ =~ @mode and draft_id?( id ) then
|
|
89
|
+
draft_delete( id )
|
|
90
|
+
end
|
|
9
91
|
end
|
|
10
92
|
|
|
11
93
|
add_edit_proc do
|
|
@@ -14,6 +96,7 @@ add_edit_proc do
|
|
|
14
96
|
下書き:
|
|
15
97
|
<select name="drafts"></select>
|
|
16
98
|
<button type="button" id="draft_load">読み込み</button>
|
|
99
|
+
<input type="hidden" name="plugin_draft_id" value="">
|
|
17
100
|
</div>
|
|
18
101
|
EOS
|
|
19
102
|
end
|
data/misc/plugin/en/image.rb
CHANGED
|
@@ -27,6 +27,10 @@
|
|
|
27
27
|
# URL of the image directory. Default is './images/'.
|
|
28
28
|
# @options['image.maxwidth']
|
|
29
29
|
# Max display width of image without specified 'size' parameter.
|
|
30
|
+
# @options['image.resize']
|
|
31
|
+
# Images are shrunk on upload so that the longer side fits in this
|
|
32
|
+
# many pixels. Default is 1600. Exif, including the location, is
|
|
33
|
+
# dropped at the same time (except GIF).
|
|
30
34
|
#
|
|
31
35
|
def image_error_num( max ); "You can add images upto #{h max} par a day."; end
|
|
32
36
|
def image_error_size( max ); "You can add images upto #{h max} bytes par an image."; end
|
|
@@ -38,6 +42,7 @@ def image_label_delete; 'Delete checked images'; end
|
|
|
38
42
|
def image_label_only_jpeg; 'Only JPEG'; end
|
|
39
43
|
def image_label_add_image; 'Upload the image'; end
|
|
40
44
|
def image_label_drop_here; 'Drop files here'; end
|
|
45
|
+
def image_label_upload_failed; 'Could not upload the image'; end
|
|
41
46
|
|
|
42
47
|
# Local Variables:
|
|
43
48
|
# mode: ruby
|
data/misc/plugin/en/makerss.rb
CHANGED
|
@@ -16,6 +16,10 @@ def makerss_conf_html
|
|
|
16
16
|
<option value="f"#{' selected' unless @conf['makerss.hidecontent']}>Include</option>
|
|
17
17
|
<option value="t"#{' selected' if @conf['makerss.hidecontent']}>Hide</option></select>
|
|
18
18
|
encoded contents of your diary in the feed.
|
|
19
|
+
<li><select name="makerss.hidesubtitle">
|
|
20
|
+
<option value="f"#{' selected' unless @conf['makerss.hidesubtitle']}>Include</option>
|
|
21
|
+
<option value="t"#{' selected' if @conf['makerss.hidesubtitle']}>Hide</option></select>
|
|
22
|
+
subtitles in the encoded contents.
|
|
19
23
|
<li>Include summary of your contents<select name="makerss.shortdesc">
|
|
20
24
|
<option value="f"#{' selected' unless @conf['makerss.shortdesc']}>as long as possible</option>
|
|
21
25
|
<option value="t"#{' selected' if @conf['makerss.shortdesc']}>only some portion</option></select>
|
data/misc/plugin/en/preview.rb
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
@preview_label_conf = 'preview'
|
|
2
|
-
@preview_label_interval = 'refresh interval'
|
|
3
|
-
@preview_label_interval_desc = 'Specify the interval at which to display the preview in seconds.'
|
|
4
2
|
@preview_label_min_width = 'side by side screen width'
|
|
5
3
|
@preview_label_min_width_desc = 'Specifies the width to display the preview screen side-by-side in pixels.'
|
data/misc/plugin/image.rb
CHANGED
|
@@ -36,6 +36,9 @@
|
|
|
36
36
|
# @options['image.maxwidth']
|
|
37
37
|
# sizeを指定しなかった場合に指定できる画像の最大表示幅。無指定時はnil
|
|
38
38
|
# 表示のたびにファイルアクセスが入るので、重くなるかも?
|
|
39
|
+
# @options['image.resize']
|
|
40
|
+
# アップロード時に縮小する画像の長辺のピクセル数。無指定時は1600
|
|
41
|
+
# 縮小と同時に位置情報などのExifも取り除かれます(GIFを除く)。
|
|
39
42
|
#
|
|
40
43
|
# ライセンスについて:
|
|
41
44
|
# Copyright (c) 2002,2003 Daisuke Kato <dai@kato-agri.com>
|
|
@@ -55,6 +58,7 @@ unless @resource_loaded then
|
|
|
55
58
|
def image_label_only_jpeg; 'JPEGのみ'; end
|
|
56
59
|
def image_label_add_image; 'この画像をアップロードする'; end
|
|
57
60
|
def image_label_drop_here; 'ここにファイルをドロップ'; end
|
|
61
|
+
def image_label_upload_failed; '画像をアップロードできませんでした'; end
|
|
58
62
|
end
|
|
59
63
|
|
|
60
64
|
def image( id, alt = 'image', thumbnail = nil, size = nil, place = 'photo' )
|
|
@@ -142,17 +146,22 @@ def image_list( date )
|
|
|
142
146
|
list
|
|
143
147
|
end
|
|
144
148
|
|
|
145
|
-
if /^(form|edit|formplugin|showcomment)$/ =~ @mode then
|
|
149
|
+
if /^(form|edit|formplugin|showcomment|preview)$/ =~ @mode then
|
|
146
150
|
enable_js( 'image.js' )
|
|
147
151
|
add_js_setting( '$tDiary.plugin.image' )
|
|
148
152
|
add_js_setting( '$tDiary.plugin.image.alt', %Q|'#{image_label_description}'| )
|
|
149
153
|
add_js_setting( '$tDiary.plugin.image.drop_here', %Q|'#{image_label_drop_here}'| )
|
|
154
|
+
add_js_setting( '$tDiary.plugin.image.failed', %Q|'#{image_label_upload_failed}'| )
|
|
155
|
+
add_js_setting( '$tDiary.plugin.image.date', %Q|'#{@date.strftime( '%Y%m%d' )}'| )
|
|
156
|
+
resize = @options['image.resize'].to_i
|
|
157
|
+
add_js_setting( '$tDiary.plugin.image.resize', resize > 0 ? resize : 1600 )
|
|
150
158
|
end
|
|
151
159
|
|
|
152
160
|
if /^formplugin$/ =~ @mode then
|
|
153
161
|
maxnum = @options['image.maxnum'] || 1
|
|
154
162
|
maxsize = @options['image.maxsize'] || 10000
|
|
155
163
|
|
|
164
|
+
@image_added = []
|
|
156
165
|
begin
|
|
157
166
|
date = @date.strftime( "%Y%m%d" )
|
|
158
167
|
images = image_list( date )
|
|
@@ -167,7 +176,9 @@ if /^formplugin$/ =~ @mode then
|
|
|
167
176
|
rescue NameError
|
|
168
177
|
size = file.stat.size
|
|
169
178
|
end
|
|
170
|
-
|
|
179
|
+
number = images.length + @image_added.length
|
|
180
|
+
output = "#{@image_dir}/#{date}_#{number}.#{extension}"
|
|
181
|
+
@image_added << number
|
|
171
182
|
File::umask( 022 )
|
|
172
183
|
File::open( output, "wb" ) do |f|
|
|
173
184
|
f.print file.read
|
|
@@ -198,25 +209,20 @@ add_form_proc do |date|
|
|
|
198
209
|
</div>
|
|
199
210
|
<form id="plugin-image-delimage" class="update" method="post" action="#{h @update}"><div>
|
|
200
211
|
#{csrf_protection}
|
|
201
|
-
<
|
|
202
|
-
<tr>]
|
|
203
|
-
tmp = ''
|
|
212
|
+
<div id="image-table">]
|
|
204
213
|
images.each_with_index do |img,id|
|
|
205
214
|
next unless img
|
|
206
215
|
_, img_w, img_h = image_info(File.join(@image_dir,img))
|
|
207
|
-
r << %Q[<td><img id="image-index-#{id}" class="image-img form" src="#{h @image_url}/#{h img}" alt="#{id}" width="#{h( (img_w && img_w > 160) ? 160 : (img_w ? img_w : 160) )}"></td>]
|
|
208
216
|
img_info = ''
|
|
209
217
|
if img_w && img_h
|
|
210
218
|
img_info << %Q|<span class="image-width">#{img_w}</span> x <span class="image-height">#{img_h}</span>|
|
|
211
219
|
end
|
|
212
|
-
|
|
213
|
-
<
|
|
214
|
-
</
|
|
220
|
+
r << %Q[<div class="image-item">
|
|
221
|
+
<img id="image-index-#{id}" class="image-img form"#{' data-added="true"' if @image_added&.include?( id )} src="#{h @image_url}/#{h img}" alt="#{id}" width="#{h( (img_w && img_w > 160) ? 160 : (img_w ? img_w : 160) )}">
|
|
222
|
+
<label id="image-info-#{id}"><input type="checkbox" tabindex="#{tabidx+id*2}" name="plugin_image_id" value="#{id}"> #{img_info}</label>
|
|
223
|
+
</div>]
|
|
215
224
|
end
|
|
216
|
-
|
|
217
|
-
r << tmp
|
|
218
|
-
r << %Q[</tr>
|
|
219
|
-
</table>
|
|
225
|
+
r << %Q[</div>
|
|
220
226
|
<input type="hidden" name="plugin_image_delimage" value="true">
|
|
221
227
|
<input type="hidden" name="date" value="#{date.strftime( '%Y%m%d' )}">
|
|
222
228
|
<input type="submit" tabindex="#{tabidx+97}" name="plugin" value="#{image_label_delete}">
|
data/misc/plugin/ja/makerss.rb
CHANGED
|
@@ -14,6 +14,9 @@ def makerss_conf_html
|
|
|
14
14
|
<li>フィードに本文全体を<select name="makerss.hidecontent">
|
|
15
15
|
<option value="f"#{' selected' unless @conf['makerss.hidecontent']}>含める</option>
|
|
16
16
|
<option value="t"#{' selected' if @conf['makerss.hidecontent']}>含めない</option></select></li>
|
|
17
|
+
<li>フィードの本文にサブタイトルを<select name="makerss.hidesubtitle">
|
|
18
|
+
<option value="f"#{' selected' unless @conf['makerss.hidesubtitle']}>含める</option>
|
|
19
|
+
<option value="t"#{' selected' if @conf['makerss.hidesubtitle']}>含めない</option></select></li>
|
|
17
20
|
<li>フィードに含める説明を<select name="makerss.shortdesc">
|
|
18
21
|
<option value="f"#{' selected' unless @conf['makerss.shortdesc']}>できるだけ長くする</option>
|
|
19
22
|
<option value="t"#{' selected' if @conf['makerss.shortdesc']}>最初だけにする</option></select></li>
|
data/misc/plugin/ja/preview.rb
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
@preview_label_conf = '日記のプレビュー'
|
|
2
|
-
@preview_label_interval = '更新間隔 (秒)'
|
|
3
|
-
@preview_label_interval_desc = 'プレビューを表示する間隔を秒単位で指定します。間隔を短くするとよりリアルタイムになりますが、その分サーバーに負荷がかかります。'
|
|
4
2
|
@preview_label_min_width = '横並びで表示する画面サイズ (px)'
|
|
5
3
|
@preview_label_min_width_desc = 'プレビュー画面を横並びで表示する幅をピクセル単位で指定します。ここで指定した幅より画面サイズが小さい場合は縦に並べて表示します。'
|
data/misc/plugin/makerss.rb
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
#
|
|
5
5
|
# options configurable through settings:
|
|
6
6
|
# @conf['makerss.hidecontent'] : hide full-text content. default: false
|
|
7
|
+
# @conf['makerss.hidesubtitle'] : hide subtitle in full-text content. default: false
|
|
7
8
|
# @conf['makerss.shortdesc'] : shorter description. default: false
|
|
8
9
|
# @conf['makerss.comment_link'] : insert tsukkomi's link. default: false
|
|
9
10
|
#
|
|
@@ -284,8 +285,8 @@ def makerss_update
|
|
|
284
285
|
end
|
|
285
286
|
|
|
286
287
|
rsses.each{|rss| rss.head( makerss_header( uri ) ) }
|
|
287
|
-
db.keys.map{|k|get(db, k)}.sort.each_with_index do |rdfsec, idx|
|
|
288
|
-
if rdfsec
|
|
288
|
+
db.keys.map{|k|get(db, k)}.compact.sort.each_with_index do |rdfsec, idx|
|
|
289
|
+
if rdfsec.section['visibility']
|
|
289
290
|
rsses.each {|rss|
|
|
290
291
|
rss.item( makerss_seq( uri, rdfsec ), makerss_body( uri, rdfsec ), rdfsec )
|
|
291
292
|
}
|
|
@@ -395,7 +396,7 @@ def makerss_body( uri, rdfsec )
|
|
|
395
396
|
rdf << %Q|<description>#{h makerss_desc_shorten( desc )}</description>\n|
|
|
396
397
|
unless @conf['makerss.hidecontent']
|
|
397
398
|
text = ''
|
|
398
|
-
text << '<h3>' + apply_plugin( subtitle.sub( /^(\[([^\]]+)\])+ */, '' ) ).strip + '</h3>' if subtitle and not subtitle.empty?
|
|
399
|
+
text << '<h3>' + apply_plugin( subtitle.sub( /^(\[([^\]]+)\])+ */, '' ) ).strip + '</h3>' if subtitle and not subtitle.empty? and not @conf['makerss.hidesubtitle']
|
|
399
400
|
text << body_enter
|
|
400
401
|
text << body
|
|
401
402
|
text << body_leave
|
|
@@ -451,7 +452,7 @@ add_header_proc {
|
|
|
451
452
|
|
|
452
453
|
add_conf_proc( 'makerss', @makerss_conf_label, 'update' ) do
|
|
453
454
|
if @mode == 'saveconf' then
|
|
454
|
-
%w( hidecontent shortdesc comment_link no_comments).each do |s|
|
|
455
|
+
%w( hidecontent hidesubtitle shortdesc comment_link no_comments).each do |s|
|
|
455
456
|
item = "makerss.#{s}"
|
|
456
457
|
@conf[item] = ( 't' == @cgi.params[item][0] )
|
|
457
458
|
end
|
data/misc/plugin/my-sequel.rb
CHANGED
data/misc/plugin/preview.rb
CHANGED
|
@@ -6,27 +6,19 @@
|
|
|
6
6
|
# Distributed under the GPL2 or any later version.
|
|
7
7
|
#
|
|
8
8
|
|
|
9
|
-
@conf['preview.interval'] ||= 10
|
|
10
9
|
@conf['preview.min_width'] ||= 896
|
|
11
10
|
|
|
12
11
|
if /\A(form|edit|preview)\z/ === @mode then
|
|
13
12
|
enable_js('preview.js')
|
|
14
13
|
add_js_setting('$tDiary.plugin.preview')
|
|
15
|
-
add_js_setting('$tDiary.plugin.preview.interval', @conf['preview.interval'].to_json)
|
|
16
14
|
add_js_setting('$tDiary.plugin.preview.minWidth', @conf['preview.min_width'].to_json)
|
|
17
15
|
end
|
|
18
16
|
|
|
19
17
|
add_conf_proc('preview', @preview_label_conf, 'update') do
|
|
20
18
|
if @mode == 'saveconf'
|
|
21
|
-
@conf['preview.interval'] = @cgi.params['preview.interval'][0].to_i
|
|
22
19
|
@conf['preview.min_width'] = @cgi.params['preview.min_width'][0].to_i
|
|
23
20
|
end
|
|
24
21
|
ERB.new(%q{
|
|
25
|
-
<h3><%= @preview_label_interval %></h3>
|
|
26
|
-
<div>
|
|
27
|
-
<p><%= @preview_label_interval_desc %></p>
|
|
28
|
-
<p><input name="preview.interval" value="<%=h @conf['preview.interval'] %>"> sec</p>
|
|
29
|
-
</div>
|
|
30
22
|
<h3><%= @preview_label_min_width %></h3>
|
|
31
23
|
<div>
|
|
32
24
|
<p><%= @preview_label_min_width_desc %></p>
|
data/theme/base.css
CHANGED
|
@@ -136,6 +136,18 @@ img.right, img.amazon {
|
|
|
136
136
|
margin-top: 0px;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
+
div#image-table {
|
|
140
|
+
display: grid;
|
|
141
|
+
grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
|
|
142
|
+
align-items: end;
|
|
143
|
+
gap: 0.5em;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
div#image-table img {
|
|
147
|
+
display: block;
|
|
148
|
+
max-width: 100%;
|
|
149
|
+
}
|
|
150
|
+
|
|
139
151
|
/*
|
|
140
152
|
calendar3 plugin
|
|
141
153
|
*/
|
|
@@ -273,6 +285,10 @@ draft plugin
|
|
|
273
285
|
div.draft select {
|
|
274
286
|
width: 60%;
|
|
275
287
|
}
|
|
288
|
+
p.draft-notice {
|
|
289
|
+
border: solid 1px #999;
|
|
290
|
+
padding: 4px 8px;
|
|
291
|
+
}
|
|
276
292
|
|
|
277
293
|
/*
|
|
278
294
|
* youtube plugin
|
|
@@ -284,16 +300,30 @@ div.youtube-player-wrapper {
|
|
|
284
300
|
}
|
|
285
301
|
|
|
286
302
|
/*
|
|
287
|
-
* editor textarea
|
|
303
|
+
* editor textarea
|
|
288
304
|
*
|
|
289
305
|
* The inline margins are zeroed on purpose: themes indent textareas
|
|
290
306
|
* (tdiary2 uses margin-left: 3em), which would push the editor out of
|
|
291
307
|
* line with the fields above it.
|
|
308
|
+
* The font likewise overrides theme textarea fonts on purpose.
|
|
292
309
|
*/
|
|
293
310
|
textarea#body {
|
|
294
311
|
box-sizing: border-box;
|
|
295
312
|
width: 100%;
|
|
296
313
|
margin-inline: 0;
|
|
297
|
-
height: clamp(10rem, 33dvh, 33rem);
|
|
314
|
+
--editor-height: clamp(10rem, 33dvh, 33rem);
|
|
315
|
+
height: var(--editor-height);
|
|
298
316
|
resize: vertical;
|
|
317
|
+
font-family: inherit;
|
|
318
|
+
font-size: max(16px, 1rem);
|
|
319
|
+
line-height: 1.6;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
@supports (field-sizing: content) {
|
|
323
|
+
textarea#body {
|
|
324
|
+
field-sizing: content;
|
|
325
|
+
height: auto;
|
|
326
|
+
min-height: var(--editor-height);
|
|
327
|
+
max-height: 75dvh;
|
|
328
|
+
}
|
|
299
329
|
}
|
data/theme/conf.css
CHANGED
|
@@ -5,11 +5,17 @@ Copyright (C) 2005 TADA Tadashi <sho@spc.gr.jp>
|
|
|
5
5
|
You can redistribute it and/or modify it under GPL2 or any later version.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
html {
|
|
9
|
+
-webkit-text-size-adjust: 100%;
|
|
10
|
+
text-size-adjust: 100%;
|
|
11
|
+
}
|
|
12
|
+
|
|
8
13
|
body {
|
|
9
14
|
background-color: #fff;
|
|
10
15
|
color: #000;
|
|
11
16
|
margin: 0px;
|
|
12
17
|
padding: 0px;
|
|
18
|
+
overflow-wrap: anywhere;
|
|
13
19
|
}
|
|
14
20
|
|
|
15
21
|
h1 {
|
|
@@ -138,6 +144,7 @@ form.conf p {
|
|
|
138
144
|
form.conf pre {
|
|
139
145
|
line-height: 150%;
|
|
140
146
|
margin: 0px 1em 0.7em 3em;
|
|
147
|
+
overflow-x: auto;
|
|
141
148
|
}
|
|
142
149
|
|
|
143
150
|
form.conf ul {
|
|
@@ -156,6 +163,13 @@ form.conf dd {
|
|
|
156
163
|
margin-bottom: 1em;
|
|
157
164
|
}
|
|
158
165
|
|
|
166
|
+
form.conf input,
|
|
167
|
+
form.conf select,
|
|
168
|
+
form.conf textarea {
|
|
169
|
+
box-sizing: border-box;
|
|
170
|
+
max-width: 100%;
|
|
171
|
+
}
|
|
172
|
+
|
|
159
173
|
p.message {
|
|
160
174
|
text-align: center;
|
|
161
175
|
font-size: large;
|
|
@@ -252,3 +266,49 @@ span.help-icon {
|
|
|
252
266
|
span.help-icon img {
|
|
253
267
|
border-width: 0px;
|
|
254
268
|
}
|
|
269
|
+
|
|
270
|
+
/*
|
|
271
|
+
design for smart phones, below the width where the form beside the menu gets narrower than on a phone
|
|
272
|
+
*/
|
|
273
|
+
@media screen and (max-width: 640px) {
|
|
274
|
+
div.adminmenu a {
|
|
275
|
+
display: inline-block;
|
|
276
|
+
padding: 0.5em 0.75em;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
div.sidebar {
|
|
280
|
+
float: none;
|
|
281
|
+
width: auto;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
div.sidebar ul {
|
|
285
|
+
display: flex;
|
|
286
|
+
flex-wrap: wrap;
|
|
287
|
+
gap: 0.2em 0.5em;
|
|
288
|
+
margin-left: 0px;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
div.sidebar li {
|
|
292
|
+
margin-bottom: 0px;
|
|
293
|
+
padding: 0px;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
div.sidebar li a {
|
|
297
|
+
display: block;
|
|
298
|
+
padding: 0.3em 0.5em;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
div.sidebar li:has(> a:empty) {
|
|
302
|
+
display: none;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
form.conf {
|
|
306
|
+
margin: 0px 16px 2em 16px;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
input,
|
|
310
|
+
select,
|
|
311
|
+
textarea {
|
|
312
|
+
font-size: 16px;
|
|
313
|
+
}
|
|
314
|
+
}
|