Changeset 7699
- Timestamp:
- 07/05/09 04:13:45 (8 months ago)
- Location:
- branches/1.8/plugins/GoogleMap
- Files:
-
- 3 added
- 1 removed
- 4 modified
- 1 moved
-
common.css (modified) (1 diff)
-
images/gmap_toolbar.gif (deleted)
-
images/icon_loading.gif (added)
-
images/toolbox-location.png (added)
-
images/toolbox-map.png (added)
-
index.php (modified) (4 diffs)
-
index.xml (modified) (1 diff)
-
popup.css (moved) (moved from branches/1.8/plugins/GoogleMap/insert.css) (4 diffs)
-
scripts/editor.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.8/plugins/GoogleMap/common.css
r6953 r7699 28 28 color: #999; 29 29 } 30 31 dl#toolbox-googlemap { 32 display: inline-block; 33 height: 22px; 34 } 35 36 dl#toolbox-googlemap dd.command-box { 37 float: left; 38 margin: 0; 39 padding: 0; 40 border-top: 1px solid #bbb; 41 border-bottom: 1px solid #bbb; 42 background: -webkit-gradient(linear, left 10, left bottom, from(#fff), to(#eee)); 43 } 44 dl#toolbox-googlemap dd.command-box:hover { 45 background: -webkit-gradient(linear, left 10, left bottom, from(#f2f2f2), to(#ddd)); 46 } 47 dl#toolbox-googlemap dd.command-box:active { 48 background: -webkit-gradient(linear, left 10, left bottom, to(#f2f2f2), from(#ddd)); 49 } 50 51 dl#toolbox-googlemap dd.command-box a.button { 52 display: block; 53 border-right: 1px solid #bbb; 54 padding: 0 6px 0 24px; 55 line-height: 22px; 56 background: transparent; 57 background-repeat: no-repeat !important; 58 background-position: 3px center !important; 59 color: black; 60 text-decoration: none; 61 } 62 63 dl#toolbox-googlemap dd.command-box:first-child a.button { 64 border-left: 1px solid #bbb; 65 } 66 67 dl#toolbox-googlemap dd.command-box a.button:hover { 68 text-decoration: none; 69 } 70 71 dl#toolbox-googlemap dd.command-box #gmap-insertMap { 72 background-image: url(./images/toolbox-map.png); 73 } 74 75 dl#toolbox-googlemap dd.command-box #gmap-getLocation { 76 background-image: url(./images/toolbox-location.png); 77 } -
branches/1.8/plugins/GoogleMap/index.php
r7617 r7699 43 43 function GoogleMap_AddToolbox($target) { 44 44 global $pluginURL; 45 $target .= "<img src=\"$pluginURL/images/gmap_toolbar.gif\" border=\"0\" alt=\"구글맵 추가하기\" onclick=\"GMapTool_Insert();\" style=\"cursor:pointer\" />\n"; 45 $target .= "<dl id=\"toolbox-googlemap\">"; 46 $target .= "<dd class=\"command-box\"><a class=\"button\" id=\"gmap-insertMap\" href=\"#insertGoogleMap\" onclick=\"GMapTool_insertMap(); return false;\">구글맵 추가하기</a></dd>"; 47 $target .= "<dd class=\"command-box\"><a class=\"button\" href=\"#getLocation\" id=\"gmap-getLocation\" onclick=\"GMapTool_getLocation(); return false;\">현재 위치 알아내기</a></dd>"; 48 $target .= "</dl>"; 46 49 return $target; 47 50 } … … 269 272 } 270 273 271 function GoogleMapUI_Insert () {274 function GoogleMapUI_InsertMap() { 272 275 global $configVal, $pluginURL; 273 276 requireComponent('Textcube.Function.Misc'); … … 319 322 } 320 323 324 function GoogleMapUI_GetLocation() { 325 global $configVal, $pluginURL; 326 requireComponent('Textcube.Function.Misc'); 327 $config = Setting::fetchConfigVal($configVal); 328 $lat = $config['latitude']; 329 $lng = $config['longitude']; 330 $default_type = 'G_HYBRID_MAP'; 331 $default_width = 500; 332 $default_height = 400; 333 $zoom = 10; 334 _GMap_printHeaderForUI('현재 위치 알아내기', $config['apiKey']); 335 ?> 336 <h2>이용 안내</h2> 337 <p>웹브라우저가 제공하는 Geolocation 서비스를 이용하여 현재 위치 정보를 가져옵니다. 정확도는 사용하고 계신 기기나 지역에 따라 다를 수 있습니다. <a href="#help">(자세히 알아보기)</a></p> 338 <p><span id="availability"></span><span id="status"></span></p> 339 <h2>미리보기</h2> 340 <div style="text-align:center;"> 341 <div id="GoogleMapPreview" style="width:<?php echo $default_width;?>px; height:<?php echo $default_height;?>px; margin:0 auto;"></div> 342 </div> 343 <script type="text/javascript"> 344 //<![CDATA[ 345 function initializeMap() { 346 map = new GMap2($('#GoogleMapPreview')[0]); 347 map.addMapType(G_PHYSICAL_MAP); 348 map.setMapType(<?php echo $default_type;?>); 349 map.addControl(new GHierarchicalMapTypeControl()); 350 map.addControl(new GLargeMapControl()); 351 map.addControl(new GScaleControl()); 352 map.enableScrollWheelZoom(); 353 map.enableContinuousZoom(); 354 map.setCenter(new GLatLng(<?php echo $lat;?>, <?php echo $lng;?>), <?php echo $zoom;?>); 355 } 356 //]]> 357 </script> 358 <script type="text/javascript"> 359 //<![CDATA[ 360 $(document).ready(function() { 361 if (navigator.geolocation) { 362 $('#availability').html('현재 웹브라우저는 Geolocation 기능을 지원합니다. <button id="getLocation">위치 가져오기</button>') 363 $('#getLocation').click(function() { 364 $('#status').html('<img src="<?php echo $pluginURL; ?>/images/icon_loading.gif" style="vertical-align:middle" width="16" height="16" alt="가져오는 중..." />'); 365 navigator.geolocation.getCurrentPosition(function(pos) { 366 map.setCenter(new GLatLng(pos.coords.latitude, pos.coords.longitude), 10); 367 $('#status').html('가져오기 완료.'); 368 }, function(error) { 369 alert('위치 정보를 가져오는 데 실패하였습니다. ('+error.code+', '+error.message+')'); 370 $('#status').html('가져오기 실패.'); 371 }); 372 }); 373 } else { 374 $('#availability').html('현재 웹브라우저는 Geolocation 기능을 지원하지 않습니다.') 375 } 376 }); 377 //]]> 378 </script> 379 <?php 380 _GMap_printFooterForUI(); 381 } 382 321 383 function _GMap_printHeaderForUI($title, $api_key) { 322 384 global $pluginURL, $blogURL, $service, $adminSkinSetting; … … 326 388 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 327 389 <title>Google Map Plugin: <?php echo $title;?></title> 328 <link rel="stylesheet" type="text/css" href="<?php echo $pluginURL;?>/ insert.css" />390 <link rel="stylesheet" type="text/css" href="<?php echo $pluginURL;?>/popup.css" /> 329 391 <script type="text/javascript" src="<?php echo $pluginURL;?>/scripts/jquery-1.2.6.min.js"></script> 330 392 <script type="text/javascript" src="<?php echo $pluginURL;?>/scripts/jquery-ui-1.6rc2.js"></script> -
branches/1.8/plugins/GoogleMap/index.xml
r7342 r7699 15 15 </requirements> 16 16 <binding> 17 <listener event="/plugin/GMapCustomInsert/">GoogleMapUI_Insert</listener> 17 <listener event="/plugin/GMapCustomInsert/">GoogleMapUI_InsertMap</listener> 18 <listener event="/plugin/GMapGetLocation/">GoogleMapUI_GetLocation</listener> 18 19 <listener event="/plugin/GMapCache/">GoogleMap_Cache</listener> 19 20 <listener event="ViewPostContent">GoogleMap_View</listener> -
branches/1.8/plugins/GoogleMap/popup.css
r7617 r7699 38 38 display: inline-block; 39 39 margin: 2px; 40 padding: 1px 3px 2px 3px; 40 padding: 0 6px; 41 line-height: 20px; 41 42 background: #f2f2f2; 42 border: 1px solid #69c; 43 background: -webkit-gradient(linear, left top, left bottom, from(#fafafa), to(#e4e4e4)); 44 border: 1px solid #bbb; 43 45 border-radius: 3px; 44 46 -moz-border-radius: 3px; … … 47 49 } 48 50 button:hover { 49 background-color: #cce8ff; 51 border-color: #999; 52 background: #D7E0EE; 53 background: -webkit-gradient(linear, left top, left bottom, from(#EFF2FB), to(#B5D5EC)); 54 } 55 button:active { 56 background: -webkit-gradient(linear, left top, left bottom, to(#C7DDF4), from(#A9C9F0)); 50 57 } 51 58 button.toggled { 59 border-color: #222; 52 60 background-color: #555; 61 background: -webkit-gradient(linear, left top, left bottom, from(#444), to(#666)); 53 62 color: white; 54 63 } 55 64 button.toggled:hover { 56 65 background-color: #666; 66 background: -webkit-gradient(linear, left top, left bottom, from(#555), to(#777)); 57 67 } 58 68 … … 72 82 input, textarea { 73 83 border: 1px solid #ccc; 84 padding: 1px; 85 line-height: 17px; 86 background: -webkit-gradient(linear, left top, 0 10, from(#eee), to(#fff)); 87 -webkit-background-origin: padding-box; 88 -webkit-background-clip: content-box; 74 89 font-size: 0.9em; 75 90 } … … 107 122 text-align: left; 108 123 } 124 #status { 125 font-size: 8pt; 126 color: #555; 127 } -
branches/1.8/plugins/GoogleMap/scripts/editor.js
r7617 r7699 6 6 } 7 7 8 function GMapTool_ Insert() {8 function GMapTool_insertMap() { 9 9 window.open(blogURL + '/plugin/GMapCustomInsert/', 'GMapTool_Insert', 'menubar=no,toolbar=no,width=550,height=650,scrollbars=yes'); 10 10 } 11 11 12 function GMapTool_getLocation() { 13 window.open(blogURL + '/plugin/GMapGetLocation/', 'GMapTool_GetLocation', 'menubar=no,toolbar=no,width=550,height=650,scrollbars=no'); 14 } 15 12 16 STD.addUnloadEventListener(function() { GUnload(); });
