1/** 2 * request application function from web 3 */ 4 5var AppInterface = function () { 6 7 var self = this; 8 /* check webview */ 9 this.isWebView = function () { 10 try { 11 if (appHandler) { 12 return true; 13 } 14 return false; 15 } catch (err) { 16 return false; 17 } 18 } 19 20 /* fallback share for PC */ 21 this.sharePC = function (stitle, body, storelink) { 22 if (navigator.share) { 23 navigator.share({ 24 title: stitle, 25 url: body 26 }).then(() => { 27 }) 28 .catch(console.error); 29 } else { 30 location.href = storelink; 31 } 32 } 33 34 /* Connects app based sharing */ 35 this.shareApp = function (title, body, storelink) { 36 try { 37 appHandler.openShareActivity(title, body); 38 return true; 39 } 40 catch (err) { 41 this.sharePC(title, body, storelink); 42 } 43 } 44 45 /* Connects app based sharing for Kakao */ 46 this.shareAppWithKakao = function (title, body, storelink) { 47 try { 48 appHandler.openShareKakaoActivity(title, body); 49 return true; 50 } 51 catch (err) { 52 this.sharePC(title, body, storelink); 53 } 54 } 55 56 /* Opens phone-app with given number */ 57 this.openCallApp = function (phonenumber) { 58 try { 59 appHandler.openPhoneActivity(phonenumber); 60 return true; 61 } 62 catch (err) { 63 return false; 64 } 65 } 66 67 68 /* Uploads given file */ 69 this.uploadImage = function (filename) { 70 try { 71 appHandler.imageUploadToGivenPath(filename); 72 return true; 73 } 74 catch (err) { 75 return false; 76 } 77 } 78 79 80 /* Opens navigation application using given location info */ 81 this.openMapApp = function (latitude, longitude) { 82 try { 83 appHandler.openMapActivity(latitude, longitude); 84 return true; 85 } 86 catch (err) { 87 return false; 88 } 89 } 90 91 /* Force reload of the current webview */ 92 this.reloadWebview = function () { 93 try { 94 appHandler.webpageReload(); 95 return true; 96 } 97 catch (err) { 98 return false; 99 } 100 } 101 102 /* Gets the current user location from app */ 103 this.getAppLocation = function () { 104 try { 105 106 appHandler.getLocation(); 107 return true; 108 109 } catch (err) { 110 111 112 var startPos; 113 var geoOptions = { 114 enableHighAccuracy: true 115 } 116 117 var geoSuccess = function (position) { 118 startPos = position; 119 window.setLocation(startPos.coords.latitude, startPos.coords.longitude); 120 }; 121 var geoError = function (error) { 122 console.log('Error occurred. Error code: ' + error.code); 123 }; 124 125 navigator.geolocation.getCurrentPosition(geoSuccess, geoError, geoOptions); 126 127 return false; 128 } 129 130 } 131 132 /* Changes application tab index */ 133 this.moveTab = function (idx) { 134 try { 135 appHandler.onClicked(idx); 136 return true; 137 } 138 catch (err) { 139 return false; 140 } 141 } 142 143 /* Emits exit signal to application using log message */ 144 this.onBeforeExitApp = function () { 145 console.log("beforeExitApp"); 146 } 147 148 /* Emits exit signal to application using log message */ 149 this.onBeforeExitWeb = function (canback) { 150 console.log("beforeExitWebview canback:" + canback); 151 } 152 153 /* Emits exit signal to application using log message */ 154 this.appStatusChanged = function (canback) { 155 } 156 157 /* Checks whethen the app alarm is set or not */ 158 this.appHandlerAreNotificationsEnabled = function () { 159 try { 160 appHandler.isNotificationEnabled(); 161 162 } catch (err) { } 163 } 164 165 /* Calls the setting page of application so that the user can set the alarm enabling */ 166 this.appHandlerOpenSettingApp = function () { 167 try { 168 appHandler.openSettingApp(); 169 170 } catch (err) { } 171 } 172 173 this.appHandlerOpenInAppPurchase = function (sku) { 174 try { 175 appHandler.openInAppPurchase(sku); 176 177 } 178 catch (err) { 179 console.log("appHandlerOpenInAppPurchase ERRPR " + sku); 180 } 181 } 182 this.appHandlerGetSubUserStatus = function (sku) { 183 try { 184 appHandler.getSubStatus(sku); 185 186 } 187 catch (err) { 188 console.log("appHandlerGetSubUserStatus ERRPR " + sku); 189 } 190 } 191 192 193 // ì¬ì©ì ì½ê´ ëì ìë£ ì´ë²¤í¸ ì ì¡ 194 // 195 // - ì¬ì©ì ì½ê´ ëì ìì ì ì±ì ì리ëë° ì¬ì©ì¤ 196 this.userTermAgreed = function (agreementId) { 197 try { 198 if (window.webkit.messageHandlers && window.webkit.messageHandlers.userTermHandler) { 199 window.webkit.messageHandlers.userTermHandler.postMessage({ 200 agreementId: agreementId || '3252452452', 201 timestamp: new Date().getTime() 202 }); 203 return true; 204 } 205 return false; 206 } catch (error) { 207 console.error('ìëë¡ì´ë ì¬ì©ì ì½ê´ ëì ì´ë²¤í¸ ì ì¡ ì¤í¨:', error); 208 return false; 209 } 210 } 211 212 // ===================================== 213 // *** ë¸ë«í¼ ë¡ê·¸ì¸ ê´ë ¨ ì´ë²¤í¸ 11/05 ì¶ê° *** 214 // ===================================== 215 216 217 this.sendDisplayNativeLoginView = function () { 218 try { 219 if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.showNativeLoginViewHandler) { 220 window.webkit.messageHandlers.showNativeLoginViewHandler.postMessage({ 221 action: 'showNativeLoginView' 222 }); 223 return true; 224 } else { 225 return false; 226 } 227 } catch (error) { 228 console.error('ìëë¡ì´ë ë¤ì´í°ë¸ ë¡ê·¸ì¸ ë·° ëì°ê¸° ì¤í¨:', error); 229 return false; 230 } 231 } 232 233 // ë¡ê·¸ì¸ ìë£ ì´ë²¤í¸ ì ì¡ 234 // @param token - JWT í í° 235 // @param loginType - ë¡ê·¸ì¸ íì ('blatform', 'kakao', 'apple') 236 // @param uid - ì¬ì©ì ID (ë¸ë«í¼ ë¡ê·¸ì¸ì ê²½ì° ìí¸íë ì¬ì©ì ID) 237 // @param password - ìí¸íë ë¹ë°ë²í¸ (ë¸ë«í¼ ë¡ê·¸ì¸ ììë§ ì ì¡, ìë²ìì ë¤í¸ìí¬ í¤ë¡ ìí¸íë¨) 238 this.sendLoginCompleteEvent = function (token, loginType, uid, password) { 239 try { 240 if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.loginCompleteHandler) { 241 const message = { 242 token: token, 243 loginType: loginType, 244 uid: uid 245 }; 246 247 // passwordë ìµì ë (ì´ë©ì¼ ë¡ê·¸ì¸ ììë§ ì ì¡, ìí¸íë ìí) 248 if (password) message.password = password; 249 250 window.webkit.messageHandlers.loginCompleteHandler.postMessage(message); 251 return true; 252 } else { 253 return false; 254 } 255 } catch (error) { 256 return false; 257 } 258 } 259} 260 261// ìëë¡ì´ë WebViewìì ì§ì í¸ì¶íë ì ì í¨ì 262// ì± ìí ë³ê²½ ì í¸ì¶ë¨ (ì: íë©´ íì , í´ëë¸ ê¸°ê¸° ì 기/í¼ì¹ê¸° ë±) 263function appStatusChanged() { 264 // íì¬ë ë¹ í¨ìì´ì§ë§, íìì ì¬ê¸°ì ë¡ì§ ì¶ê° ê°ë¥ 265 console.log('appStatusChanged called'); 266} 267 268// ìëë¡ì´ë WebViewìì ì´ë¯¸ì§ ì ë¡ë ìë£ ì í¸ì¶íë ì ì í¨ì 269// Android ImgUploadActivityìì ì ë¡ë ì±ê³µ í javascript:imgUploadCompleted('íì¼ëª ') ì¤í 270function imgUploadCompleted(pImgName) { 271 console.log('IMG Upload Completed: ' + pImgName); 272 273 // CustomEvent를 ë°ììì¼ upload-image ì»´í¬ëí¸ì ì림 274 const event = new CustomEvent('imageUploadCompleted', { 275 detail: { imageName: pImgName } 276 });
277 window.dispatchEvent(event); 278} 279
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.