Sha256: efd8060623f7b3b838a8b9d84f874aafb7b215285faa1b49d1b43419b32ad5a3

Contents?: true

Size: 944 Bytes

Versions: 52

Compression:

Stored size: 944 Bytes

Contents

# popit.rb:plugin embedding POP on POPit(http://pop-it.jp)
#
# usage:
#   popit(pop_id) - pop_id: The id of the POP on POPit (e.g. 2000 http://pop-it.jp/item/amazon/1989/pop/2000 )
#
# Copyright (c) KAYA Satoshi <http://kayakaya.net/>
# You can redistributed it and/or modify if under GPL2.
#
def popit(pop_id, size = "large")
  return unless pop_id

  width_size = {"large" => "260", "small" => "180" }
  height_size = {"large" => "380", "small" => "220" }
  width_style = {"large" => "220px", "small" => "160px" }

  sizequery = size == "large" ? "?size=large" : ''
  r = ""
  r << %Q|<iframe src="http://pop-it.jp/pop/blogparts/#{pop_id}#{sizequery}" frameborder="0" width="#{width_size[size]}" height="#{height_size[size]}"> </iframe>|
  r << %Q|<div style="width:#{width_style[size]};margin:0;text-align:center;font-size:12px;">Powered by <a href="http://pop-it.jp" target="_blank" style="color: #edbe26;">POPit</a></div>|

  return r
end

Version data entries

52 entries across 46 versions & 2 rubygems

Version Path
tdiary-contrib-5.0.10 plugin/popit.rb
tdiary-contrib-5.0.9 plugin/popit.rb
tdiary-contrib-5.0.8 plugin/popit.rb
tdiary-contrib-5.0.7 plugin/popit.rb
tdiary-contrib-5.0.6 plugin/popit.rb
tdiary-contrib-5.0.5 plugin/popit.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/bundler/gems/tdiary-contrib-8299b30cbf3f/plugin/popit.rb
tdiary-5.0.5 vendor/bundle/bundler/gems/tdiary-contrib-fa9c20aa0d97/plugin/popit.rb
tdiary-5.0.5 vendor/bundle/bundler/gems/tdiary-contrib-f08988dfa0f6/plugin/popit.rb
tdiary-5.0.5 vendor/bundle/bundler/gems/tdiary-contrib-a3c5f37278c4/plugin/popit.rb
tdiary-5.0.5 vendor/bundle/bundler/gems/tdiary-contrib-8299b30cbf3f/plugin/popit.rb
tdiary-contrib-5.0.4 plugin/popit.rb
tdiary-5.0.4 vendor/bundle/bundler/gems/tdiary-contrib-8299b30cbf3f/plugin/popit.rb
tdiary-contrib-5.0.3 plugin/popit.rb
tdiary-contrib-5.0.2 plugin/popit.rb
tdiary-contrib-5.0.1 plugin/popit.rb
tdiary-contrib-5.0.0 plugin/popit.rb
tdiary-contrib-4.2.1 plugin/popit.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/bundler/gems/tdiary-contrib-2ab36447ae2a/plugin/popit.rb
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/bundler/gems/tdiary-contrib-d189eb6688f1/plugin/popit.rb