修复编辑器背景与重复的代码更新提示

video_transcode
harry 5 years ago
parent a9a74219b5
commit 862135ef8a

@ -22,7 +22,7 @@ const SettingDrawer = (props) => {
return +fromStore('oj_fontSize') || 14; return +fromStore('oj_fontSize') || 14;
}); });
const [theme, setTheme] = useState(() => { const [theme, setTheme] = useState(() => {
return fromStore('oj_theme') || 'dark'; return fromStore('oj_theme') || 'vs-dark';
}); });
const { title, type = 'label', content = [] } = props; const { title, type = 'label', content = [] } = props;
@ -78,7 +78,8 @@ const SettingDrawer = (props) => {
> >
{opt.text} {opt.text}
</option> </option>
)}); )
});
renderResult = ( renderResult = (
<div className={'setting_desc'} key={`sel_${index}`}> <div className={'setting_desc'} key={`sel_${index}`}>
<span className={'flex_item'}>{ctx.text}</span> <span className={'flex_item'}>{ctx.text}</span>

@ -1,13 +1,14 @@
.monaco_editor_area { .monaco_editor_area {
height: 100%; height: 100%;
background-color: rgba(7,15,25,1);
.code_title { .code_title {
display: flex; display: flex;
align-items: center; align-items: center;
background-color: rgba(18,28,36,1);
color: #fff; color: #fff;
height: 56px; height: 56px;
background-color: rgba(18, 28, 36, 1);
padding: 0 20px; padding: 0 20px;
.flex_strict { .flex_strict {
flex: 1; flex: 1;
} }
@ -17,9 +18,11 @@
cursor: pointer; cursor: pointer;
margin-right: 20px; margin-right: 20px;
} }
.code-icon { .code-icon {
cursor: pointer; cursor: pointer;
} }
.flex_strict, .flex_strict,
.flex_normal, .flex_normal,
.code-icon { .code-icon {
@ -27,23 +30,13 @@
} }
} }
// .margin,
// .margin-view-overlays,
// .current-line{
// width: 40px !important;
// }
// .monaco-editor .margin-view-overlays .line-numbers{
// text-align: center;
// }
// .monaco-scrollable-element{
// left: 40px !important;
// }
} }
.setting_drawer { .setting_drawer {
.ant-drawer-close { .ant-drawer-close {
color: #ffffff; color: #ffffff;
} }
.ant-drawer-content { .ant-drawer-content {
top: 120px; top: 120px;
bottom: 56px; bottom: 56px;
@ -51,6 +44,7 @@
// background: #333333; // background: #333333;
background: rgba(7, 15, 25, 1); background: rgba(7, 15, 25, 1);
color: #fff; color: #fff;
.setting_h2 { .setting_h2 {
color: #fff; color: #fff;
} }
@ -62,6 +56,7 @@
// line-height: 24px; // line-height: 24px;
margin-top: 4px; margin-top: 4px;
} }
select option { select option {
background: gold; background: gold;
color: #fff; color: #fff;
@ -76,21 +71,8 @@
animation-iteration-count: 3; animation-iteration-count: 3;
} }
// .monaco-editor, .monaco-editor-background, .monaco-editor .inputarea.ime-input,
// .monaco-editor .margin,
// .minimap slider-mouseover,
// .minimap-decorations-layer{
// background:rgba(3,19,40,1) !important;
// }
@keyframes blink { @keyframes blink {
50% { 50% {
color: #fff; color: #fff;
} }
} }
.monaco-editor, .monaco-editor-background, .monaco-editor .inputarea.ime-input,
.monaco-editor .margin,
.minimap .minimap-decorations-layer{
background-color: transparent !important;
}

@ -65,7 +65,6 @@ function RecordDetail (props) {
const handleEditorCode = (identifier, code) => { const handleEditorCode = (identifier, code) => {
if (identifier) { if (identifier) {
console.log(code);
saveEditorCodeForDetail(code); saveEditorCodeForDetail(code);
props.history.push(`/myproblems/${identifier}`); props.history.push(`/myproblems/${identifier}`);
} }

@ -1,55 +1,74 @@
@import '../split_pane_resizer.scss'; @import '../split_pane_resizer.scss';
.result_code_area .monaco-editor, .monaco-editor-background, .monaco-editor .inputarea.ime-input{
.result_code_area .monaco-editor,
.monaco-editor-background,
.monaco-editor .inputarea.ime-input {
background-color: #f9f9f9 !important; background-color: #f9f9f9 !important;
} }
.result_code_area .monaco-editor .line-numbers { .result_code_area .monaco-editor .line-numbers {
color: #999 !important; color: #999 !important;
} }
.result_code_area .monaco-editor .current-line~.line-numbers { .result_code_area .monaco-editor .current-line~.line-numbers {
color: #0b216f !important; color: #0b216f !important;
} }
.result_code_area .minimap-decorations-layer { .result_code_area .minimap-decorations-layer {
background: rgba(225, 225, 225, 0.2) !important; background: rgba(225, 225, 225, 0.2) !important;
} }
.result_code_area .monaco-editor .margin { .result_code_area .monaco-editor .margin {
background-color: #eee !important; background-color: #eee !important;
} }
.record_detail_area { .record_detail_area {
background: #fff; background: #fff;
.record_detail_ctx { .record_detail_ctx {
padding: 0 20px; padding: 0 20px;
.detail_ctx_header { .detail_ctx_header {
position: relative; position: relative;
height: 56px; height: 56px;
} }
.header_h2 { .header_h2 {
line-height: 56px; line-height: 56px;
} }
.header_btn { .header_btn {
position: absolute; position: absolute;
right: 0; right: 0;
top: 14px; top: 14px;
} }
.detail_ctx_status { .detail_ctx_status {
height: 18px; height: 18px;
line-height: 18px; line-height: 18px;
.status_label { .status_label {
color: rgba(153, 153, 153, 1); color: rgba(153, 153, 153, 1);
margin-right: 40px; margin-right: 40px;
} }
.status_label_error { .status_label_error {
color: #E51C24; color: #E51C24;
} }
.status_label_success { .status_label_success {
color: #28BD8B; color: #28BD8B;
} }
.status_label_sub { .status_label_sub {
color: #333333; color: #333333;
} }
.pass_case { .pass_case {
float: right; float: right;
margin-right: 0; margin-right: 0;
} }
.pass_case_span { .pass_case_span {
margin-right: 10px; margin-right: 10px;
} }
@ -59,6 +78,7 @@
// height: 500px; // height: 500px;
height: calc(100vh - 360px); height: calc(100vh - 360px);
} }
.result_error_area { .result_error_area {
margin-top: 15px; margin-top: 15px;
background: rgba(250, 250, 250, 1); background: rgba(250, 250, 250, 1);

@ -12,13 +12,10 @@ import { connect } from 'react-redux';
import SplitPane from 'react-split-pane'; import SplitPane from 'react-split-pane';
import LeftPane from './leftpane'; import LeftPane from './leftpane';
import RightPane from './rightpane'; import RightPane from './rightpane';
// import { Link } from 'react-router-dom';
// import { getImageUrl } from 'educoder'
// import RightPane from '../newOrEditTask/rightpane';
import { Icon } from 'antd'; import { Icon } from 'antd';
import UserInfo from '../components/userInfo'; import UserInfo from '../components/userInfo';
import actions from '../../../redux/actions'; import actions from '../../../redux/actions';
import { fromStore, CNotificationHOC } from 'educoder'; import { CNotificationHOC } from 'educoder';
import { withRouter } from 'react-router'; import { withRouter } from 'react-router';
function StudentStudy(props) { function StudentStudy(props) {
@ -27,8 +24,6 @@ function StudentStudy(props) {
const { const {
hack, hack,
userInfo, userInfo,
// hack_identifier,
// user_program_identifier,
restoreInitialCode, restoreInitialCode,
changeUserCodeTab, changeUserCodeTab,
changeShowOrHideControl, changeShowOrHideControl,
@ -74,7 +69,7 @@ function StudentStudy(props) {
changeUserCodeTab(tab); changeUserCodeTab(tab);
} }
}, []); }, []);
// console.log(hack, hack.modify_code)
useEffect(() => { useEffect(() => {
if (hack && hack.modify_code && hasUpdate) { // 代码更改,提示是否需要更新代码 if (hack && hack.modify_code && hasUpdate) { // 代码更改,提示是否需要更新代码
setHasUpdate(false); setHasUpdate(false);

@ -58,7 +58,7 @@ const RightPane = (props) => {
clearInterval(timer); clearInterval(timer);
timer = null; timer = null;
saveUserCodeForInterval(identifier); saveUserCodeForInterval(identifier);
}, 10000); }, 5000);
} }
} }

@ -137,6 +137,7 @@ const ojForUserReducer = (state = initialState, action) => {
} else { } else {
curHack['code'] = ''; curHack['code'] = '';
} }
curHack['modify_code'] = false
return { return {
...state, ...state,
hack: Object.assign({}, state.hack, curHack), hack: Object.assign({}, state.hack, curHack),

Loading…
Cancel
Save