chromesetting
杨树明 5 years ago
parent 457267c255
commit 838a590074

@ -23,27 +23,23 @@ function runEvery10Sec() {
}
$(function(){
document.addEventListener('keydown', (e) => {
if (e.keyCode == 83 && (navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey)){
e.preventDefault();
console.log("点击了ctrl+s");
console.log("开始发送消息了ctrl+s");
window.parent.postMessage('jupytermessage','*');
}
});
})
$(function(){
document.addEventListener('keydown', (e) => {
if (e.keyCode == 83 && (navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey)){
e.preventDefault();
console.log("点击了ctrl+s");
console.log("开始发送消息了ctrl+s");
window.parent.postMessage('jupytermessage','*');
}
});
window.addEventListener('message', (e) => {
console.log("触发了Parentwindow");
console.log(e);
if(e){
if(e.data){
if(e.data==="Parentwindow"){
if(e.data==="stopParent"){
//重置停止
timebool=false;
console.log("父窗口调我了");
}else if(e.data==="Parentwindow"){
console.log("父窗口调我了");
}else if(e.data==="clonsParent"){
//取消启动
timebool=true;
this.runEvery10Sec();
@ -53,5 +49,6 @@ $(function(){
}
});
})

@ -135,6 +135,14 @@ function JupyterTPI (props) {
// 重置实训
const handleClickResetTpi = () => {
var _iframe = document.getElementById("rightPaneframe");
if(_iframe == null || _iframe == undefined || _iframe == ""){
return;
}
_iframe.contentWindow.postMessage("stopParent", "*");
Modal.confirm({
title: '重置实训',
content: (
@ -150,7 +158,10 @@ function JupyterTPI (props) {
if (myIdentifier) {
syncJupyterCode(myIdentifier, '重置成功');
}
}
},
onCancel() {
_iframe.contentWindow.postMessage("clonsParent", "*");
},
})
}

@ -57,7 +57,8 @@ function RightPane (props) {
<div className="jupyter_result">
<div className="jupyter_iframe">
<iframe
<iframe
id={"rightPaneframe"}
title=" "
width="100%"
height="100%"

Loading…
Cancel
Save