Changeset 250

Show
Ignore:
Timestamp:
09/26/06 23:56:59 (2 years ago)
Author:
ogawa
Message:

Now uses window.addEventListener or window.attachEvent.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Mapper/trunk/Mapper.pl

    r200 r250  
    1515use MT::ConfigMgr; 
    1616use base 'MT::Plugin'; 
    17 use vars qw($VERSION); 
    1817 
    1918sub BEGIN { 
    20     $VERSION = '0.11'; 
     19    our $VERSION = '0.12'; 
    2120    my $plugin = MT::Plugin::Mapper->new({ 
    2221        name => 'Mapper', 
    2322        version => $VERSION, 
    2423        description => 'This plugin enables MTMapper container tag, which converts "[map:address-description]" string into an embeded map provided by mapping services such as Google Maps.', 
    25         doc_link => 'http://as-is.net/wiki/Mapper_Plugin', 
     24        doc_link => 'http://code.as-is.net/wiki/Mapper_Plugin', 
    2625        author_name => 'Hirotaka Ogawa', 
    2726        author_link => 'http://profile.typekey.com/ogawa/', 
    2827        blog_config_template => \&blog_config_template, 
    2928        settings => new MT::PluginSettings([ 
    30                                            ['google_maps_key', { Default => '' }] 
    31                                            ]) 
    32        }); 
     29            ['google_maps_key', { Default => '' }] 
     30        ]), 
     31    }); 
    3332    MT->add_plugin($plugin); 
    3433    MT::Template::Context->add_container_tag(Mapper => sub { $plugin->mapper(@_) }); 
     
    6059<p>This plugin enables MTMapper container tag, which converts "[map:address-description]" string into an embeded map provided by mapping services such as Google Maps.</p> 
    6160 
    62 <p>For more details, see <a href="http://as-is.net/blog/archives/001108.html">"MTMapper Plugin - Ogawa::Memoranda"</a>.</p> 
     61<p>For more details, see <a href="http://code.as-is.net/wiki/Mapper_Plugin">"Mapper Plugin"</a>.</p> 
    6362 
    6463<div class="setting"> 
     
    135134//<![CDATA[ 
    136135function attachOnLoad(func) { 
    137     var old = window.onload; 
    138     window.onload = (typeof old != 'function') ? 
    139         func : function(e) { old(e); return func(e); }; 
     136    if (window.addEventListener) 
     137        window.addEventListener('load',func,false); 
     138    else if (window.attachEvent) 
     139        window.attachEvent('onload',func); 
    140140} 
    141141function generateGMap(mapid, address, lat, lng, zoom, maptype) { 
     
    194194                 address => $adr, 
    195195                 maptype => $this->{maptype} || 'G_NORMAL_MAP', 
    196                  zoom => (defined $this->{zoom}) ? $this->{zoom} : 13 
     196                 zoom => (defined $this->{zoom}) ? $this->{zoom} : 15 
    197197                 ); 
    198198    $tmpl->output;