1let __firstSdkVersion = null; 2const __development = false; 3(function () { 4 $(document).ready(function () { 5 app(); 6 }); 7 8 function getHostForApp() { 9 if (__development || localStorage.getItem('runtime-dev')) { 10 /* ê°ë° ë²ì */ 11 return { 12 mainHost: "http://purple.jungli.net/test/fair/ini-integrate/www", 13 /* ê°ë°ìë³ë¡ ì§ì í dist í´ëìì íë©´ ìì¤ë¥¼ ë¶ë¬ì¨ë¤. */ 14 distHost: localStorage.getItem('runtime-dev-url') || "http://purple.jungli.net/test/fair/ini-integrate/www/dist", 15 sdkHost: "http://purple.jungli.net/test/picktalk/www/dist", 16 } 17 }else { 18 /* ë°°í¬ ë²ì */ 19 return { 20 mainHost: "https://iniwedding.com/h", 21 sdkHost: "https://initalk-sdk.iniwedding.com", 22 } 23 } 24 } 25 26 function getHostForWeb() { 27 const host = window.location.host; 28 const hostName = window.location.hostname; 29 30 /* ì¸ë¶ ë§í¬ ì°ë */ 31 var params = getUrlParams(); 32 if(params.TID2) { 33 window.TID2 = params.TID2; 34 } 35 if(params.p_name) { 36 window.location.weblinkPageName = params.p_name; 37 38 /** 39 * 구) íì´ì§ ë°ì´í°ë¥¼ JSONì¼ë¡ ë°ìì ì¤í 40 * ë ¸ì¶ëë urlì´ URLì¸ì½ë© ëì´ìì´ ëì¼ë¡ í´ìí기 í¨ë¬ 41 */ 42 if(params.p_data) { 43 try{ 44 window.location.weblinkPageData = JSON.parse(decodeURIComponent(params.p_data)); 45 }catch(e){ 46 console.error('ì¹ë§í¬ ë°ì´í°ê° JSON í¼ì´ ìëëë¤'); 47 } 48 // delete params.p_data; 49 } 50 /** 51 * ì ) íì´ì§ ë°ì´í°ë¥¼ íë¼ë¯¸í°ë¡ ë°ìì ì¤í 52 * íì´ì§ ë°ì´í°ë íë¼ë¯¸í° í¤ìì prefixê° "d_"ë¡ ììíë íë¼ë¯¸í° í¤ì ë°ì´í°ë¥¼ ì¬ì© 53 * ì: 54 * - ìì´ëì¨ë© ìê° > ìì´ëë´ì¤ë£¸ URL : p_name=introduce&d_tabName=newsroom 55 * - íì´ì§ì´ë¦: introduce / íì´ì§ë°ì´í°: tabName=newsroom 56 */ 57 else { 58 let pageData = {}; 59 Object.keys(params).filter((key)=>key.indexOf('d_') != -1).forEach((key)=>pageData[key.split('d_')[1]] = params[key]); 60 window.location.weblinkPageData = pageData; 61 } 62 } 63 64 65 /* ë©ì¸ ìë² */ 66 if(hostName.indexOf('iniwedding.com') != -1) { 67 var customUrlParams = $.extend(params, {}); 68 history.pushState(null, null, `?${decodeURIComponent($.param(customUrlParams))}`); 69 return { 70 mainHost: "./", 71 sdkHost: "https://initalk-sdk.iniwedding.com" 72 }; 73 } 74 /* dev ì¹ ìë² */ 75 else if(hostName.indexOf('m-v2-dev.') != -1) { 76 var customUrlParams = $.extend(params, {}); 77 history.pushState(null, null, `?${decodeURIComponent($.param(customUrlParams))}`); 78 return { 79 mainHost: "", 80 sdkHost: "https://initalk-sdk.iniwedding.com" 81 }; 82 } 83 /* í ì¤í¸ ìë² */ 84 else { 85 /* ëë²ê·¸ëª¨ë ì¶ê° */ 86 var customUrlParams = $.extend(params, { 87 mode: "debug", 88 }); 89 history.pushState(null, null, `?${decodeURIComponent($.param(customUrlParams))}`); 90 91 /* 과거 ì¤ë ì· */ 92 if(params.sdk) { 93 return { 94 mainHost: `https://file1.iniwedding.com/fair/integrate/sdk/${params.sdk}`, 95 sdkHost: "http://purple.jungli.net/test/picktalk/www/dist", 96 }; 97 } 98 99 /* ë´ë¶ í ì¤í¸ */ 100 if(hostName.indexOf("purple") != -1) { 101 return { 102 mainHost: "http://purple.jungli.net/test/fair/ini-integrate/www", 103 sdkHost: "http://purple.jungli.net/test/picktalk/www/dist", 104 } 105 } 106 107 /* ë커 í ì¤í¸ */ 108 if(host.indexOf("localhost:9712") != -1) { 109 return { 110 mainHost: "/ini-integrate/www", 111 sdkHost: "http://purple.jungli.net/test/picktalk/www/dist", 112 }; 113 } 114 115 /* npm í ì¤í¸ */ 116 if(hostName.indexOf("localhost") != -1 || hostName.indexOf("192.168.22") != -1) { 117 return { 118 mainHost: "", 119 sdkHost: "http://purple.jungli.net/test/picktalk/www/dist", 120 }; 121 } 122 } 123 124 } 125 126 function app() { 127 const hostInfo = window.cordova ? getHostForApp() : getHostForWeb();; 128 const host = hostInfo.mainHost; 129 /* ë³ë dist 주ìê° ìì¼ë©´ 기존 í¸ì¤í¸ íìì dist를 ì¬ì©íë¤. */ 130 const distHost = hostInfo.distHost || `${host}/dist`; 131 const sdkHost = hostInfo.sdkHost; 132 133 const prepareEl = $("#prepare"); 134 const dotsEl = prepareEl.find(".dots"); 135 const offset = ($(window).height() / 2) - 13; 136 if(window.cordova) { 137 if (cordova.platformId == "android") { 138 dotsEl.css("bottom", `${offset}px`); 139 } else if (cordova.platformId == "ios") { 140 dotsEl.css("top", `${offset}px`); 141 } 142 }else { 143 dotsEl.css("top", `${offset}px`); 144 } 145 dotsEl.css("opacity", "1"); 146 147 requestVersion().then(function (versionInfo) { 148 if (!versionInfo) { 149 console.error("ìë²ìì SDK ë²ì ì ê°ì ¸ì¬ ì ììµëë¤."); 150 } 151 const sdkVersion = versionInfo ? versionInfo.sdk_version : "000000"; 152 __firstSdkVersion = sdkVersion; 153 154 const templateUrl = makeUrl(`${distHost}/app-sdk.template.html`, sdkVersion); 155 156 const sdkJsUrl = makeUrl(`${sdkHost}/picktalk-sdk.min.js`, sdkVersion); 157 const sdkCssUrl = makeUrl(`${sdkHost}/picktalk-sdk.min.css`, sdkVersion); 158 159 const appJsUrl = makeUrl(`${distHost}/app-sdk.min.js`, sdkVersion); 160 const appCssUrl = makeUrl(`${distHost}/app-sdk.min.css`, sdkVersion); 161 162 /* ì¤íì¼ê³¼ í í릿ì ë³ë ¬ë¡ ë°ê³ , ë ë¤ ì¤ë¹ë ë¤ ì± ì¤í¬ë¦½í¸ë¥¼ ì¤ííë¤. */ 163 Promise.all([ 164 styleLoader([sdkCssUrl, appCssUrl]), 165 htmlLoader(templateUrl), 166 ]) 167 .then(function () { 168 scriptLoader([sdkJsUrl, appJsUrl]) 169 .then(function () { 170 $("#app").css("opacity", "1"); 171 setTimeout(function () { 172 prepareEl.fadeOut(100, function () {}); 173 }, 800); 174 }) 175 .catch(function (error) { 176 console.error("error in Script Loader", error); 177 }); 178 }) 179 .catch(function (error) { 180 console.error("error in Resource Loader", error); 181 }); 182 }); 183 } 184 function styleLoader(cssList) { 185 let promises = []; 186 $.each(cssList, function (i, cssUrl) { 187 promises.push(cssLoader(cssUrl)); 188 }); 189 return Promise.all(promises); 190 } 191 192 function scriptLoader(jsList) { 193 return jsList.reduce(function (prom, nextUrl) { 194 return prom.then(function () { 195 return jsLoader(nextUrl); 196 }); 197 }, Promise.resolve()); 198 } 199 200 function htmlLoader(url) { 201 return new Promise(function (res, rej) { 202 $("#app").load(url, function (response, status, xhr) { 203 if (status == "error") { 204 console.error("html Load : ì¤ë¥ê° ììµëë¤"); 205 rej(response, status, xhr); 206 return; 207 } 208 res(); 209 }); 210 }); 211 } 212 function makeUrl(url, version) { 213 return url + "?_=" + version; 214 } 215 function jsLoader(url) { 216 return new Promise(function (res, rej) { 217 $.getScript(url).done(res).fail(rej); 218 }); 219 } 220 function cssLoader(url) { 221 return new Promise(function (res) { 222 var link = document.createElement("link"); 223 link.rel = "stylesheet"; 224 link.type = "text/css"; 225 link.href = url; 226 link.onload = res; 227 link.onerror = function () { 228 /* ì¤íì¼ ì¤í¨ê° ì± ì ì²´ ì¤íì ë§ì§ ìëë¡ ê¸°ì¡´ ëìì²ë¼ ê³ì ì§ííë¤. */
229 console.error("error in CSS Loader", url); 230 res(); 231 }; 232 document.head.appendChild(link); 233 }); 234 } 235 236 function requestVersion() { 237 return new Promise(function (res, rej) { 238 $.ajax("https://m-admin.iniwedding.com/api3/integrate/version", { 239 type: "get", 240 dataType: "json", 241 jsonp: "callback", 242 contentType: "application/json; charset=utf-8", 243 cache: false, 244 beforeSend: function (request) { 245 request.setRequestHeader("Accept", "application/json"); 246 request.setRequestHeader("Content-Type", "application/json"); 247 }, 248 success: function (oRes, sStatus, oXHR) { 249 if (oRes.isSuccess) { 250 res(oRes.data); 251 } else { 252 res(null); 253 } 254 }, 255 error: function (xhr, status, error) { 256 res(null); 257 }, 258 }); 259 }); 260 } 261 262 function getUrlParams() { 263 var params = {}; 264 window.location.search.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (str, key, value) { 265 params[key] = value; 266 }); 267 return params; 268 } 269})();
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.