Changeset 2478934
- Timestamp:
- 02/22/2021 12:14:55 PM (5 years ago)
- Location:
- bbaton-anonymous-age-verification/trunk
- Files:
-
- 4 edited
-
assets/css/bbaa.css (modified) (1 diff)
-
assets/js/bbaa.js (modified) (3 diffs)
-
bbaton-ananoymous-age-verification.php (modified) (5 diffs)
-
login-page.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bbaton-anonymous-age-verification/trunk/assets/css/bbaa.css
r2463569 r2478934 1 #detail_popup {2 display: none; /* Hidden by default */3 position: fixed; /* Stay in place */4 z-index: 99999; /* Sit on top */5 padding-top: 100px; /* Location of the box */6 left: 0;7 top: 0;8 min-width: 100% !important; /* Full width */9 min-height: 100% !important; /* Full height */10 overflow: auto; /* Enable scroll if needed */11 background-color: rgb(0,0,0); /* Fallback color */12 background-color: rgba(0,0,0,0.4); /* Black w/ opacity */13 background: url(http://ijvann11.cafe24.com/wp-content/plugins/bbaton-anonymous-age-verification/assets/blue-white.jpg) !important;14 background-size: auto;15 background-size: cover !important;16 }17 .imp-dialog.pc.certification-danal {18 background: url(http://ijvann11.cafe24.com/wp-content/plugins/bbaton-anonymous-age-verification/assets/blue-white.jpg) !important;19 background-size: auto;20 background-size: cover !important;21 }22 .btn_yes,.redirect_me{23 background-color: #0071bc !important;24 }25 .btn_no{26 text-decoration: underline !important;27 }28 .email_container {29 text-align: center;30 }31 .email_container{32 display: none;33 }34 #submit_btn{35 margin-top: 7px;36 }37 #user_email{38 max-width: 298px;39 margin: auto;40 }41 42 /* Modal Content */43 .modal-content {44 background-color: #fefefe;45 margin: auto;46 padding: 20px;47 border: 1px solid #888;48 width: 50% !important;49 text-align: center;50 }51 52 /* The Close Button */53 .close {54 color: #aaaaaa;55 float: right;56 font-size: 28px;57 font-weight: bold;58 }59 60 .close:hover,61 .close:focus {62 color: #000;63 text-decoration: none;64 cursor: pointer;65 }66 67 1 .bbaa { 68 2 text-align: center; -
bbaton-anonymous-age-verification/trunk/assets/js/bbaa.js
r2463569 r2478934 1 1 jQuery(document).ready(function(){ 2 jQuery(document).on('click','.imp-close',function(){3 location.reload();4 });5 var IMP = window.IMP;6 IMP.init(bbaton_anonymous_age_verification.iamport_merchant_id);7 var mer_uid= '';8 var imp_uid= '';9 var url_initial= '';10 2 jQuery(".bbaa #iamport_auth").on("click", function (e){ 11 e.preventDefault(); 12 var url = window.location.href; 13 if (typeof(Storage) !== "undefined") { 14 localStorage.setItem("bbaton_anonymous_age_verification_last_url", url); 15 } 16 url_initial = url; 17 jQuery('.bbaa').hide(); 18 IMP.certification({}, function (rsp) { // callback 19 if (rsp.success) { 20 mer_uid = rsp.merchant_uid; 21 imp_uid = rsp.imp_uid; 22 var postData = { 23 imp_uid: imp_uid, 24 action : 'request_token' 25 }; 26 jQuery.ajax({ 27 type: "POST", 28 url: bbaton_anonymous_age_verification.ajax_url, 29 dataType: "json", 30 data: postData, 31 success: function (response) { 32 if( response.success ) { 33 var user_info = response.data; 34 console.log(response); 35 console.log(checkIsAdult(user_info.birthday)); 36 if(checkIsAdult(user_info.birthday) > 18 && user_info.name){ 37 jQuery('#detail_popup').show(); 38 var pop_up_content = ''; 39 pop_up_content += '<p class="inf_det">'+user_info.name+'</p>'; 40 pop_up_content += '<p class="inf_det">'+user_info.gender+'</p>'; 41 pop_up_content += '<p class="inf_det">'+user_info.birthday+'</p>'; 42 pop_up_content += '<p class="inf_det">'+user_info.phone+'</p>'; 43 pop_up_content += '<p class="inf_det">'+user_info.carrier+'</p>'; 44 console.log(pop_up_content); 45 jQuery('.info_section').css('text-align','center'); 46 jQuery('.info_section').prepend(pop_up_content); 47 jQuery('.btn_no').on('click', function(){ 48 jQuery('#detail_popup').hide(); 49 if (url.indexOf("?") < 0) 50 url_initial += "?iamport_response_code=" + rsp.merchant_uid; 51 else 52 url_initial += "&iamport_response_code=" + rsp.merchant_uid; 53 window.location.href = url_initial; 54 }); 55 jQuery('.btn_yes').on('click', function(){ 56 jQuery('.info_section').hide(); 57 jQuery('.email_container').show(); 58 }); 59 } else { 60 alert('no data available'); 61 location.reload(); 62 } 63 // // When the user clicks on <span> (x), close the modal 64 // span.onclick = function() { 65 // modal.style.display = "none"; 66 // } 67 68 // When the user clicks anywhere outside of the modal, close it 69 // window.onclick = function(event) { 70 // if (event.target == modal) { 71 // modal.style.display = "none"; 72 // } 73 // } 74 // if(response.codecode ){ 75 // $('#code').val(response.codecode); 76 // } else { 77 // $('#code').val(''); 78 // } 79 } else { 80 alert(response.msg); 81 setTimeout(function(){ location.reload(); }, 2000); 82 } 83 }, 84 error: function () {} 85 }); 86 // if (url.indexOf("?") < 0) 87 // url += "?iamport_response_code=" + rsp.merchant_uid; 88 // else 89 // url += "&iamport_response_code=" + rsp.merchant_uid; 90 // window.location.href = url; 91 } else { 92 alert(rsp.error_msg); 93 } 94 }); 95 96 }); 97 jQuery('#ignore_mail').on('click', function(){ 98 jQuery('#detail_popup').hide(); 99 if (url_initial.indexOf("?") < 0) 100 url_initial += "?iamport_response_code=" + mer_uid; 101 else 102 url_initial += "&iamport_response_code=" + mer_uid; 103 window.location.href = url_initial; 104 }); 105 106 var mail_form = jQuery('#mail_form'); 107 if (mail_form.length > 0 ) { 108 jQuery(document).on('submit',mail_form, function(e){ 109 e.preventDefault(); 110 var customer_email= jQuery('#user_email').val(); 111 console.log(customer_email); 112 if( customer_email != ''&& mer_uid != '' ){ 113 jQuery('#submit_btn').prop("disabled",true); 114 var postData = { 115 imp_uid: imp_uid, 116 action : 'make_anonymous', 117 user_email : customer_email.trim(), 118 }; 119 jQuery.ajax({ 120 type: "POST", 121 url: bbaton_anonymous_age_verification.ajax_url, 122 dataType: "json", 123 data: postData, 124 success: function (response) { 125 if (response.data.status == 'success') { 126 //jQuery('.after_mail_msg').text('Email Verified Successfully'); 127 jQuery('#mail_form').hide(); 128 jQuery('.last_step').show(); 129 jQuery(document).on('click','.redirect_me', function(){ 130 if (url_initial.indexOf("?") < 0) 131 url_initial += "?iamport_response_code=" + mer_uid; 132 else 133 url_initial += "&iamport_response_code=" + mer_uid; 134 window.location.href = url_initial; 135 }); 136 } else { 137 setTimeout(function(){ 138 jQuery('#detail_popup').hide(); 139 if (url_initial.indexOf("?") < 0) 140 url_initial += "?iamport_response_code=" + mer_uid; 141 else 142 url_initial += "&iamport_response_code=" + mer_uid; 143 window.location.href = url_initial; 144 }, 2000); 145 } 146 }, 147 error: function () {} 148 }); 149 } else { 150 location.reload(); 151 } 152 }); 153 } 3 e.preventDefault(); 4 window.open(bbaton_anonymous_age_verification.new_window, 'popupChk', 'width=430, height=680, top=100, left=100, fullscreen=no, menubar=no, status=no, toolbar=no, titlebar=yes, location=no, scrollbar=no'); 5 }); 154 6 jQuery(".bbaa #bbaton_auth").click(function(e){ 155 7 e.preventDefault(); … … 158 10 localStorage.setItem("bbaton_anonymous_age_verification_last_url", current_url); 159 11 } 160 var data = { 161 'action': 'bbaa_login_process', 162 'backUrl': current_url 163 }; 164 // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php 165 jQuery.post(bbaton_anonymous_age_verification.ajax_url, data, function(response) { 166 window.location.href = response; 167 }); 12 var bbaa_client_id = bbaton_anonymous_age_verification.bbaa_client_id; 13 var redirect_uri = bbaton_anonymous_age_verification.redirect_uri; 14 window.open( "http://bauth.bbaton.com/oauth/authorize?client_id="+bbaa_client_id+"&redirect_uri="+redirect_uri+"&response_type=code&scope=read_profile","bbaton","width=400, height=500"); 15 // var data = { 16 // 'action': 'bbaa_login_process', 17 // 'backUrl': current_url 18 // }; 19 // // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php 20 // jQuery.post(bbaton_anonymous_age_verification.ajax_url, data, function(response) { 21 // window.location.href = response; 22 // }); 168 23 }); 169 24 if(jQuery("div").hasClass("bbaa")){ … … 171 26 } 172 27 }); 173 174 function checkIsAdult(enteredDate){175 var years = new Date(new Date() - new Date(enteredDate)).getFullYear() - 1970;176 years = parseInt(years)+parseInt(1);177 return years;178 } -
bbaton-anonymous-age-verification/trunk/bbaton-ananoymous-age-verification.php
r2465711 r2478934 3 3 Plugin Name: 비바톤 익명 성인인증 | BBaton Anonymous Age Verification 4 4 Description: Anonymous Age Verification Service for Korean Users 5 Version: 1.115 Version: 2.0 6 6 Author: BBaton 7 7 Author URI: https://www.bbaton.com … … 38 38 'bbaa_redirect_back' 39 39 )); 40 add_shortcode('new_window_content', array($this, 'new_window_content_callback')); 41 add_filter( 'page_template', array( 42 $this,'wpa3396_page_template')); 43 register_activation_hook( __FILE__, array($this,'bbaton_activate')); 44 } 45 46 function bbaton_activate(){ 47 if ( 0 === post_exists( 'New Window' ) ) { 48 // Create post object 49 $my_post = array( 50 'post_title' => wp_strip_all_tags( 'New Window' ), 51 'post_name' => 'new-window', 52 'post_content' => '[new_window_content]', 53 'post_status' => 'publish', 54 'post_author' => get_current_user_id(), 55 'post_type' => 'page', 56 ); 57 // Insert the post into the database 58 $post_id = wp_insert_post( $my_post ); 59 update_option( 'new_window_page_id', $post_id ); 60 } 61 } 62 function wpa3396_page_template( $page_template ){ 63 if ( is_page( 'new-window' ) ) { 64 $page_template = plugin_dir_path( __FILE__ ) . 'template_without_header_footer_sidebar.php'; 65 } 66 return $page_template; 67 } 68 69 function new_window_content_callback(){ 70 wp_enqueue_style('new_window_css'); 71 wp_enqueue_script('new_window_js'); 72 ob_start(); 73 require_once 'bbaton-verification-window.php'; 74 $output = ob_get_contents(); 75 ob_end_clean(); 76 return $output; 40 77 } 41 78 function bbaa_start_from_here() … … 47 84 function bbaa_enqueue_script_front() 48 85 { 86 $page_url = get_permalink( get_page_by_path( 'new-window' ) ); 87 if(!$page_url){ 88 $page_url = get_permalink( get_page_by_title( 'New Window' ) ); 89 } 49 90 //Style & Script 50 91 wp_enqueue_script('bbaa-script', plugins_url('assets/js/bbaa.js', __FILE__) , array( … … 54 95 'jquery' 55 96 ) , '1.2', true); 97 wp_register_style('new_window_css', plugins_url('assets/css/new_window.css', __FILE__), array(), '1.1', 'all'); 98 wp_register_script( 'new_window_js', plugins_url('assets/js/new_window.js', __FILE__), array( 'jquery' ), '1.1', false ); 56 99 wp_localize_script('bbaa-script', 'bbaton_anonymous_age_verification', array( 57 100 'ajax_url' => admin_url('admin-ajax.php'), 58 'iamport_merchant_id' => 'imp34765018' 101 'iamport_merchant_id' => 'imp34765018', 102 'new_window' => $page_url, 103 'domain' => parse_url(get_option('siteurl') , PHP_URL_HOST), 104 'bbaa_client_id' =>( sanitize_text_field(get_option('bbaa_client_id')) ), 105 'redirect_uri' => sanitize_text_field(get_option('bbaa_redirect_url')) 59 106 )); 60 107 } … … 170 217 redirectURL = localStorage.getItem("bbaton_anonymous_age_verification_last_url"); 171 218 } 172 window.location.replace(redirectURL); 219 opener.location.href = redirectURL; 220 self.close(); 173 221 </script>'; 174 222 die(); -
bbaton-anonymous-age-verification/trunk/login-page.php
r2465711 r2478934 11 11 min-height: 100%; 12 12 } 13 .btn_yes, .redirect_me {13 /* .btn_yes, .redirect_me { 14 14 background-color: #0071bc !important; 15 15 padding: 11px 48px; … … 17 17 color: #fff; 18 18 font-weight: bold; 19 } 19 }*/ 20 20 21 .anonymous_ques {21 /* .anonymous_ques { 22 22 margin-top: 27px; 23 } 23 }*/ 24 24 25 #submit_btn{25 /* #submit_btn{ 26 26 background-color: #0071bc !important; 27 27 padding: 11px 48px; … … 29 29 color: #fff; 30 30 font-weight: bold; 31 } 31 }*/ 32 32 33 .tag_line {33 /* .tag_line { 34 34 font-size: 20px; 35 35 font-weight: bold; 36 } 36 }*/ 37 37 .inf_det{ 38 38 font-family: "Nanum Gothic", sans-serif !important; 39 39 margin-bottom: 4px !important; 40 40 } 41 .tag_line{41 /*.tag_line{ 42 42 color: #0071bc !important; 43 43 margin-top: 5px !important; … … 45 45 .last_step{ 46 46 display: none; 47 } 47 }*/ 48 48 body { 49 49 padding: 0; … … 54 54 overflow: hidden; 55 55 } 56 #detail_popup {56 /* #detail_popup { 57 57 background: url(<?php echo plugins_url('assets/bg-login.jpg', __FILE__); ?>) !important; 58 58 background-size: auto; 59 59 background-size: cover !important; 60 } 60 }*/ 61 61 62 .imp-dialog.pc.certification-danal {62 /* .imp-dialog.pc.certification-danal { 63 63 background: url(<?php echo plugins_url('assets/bg-login.jpg', __FILE__); ?>) !important; 64 64 background-size: auto; 65 65 background-size: cover !important; 66 } 66 }*/ 67 67 .bbaa { 68 min-width: 100% !important; 69 min-height: 100% !important; 68 70 background: url(<?php echo plugins_url('assets/bg-login.jpg', __FILE__); ?>) !important; 69 71 background-size: cover !important; … … 83 85 word-break: keep-all !important; 84 86 } 85 .img_last_step{87 /* .img_last_step{ 86 88 margin: auto !important; 87 } 89 }*/ 88 90 #bbaton_auth { 89 91 padding-top: 100px; … … 128 130 </div> 129 131 </div> 132 <?php /* ?> 130 133 <div id="detail_popup" class="modal"> 131 134 <!-- Modal content --> … … 165 168 </div> 166 169 </div> 167 170 <?php */ ?> 168 171 <script> 169 172 jQuery("header").remove();
Note: See TracChangeset
for help on using the changeset viewer.