Feature request#5026 -- fixed mistakes added in last commit.
svn: r17926
This commit is contained in:
parent
e2b4233aec
commit
473c809e39
@ -591,11 +591,10 @@ class EditExifMetadata(Gramplet):
|
|||||||
"""
|
"""
|
||||||
Return True if the gramplet has data, else return False.
|
Return True if the gramplet has data, else return False.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if media is None:
|
if media is None:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
full_path = Utils.media_path_full(self.dbstate.db, media.get_path() )
|
full_path = Utils.media_path_full(self.dbstate.db, media.get_path())
|
||||||
return self.view.get_has_data(full_path)
|
return self.view.get_has_data(full_path)
|
||||||
|
|
||||||
def __create_button(self, pos, text, callback =[], icon =False, sensitive =False):
|
def __create_button(self, pos, text, callback =[], icon =False, sensitive =False):
|
||||||
|
@ -1134,6 +1134,8 @@ class BasePage(object):
|
|||||||
const.PROGRAM_NAME, const.VERSION, const.URL_HOMEPAGE
|
const.PROGRAM_NAME, const.VERSION, const.URL_HOMEPAGE
|
||||||
)
|
)
|
||||||
_META2 = 'name="author" content="%s"' % self.author
|
_META2 = 'name="author" content="%s"' % self.author
|
||||||
|
_META3 = 'name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" '
|
||||||
|
_META4 = 'http-equiv="content-type" content="text/html; charsetset=%s" ' % xmllang
|
||||||
|
|
||||||
page, head, body = Html.page('%s - %s' %
|
page, head, body = Html.page('%s - %s' %
|
||||||
(html_escape(self.title_str),
|
(html_escape(self.title_str),
|
||||||
@ -1145,8 +1147,10 @@ class BasePage(object):
|
|||||||
del page[0]
|
del page[0]
|
||||||
|
|
||||||
# create additional meta tags
|
# create additional meta tags
|
||||||
meta = (Html("meta", attr = _META1) +
|
meta = Html("meta", attr = _META1) + (
|
||||||
Html("meta", attr = _META2, indent = False)
|
Html("meta", attr = _META2, indent = False),
|
||||||
|
Html("meta", attr = _META3, indent =False),
|
||||||
|
Html("meta", attr = _META4, indent =False)
|
||||||
)
|
)
|
||||||
|
|
||||||
# Link to _NARRATIVESCREEN stylesheet
|
# Link to _NARRATIVESCREEN stylesheet
|
||||||
@ -2593,13 +2597,8 @@ class PlacePage(BasePage):
|
|||||||
|
|
||||||
# add googlev3 specific javascript code
|
# add googlev3 specific javascript code
|
||||||
if self.googlemap:
|
if self.googlemap:
|
||||||
head += Html("script", type = "text/javascript",
|
head += Html("script", type ="text/javascript",
|
||||||
src = "http://maps.google.com/maps/api/js?sensor=false", inline = True)
|
src ="http://maps.googleapis.com/maps/api/js?sensor=false", inline =True)
|
||||||
|
|
||||||
# add mapstraction javascript code
|
|
||||||
fname = "/".join(["mapstraction", "mxn.js?(googlev3)"])
|
|
||||||
url = self.report.build_url_fname(fname, None, self.up)
|
|
||||||
head += Html("script", type = "text/javascript", src = url, inline = True)
|
|
||||||
|
|
||||||
# Place Map division
|
# Place Map division
|
||||||
with Html("div", id = "mapstraction") as mapstraction:
|
with Html("div", id = "mapstraction") as mapstraction:
|
||||||
@ -2617,54 +2616,35 @@ class PlacePage(BasePage):
|
|||||||
latitude, longitude)
|
latitude, longitude)
|
||||||
middle += Html("iframe", src = url, inline = True)
|
middle += Html("iframe", src = url, inline = True)
|
||||||
|
|
||||||
if self.wikimapia:
|
elif self.wikimapia:
|
||||||
url = 'http://wikimapia.org/#lat=%s&lon=%s&z=11&l=0&m=a&v=2' % (
|
url = 'http://wikimapia.org/#lat=%s&lon=%s&z=11&l=0&m=a&v=2' % (
|
||||||
latitude, longitude)
|
latitude, longitude)
|
||||||
middle += Html("iframe", src = url, inline = True)
|
middle += Html("iframe", src = url, inline = True)
|
||||||
|
|
||||||
if self.googlemap:
|
else:
|
||||||
# begin inline javascript code
|
# begin inline javascript code
|
||||||
# because jsc is a string, it does NOT have to properly indented
|
# because jsc is a string, it does NOT have to be properly indented
|
||||||
with Html("script", type = "text/javascript") as jsc:
|
with Html("script", type = "text/javascript") as jsc:
|
||||||
middle += jsc
|
head += jsc
|
||||||
|
|
||||||
jsc += """
|
jsc += """
|
||||||
var map;
|
function initialize() {
|
||||||
var home = new mxn.LatLonPoint(%s, %s);""" % (latitude, longitude)
|
var myLatlng = new google.maps.LatLng(%s, %s);""" % (
|
||||||
|
latitude, longitude)
|
||||||
|
|
||||||
jsc += """
|
jsc += """
|
||||||
function initialize() {
|
var myOptions = {
|
||||||
|
zoom: 8,
|
||||||
// create mxn object
|
center: myLatlng,
|
||||||
map = new mxn.Mapstraction('googlev3','googlev3');
|
mapTypeId: google.maps.MapTypeId.ROADMAP
|
||||||
|
}
|
||||||
// add map controls to image
|
var map = new google.maps.Map(document.getElementById("middle"), myOptions);
|
||||||
map.addControls({
|
}"""
|
||||||
pan: true,
|
|
||||||
zoom: 'large',
|
|
||||||
scale: true,
|
|
||||||
keyboardShortcuts: true,
|
|
||||||
map_type: true
|
|
||||||
});
|
|
||||||
|
|
||||||
// put map on page
|
|
||||||
map.setCenterAndZoom(home, 12);
|
|
||||||
|
|
||||||
// set marker at latitude/ longitude
|
|
||||||
var marker = new mxn.Marker(home);
|
|
||||||
|
|
||||||
// add marker InfoBubble() place name
|
|
||||||
hrp-infoInfoBubble('%s'); """ % self.page_title
|
|
||||||
|
|
||||||
jsc += """
|
|
||||||
// add marker to map
|
|
||||||
map.addMarker(marker, true);
|
|
||||||
}"""
|
|
||||||
# there is no need to add an ending "</script>",
|
# there is no need to add an ending "</script>",
|
||||||
# as it will be added automatically!
|
# as it will be added automatically!
|
||||||
|
|
||||||
# googlev3 division
|
# add map_canvas division...
|
||||||
middle += Html("div", id = "googlev3", inline = True)
|
middle += Html('div', id ='map_canvas')
|
||||||
|
|
||||||
# add fullclear for proper styling
|
# add fullclear for proper styling
|
||||||
middle += fullclear
|
middle += fullclear
|
||||||
|
Loading…
x
Reference in New Issue
Block a user