From 3b83ffd0948ddc93d854f6eaf7422de484a2576c Mon Sep 17 00:00:00 2001 From: lch Date: Fri, 11 Jun 2021 01:39:16 +0000 Subject: [PATCH] =?UTF-8?q?beforeunload=20=EC=9D=B4=EB=B2=A4=ED=8A=B8=20?= =?UTF-8?q?=EB=B0=9C=EC=83=9D=EC=8B=9C=20ajax=20=EC=98=A4=EB=A5=98?= =?UTF-8?q?=EB=A1=9C=20=ED=95=99=EC=8A=B5=EC=A2=85=EB=A3=8C=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=ED=81=B4=EB=A6=AD=20=EB=98=90=EB=8A=94=20beforeunl?= =?UTF-8?q?oad=20=EC=9D=B4=EB=B2=A4=ED=8A=B8=20=EB=B0=9C=EC=83=9D=EC=8B=9C?= =?UTF-8?q?=20ajax=20:=20async:=20false=20=EB=8F=99=EA=B8=B0=EB=A1=9C=20?= =?UTF-8?q?=ED=98=B8=EC=B6=9C=20=ED=95=98=EA=B2=8C=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=ED=95=A8=EC=88=98=20async=20=EC=98=B5?= =?UTF-8?q?=EC=85=98=EC=B6=94=EA=B0=80=20function=20golog(false,=20true,?= =?UTF-8?q?=20false,=20false);=20function=20capp(url,=20p,=20callback,=20g?= =?UTF-8?q?etpost,=20autoMsg,=20noBG,=20jsislayer2,=20hideBG,=20noerror,?= =?UTF-8?q?=20async)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FO/Views/CDMS/Contents.cshtml | 16 ++++++++++++---- FO/Views/CDMS/Contents2.cshtml | 7 +++++++ FO/Views/CDMS/ViewTaste.cshtml | 5 +---- FO/js/site.js | 4 +++- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/FO/Views/CDMS/Contents.cshtml b/FO/Views/CDMS/Contents.cshtml index ffd078e..b05937d 100644 --- a/FO/Views/CDMS/Contents.cshtml +++ b/FO/Views/CDMS/Contents.cshtml @@ -121,6 +121,13 @@ $("#video1").css("max-height", window.innerHeight - 120); } } + function closestudy() { + if (!_passunload && _istaste != 1 && !_islogout) { + golog(false, true, false, false); + _passunload = true; + } + self.close(); + } $(window).load(function () { if (@Model.status == 0) { _passunload = true; @@ -352,11 +359,12 @@ resizeme(); //} } - function golog(ispaging, isunload, isinning) { + function golog(ispaging, isunload, isinning, async) { ispaging = ispaging || false; isunload = isunload || false; isinning = isinning || false; + async = async || true; _tsec++; if (!ispaging && !isunload && !isinning) { _sec++; @@ -379,7 +387,7 @@ _psecond = getint($("#video1")[0].currentTime); } } catch (e) { } - capp("/focommon/studylog", { logno: _logno, lectno: @Model.lip.lectno, cmino: @Model.lip.cmino, cpno: _cpno, studysec: _sec, ispc: ismobile() ? 0 : 1, nextcpno: ispaging ? _nextcpno : 0, getiframe: @(Model.CMInning.ismenu == 1 && Model.CMInning.ctype == 2 ? 1 : 0), issample: @Model.istaste, psec: _psecond }, "cbstudylog" + (ispaging ? "page" : "") + (isunload ? "unload" : "") + (isinning ? "inning" : ""), null, null, true, null, true); + capp("/focommon/studylog", { logno: _logno, lectno: @Model.lip.lectno, cmino: @Model.lip.cmino, cpno: _cpno, studysec: _sec, ispc: ismobile() ? 0 : 1, nextcpno: ispaging ? _nextcpno : 0, getiframe: @(Model.CMInning.ismenu == 1 && Model.CMInning.ctype == 2 ? 1 : 0), issample: @Model.istaste, psec: _psecond }, "cbstudylog" + (ispaging ? "page" : "") + (isunload ? "unload" : "") + (isinning ? "inning" : ""), null, null, true, null, true, async)); } else if (_mtime > 0 && !_okmid && _tsec >= _mtime && _mtimesec < 1) { //clearInterval(_timerlog); _mtimesec = 1; @@ -540,8 +548,8 @@ //else { //if (opener && (opener._cdmsisopenning || 0) == 0) { opener.location.href = opener.location.href.replace(/#/gi, ''); - //} - golog(false, true); + //} + golog(false, true, false, false); //} } } diff --git a/FO/Views/CDMS/Contents2.cshtml b/FO/Views/CDMS/Contents2.cshtml index 7e833e7..65b7f73 100644 --- a/FO/Views/CDMS/Contents2.cshtml +++ b/FO/Views/CDMS/Contents2.cshtml @@ -130,6 +130,13 @@ $("#video1").css("max-height", window.innerHeight - 120); } } + function closestudy() { + if (!_passunload && _istaste != 1 && !_islogout) { + golog(false, true); + _passunload = true; + } + self.close(); + } $(window).load(function () { if (@Model.status == 0) { _passunload = true; diff --git a/FO/Views/CDMS/ViewTaste.cshtml b/FO/Views/CDMS/ViewTaste.cshtml index 25917a9..e9fb0ad 100644 --- a/FO/Views/CDMS/ViewTaste.cshtml +++ b/FO/Views/CDMS/ViewTaste.cshtml @@ -20,9 +20,6 @@ if (@Model.status == 0) { self.close(); } - }); - function closestudy() { - self.close(); - } + }); } \ No newline at end of file diff --git a/FO/js/site.js b/FO/js/site.js index 44f4922..66a9192 100644 --- a/FO/js/site.js +++ b/FO/js/site.js @@ -602,10 +602,11 @@ function cap(url, formid, callback, getpost, autoMsg, noBG, jsislayer2) { console.log("다른 작업을 처리중입니다. 잠시후 다시 작업해주세요."); } } -function capp(url, p, callback, getpost, autoMsg, noBG, jsislayer2,hideBG, noerror) { +function capp(url, p, callback, getpost, autoMsg, noBG, jsislayer2, hideBG, noerror, async) { _jsislayer2 = jsislayer2 || false; _noerror = noerror || false; _hideBG = hideBG || false; + _async = async || true; if (!isCaping) { isAutoMsg = autoMsg || false; _bging = noBG || false; @@ -624,6 +625,7 @@ function capp(url, p, callback, getpost, autoMsg, noBG, jsislayer2,hideBG, noerr type: getpost || "post", url: url, data: p, + async: _async, success: function (r) { isCaping = false; capResult = r;