SanHQin 3 semanas atrás
pai
commit
b3cce703b2
2 arquivos alterados com 66 adições e 5 exclusões
  1. BIN
      img/icon/ppt.png
  2. 66 5
      js/Desktop/DeskTop.js

BIN
img/icon/ppt.png


+ 66 - 5
js/Desktop/DeskTop.js

@@ -5524,7 +5524,9 @@ window.addEventListener('message', function (e) { // 监听 message 事件
         U.MD.D.I.openApplicationJieStudio("doc", e.data.cid, e.data.stage, e.data.task, e.data.tool)
     } else if (e.data.tools && e.data.tools == "3y") {
         U.MD.D.I.openApplicationYu("mind", e.data.cid, e.data.stage, e.data.task, e.data.tool)
-    } else if (e.data.tools && e.data.tools == "1y") {
+    } else if (e.data.tools && e.data.tools == "73y") {
+				U.MD.D.I.openApplicationYu("ppt", e.data.cid, e.data.stage, e.data.task, e.data.tool)
+		} else if (e.data.tools && e.data.tools == "1y") {
         U.MD.D.I.openApplicationYu("whiteboard", e.data.cid, e.data.stage, e.data.task, e.data.tool)
     } else if (e.data.tools && e.data.tools == "inviteLogin") {
         U.MD.D.getuser2(e.data.userid, e.data.courseId)
@@ -11108,6 +11110,48 @@ U.MD.D.I.openApplicationYu = function (str, cid, stage, task, tool) {
                 }
             }
             break;
+				case "ppt":
+					aTool = 73;
+					_iframe = $$("iframe", {
+							"frameborder": "no",
+							"border": "0",
+							"scrolling ": "no",
+							"style": {
+									"cssText": "border:0;width:100%;height:100%"
+							},
+							"src": "https://ppt.cocorobo.cn/"
+					});
+					_box.appendChild(_iframe);
+					_box.appendChild(_jie);
+					_formdiv = new U.UF.UI.form(
+							"PPT",
+							_box, { //"/jsmind/example/demo.html" 
+							"id": "ppts_Yu" + cid + stage + task + tool,
+							"style": {
+									"width": "90%",
+									"height": "90%",
+									"overflow": 'hidden'
+							},
+							"onresize": function () { }
+					}, {
+							closecallback: function () { }
+					}, {
+							"style": {
+									"height": "36px"
+							}
+					}).form; //创建窗体
+					_taskbar = {
+							"id": str + _formdiv.id,
+							"style": {
+									"backgroundImage": "url(/img/icon/ppt.png)"
+							},
+							"name": "PPT",
+							"forms": _formdiv,
+							"click": function () {
+									U.MD.D.I.openApplication(str, obj, info);
+							}
+					}
+					break;
     }
 
     if (_iframe) {
@@ -11155,7 +11199,17 @@ U.MD.D.I.openApplicationYu = function (str, cid, stage, task, tool) {
             } else {
                 _iframe.contentDocument.location.reload()
             }
-        } else {
+        } else if (str == 'ppt') {
+					_iframe = _formdiv.querySelector('iframe')
+					let onloadListener = U.UF.DL.iframeLoad(_iframe, function () {
+							U.MD.D.I.getContents2(cid, stage, task, tool, _userid, '5', _iframe)
+					})
+					if (onloadListener) {
+							_iframe.contentDocument.location.reload()
+					} else {
+							_iframe.contentDocument.location.reload()
+					}
+				} else {
             _iframe.onload = () => { };
         }
         _jie.onclick = async () => {
@@ -11173,7 +11227,10 @@ U.MD.D.I.openApplicationYu = function (str, cid, stage, task, tool) {
             } else if (aTool == 57) {
                 text = encodeURIComponent(_iframe.contentWindow.getLoadXmlStr())
                 type = '4'
-            }
+            } else if (aTool == 73) {
+								text = _iframe.contentWindow.window.exportJSON()
+								type = '5'
+					}
             _loading.style.display = 'flex'
 
             U.MD.D.I.setContents(_cid, _stage, _task, _tool, _userid, type, text, _loading, _lspan)
@@ -11232,7 +11289,9 @@ U.MD.D.I.getContents2 = function (cid, s, task, t, uid, type, iframe) {
                     iframe.contentWindow.h.app.updateScene({ elements: JSON.parse(JSON.parse(xmlhttp.response)[0][0].text) })
                 } else if (type == '4') {
                     iframe.contentWindow.loadingXml(JSON.parse(xmlhttp.response)[0][0].text)
-                }
+                } else if (type == '5') {
+										iframe.contentWindow.window.readJSON(JSON.parse(JSON.parse(xmlhttp.response)[0][0].text), true)
+								}
             } else {
                 if (type == '2') {
                     iframe.contentWindow.editor.minder.importData('json', '')
@@ -11240,7 +11299,9 @@ U.MD.D.I.getContents2 = function (cid, s, task, t, uid, type, iframe) {
                     iframe.contentWindow.h.app.updateScene({ elements: [] })
                 } else if (type == '4') {
                     iframe.contentWindow.window.blockpy.components.editor.blockly.clear();
-                }
+                }else if (type == '5') {
+										iframe.contentWindow.window.readJSON({}, true)
+								}
             }
         }
     }