chromesetting
杨树明 5 years ago
parent 79da9219d2
commit 6954ebf77e

@ -261,7 +261,7 @@ class Osshackathon extends Component {
} }
</style> </style>
<div className={"educontent mb20 persmstyle"} style={{width: "1200px", marginTop: "26px"}}> <div className={"educontent mb60 persmstyle"} style={{width: "1200px", marginTop: "26px"}}>
<div className="registrationback" <div className="registrationback"
style={{"background": `url(${getImageUrl(`images/educoder/competitions/heikesong.jpg`)})`,"height":"360px"}} style={{"background": `url(${getImageUrl(`images/educoder/competitions/heikesong.jpg`)})`,"height":"360px"}}

@ -1,18 +1,12 @@
import React, { Component } from 'react'; import React, { Component } from 'react';;
import { Redirect } from 'react-router'; import { Link } from "react-router-dom";
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { getImageUrl ,markdownToHTML, configShareForCustom} from 'educoder' import { getImageUrl ,markdownToHTML, configShareForCustom} from 'educoder'
import { CircularProgress } from 'material-ui/Progress'; import { CircularProgress } from 'material-ui/Progress';
import { Modal, Spin, Tooltip ,message,Icon,Button} from 'antd'; import { Modal, Spin, Tooltip ,message,Icon,Button,Divider} from 'antd';
import 'antd/lib/pagination/style/index.css'; import 'antd/lib/pagination/style/index.css';
@ -39,6 +33,8 @@ class Challenges extends Component {
hidestartshixunsreplacevalue:"", hidestartshixunsreplacevalue:"",
operationstrue:false, operationstrue:false,
isSpin:false, isSpin:false,
boxoffsetHeigh:0,
opentitletype:true
} }
} }
@ -64,9 +60,32 @@ class Challenges extends Component {
} }
componentDidMount() { componentDidMount() {
setTimeout(this.ChallengesList(), 1000); this.ChallengesList()
} }
componentDidUpdate = (prevProps,prevState) => {
//防止陷入无限循环
if(prevState.ChallengesDataList!=this.state.ChallengesDataList){
let boxoffsetHeigh;
let box=document.getElementById("shixunchallengesid");
if(box){
boxoffsetHeigh=box.offsetHeight
if(boxoffsetHeigh<260){
this.setState({
opentitletype:false,
boxoffsetHeigh:boxoffsetHeigh
})
}else{
this.setState({
boxoffsetHeigh:boxoffsetHeigh
})
}
}
}
}
updatamakedown = (id) => { updatamakedown = (id) => {
setTimeout(() => { setTimeout(() => {
var shixunDescr = window.editormd.markdownToHTML(id, { var shixunDescr = window.editormd.markdownToHTML(id, {
@ -301,6 +320,12 @@ class Challenges extends Component {
}) })
} }
opentitle=()=>{
this.setState({
opentitletype:!this.state.opentitletype
})
}
render() { render() {
let { ChallengesDataList, startbtns, sumidtype ,startshixunCombattype,shixunsreplace,shixunsmessage,hidestartshixunsreplacevalue,operationstrue,AccountProfiletype} = this.state; let { ChallengesDataList, startbtns, sumidtype ,startshixunCombattype,shixunsreplace,shixunsmessage,hidestartshixunsreplacevalue,operationstrue,AccountProfiletype} = this.state;
let { loadingContent } = this.props; let { loadingContent } = this.props;
@ -378,8 +403,18 @@ class Challenges extends Component {
this.props.identity < 5?<a className="fr font-14 color-blue mr20" href="/forums/2943" this.props.identity < 5?<a className="fr font-14 color-blue mr20" href="/forums/2943"
target="_blank">实训制作指南</a> : "":""} target="_blank">实训制作指南</a> : "":""}
</div> </div>
{this.state.opentitletype===true?<style>
<div className={"pd20"}> {
`
#shixunchallengesid{
max-height: 260px;
overflow: hidden;
}
`
}
</style>:""}
<div>
<div className={"pd20"} id={"shixunchallengesid"}>
<style> <style>
{ {
` `
@ -389,6 +424,7 @@ class Challenges extends Component {
` `
} }
</style> </style>
<div className="justify break_full_word new_li " <div className="justify break_full_word new_li "
id="challenge_editorMd_description"> id="challenge_editorMd_description">
<p id="ReactMarkdown" style={{overflow:'hidden'}}> <p id="ReactMarkdown" style={{overflow:'hidden'}}>
@ -397,6 +433,13 @@ class Challenges extends Component {
} }
</p> </p>
</div> </div>
</div>
{this.state.opentitletype===true?<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}>
<a className={"font-14 color-grey-9"}>阅读全文 <i className={"iconfont icon-jiantou9 font-14"}></i></a>
</Divider>:<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}>
<a className={"font-14 color-grey-9"}>收起全文 <i className={"iconfont icon-changyongtubiao-xianxingdaochu-zhuanqu- font-14"}></i></a>
</Divider>}
</div> </div>
</p> </p>

@ -1,25 +1,11 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Link } from "react-router-dom";
import { Redirect } from 'react-router'; import { markdownToHTML, configShareForCustom} from 'educoder'
import { Divider, Tooltip } from 'antd';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { getImageUrl ,markdownToHTML, configShareForCustom} from 'educoder'
import { CircularProgress } from 'material-ui/Progress';
import { Modal, Spin, Tooltip ,message,Icon} from 'antd';
import LoadingSpin from '../../../../common/LoadingSpin'; import LoadingSpin from '../../../../common/LoadingSpin';
import 'antd/lib/pagination/style/index.css'; import 'antd/lib/pagination/style/index.css';
import '../shixunchildCss/Challenges.css';
import '../shixunchildCss/Challenges.css'
import ReactDOM from 'react-dom';
import axios from 'axios'; import axios from 'axios';
import AccountProfile from"../../../user/AccountProfile";
const $ = window.$; const $ = window.$;
@ -36,6 +22,8 @@ class Challengesjupyter extends Component {
username:"", username:"",
booljupyterurls:false, booljupyterurls:false,
loading:false, loading:false,
boxoffsetHeigh:0,
opentitletype:true
} }
} }
@ -59,7 +47,29 @@ class Challengesjupyter extends Component {
//console.log(error) //console.log(error)
}); });
} }
componentDidUpdate = (prevProps,prevState) => {
//防止陷入无限循环
if(prevState.ChallengesDataList!=this.state.ChallengesDataList){
let boxoffsetHeigh;
let box=document.getElementById("shixunchallengesid");
if(box){
boxoffsetHeigh=box.offsetHeight
if(boxoffsetHeigh<260){
this.setState({
opentitletype:false,
boxoffsetHeigh:boxoffsetHeigh
})
}else{
this.setState({
boxoffsetHeigh:boxoffsetHeigh
})
}
}
}
}
componentDidMount() { componentDidMount() {
setTimeout(this.ChallengesList(), 1000); setTimeout(this.ChallengesList(), 1000);
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
@ -178,6 +188,11 @@ class Challengesjupyter extends Component {
}) })
} }
opentitle=()=>{
this.setState({
opentitletype:!this.state.opentitletype
})
}
render() { render() {
@ -204,33 +219,53 @@ class Challengesjupyter extends Component {
<div className={"shixunjianjie"}> <div className={"shixunjianjie"}>
<span className="font-16 fl">简介</span> <span className="font-16 fl">简介</span>
<Tooltip placement="bottom" title={"编辑"}> <Tooltip placement="bottom" title={"编辑"}>
<a style={{ display: this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status < 3 ? "block" : 'none' }} <Link style={{ display: this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status < 3 ? "block" : 'none' }}
href={"/shixuns/" + id + "/settings?edit=1"} className="fr color-blue font-14"> to={"/shixuns/" + id + "/settings?edit=1"} className="fr color-blue font-14">
编辑 编辑
</a> </Link>
</Tooltip> </Tooltip>
</div> </div>
<div className={"pd20"}> {this.state.opentitletype===true?<style>
<p id="ReactMarkdown" style={{overflow:'hidden'}}>
{ChallengesDataList === undefined ? "" :ChallengesDataList&&ChallengesDataList.description===null?"":
<div className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(ChallengesDataList.description).replace(/▁/g,"▁▁▁")}}></div>
}
</p>
{ {
booljupyterurls===true? `
( #shixunchallengesid{
this.state.jupyter_url === null? max-height: 260px;
<div className="mt50 intermediatecenter juplbool"> overflow: hidden;
<span className="icon iconfontysl icon-jiazaishibai1"></span> }
<p className="intermediatecenter sortinxdirection mt5 juplboolp"><p className="colorbluetest">加载实训失败</p><p className="colorbluetwo" onClick={()=>this.updatamakedowns()}></p></p> `
}
</style>:""}
<div>
</div> <div className={"pd20"} id={"shixunchallengesid"}>
<p id="ReactMarkdown" style={{overflow:'hidden'}}>
{ChallengesDataList === undefined ? "" :ChallengesDataList&&ChallengesDataList.description===null?"":
<div className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(ChallengesDataList.description).replace(/▁/g,"▁▁▁")}}></div>
}
</p>
{
booljupyterurls===true?
(
this.state.jupyter_url === null?
<div className="mt50 intermediatecenter juplbool">
<span className="icon iconfontysl icon-jiazaishibai1"></span>
<p className="intermediatecenter sortinxdirection mt5 juplboolp"><p className="colorbluetest">加载实训失败</p><p className="colorbluetwo" onClick={()=>this.updatamakedowns()}></p></p>
</div>
:""
)
:""
}
</div>
:"" {this.state.opentitletype===true?<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}>
) <a className={"font-14 color-grey-9"}>阅读全文 <i className={"iconfont icon-jiantou9 font-14"}></i></a>
:"" </Divider>:<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}>
} <a className={"font-14 color-grey-9"}>收起全文 <i className={"iconfont icon-changyongtubiao-xianxingdaochu-zhuanqu- font-14"}></i></a>
</Divider>}
</div> </div>
</p> </p>
<div className="justify break_full_word new_li edu-back-white" <div className="justify break_full_word new_li edu-back-white"

@ -110,7 +110,7 @@
line-height: 35px; line-height: 35px;
padding: 20px; padding: 20px;
border-bottom: 1px solid #eeee; border-bottom: 1px solid #eeee;
margin-bottom: 10px; /*margin-bottom: 10px;*/
} }
.pd20{ .pd20{

Loading…
Cancel
Save