diff --git a/public/javascripts/jupyter.js b/public/javascripts/jupyter.js index 6610bfdca..1f64f7e77 100644 --- a/public/javascripts/jupyter.js +++ b/public/javascripts/jupyter.js @@ -9,7 +9,6 @@ window.onload=function(){ } function runEvery10Sec() { - // 1000 * 10 = 10 秒钟 console.log("每隔10秒中一次"); require(["base/js/namespace"],function(Jupyter) { @@ -26,24 +25,19 @@ $(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"); + console.log("ctrl+s"); window.parent.postMessage('jupytermessage','*'); } }); -}) -$(function(){ 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==="cancelwindow"){ - console.log("父窗口调我了取消启动"); + console.log("父窗口调用停止"); + }else if(e.data==="clonsParent"){ + console.log("父窗口调用启动"); //取消启动 timebool=true; this.runEvery10Sec(); @@ -51,7 +45,7 @@ $(function(){ } } - }); }) +