1"use strict"; 2 3function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } 4function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context);
vendor: 4,705 bytes, line 4
4 if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEac
4h(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } 5function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } 6function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } 7//IOS / ANDROID / WEB ê³µíµ ì²ë¦¬ 8var PLATFORM_TYPE = { 9 BROWSER: "browser", 10 IOS: "ios", 11 ANDROID: "android" 12}; 13function getOs() { 14 var browserUserAgent = navigator.userAgent || navigator.vendor || window.opera || ""; 15 browserUserAgent = browserUserAgent.toLowerCase(); 16 if (/iphone|ipad|ipod/.test(browserUserAgent)) { 17 return 'ios'; 18 } else if (/android/.test(browserUserAgent) && browserUserAgent.match(/wv/i)) { 19 return 'android'; 20 } else { 21 return 'unknown'; 22 } 23} 24; 25function getIsMobile() { 26 return [PLATFORM_TYPE.IOS, PLATFORM_TYPE.ANDROID].includes(getOs()); 27} 28function browserFunction() { 29 return { 30 DOWN_EVENT_KEY: "mousedown", 31 getAppLink: function getAppLink() { 32 var platform = getOs(); 33 if (platform === PLATFORM_TYPE.IOS) { 34 //íì¸ íì 35 //return "itms-apps://itunes.apple.com/app/AppleID"; 36 } else if (platform === PLATFORM_TYPE.ANDROID) { 37 //íì¸ íì 38 //return "https://play.google.com/store/apps/details?id=com.appg.ok114" 39 } 40 }, 41 getCurrentLocation: function getCurrentLocation() { 42 return new Promise(function (resolve, reject) { 43 try { 44 if (navigator.geolocation) { 45 navigator.geolocation.getCurrentPosition(function (position) { 46 _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { 47 var lat, lng, response, result; 48 return _regeneratorRuntime().wrap(function _callee$(_context) { 49 while (1) switch (_context.prev = _context.next) { 50 case 0: 51 lat = position.coords.latitude; 52 lng = position.coords.longitude; 53 _context.next = 4; 54 return fetch("/ntnw/base/coord2address.json?" + "y=" + lat + "&x=" + lng); 55 case 4: 56 response = _context.sent; 57 _context.next = 7; 58 return response.json(); 59 case 7: 60 result = _context.sent; 61 result = JSON.parse(result.returnData); 62 if (result.code === 200) { 63 resolve({ 64 lat: position.coords.latitude, 65 lng: position.coords.longitude, 66 address: result.short_address_name 67 }); 68 } else { 69 reject(result.message); 70 } 71 case 10: 72 case "end": 73 return _context.stop(); 74 } 75 }, _callee); 76 }))(); 77 }, function (error) { 78 console.error(error); 79 reject(error); 80 }); 81 } else { 82 console.error("Geolocation is not supported by this browser."); 83 reject(error); 84 } 85 } catch (e) { 86 console.error(e); 87 reject(e); 88 } 89 }); 90 }, 91 goDetailPage: function goDetailPage(ucode) { 92 location.href = "/ntnw/search/company/m/searchCompanyDetail.json?master_ucode=" + ucode;
93 }, 94 backFromDetailPage: function backFromDetailPage() { 95 window.history.back(); 96 }, 97 isNone_shareCommon: function isNone_shareCommon() { 98 return true; 99 }, 100 //shareCommon: function (content) { 101 // alert('ì±ì ì¤ì¹í´ 주ì¸ì!'); 102 //}, 103 call: function call(phoneNumber) { 104 if (getIsMobile()) location.href = "tel:" + phoneNumber; 105 }, 106 getImages: function getImages(min, max, func) { 107 function processFile(file) { 108 var reader = new FileReader(); 109 reader.onload = function () { 110 var result = reader.result; 111 func({ 112 Id: Date.now(), 113 Base64: result 114 }); 115 }; 116 reader.readAsDataURL(file); 117 } 118 var input = document.createElement("input"); 119 input.type = "file"; 120 input.accept = "image/*"; 121 input.id = "uploadInput"; 122 input.onchange = function (event) { 123 if (event.target.files.length > max) { 124 alert(max + 'ì¥ ì´íë¡ ë±ë¡ ê°ë¥í©ëë¤'); 125 return; 126 } 127 Array.from(event.target.files).forEach(function (file) { 128 processFile(file); 129 }); 130 }; 131 input.click(); 132 }, 133 HAS_DATA_API: true, 134 HAS_DATA_API_V2: true, 135 setData: function setData(id, text) { 136 localStorage.setItem(id, text); 137 }, 138 getData: function getData(id) { 139 return new Promise(function (resolve, reject) { 140 resolve(localStorage.getItem(id)); 141 }); 142 } 143 }; 144} 145function androidFunction() { 146 return { 147 DOWN_EVENT_KEY: "touchstart", 148 getCurrentLocation: function getCurrentLocation() { 149 return new Promise(function (resolve, reject) { 150 try { 151 var prevFunc = window.setLocation; 152 window.setLocation = function (lat, lng, addr) { 153 window.setLocation = prevFunc; 154 resolve({ 155 lat: lat, 156 lng: lng, 157 address: addr 158 }); 159 }; 160 var api = window.Android ? window.Android : window.AndroidDetail; 161 api.getLocation(); 162 } catch (e) { 163 console.error(e); 164 reject(e); 165 } 166 }); 167 }, 168 TmapNavi: function TmapNavi(lat, lng, name) { 169 var base = "https://apis.openapi.sk.com/tmap/app/routes?appKey=41b9f260-04f1-4a4e-be57-9ad9f9d71d4f"; 170 var title = "${resultData.company_name}"; 171 var url = base + "&name=" + encodeURIComponent(name) + "&lat=" + lat + "&lon=" + lng; 172 window.open(url, '_blank'); 173 }, 174 goDetailPage: function goDetailPage(ucode) { 175 window.Android.goDetail("" + ucode); 176 }, 177 backFromDetailPage: function backFromDetailPage() { 178 window.AndroidDetail.finishDetail(); 179 }, 180 shareCommon: function shareCommon(content) { 181 var api = window.Android ? window.Android : window.AndroidDetail; 182 api.shareCommon(content); 183 }, 184 call: function call(phoneNumber) { 185 location.href = "tel:" + phoneNumber; 186 }, 187 getAllSearchHistory: function getAllSearchHistory() { 188 return new Promise(function (resolve, reject) { 189 resolve(JSON.parse(window.Android.selectAllSrch() || '[]')); 190 }); 191 }, 192 deleteSearchHistory: function deleteSearchHistory(id) { 193 return new Promise(function (resolve, reject) { 194 window.Android.deleteSrch(id); 195 resolve(); 196 }); 197 }, 198 deleteAllSearchHistory: function deleteAllSearchHistory() { 199 window.Android.removeSrchAll(); 200 }, 201 insertSearchHistory: function insertSearchHistory(word) { 202 return new Promise(function (resolve, reject) { 203 window.Android.srchInsert(word); 204 resolve(); 205 }); 206 }, 207 getImages: function getImages(min, max, func) { 208 window.galleryImageResultFromAndroid = function (obj) { 209 obj.forEach(function (item, index) { 210 item.Id = Date.now() + index; 211 func(item); 212 }); 213 }; 214 window.AndroidDetail.chooseImg(min, max); 215 }, 216 requestVoiceSearch: function requestVoiceSearch(eventList) { 217 var empty = function empty() {}; 218 window.voiceSearchStateFromAndroid = eventList.onChangeState || empty; 219 window.voiceSearchProgress = eventList.onProgress || empty; 220 window.voiceSearchResultFromAndroid = eventList.onSearchResult || empty; 221 window.Android.requstVoiceSearch(); 222 }, 223 stopVoiceSearch: function stopVoiceSearch() { 224 window.Android.stopVoiceSearch(); 225 }, 226 HAS_DATA_API: !!((window.Android ? window.Android : window.AndroidDetail) || {}).setJsonInfo, 227 HAS_DATA_API_V2: !!((window.Android ? window.Android : window.AndroidDetail) || {}).setJsonInfo, 228 setData: function setData(id, data) { 229 var api = window.Android ? window.Android : window.AndroidDetail; 230 api.setJsonInfo(id, data); 231 }, 232 getData: function getData(id) { 233 return new Promise(function (resolve, reject) { 234 var api = window.Android ? window.Android : window.AndroidDetail; 235 resolve(api.getJsonInfo(id)); 236 }); 237 } 238 }; 239} 240function IOSFunction() { 241 return { 242 DOWN_EVENT_KEY: "touchstart", 243 getCurrentLocation: function getCurrentLocation() { 244 return new Promise(function (resolve, reject) { 245 window.setLocation = function (str) { 246 var callbackData = str.split(","); 247 if (callbackData[0] && callbackData[1]) { 248 resolve({ 249 lat: callbackData[0], 250 lng: callbackData[1], 251 address: callbackData[2] 252 }); 253 } else { 254 reject(); 255 } 256 }; 257 webkit.messageHandlers.getLocation.postMessage(1); 258 }); 259 }, 260 goDetailPage: function goDetailPage(ucode) { 261 var proto = window.location.href.split("//")[0]; 262 var domain = window.location.href.split("//")[1].split("/")[0]; 263 var domainUrl = proto + "//" + domain; 264 webkit.messageHandlers.goWebViewDetail.postMessage(domainUrl + "/ntnw/search/company/m/searchCompanyDetail.json?master_ucode=" + ucode); 265 }, 266 backFromDetailPage: function backFromDetailPage() { 267 webkit.messageHandlers.finishWebDetail.postMessage("1"); 268 }, 269 shareCommon: function shareCommon(content) { 270 webkit.messageHandlers.shareSNS.postMessage(content); 271 }, 272 call: function call(phoneNumber) { 273 webkit.messageHandlers.callPhone.postMessage(["dummy", phoneNumber, "dummy"].join("//")); 274 }, 275 getAllSearchHistory: function getAllSearchHistory() { 276 return new Promise(function (resolve, reject) { 277 window.dataFromIOS = function (data) { 278 resolve(JSON.parse(data || '[]')); 279 }; 280 webkit.messageHandlers.getData.postMessage('search_history'); 281 }); 282 }, 283 deleteSearchHistory: function deleteSearchHistory(id) { 284 return new Promise(function (resolve, reject) { 285 window.dataFromIOS = function (data) { 286 var prev = JSON.parse(data || '[]'); 287 var newData = JSON.stringify(prev.filter(function (item) { 288 return item.id != id; 289 })); 290 webkit.messageHandlers.setData.postMessage('search_history//' + newData); 291 resolve(); 292 }; 293 webkit.messageHandlers.getData.postMessage('search_history'); 294 }); 295 }, 296 deleteAllSearchHistory: function deleteAllSearchHistory() { 297 webkit.messageHandlers.setData.postMessage('search_history//'); 298 }, 299 insertSearchHistory: function insertSearchHistory(word) { 300 return new Promise(function (resolve, reject) { 301 window.dataFromIOS = function (data) { 302 var prev = JSON.parse(data || '[]'); 303 var exist = prev.some(function (item) { 304 return item.text == word; 305 }); 306 if (exist) { 307 resolve(); 308 return; 309 } 310 var ids = prev.map(function (item) { 311 return Number(item.id); 312 }); 313 var id = Math.max.apply(null, [0].concat(ids)) + 1; 314 var newData = JSON.stringify([{ 315 id: id, 316 text: word 317 }].concat(prev)); 318 webkit.messageHandlers.setData.postMessage('search_history//' + newData); 319 resolve(); 320 }; 321 webkit.messageHandlers.getData.postMessage('search_history'); 322 }); 323 }, 324 getImages: function getImages(min, max, func) { 325 window.galleryImageResultFromIOS = function (obj) { 326 func({ 327 Id: Date.now() + index, 328 Base64: obj 329 }); 330 }; 331 webkit.messageHandlers.chooseImg.postMessage([min || 1, max || 1, 1024, 1024].join("//")); 332 }, 333 TmapNavi: function TmapNavi(lat, lng, name) { 334 webkit.messageHandlers.tmap.postMessage([name, lat.trim(), lng.trim()].join("//")); 335 }, 336 AppleMap: function AppleMap(address) {
337 webkit.messageHandlers.maps.postMessage(address); 338 }, 339 HAS_DATA_API: !!webkit.messageHandlers.setData, 340 HAS_DATA_API_V2: !!webkit.messageHandlers.getDataV2, 341 setData: function setData(id, data) { 342 var escapedData = data.replaceAll("//", "^/^/"); 343 webkit.messageHandlers.setData.postMessage(id + '//' + escapedData); 344 }, 345 getData: function getData(id) { 346 return new Promise(function (resolve, reject) { 347 if (!webkit.messageHandlers.getDataV2) { 348 window.dataFromIOS = function (data) { 349 var parsedData = data.replaceAll("^/^/", "//"); 350 resolve(parsedData); 351 }; 352 webkit.messageHandlers.getData.postMessage(id); 353 } else { 354 var funcName = "returnFunc" + new Date().getTime(); 355 window[funcName] = function (data) { 356 var parsedData = data.replaceAll("^/^/", "//"); 357 window.funcName = null; 358 resolve(parsedData); 359 }; 360 webkit.messageHandlers.getDataV2.postMessage(id + "//" + funcName); 361 } 362 }); 363 } 364 }; 365} 366window.native = function () { 367 var platform = PLATFORM_TYPE.BROWSER; 368 if (window.Android || window.AndroidDetail) { 369 platform = PLATFORM_TYPE.ANDROID; 370 } else if (!!window.webkit && !!window.webkit.messageHandlers && !!window.webkit.messageHandlers.getData) { 371 platform = PLATFORM_TYPE.IOS; 372 } 373 374 //í ì¤í¸ì© 375 //if (platform === PLATFORM_TYPE.IOS) platform = PLATFORM_TYPE.BROWSER; 376 377 var targetFunction = browserFunction; 378 if (platform === PLATFORM_TYPE.ANDROID) { 379 targetFunction = androidFunction; 380 } else if (platform === PLATFORM_TYPE.IOS) { 381 targetFunction = IOSFunction; 382 } 383 var functions = targetFunction(); 384 385 //ì¤ë¥ ë°©ì§ë¥¼ ìí ë¹ í¨ì ì¤ì 386 functions.getData = functions.getData || function () {}; 387 functions.setData = functions.setData || function () {}; 388 return { 389 platform: platform, 390 DOWN_EVENT_KEY: functions.DOWN_EVENT_KEY, 391 getCurrentLocation: functions.getCurrentLocation, 392 // ()=>(lat,lng,address) 393 TmapNavi: functions.TmapNavi, 394 goDetailPage: functions.goDetailPage, 395 // ( mcì½ë ) => void 396 backFromDetailPage: functions.backFromDetailPage, 397 shareCommon: functions.shareCommon, 398 // ( ê³µì í í ì¤í¸ ) => void, 399 getAppLink: functions.getAppLink, 400 // () => (ì¤í ì´ URL) 401 call: functions.call, 402 //( ì íë²í¸ ) => void 403 getAllSearchHistory: functions.getAllSearchHistory, 404 //()=>[{id:1,text:"ì§ìëª }] 405 deleteSearchHistory: functions.deleteSearchHistory, 406 //(id) => void 407 deleteAllSearchHistory: functions.deleteAllSearchHistory, 408 insertSearchHistory: functions.insertSearchHistory, 409 //(ì§ì ê²ìì´) => void, 410 getImages: functions.getImages, 411 // (ìµìê°¯ì, ìµë ê°¯ì) => ({Id,Base64}), 412 AppleMap: functions.AppleMap, 413 requestVoiceSearch: functions.requestVoiceSearch, 414 //({onChangeState, onProgress, onSearchResult}) => void 415 stopVoiceSearch: functions.stopVoiceSearch, 416 //HAS_DATA_API: false, 417 HAS_DATA_API: functions.HAS_DATA_API, 418 HAS_DATA_API_V2: functions.HAS_DATA_API_V2, 419 setData: functions.setData, 420 // (id,text) =>void: 421 getData: functions.getData // (id) => Promise<text> 422 }; 423}(); 424 425var CreateDataController = function CreateDataController(key, options) { 426 if (!options) options = {}; 427 var get = function get() { 428 return new Promise(function (resolve, reject) { 429 window.native.getData(key).then(function (data) { 430 var returnValue = data; 431 if (options.isJson) { 432 returnValue = {}; 433 try { 434 returnValue = JSON.parse(data || "{}"); 435 } catch (e) {} 436 ; 437 } 438 resolve(returnValue); 439 }); 440 }); 441 }; 442 var set = function set(data) { 443 window.native.setData(key, options.isJson ? JSON.stringify(data) : data); 444 }; 445 return { 446 get: get, 447 set: set 448 }; 449}; 450var CreateJsonDataController = function CreateJsonDataController(key) { 451 var dataController = CreateDataController(key, { 452 isJson: true 453 }); 454 var get = function get(jsonKey) { 455 if (!jsonKey) return dataController.get(); 456 return new Promise(function (resolve, reject) { 457 dataController.get().then(function (data) { 458 resolve((data || {})[jsonKey]); 459 }); 460 }); 461 }; 462 463 //ì ë¶ ë³ê²½ 464 var set = function set(data) { 465 return new Promise(function (resolve, reject) { 466 dataController.get().then(function (prevData) { 467 dataController.set(data); 468 resolve(data); 469 }); 470 }); 471 }; 472 473 //í¤ê°ìë°ë¼ ì¼ë¶ ì ì§ 474 var put = function put(data) { 475 return new Promise(function (resolve, reject) { 476 dataController.get().then(function (prevData) { 477 var newData = Object.assign({}, prevData || {}, data); 478 dataController.set(newData); 479 resolve(newData); 480 }); 481 }); 482 }; 483 return { 484 get: get, 485 set: set, 486 put: put 487 }; 488};
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.