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

@ -261,7 +261,7 @@ class Osshackathon extends Component {
}
</style>
<div className={"educontent mb20 persmstyle"} style={{width: "1200px", marginTop: "26px"}}>
<div className={"educontent mb60 persmstyle"} style={{width: "1200px", marginTop: "26px"}}>
<div className="registrationback"
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 { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { Link } from "react-router-dom";
import { getImageUrl ,markdownToHTML, configShareForCustom} from 'educoder'
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';
@ -39,6 +33,8 @@ class Challenges extends Component {
hidestartshixunsreplacevalue:"",
operationstrue:false,
isSpin:false,
boxoffsetHeigh:0,
opentitletype:true
}
}
@ -64,9 +60,32 @@ class Challenges extends Component {
}
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) => {
setTimeout(() => {
var shixunDescr = window.editormd.markdownToHTML(id, {
@ -301,6 +320,12 @@ class Challenges extends Component {
})
}
opentitle=()=>{
this.setState({
opentitletype:!this.state.opentitletype
})
}
render() {
let { ChallengesDataList, startbtns, sumidtype ,startshixunCombattype,shixunsreplace,shixunsmessage,hidestartshixunsreplacevalue,operationstrue,AccountProfiletype} = this.state;
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"
target="_blank">实训制作指南</a> : "":""}
</div>
<div className={"pd20"}>
{this.state.opentitletype===true?<style>
{
`
#shixunchallengesid{
max-height: 260px;
overflow: hidden;
}
`
}
</style>:""}
<div>
<div className={"pd20"} id={"shixunchallengesid"}>
<style>
{
`
@ -389,6 +424,7 @@ class Challenges extends Component {
`
}
</style>
<div className="justify break_full_word new_li "
id="challenge_editorMd_description">
<p id="ReactMarkdown" style={{overflow:'hidden'}}>
@ -397,6 +433,13 @@ class Challenges extends Component {
}
</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>
</p>

@ -1,25 +1,11 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
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 { Link } from "react-router-dom";
import { markdownToHTML, configShareForCustom} from 'educoder'
import { Divider, Tooltip } from 'antd';
import LoadingSpin from '../../../../common/LoadingSpin';
import 'antd/lib/pagination/style/index.css';
import '../shixunchildCss/Challenges.css'
import ReactDOM from 'react-dom';
import '../shixunchildCss/Challenges.css';
import axios from 'axios';
import AccountProfile from"../../../user/AccountProfile";
const $ = window.$;
@ -36,6 +22,8 @@ class Challengesjupyter extends Component {
username:"",
booljupyterurls:false,
loading:false,
boxoffsetHeigh:0,
opentitletype:true
}
}
@ -59,7 +47,29 @@ class Challengesjupyter extends Component {
//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() {
setTimeout(this.ChallengesList(), 1000);
let id = this.props.match.params.shixunId;
@ -178,6 +188,11 @@ class Challengesjupyter extends Component {
})
}
opentitle=()=>{
this.setState({
opentitletype:!this.state.opentitletype
})
}
render() {
@ -204,33 +219,53 @@ class Challengesjupyter extends Component {
<div className={"shixunjianjie"}>
<span className="font-16 fl">简介</span>
<Tooltip placement="bottom" title={"编辑"}>
<a 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">
<Link style={{ display: this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status < 3 ? "block" : 'none' }}
to={"/shixuns/" + id + "/settings?edit=1"} className="fr color-blue font-14">
编辑
</a>
</Link>
</Tooltip>
</div>
<div className={"pd20"}>
<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>
{this.state.opentitletype===true?<style>
{
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>
`
#shixunchallengesid{
max-height: 260px;
overflow: hidden;
}
`
}
</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>
</p>
<div className="justify break_full_word new_li edu-back-white"

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

Loading…
Cancel
Save