chromesetting
杨树明 5 years ago
parent 452daa1f9f
commit ae0a1d3a54

@ -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(){
}
}
});
})

Loading…
Cancel
Save