From a592e04f5f20220f50b11e49cf985deccbd9bc67 Mon Sep 17 00:00:00 2001 From: following Date: Tue, 12 Mar 2013 01:03:28 +0100 Subject: [PATCH] map: improved waypoint popup windows --- htdocs/editcache.php | 1 + htdocs/lang/de/ocstyle/editcache.inc.php | 2 +- htdocs/map2.php | 2 +- htdocs/resource2/ocstyle/css/style_screen.css | 8 ++++-- htdocs/templates2/ocstyle/map2.tpl | 26 ++++++++----------- 5 files changed, 20 insertions(+), 19 deletions(-) diff --git a/htdocs/editcache.php b/htdocs/editcache.php index 5dbb462e..1da3bf7f 100644 --- a/htdocs/editcache.php +++ b/htdocs/editcache.php @@ -46,6 +46,7 @@ function getWaypoints($cacheid) $htmlcoordinate = $formatter->formatHtml($waypoint['coordinate'], ''); $tmpline = mb_ereg_replace('{wp_coordinate}', $htmlcoordinate, $tmpline); $tmpline = mb_ereg_replace('{wp_description}', htmlspecialchars($waypoint['description'], ENT_COMPAT, 'UTF-8'), $tmpline); + $tmpline = mb_ereg_replace('{wp_show_description}', mb_ereg_replace('\r\n','
',htmlspecialchars($waypoint['description'], ENT_COMPAT, 'UTF-8')), $tmpline); $tmpline = mb_ereg_replace('{cacheid}', htmlspecialchars($cacheid, ENT_COMPAT, 'UTF-8'), $tmpline); $tmpline = mb_ereg_replace('{childid}', htmlspecialchars($waypoint['childid'], ENT_COMPAT, 'UTF-8'), $tmpline); diff --git a/htdocs/lang/de/ocstyle/editcache.inc.php b/htdocs/lang/de/ocstyle/editcache.inc.php index df1d3a58..7e81261a 100644 --- a/htdocs/lang/de/ocstyle/editcache.inc.php +++ b/htdocs/lang/de/ocstyle/editcache.inc.php @@ -36,7 +36,7 @@ $picturelines = '{lines} '; $nowaypoints = '' . t('No waypoints available') . ''; - $waypointline = '
{wp_type}
{wp_coordinate}
{wp_description}[' . t('Edit') . '] [' . t('Delete') . ']'; + $waypointline = '
{wp_type}
{wp_coordinate}
{wp_show_description}[' . t('Edit') . '] [' . t('Delete') . ']'; $waypointlines = '{lines}
 '; $cache_attrib_js = "new Array({id}, {selected}, '{img_undef}', '{img_large}')"; diff --git a/htdocs/map2.php b/htdocs/map2.php index abaf53d5..70eba51a 100644 --- a/htdocs/map2.php +++ b/htdocs/map2.php @@ -366,7 +366,7 @@ function output_cachexml($sWaypoint) echo 'imagewidth="38" imageheight="38" '; echo 'latitude="' . xmlentities($waypoint['latitude']) . '" '; echo 'longitude="' . xmlentities($waypoint['longitude']) . '" '; - echo 'description="' . xmlentities($waypoint['description']) . '" />\n'; + echo 'description="' . xmlentities(mb_ereg_replace('\r\n','
',$waypoint['description'])) . '" />\n'; } echo ' \n'; diff --git a/htdocs/resource2/ocstyle/css/style_screen.css b/htdocs/resource2/ocstyle/css/style_screen.css index a7ab0712..39d03337 100644 --- a/htdocs/resource2/ocstyle/css/style_screen.css +++ b/htdocs/resource2/ocstyle/css/style_screen.css @@ -1191,12 +1191,16 @@ td.mapheader_spacer { div.mappopup { overflow:hidden; /* avoids double-scrollbars in MSIE; 'visible' wont work */ - } +} table.mappopup td { font-size: 11px; white-space: nowrap; - } +} + +td.wppopupheader { + font-size:1.15em; +} .mapboxframe { border:1px solid #777777; diff --git a/htdocs/templates2/ocstyle/map2.tpl b/htdocs/templates2/ocstyle/map2.tpl index a76cc5fb..e02cafcc 100644 --- a/htdocs/templates2/ocstyle/map2.tpl +++ b/htdocs/templates2/ocstyle/map2.tpl @@ -884,7 +884,7 @@ function adjust_infowindow() // alert("Before: " + iw_frame.style.width + " / " + iw_frame.style.height); iw_frame.style.width = String(iw_width + 2) + "px"; // making it too wide would let additional wp text flow into the margin at MSIE - iw_frame.style.height = String(iw_height + 25) + "px"; + iw_frame.style.height = String(iw_height + 10) + "px"; // alert("After: " + iw_frame.style.width + " / " + iw_frame.style.height); } else @@ -990,26 +990,22 @@ function init_waypoint_markers(aWaypoints) var typename = maWpWaypoints[nearestwp].getAttribute('typename'); var description = maWpWaypoints[nearestwp].getAttribute('description'); - {/literal} - var typetext; - if (wptype+0 == 0 && {if $help_note != ""}1{else}0{/if}) - typetext = "{$help_note}"; - else if ({if $help_wps != ""}1{else}0{/if}) - typetext = "{$help_wps}"; - if (typetext != "") - typetext += typename + ""; + var maxwidth; + if (description.length < 512) + maxwidth = "320px"; else - typetext += typename; + maxwidth = "480px"; - var text = // MSIE needs max width to wrap long descriptions - "
" + + {/literal} + var text = + "
" + ""; if (description != "") - text += ""; + text += ""; text += "
" + - "" + - "" + + "" + + "" + "
" + "" + typetext + " {t}for{/t}" + " " + msPopupMarkerWP + "" + typename + " {t}for{/t}" + " " + msPopupMarkerWP + "
" + description + "
" + description + "
"; {literal}