lsc 2 éve
szülő
commit
e82d7fcbaf
1 módosított fájl, 84 hozzáadás és 35 törlés
  1. 84 35
      js/Desktop/DeskTop.js

+ 84 - 35
js/Desktop/DeskTop.js

@@ -3706,13 +3706,19 @@ U.MD.D.I.openApplicationJie = function (str, cid, stage, task, tool) {
 
     if (_iframe) {
         if (str == 'doc') {
-            U.UF.DL.iframeLoad(_iframe, function () {
+            _iframe = _formdiv.querySelector('iframe')
+            let onloadListener = U.UF.DL.iframeLoad(_iframe, function () {
                 _iframe.contentWindow.U.MD.O.W.load(cid, stage, task, tool);
                 _iframe.contentWindow.document.body.appendChild(script1);
                 _iframe.contentWindow.document.body.appendChild(script2);
                 // _iframe.contentWindow.document.body.appendChild(script3);
                 _iframe.contentWindow.document.body.appendChild(script4);
             })
+            if (onloadListener) {
+                _iframe.contentDocument.location.reload()
+            } else {
+                _iframe.contentDocument.location.reload()
+            }
         } else if (str == 'courseDesign') {
             U.UF.DL.iframeLoad(_iframe, function () {
                 // _iframe.contentWindow.U.MD.O.W.load();
@@ -3721,13 +3727,19 @@ U.MD.D.I.openApplicationJie = function (str, cid, stage, task, tool) {
                 _iframe.contentWindow.document.body.appendChild(script4);
             })
         } else if (str == 'mind') {
-            U.UF.DL.iframeLoad(_iframe, function () {
+            _iframe = _formdiv.querySelector('iframe')
+            let onloadListener = U.UF.DL.iframeLoad(_iframe, function () {
                 // 
                 _iframe.contentWindow.document.body.appendChild(script1);
                 _iframe.contentWindow.document.body.appendChild(script2);
                 _iframe.contentWindow.document.body.appendChild(script4);
                 U.MD.D.I.getContent(cid, stage, task, tool, _userid, '2', _iframe)
             })
+            if (onloadListener) {
+                _iframe.contentDocument.location.reload()
+            } else {
+                _iframe.contentDocument.location.reload()
+            }
         } else if (str == 'whiteboard') {
             _iframe = _formdiv.querySelector('iframe')
             let onloadListener = _iframe.onload = () => {
@@ -3737,13 +3749,10 @@ U.MD.D.I.openApplicationJie = function (str, cid, stage, task, tool) {
                 U.MD.D.I.getContent(cid, stage, task, tool, _userid, '3', _iframe)
             };
             if (onloadListener) {
-                // iframe 已经加载完成  
                 _iframe.contentDocument.location.reload()
             } else {
-                // iframe 还没有加载完成  
                 _iframe.contentDocument.location.reload()
             }
-
         } else {
             _iframe.onload = () => {
                 _iframe.contentWindow.document.body.appendChild(script1);
@@ -4160,13 +4169,19 @@ U.MD.D.I.openApplicationJieTeacher = function (str, cid, stage, task, tool, stud
 
     if (_iframe) {
         if (str == 'doc') {
-            U.UF.DL.iframeLoad(_iframe, function () {
+            _iframe = _formdiv.querySelector('iframe')
+            let onloadListener = U.UF.DL.iframeLoad(_iframe, function () {
                 _iframe.contentWindow.U.MD.O.W.load(cid, stage, task, tool);
                 _iframe.contentWindow.document.body.appendChild(script1);
                 _iframe.contentWindow.document.body.appendChild(script2);
                 // _iframe.contentWindow.document.body.appendChild(script3);
                 _iframe.contentWindow.document.body.appendChild(script4);
             })
+            if (onloadListener) {
+                _iframe.contentDocument.location.reload()
+            } else {
+                _iframe.contentDocument.location.reload()
+            }
         } else if (str == 'courseDesign') {
             U.UF.DL.iframeLoad(_iframe, function () {
                 // _iframe.contentWindow.U.MD.O.W.load();
@@ -4175,20 +4190,32 @@ U.MD.D.I.openApplicationJieTeacher = function (str, cid, stage, task, tool, stud
                 _iframe.contentWindow.document.body.appendChild(script4);
             })
         } else if (str == 'mind') {
-            U.UF.DL.iframeLoad(_iframe, function () {
+            _iframe = _formdiv.querySelector('iframe')
+            let onloadListener = U.UF.DL.iframeLoad(_iframe, function () {
                 // 
                 _iframe.contentWindow.document.body.appendChild(script1);
                 _iframe.contentWindow.document.body.appendChild(script2);
                 _iframe.contentWindow.document.body.appendChild(script4);
                 U.MD.D.I.getContent(cid, stage, task, tool, _userid, '2', _iframe)
             })
+            if (onloadListener) {
+                _iframe.contentDocument.location.reload()
+            } else {
+                _iframe.contentDocument.location.reload()
+            }
         } else if (str == 'whiteboard') {
-            _iframe.onload = () => {
+            _iframe = _formdiv.querySelector('iframe')
+            let onloadListener = _iframe.onload = () => {
                 _iframe.contentWindow.document.body.appendChild(script1);
                 _iframe.contentWindow.document.body.appendChild(script2);
                 _iframe.contentWindow.document.body.appendChild(script4);
                 U.MD.D.I.getContent(cid, stage, task, tool, _userid, '3', _iframe)
             };
+            if (onloadListener) {
+                _iframe.contentDocument.location.reload()
+            } else {
+                _iframe.contentDocument.location.reload()
+            }
         } else {
             _iframe.onload = () => {
                 _iframe.contentWindow.document.body.appendChild(script1);
@@ -4518,20 +4545,32 @@ U.MD.D.I.openApplicationJieS = function (str, cid, stage, task, tool) {
 
     if (_iframe) {
         if (str == 'doc') {
-            U.UF.DL.iframeLoad(_iframe, function () {
+            _iframe = _formdiv.querySelector('iframe')
+            let onloadListener = U.UF.DL.iframeLoad(_iframe, function () {
                 _iframe.contentWindow.U.MD.O.W.load(cid, stage, task, tool, '2');
                 _iframe.contentWindow.document.body.appendChild(script1);
                 _iframe.contentWindow.document.body.appendChild(script2);
                 // _iframe.contentWindow.document.body.appendChild(script3);
                 _iframe.contentWindow.document.body.appendChild(script4);
             })
+            if (onloadListener) {
+                _iframe.contentDocument.location.reload()
+            } else {
+                _iframe.contentDocument.location.reload()
+            }
         } else if (str == 'mind') {
-            U.UF.DL.iframeLoad(_iframe, function () {
+            _iframe = _formdiv.querySelector('iframe')
+            let onloadListener = U.UF.DL.iframeLoad(_iframe, function () {
                 _iframe.contentWindow.document.body.appendChild(script1);
                 _iframe.contentWindow.document.body.appendChild(script2);
                 _iframe.contentWindow.document.body.appendChild(script4);
                 U.MD.D.I.getContents(cid, stage, task, tool, _userid, '2', _iframe)
             })
+            if (onloadListener) {
+                _iframe.contentDocument.location.reload()
+            } else {
+                _iframe.contentDocument.location.reload()
+            }
         } else {
             _iframe.onload = () => {
                 _iframe.contentWindow.document.body.appendChild(script1);
@@ -4815,20 +4854,32 @@ U.MD.D.I.openApplicationJieStudio = function (str, cid, stage, task, tool) {
 
     if (_iframe) {
         if (str == 'doc') {
-            U.UF.DL.iframeLoad(_iframe, function () {
+            _iframe = _formdiv.querySelector('iframe')
+            let onloadListener = U.UF.DL.iframeLoad(_iframe, function () {
                 _iframe.contentWindow.U.MD.O.W.load(cid, stage, task, tool, '2');
                 _iframe.contentWindow.document.body.appendChild(script1);
                 _iframe.contentWindow.document.body.appendChild(script2);
                 // _iframe.contentWindow.document.body.appendChild(script3);
                 _iframe.contentWindow.document.body.appendChild(script4);
             })
+            if (onloadListener) {
+                _iframe.contentDocument.location.reload()
+            } else {
+                _iframe.contentDocument.location.reload()
+            }
         } else if (str == 'mind') {
-            U.UF.DL.iframeLoad(_iframe, function () {
+            _iframe = _formdiv.querySelector('iframe')
+            let onloadListener = U.UF.DL.iframeLoad(_iframe, function () {
                 _iframe.contentWindow.document.body.appendChild(script1);
                 _iframe.contentWindow.document.body.appendChild(script2);
                 _iframe.contentWindow.document.body.appendChild(script4);
                 U.MD.D.I.getContents(cid, stage, task, tool, _userid, '2', _iframe)
             })
+            if (onloadListener) {
+                _iframe.contentDocument.location.reload()
+            } else {
+                _iframe.contentDocument.location.reload()
+            }
         } else {
             _iframe.onload = () => {
                 _iframe.contentWindow.document.body.appendChild(script1);
@@ -5093,40 +5144,38 @@ U.MD.D.I.openApplicationYu = function (str, cid, stage, task, tool) {
             }
             break;
     }
-    const script1 = document.createElement("script");
-    script1.type = "text/javascript";
-    // script1.src = US.Config.bpbl + "/pbl-student-table/dist/js/jquery-3.6.0.min.js";
-
-    // script1.src = "https://cloud.cocorobo.cn/js/Common/jquery-3.6.0.min.js";
-    // const script2 = document.createElement("script");
-    // script2.type = "text/javascript";
-
-    // script2.src = US.Config.bpbl + "/pbl-student-table/dist/js/aws-sdk-2.235.1.min.js";
-    // script2.src = "https://cloud.cocorobo.cn/js/Common/aws-sdk-2.235.1.min.js";
-    // const script3 = document.createElement("script");
-    // script3.type = "text/javascript";
-    // script3.charset = "UTF-8";
-
-    // script3.src = "https://cloud.cocorobo.cn/js/Common/html2canvas.min.js";
-    // const script4 = document.createElement("script");
-    // script4.type = "text/javascript";
-    // script4.src = US.Config.bpbl + "/pbl-student-table/dist/js/jietu4.js";
-
-    // script4.src = "https://cloud.cocorobo.cn/js/Common/jietu4.js";
 
     if (_iframe) {
         if (str == 'doc') {
-            U.UF.DL.iframeLoad(_iframe, function () {
+            _iframe = _formdiv.querySelector('iframe')
+            let onloadListener = U.UF.DL.iframeLoad(_iframe, function () {
                 _iframe.contentWindow.U.MD.O.W.load(cid, stage, task, tool, '2');
             })
+            if (onloadListener) {
+                _iframe.contentDocument.location.reload()
+            } else {
+                _iframe.contentDocument.location.reload()
+            }
         } else if (str == 'mind') {
-            U.UF.DL.iframeLoad(_iframe, function () {
+            _iframe = _formdiv.querySelector('iframe')
+            let onloadListener = U.UF.DL.iframeLoad(_iframe, function () {
                 U.MD.D.I.getContents2(cid, stage, task, tool, _userid, '2', _iframe)
             })
+            if (onloadListener) {
+                _iframe.contentDocument.location.reload()
+            } else {
+                _iframe.contentDocument.location.reload()
+            }
         } else if (str == 'whiteboard') {
-            U.UF.DL.iframeLoad(_iframe, function () {
+            _iframe = _formdiv.querySelector('iframe')
+            let onloadListener = U.UF.DL.iframeLoad(_iframe, function () {
                 U.MD.D.I.getContents2(cid, stage, task, tool, _userid, '3', _iframe)
             })
+            if (onloadListener) {
+                _iframe.contentDocument.location.reload()
+            } else {
+                _iframe.contentDocument.location.reload()
+            }
         } else {
             _iframe.onload = () => {
             };