daum 도로명 주소 적용 스킨 수정 및 zip.js 로 분리

This commit is contained in:
thisgun
2014-08-20 15:21:06 +09:00
parent a6bd17fa01
commit cb6fe2d32c
4 changed files with 51 additions and 68 deletions

View File

@ -12,5 +12,7 @@ if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') { //https 통신
include_once($member_skin_path.'/zip.skin.php'); include_once($member_skin_path.'/zip.skin.php');
echo '<script src="'.G5_JS_URL.'/zip.js"></script>';
include_once(G5_PATH.'/tail.sub.php'); include_once(G5_PATH.'/tail.sub.php');
?> ?>

20
js/zip.js Normal file
View File

@ -0,0 +1,20 @@
$(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);

View File

@ -8,44 +8,23 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
<div id="daum_juso_wrap" class="daum_juso_wrap"></div> <div id="daum_juso_wrap" class="daum_juso_wrap"></div>
<script> <script>
jQuery(function($){ function put_data2(zip1, zip2, addr1, addr2, addr3, jibeon)
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1; {
if(!is_chrome) { //모바일 크롬에서 먹통되는 현상이 있음 var of = window.opener.document.<?php echo $frm_name; ?>;
$("html, body").addClass("daum_juso_body");
}
function put_data2(zip1, zip2, addr1, addr2, addr3, jibeon) of.<?php echo $frm_zip1; ?>.value = zip1;
{ of.<?php echo $frm_zip2; ?>.value = zip2;
var of = window.opener.document.<?php echo $frm_name; ?>; 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; if( jibeon ){
of.<?php echo $frm_zip2; ?>.value = zip2; if(of.<?php echo $frm_jibeon; ?> !== undefined){
of.<?php echo $frm_addr1; ?>.value = addr1; of.<?php echo $frm_jibeon; ?>.value = jibeon;
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;
}
} }
of.<?php echo $frm_addr3; ?>.focus(); //안드로이드 4.3 기본브라우져에서 가끔 안나오는 현상이 있어서 일부러 적용
of.<?php echo $frm_addr2; ?>.focus();
window.close();
} }
of.<?php echo $frm_addr3; ?>.focus(); //안드로이드 4.3 기본브라우져에서 가끔 안나오는 현상이 있어서 일부러 적용
var el_id = document.getElementById('daum_juso_wrap'); of.<?php echo $frm_addr2; ?>.focus();
new daum.Postcode({ window.close();
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);
});
</script> </script>

View File

@ -8,40 +8,22 @@ add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">',
<div id="daum_juso_wrap" class="daum_juso_wrap"></div> <div id="daum_juso_wrap" class="daum_juso_wrap"></div>
<script> <script>
jQuery(function($){ function put_data2(zip1, zip2, addr1, addr2, addr3, jibeon)
$("html, body").addClass("daum_juso_body"); {
var of = window.opener.document.<?php echo $frm_name; ?>;
function put_data2(zip1, zip2, addr1, addr2, addr3, jibeon) of.<?php echo $frm_zip1; ?>.value = zip1;
{ of.<?php echo $frm_zip2; ?>.value = zip2;
var of = window.opener.document.<?php echo $frm_name; ?>; 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; if( jibeon ){
of.<?php echo $frm_zip2; ?>.value = zip2; if(of.<?php echo $frm_jibeon; ?> !== undefined){
of.<?php echo $frm_addr1; ?>.value = addr1; of.<?php echo $frm_jibeon; ?>.value = jibeon;
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;
}
} }
of.<?php echo $frm_addr2; ?>.focus();
window.close();
} }
of.<?php echo $frm_addr2; ?>.focus();
var el_id = document.getElementById('daum_juso_wrap'); window.close();
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);
});
</script> </script>