pre_develop
jingquan huang 6 years ago
commit b426ee47a0

@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><meta name="renderer" content="webkit"/><meta name="force-rendering" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><title>Educoder</title><script type="text/javascript">window.__isR=!0</script><link rel="stylesheet" href="/react/build/css/css_min_all.css"><link rel="stylesheet" href="/assets/iconfont/iconfont.css"><link href="/react/build/./static/css/main.0568ccaf.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="md_div" style="display:none"></div><div id="root" class="page -layout-v -fit"></div><div id="picture_display" style="display:none"></div><script type="text/javascript" src="/react/build/js/js_min_all.js"></script><script type="text/javascript" src="/assets/kindeditor/kindeditor.js"></script><script type="text/javascript" src="/react/build/js/create_kindeditor.js"></script><script type="text/javascript" src="/javascripts/educoder/edu_application.js"></script><script type="text/javascript" src="/react/build/./static/js/main.dfa4489a.js"></script></body></html> <!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><meta name="renderer" content="webkit"/><meta name="force-rendering" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><title>Educoder</title><script type="text/javascript">window.__isR=!0</script><link rel="stylesheet" href="/react/build/css/css_min_all.css"><link rel="stylesheet" href="/assets/iconfont/iconfont.css"><link href="/react/build/./static/css/main.e1b0d6a5.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="md_div" style="display:none"></div><div id="root" class="page -layout-v -fit"></div><div id="picture_display" style="display:none"></div><script type="text/javascript" src="/react/build/js/js_min_all.js"></script><script type="text/javascript" src="/assets/kindeditor/kindeditor.js"></script><script type="text/javascript" src="/react/build/js/create_kindeditor.js"></script><script type="text/javascript" src="/javascripts/educoder/edu_application.js"></script><script type="text/javascript" src="/react/build/./static/js/main.1d0aa33a.js"></script></body></html>

@ -177,6 +177,7 @@ $(function(){
//var nCol = 0; //var nCol = 0;
lab.live('mousedown touchstart',function(){ lab.live('mousedown touchstart',function(){
$('#game_webssh').css('pointer-events', 'none') $('#game_webssh').css('pointer-events', 'none')
$('#contentIframe').css('pointer-events', 'none')
dragging = true; dragging = true;
leftOffset = $(".labelN").offset().left; leftOffset = $(".labelN").offset().left;
wrapWidth = $(".labelN").width(); wrapWidth = $(".labelN").width();
@ -186,6 +187,7 @@ $(function(){
cen.live('mousedown ',function(){ cen.live('mousedown ',function(){
// 使得iframe不捕获事件 // 使得iframe不捕获事件
$('#game_webssh').css('pointer-events', 'none') $('#game_webssh').css('pointer-events', 'none')
$('#contentIframe').css('pointer-events', 'none')
flag = true; flag = true;
topOffset = $(".centerH").offset().top; topOffset = $(".centerH").offset().top;
wrapHeight = $(".centerH").height(); wrapHeight = $(".centerH").height();
@ -262,6 +264,8 @@ $(function(){
doc.live("mouseup touchend", function(e) { doc.live("mouseup touchend", function(e) {
// 使得iframe可以继续捕获事件 // 使得iframe可以继续捕获事件
$('#game_webssh').css('pointer-events', 'inherit') $('#game_webssh').css('pointer-events', 'inherit')
$('#contentIframe').css('pointer-events', 'inherit')
flag = false; flag = false;
dragging = false; dragging = false;
e.cancelBubble = true; e.cancelBubble = true;

File diff suppressed because one or more lines are too long

@ -181,6 +181,8 @@ class Index extends Component {
challenge={context.challenge} challenge={context.challenge}
myshixun={context.myshixun} myshixun={context.myshixun}
shixun={context.shixun} shixun={context.shixun}
vnc_url={context.vnc_url}
loading={context.loading} loading={context.loading}
discusses_count={context.discusses_count} discusses_count={context.discusses_count}
hide_code={context.hide_code} hide_code={context.hide_code}

@ -17,17 +17,15 @@ import Button from 'material-ui/Button';
import './tpiPage.css'; import './tpiPage.css';
import './tpiPageForMobile.css'; import './tpiPageForMobile.css';
const $ = window.$; const $ = window.$;
const showIframeContent = window.location.search.indexOf('vnc=1') != -1; // const showIframeContent = window.location.search.indexOf('vnc=1') != -1;
class MainContent extends Component { class MainContent extends Component {
componentDidMount() { componentDidMount() {
// ios下图标位置有问题 // ios下图标位置有问题
if (!showIframeContent) {
setTimeout(()=>{ setTimeout(()=>{
if (window.$('.b-label>.resize-helper').position().top < 100) { if (window.$('.b-label>.resize-helper').position().top < 100) {
window.$('.b-label>.resize-helper').css('top', '200px') window.$('.b-label>.resize-helper').css('top', '200px')
} }
}, 4000) }, 4000)
}
$("body").css("padding-right","0px!important") $("body").css("padding-right","0px!important")
} }
onResizeButtonClick = () => { onResizeButtonClick = () => {
@ -35,7 +33,7 @@ class MainContent extends Component {
} }
render() { render() {
const { challenge, output_sets, onRunCodeTest, latest_output, record, st, readRepoTimeout, const { challenge, output_sets, onRunCodeTest, latest_output, record, st, readRepoTimeout,
onTestSetHeaderClick, loading, codeLoading } = this.props onTestSetHeaderClick, loading, codeLoading, shixun, vnc_url } = this.props
// if (output_sets && output_sets.test_sets) { // if (output_sets && output_sets.test_sets) {
// const test_sets_array = JSON.parse("[" + output_sets.test_sets + "]"); // const test_sets_array = JSON.parse("[" + output_sets.test_sets + "]");
@ -48,6 +46,7 @@ class MainContent extends Component {
} else { } else {
games_repository_contents_style = {overflow: 'hidden', height: '445px'} games_repository_contents_style = {overflow: 'hidden', height: '445px'}
} }
const showIframeContent = shixun && shixun.vnc == true
return ( return (
<div className="page--body -margin-t-64 -flex"> <div className="page--body -margin-t-64 -flex">
<div className="-layout -stretch -fit labelN" id="game_show_content"> <div className="-layout -stretch -fit labelN" id="game_show_content">
@ -68,19 +67,21 @@ class MainContent extends Component {
<div className="split-panel--second -layout -vertical -flex -relative -flex-basic50" <div className="split-panel--second -layout -vertical -flex -relative -flex-basic50"
id="game_right_contents" style={{width: '996px'}}> id="game_right_contents" style={{width: '996px'}}>
{/* {/*
iframe模式下需要这两个样式来调整 iframe模式下可以使用样式控制不接收鼠标事件
.page--body { z-index: 9999; }
.resize-helper { top: 10px } .page--body { z-index: ${showIframeContent ? '7999': '1'} ; }
.b-label>.resize-helper { top: ${showIframeContent ? '10px': '50%'} }
*/} */}
<style>{` <style>{`
#contentIframe { #contentIframe {
height: 100%; height: 100%;
background: #fff; background: #fff;
} }
.page--body { z-index: ${showIframeContent ? '7999': '1'} ; } .page--body { z-index: 9999; }
.b-label>.resize-helper { top: ${showIframeContent ? '10px': '50%'} } .resize-helper { top: 10px }
`}</style> `}</style>
{ showIframeContent ? <iframe src="http://106.75.27.125:42288/vnc.html" id="contentIframe" ></iframe> : { showIframeContent ? <iframe src={vnc_url ||"http://106.75.27.125:42288/vnc.html"} id="contentIframe" ></iframe> :
<React.Fragment> <React.Fragment>
{/* 旧版本、评测等待提示--更新提示块*/} {/* 旧版本、评测等待提示--更新提示块*/}
{/*<div className="tip-panel-animate clearfix user_bg_shadow bor-grey-e"> {/*<div className="tip-panel-animate clearfix user_bg_shadow bor-grey-e">

@ -229,6 +229,10 @@ class MainContentContainer extends Component {
// arg_path 点击文件目录树时传入的点击节点对应的path // arg_path 点击文件目录树时传入的点击节点对应的path
fetchRepositoryCode( props, arg_path, type, isRetry) { fetchRepositoryCode( props, arg_path, type, isRetry) {
const { challenge, showSnackbar, game, shixun, hide_code } = props ? props : this.props; const { challenge, showSnackbar, game, shixun, hide_code } = props ? props : this.props;
if (shixun.vnc == true) {
// vnc模式下不需要加载代码
return true;
}
if (hide_code) { // 隐藏code的实训 if (hide_code) { // 隐藏code的实训
this.setState({ codeLoading: false }); this.setState({ codeLoading: false });
return; return;
@ -269,6 +273,7 @@ class MainContentContainer extends Component {
const that = this; const that = this;
// test // test
// console.log('---- fetch code')
// const _code = '"#include<math.h>\n\n// \u6c42n\u7684\u7b97\u672f\u5e73\u65b9\u6839\ndouble SquareRoot(float n)\n{\n // \u8bf7\u5728\u6b64\u6dfb\u52a0\u4ee3\u7801\uff0c\u8865\u5168\u51fd\u6570SquareRoot\n /********** Begin *********/\n\n\n /********** End **********/\n}"' // const _code = '"#include<math.h>\n\n// \u6c42n\u7684\u7b97\u672f\u5e73\u65b9\u6839\ndouble SquareRoot(float n)\n{\n // \u8bf7\u5728\u6b64\u6dfb\u52a0\u4ee3\u7801\uff0c\u8865\u5168\u51fd\u6570SquareRoot\n /********** Begin *********/\n\n\n /********** End **********/\n}"'
// this.oldRepositoryCode = _code; // this.oldRepositoryCode = _code;
// this.updateRepositoryCode(_code, updateCodeMirror) // this.updateRepositoryCode(_code, updateCodeMirror)

@ -412,7 +412,7 @@ class CodeRepositoryView extends Component {
{/* onClick={showFilesDrawer.bind(this, true)} */} {/* onClick={showFilesDrawer.bind(this, true)} */}
{ myshixun_manager == true && <Tooltip title={ "下载代码"} disableFocusListener={true}> { myshixun_manager == true && <Tooltip title={ "下载代码"} disableFocusListener={true}>
<a href={`/myshixuns/${myshixun.identifier}/archive`} className="iconButton" target='_blank'> <a href={shixun.zip_path || `/myshixuns/${myshixun.identifier}/archive`} className="iconButton" target='_blank'>
<i className="iconfont icon-xiazai1 font-18 "></i> <i className="iconfont icon-xiazai1 font-18 "></i>
</a> </a>
</Tooltip> } </Tooltip> }

Loading…
Cancel
Save