chromesetting
杨树林 5 years ago
parent 0653c29ab5
commit 9ad11c5deb

@ -5,3 +5,9 @@
$(function(){ $(function(){
console.log("educoder jupyter js init"); console.log("educoder jupyter js init");
}) })
$(function(){
window.parent.postMessage('jupytermessage','需要发送的消息');
})

@ -10,20 +10,19 @@
// //子目标父窗口接收子窗口发送的消息 // //子目标父窗口接收子窗口发送的消息
// let message = {type: 'open', link:'需要发送的消息'}; // let message = {type: 'open', link:'需要发送的消息'};
// //子窗口向父窗口发送消息,消息中包含我们想跳转的链接 //子窗口向父窗口发送消息,消息中包含我们想跳转的链接
// window.parent.postMessage(message,'需要发送的消息'); window.parent.postMessage('jupytermessage','需要发送的消息');
// //目标父窗口接收子窗口发送的消息 // //目标父窗口接收子窗口发送的消息
// window.addEventListener('message', (e)=>{ // window.addEventListener('message', (e)=>{
// let origin = event.origin || event.originalEvent.origin; // let origin = event.origin || event.originalEvent.origin;
// if (origin !== '需要发送的消息') { // if (origin !== '需要发送的消息') {
// return; // return;
// }else { // }else {
// //更换iframe的src,实现iframe页面跳转 // //更换iframe的src,实现iframe页面跳转
// 执行方法 // 执行方法
// } // }
// },false); // },false);

@ -229,6 +229,8 @@ class Challengesjupyter extends Component {
const business = this.props&&this.props.current_user&&this.props.current_user.business?this.props.current_user.business:false; const business = this.props&&this.props.current_user&&this.props.current_user.business?this.props.current_user.business:false;
//管理员 //管理员
const admin = this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; const admin = this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
//用户
const login = this.props&&this.props.current_user&&this.props.current_user.login?this.props.current_user.login:"";
let mysidentity =false; let mysidentity =false;
try { try {
@ -409,10 +411,19 @@ class Challengesjupyter extends Component {
:"" :""
) )
: :
<iframe src={this.state.jupyter_url} className={enlarge?"fangdatwo":""} (
sandbox="allow-same-origin allow-scripts allow-top-navigation " scrolling="no" id="frame" login==="innov"?
name="framename" width="100%" height="700" frameBorder="0" <iframe src={"http://121.41.4.83:46666/notebooks/root/work/01.ipynb"} className={enlarge?"fangdatwo":""}
></iframe> sandbox="allow-same-origin allow-scripts allow-top-navigation " scrolling="no" id="frame"
name="framename" width="100%" height="700" frameBorder="0"
></iframe>
:
<iframe src={this.state.jupyter_url} className={enlarge?"fangdatwo":""}
sandbox="allow-same-origin allow-scripts allow-top-navigation " scrolling="no" id="frame"
name="framename" width="100%" height="700" frameBorder="0"
></iframe>
)
} }
</div> </div>
</div> </div>

Loading…
Cancel
Save