|
|
|
@ -17,22 +17,22 @@ function runEvery10Sec() {
|
|
|
|
|
setTimeout( runEvery10Sec, 1000 * 10 );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function keyDown(e){
|
|
|
|
|
try {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
var currKey=0, e=e||event||window.event;
|
|
|
|
|
currKey = e.keyCode||e.which||e.charCode;
|
|
|
|
|
if(currKey == 83 && (e.ctrlKey||e.metaKey)){
|
|
|
|
|
console.log("点击了ctrl+s");
|
|
|
|
|
console.log("开始发送消息了ctrl+s");
|
|
|
|
|
window.parent.postMessage('jupytermessage','*');
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
document.onkeydown = keyDown;
|
|
|
|
|
// function keyDown(e){
|
|
|
|
|
// try {
|
|
|
|
|
// e.preventDefault();
|
|
|
|
|
// var currKey=0, e=e||event||window.event;
|
|
|
|
|
// currKey = e.keyCode||e.which||e.charCode;
|
|
|
|
|
// if(currKey == 83 && (e.ctrlKey||e.metaKey)){
|
|
|
|
|
// console.log("点击了ctrl+s");
|
|
|
|
|
// console.log("开始发送消息了ctrl+s");
|
|
|
|
|
// window.parent.postMessage('jupytermessage','*');
|
|
|
|
|
// return true;
|
|
|
|
|
// }
|
|
|
|
|
// }catch (e) {
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// document.onkeydown = keyDown;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|