root/platform/tdiary/plugin/everytrail.rb

Revision 20669, 0.6 kB (checked in by sho, 2 months ago)

platform/tdiary/plugin/everytrail.rb: fixed sizing bug.

Line 
1#
2# everytrail.rb: plugin embedding trip map on everytrail.com.
3#
4# Copyright (C) 2008 TADA Tadashi <sho@spc.gr.jp>
5# You can redistribute it and/or modify it under GPL2.
6#
7
8def everytrail( trip_id, label = nil, size = [400,300] )
9        size.collect! {|i| i.to_i }
10        size[0] = 400 if size[0] == 0
11        size[1] = 300 if size[1] == 0
12        l = label ? %Q|<a href="http://www.everytrail.com/view_trip.php?trip_id=#{h trip_id}">#{h label}</a>| : ''
13        %Q|<iframe src="http://www.everytrail.com/iframe2.php?trip_id=#{h trip_id}&width=#{size[0]}&height=#{size[1]}" marginheight=0 marginwidth=0 frameborder=0 scrolling=no width=#{size[0]} height=#{size[1]}>#{l}</iframe>|
14end
Note: See TracBrowser for help on using the browser.