[pLog-svn] r5738 - in plog/trunk: class/template/smarty/plugins styles templates/admin templates/admin/chooser
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Fri Jul 27 15:55:46 EDT 2007
Author: oscar
Date: 2007-07-27 15:55:46 -0400 (Fri, 27 Jul 2007)
New Revision: 5738
Modified:
plog/trunk/class/template/smarty/plugins/function.location_chooser.php
plog/trunk/styles/admin.css
plog/trunk/templates/admin/chooser/location.template
plog/trunk/templates/admin/jslocale.template
plog/trunk/templates/admin/newpost.template
Log:
Google Maps integration working again and using our new overlay windows rather than an old style window.open()
Modified: plog/trunk/class/template/smarty/plugins/function.location_chooser.php
===================================================================
--- plog/trunk/class/template/smarty/plugins/function.location_chooser.php 2007-07-27 19:54:50 UTC (rev 5737)
+++ plog/trunk/class/template/smarty/plugins/function.location_chooser.php 2007-07-27 19:55:46 UTC (rev 5738)
@@ -34,7 +34,7 @@
// whether to use the location display icon next to the drop-down list
isset( $params["showDisplayLink"]) ? $showDisplayLink = true : $showDisplayLink = false;
- $code = "<select name=\"locationId\" id=\"locationId\" onChange=\"if(this.options[this.selectedIndex].value == -1) window.open('?op=locationChooser','LocationChooser','scrollbars=no,resizable=no,toolbar=no,height=530,width=590');\">";
+ $code = "<select name=\"locationId\" id=\"locationId\" onChange=\"Lifetype.UI.Location.Selector.onChangeHandler(this);\">";
$code .= "<option value=\"0\"";
$code .= ">None</option>";
foreach( $locs as $loc ) {
@@ -56,18 +56,7 @@
$code .= " </select>";
if( $showDisplayLink ) {
- $code .= "<script type=\"text/javascript\">
- function displaySelectedLocation() {
- list = document.getElementById('locationId');
- if( list.options[list.selectedIndex].value == 0 )
- return false;
- locId = list.options[list.selectedIndex].value;
- url = '?op=adminLocationDisplay&locId=' + locId;
- window.open(url,'LocationViewer','scrollbars=no,resizable=no,toolbar=no,height=500,width=590');
- }
- </script>
- ";
- $code .= " <a href=\"#\" onClick=\"displaySelectedLocation();return false;\"><img src=\"imgs/admin/icon_globe-16.png\" alt=\"Location Display\" style=\"border:0px\" /></a>";
+ $code .= " <a href=\"#\" onClick=\"return(Lifetype.UI.Location.Selector.displaySelected(this))\"><img src=\"imgs/admin/icon_globe-16.png\" alt=\"Location Display\" style=\"border:0px\" /></a>";
}
$code .= "<input type=\"hidden\" name=\"locationDesc\" id=\"locationDesc\" value=\"\" />
Modified: plog/trunk/styles/admin.css
===================================================================
--- plog/trunk/styles/admin.css 2007-07-27 19:54:50 UTC (rev 5737)
+++ plog/trunk/styles/admin.css 2007-07-27 19:55:46 UTC (rev 5738)
@@ -1093,4 +1093,20 @@
align:center;
border: 1px solid #dfdfdf;
width:120px;
-}*/
\ No newline at end of file
+}*/
+
+/**
+ * Map selector
+ */
+#mapChooserBody {
+ padding: 0px;
+ margin: 0px;
+}
+
+#map {
+ width: 651px;
+ height: 500px;
+ margin:0;
+ margin-bottom:5px;
+ padding:0;
+}
\ No newline at end of file
Modified: plog/trunk/templates/admin/chooser/location.template
===================================================================
--- plog/trunk/templates/admin/chooser/location.template 2007-07-27 19:54:50 UTC (rev 5737)
+++ plog/trunk/templates/admin/chooser/location.template 2007-07-27 19:55:46 UTC (rev 5738)
@@ -1,27 +1,7 @@
-{include file="$admintemplatepath/chooser/header.template"}
- <script src="http://maps.google.com/maps?file=api&v=2&key={$google_maps_api_key}" type="text/javascript"></script>
- <script type="text/javascript" src="js/location/location.js"></script>
-
- <script type="text/javascript">
-
- // create the global object
- l = new Lifetype.UI.Location();
-
- // localized messages
- l.locationLocaleNoMarkerHasBeenSetYet = "{$locale->tr("error_no_marker_set")}";
- l.locationLocaleNoDescriptionError = "{$locale->tr("error_no_description_set")}";
-
- YAHOO.util.Event.addListener( window, "load", function() {literal}{{/literal}
- l.init( '{$mode}' );
-
-{if $loc} l.displayLocation({literal}{{/literal}latlong:'{$loc->getLatitude()},{$loc->getLongitude()}',desc:'{$loc->getDescription()|escape:"javascript"}',id:'{$loc->getId()}'{literal}}{/literal});
-{/if}
- {literal}}{/literal});
-
- YAHOO.util.Event.addListener( window, "unload", GUnload());
- </script>
- <body style="padding:0;margin:0">
- <div id="map" style="width: 590px; height: 500px;margin:0;margin-bottom:5px;padding:0;"></div>
+<script src="http://maps.google.com/maps?file=api&v=2&key={$google_maps_api_key}" type="text/javascript"></script>
+<script type="text/javascript" src="js/location/location.js"></script>
+<div id="mapChooserBody">
+ <div id="map"></div>
{if $mode==1}
<div id="data" style="width:100%;padding-left:10px">
<input type="button" onClick="l.AddLocation()" id="addLocationButton" value="{$locale->tr("add_location")}" />
@@ -29,4 +9,11 @@
{/if}
<input type="hidden" name="lat" value="" id="lat" />
<input type="hidden" name="long" value="" id="long" />
-{include file="$admintemplatepath/chooser/footer.template"}
\ No newline at end of file
+<script type="text/javascript">
+// create the global object
+l = new Lifetype.UI.Location();
+
+l.init('{$mode}');
+{if $loc} l.displayLocation({literal}{{/literal}latlong:'{$loc->getLatitude()},{$loc->getLongitude()}',desc:'{$loc->getDescription()|escape:"javascript"}',id:'{$loc->getId()}'{literal}}{/literal});
+{/if}
+</script>
\ No newline at end of file
Modified: plog/trunk/templates/admin/jslocale.template
===================================================================
--- plog/trunk/templates/admin/jslocale.template 2007-07-27 19:54:50 UTC (rev 5737)
+++ plog/trunk/templates/admin/jslocale.template 2007-07-27 19:55:46 UTC (rev 5738)
@@ -25,4 +25,10 @@
Lifetype.Locale.add( 'saving_message', "{$locale->tr("saving_message")}");
Lifetype.Locale.add( 'warning_autosave_message', '{$locale->tr("warning_autosave_message")|escape:javascript}' );
+// location chooser
+// localized messages
+Lifetype.Locale.add( 'error_no_marker_set', "{$locale->tr("error_no_marker_set")}" );
+Lifetype.Locale.add( 'error_no_description_set', "{$locale->tr("error_no_description_set")}" );
+Lifetype.Locale.add( 'enter_location_name', "{$locale->tr("enter_location_name")}" );
+
</script>
\ No newline at end of file
Modified: plog/trunk/templates/admin/newpost.template
===================================================================
--- plog/trunk/templates/admin/newpost.template 2007-07-27 19:54:50 UTC (rev 5737)
+++ plog/trunk/templates/admin/newpost.template 2007-07-27 19:55:46 UTC (rev 5738)
@@ -1,5 +1,7 @@
{include file="$admintemplatepath/header.template"}
{js src="js/ui/pages/posts.js"}
+<script src="http://maps.google.com/maps?file=api&v=2&key={$google_maps_api_key}" type="text/javascript"></script>
+<script type="text/javascript" src="js/location/location.js"></script>
{include file="$admintemplatepath/navigation.template" showOpt=newPost title=$locale->tr("newPost")}
{assign var=htmlarea value=$blogsettings->getValue("htmlarea_enabled")}
<link rel="stylesheet" type="text/css" media="all" href="js/jscalendar/calendar-win2k-cold-1.css" title="win2k-cold-1" />
More information about the pLog-svn
mailing list