Skip to content

Commit

Permalink
다음주소API 관련 스크립트 코드 및 기타 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
chicpro committed Aug 20, 2014
1 parent e891791 commit 5a37e82
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 73 deletions.
2 changes: 2 additions & 0 deletions bbs/zip.php
Expand Up @@ -12,5 +12,7 @@

include_once($member_skin_path.'/zip.skin.php');

echo '<script src="'.G5_JS_URL.'/zip.js"></script>';

include_once(G5_PATH.'/tail.sub.php');
?>
19 changes: 19 additions & 0 deletions js/zip.js
@@ -0,0 +1,19 @@
$(function() {
var is_chrome = navigator.userAgent.toLowerCase().indexOf("chrome") > -1;
if(!(g5_is_mobile && is_chrome)) { //모바일 크롬에서 먹통되는 현상이 있음
$("html, body").addClass("daum_juso_body");
}
var el_id = document.getElementById("daum_juso_wrap");
new daum.Postcode({
oncomplete: function(data) {
var address1 = data.address1,
address2 = "";
if(data.addressType == "R"){ //도로명이면
address2 = data.address2;
}
put_data2(data.postcode1, data.postcode2, address1, "", address2, data.addressType);
},
width : "100%",
height : "100%"
}).embed(el_id);
});
6 changes: 3 additions & 3 deletions lib/common.lib.php
Expand Up @@ -2592,11 +2592,11 @@ function print_address($addr1, $addr2, $addr3, $addr4)
} else {
if($addr2)
$address .= ', '.$addr2;

if($addr3)
$address .= ' '.$addr3;
}

if($addr3)
$address .= ' '.$addr3;

return $address;
}

Expand Down
51 changes: 15 additions & 36 deletions mobile/skin/member/basic/zip.skin.php
Expand Up @@ -8,44 +8,23 @@
<div id="daum_juso_wrap" class="daum_juso_wrap"></div>

<script>
jQuery(function($){
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
if(!is_chrome) { //모바일 크롬에서 먹통되는 현상이 있음
$("html, body").addClass("daum_juso_body");
}

function put_data2(zip1, zip2, addr1, addr2, addr3, jibeon)
{
var of = window.opener.document.<?php echo $frm_name; ?>;
function put_data2(zip1, zip2, addr1, addr2, addr3, jibeon)
{
var of = window.opener.document.<?php echo $frm_name; ?>;

of.<?php echo $frm_zip1; ?>.value = zip1;
of.<?php echo $frm_zip2; ?>.value = zip2;
of.<?php echo $frm_addr1; ?>.value = addr1;
of.<?php echo $frm_addr2; ?>.value = addr2;
of.<?php echo $frm_addr3; ?>.value = addr3;
of.<?php echo $frm_zip1; ?>.value = zip1;
of.<?php echo $frm_zip2; ?>.value = zip2;
of.<?php echo $frm_addr1; ?>.value = addr1;
of.<?php echo $frm_addr2; ?>.value = addr2;
of.<?php echo $frm_addr3; ?>.value = addr3;

if( jibeon ){
if(of.<?php echo $frm_jibeon; ?> !== undefined){
of.<?php echo $frm_jibeon; ?>.value = jibeon;
}
if( jibeon ){
if(of.<?php echo $frm_jibeon; ?> !== undefined){
of.<?php echo $frm_jibeon; ?>.value = jibeon;
}
of.<?php echo $frm_addr3; ?>.focus(); //안드로이드 4.3 기본브라우져에서 가끔 안나오는 현상이 있어서 일부러 적용
of.<?php echo $frm_addr2; ?>.focus();
window.close();
}

var el_id = document.getElementById('daum_juso_wrap');
new daum.Postcode({
oncomplete: function(data) {
var address1 = data.address1,
address2 = "";
if(data.addressType == "R"){ //도로명이면
address2 = data.address2;
}
put_data2(data.postcode1, data.postcode2, address1, '', address2, data.addressType);
},
width : '100%',
height : '100%'
}).embed(el_id);
});
of.<?php echo $frm_addr3; ?>.focus(); //안드로이드 4.3 기본브라우져에서 가끔 안나오는 현상이 있어서 일부러 적용
of.<?php echo $frm_addr2; ?>.focus();
window.close();
}
</script>
3 changes: 2 additions & 1 deletion mobile/tail.php
Expand Up @@ -27,7 +27,8 @@
<?php
if(G5_USE_MOBILE && G5_IS_MOBILE) {
$seq = 0;
$href = $_SERVER['PHP_SELF'];
$p = parse_url(G5_URL);
$href = $p['scheme'].'://'.$p['host'].$_SERVER['PHP_SELF'];
if($_SERVER['QUERY_STRING']) {
$sep = '?';
foreach($_GET as $key=>$val) {
Expand Down
46 changes: 14 additions & 32 deletions skin/member/basic/zip.skin.php
Expand Up @@ -8,40 +8,22 @@
<div id="daum_juso_wrap" class="daum_juso_wrap"></div>

<script>
jQuery(function($){
$("html, body").addClass("daum_juso_body");
function put_data2(zip1, zip2, addr1, addr2, addr3, jibeon)
{
var of = window.opener.document.<?php echo $frm_name; ?>;

function put_data2(zip1, zip2, addr1, addr2, addr3, jibeon)
{
var of = window.opener.document.<?php echo $frm_name; ?>;
of.<?php echo $frm_zip1; ?>.value = zip1;
of.<?php echo $frm_zip2; ?>.value = zip2;
of.<?php echo $frm_addr1; ?>.value = addr1;
of.<?php echo $frm_addr2; ?>.value = addr2;
of.<?php echo $frm_addr3; ?>.value = addr3;

of.<?php echo $frm_zip1; ?>.value = zip1;
of.<?php echo $frm_zip2; ?>.value = zip2;
of.<?php echo $frm_addr1; ?>.value = addr1;
of.<?php echo $frm_addr2; ?>.value = addr2;
of.<?php echo $frm_addr3; ?>.value = addr3;

if( jibeon ){
if(of.<?php echo $frm_jibeon; ?> !== undefined){
of.<?php echo $frm_jibeon; ?>.value = jibeon;
}
if( jibeon ){
if(of.<?php echo $frm_jibeon; ?> !== undefined){
of.<?php echo $frm_jibeon; ?>.value = jibeon;
}
of.<?php echo $frm_addr2; ?>.focus();
window.close();
}

var el_id = document.getElementById('daum_juso_wrap');
new daum.Postcode({
oncomplete: function(data) {
var address1 = data.address1,
address2 = "";
if(data.addressType == "R"){ //도로명이면
address2 = data.address2;
}
put_data2(data.postcode1, data.postcode2, address1, '', address2, data.addressType);
},
width : '100%',
height : '100%'
}).embed(el_id);
});
of.<?php echo $frm_addr2; ?>.focus();
window.close();
}
</script>
3 changes: 2 additions & 1 deletion tail.php
Expand Up @@ -42,7 +42,8 @@
<?php
if(G5_USE_MOBILE && !G5_IS_MOBILE) {
$seq = 0;
$href = $_SERVER['PHP_SELF'];
$p = parse_url(G5_URL);
$href = $p['scheme'].'://'.$p['host'].$_SERVER['PHP_SELF'];
if($_SERVER['QUERY_STRING']) {
$sep = '?';
foreach($_GET as $key=>$val) {
Expand Down

0 comments on commit 5a37e82

Please sign in to comment.