~ubuntu-branches/ubuntu/utopic/gramps/utopic

« back to all changes in this revision

Viewing changes to src/plugins/lib/libhtmlconst.py

  • Committer: Package Import Robot
  • Author(s): James A. Treacy
  • Date: 2012-05-22 17:18:36 UTC
  • mfrom: (39.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20120522171836-35fi62lp4w7jnrd7
Tags: 3.4.0-1
* New upstream version
* Updated desktop file. Closes: #667472

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
#!/usr/bin/python
1
3
#
2
4
# Gramps - a GTK+/GNOME based genealogy program
3
5
#
7
9
# Copyright (C) 2007-2009  Stephane Charette <stephanecharette@gmail.com>
8
10
# Copyright (C) 2008       Brian G. Matherly
9
11
# Copyright (C) 2008       Jason M. Simanek <jason@bohemianalps.com>
10
 
# Copyright (C) 2008-2009  Rob G. Healey <robhealey1@gmail.com> 
 
12
# Copyright (C) 2008-2011  Rob G. Healey <robhealey1@gmail.com>
11
13
#
12
14
# This program is free software; you can redistribute it and/or modify
13
15
# it under the terms of the GNU General Public License as published by
24
26
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
25
27
#
26
28
 
27
 
# $Id: libhtmlconst.py 17994 2011-08-06 17:09:09Z robhealey1 $
 
29
# $Id: libhtmlconst.py 18645 2011-12-21 00:44:16Z robhealey1 $
28
30
 
29
31
"""
30
32
General constants used in different html enabled plugins
116
118
 
117
119
        _('No copyright notice'),
118
120
        ]
119
 
 
120
 
# NarrativeWeb javascript code for PlacePage's "Google Maps"...
121
 
google_jsc = """
122
 
var myLatlng = new google.maps.LatLng(%s, %s);
123
 
 
124
 
function initialize() {
125
 
    var mapOptions = {
126
 
        zoom: 13,
127
 
        mapTypeId: google.maps.MapTypeId.ROADMAP,
128
 
        center: myLatlng
129
 
    };
130
 
    var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
131
 
          
132
 
    var marker = new google.maps.Marker({
133
 
        map:       map,
134
 
        draggable: true,
135
 
        animation: google.maps.Animation.DROP,
136
 
        position:  myLatlng
137
 
    });
138
 
    google.maps.event.addListener(marker, 'click', toggleBounce);
139
 
}
140
 
 
141
 
function toggleBounce() {
142
 
    if (marker.getAnimation() != null) {
143
 
        marker.setAnimation(null);
144
 
    } else {
145
 
        marker.setAnimation(google.maps.Animation.BOUNCE);
146
 
    }
147
 
}"""
148
 
 
149
 
# NarrativeWeb javascript code for PlacePage's "Open Street Map"...
150
 
openstreet_jsc = """
151
 
    OpenLayers.Lang.setCode("%s");
152
 
 
153
 
    map = new OpenLayers.Map("map_canvas");
154
 
    var osm = new OpenLayers.Layer.OSM()
155
 
    map.addLayer(osm);
156
 
 
157
 
    var lonLat = new OpenLayers.LonLat(%s, %s)
158
 
        .transform(
159
 
            new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984
160
 
            map.getProjectionObject() // to Spherical Mercator Projection
161
 
        );
162
 
    var zoom =16;
163
 
    map.setCenter(lonLat, zoom);
164
 
 
165
 
    var markers = new OpenLayers.Layer.Markers("Markers");
166
 
    markers.addMarker(new OpenLayers.Marker(lonLat));
167
 
    map.addLayer(markers);
168
 
 
169
 
    // add overview control
170
 
    map.addControl(new OpenLayers.Control.OverviewMap());
171
 
 
172
 
    // add a layer switcher
173
 
    map.addControl(new OpenLayers.Control.LayerSwitcher());"""