Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_daiao
daiao 5 years ago
commit 80e2e08f58

@ -6,7 +6,7 @@
float: left;
width: 97px;}
.head-nav{float: left;width: 780px;text-align: center;height: 60px;box-sizing: border-box; min-width: 400px;}
.head-nav ul#header-nav{position: absolute;top: 0px;z-index: 3;height: 60px;box-sizing: border-box;padding-left: 30px;}
.head-nav ul#header-nav{position: absolute;top: 0px;z-index: 3;height: 60px;box-sizing: border-box;}
.head-nav ul#header-nav li{float: left;height: 60px;line-height: 60px;margin-right: 30px;cursor: pointer;position: relative;font-size: 16px}
.head-nav ul#header-nav li a{display: block;height: 100%;width: 100%;color: #fff}
.head-nav ul#header-nav li a:hover{color: #cccccc;}

@ -10,7 +10,8 @@ export function markdownToHTML(oldContent, selector) {
window.$(selector).html(oldContent)
} else {
try {
var markdwonParser = window.editormd.markdownToHTML("md_div", {
// selector ||
var markdwonParser = window.editormd.markdownToHTML(selector || "md_div", {
markdown: oldContent, // .replace(/▁/g,"▁▁▁"),
emoji: true,
htmlDecode: "style,script,iframe", // you can filter tags decode
@ -23,6 +24,10 @@ export function markdownToHTML(oldContent, selector) {
} catch(e) {
console.error(e)
}
// selector = '.' + selector
if (selector) {
return;
}
const content = window.$('#md_div').html()
if (selector) {

@ -0,0 +1,6 @@
.markdownToHtml.editormd-html-preview, .markdownToHtml.editormd-preview-container {
overflow: hidden;
}
.markdownToHtml.editormd-html-preview p.editormd-tex, .markdownToHtml.editormd-preview-container p.editormd-tex {
text-align: left;
}

@ -1,5 +1,6 @@
import React,{ Component } from "react";
import { markdownToHTML } from 'educoder'
import './MarkdownToHtml.css'
/**
selector 需要传入唯一的selector作为id不然会引起冲突
delay 如果有公式需要传入delay={true}
@ -14,9 +15,9 @@ class MarkdownToHtml extends Component{
if (this.props.delay == true) {
(function(content, selector) {
// console.log('selector: ', selector)
setTimeout(() => {
// setTimeout(() => {
markdownToHTML(content, selector)
}, 600)
// }, 600)
})(content, selector)
} else {
markdownToHTML(content, selector)
@ -25,18 +26,20 @@ class MarkdownToHtml extends Component{
componentDidUpdate = (prevProps) => {
if (this.props.content) {
if ( prevProps.content != this.props.content ) {
this._markdownToHTML(this.props.content, `.markdown_to_html_${this.props.selector || ''}`)
this._markdownToHTML(this.props.content, `markdown_to_html_${this.props.selector || ''}`)
}
}
}
componentDidMount () {
this.props.content && this._markdownToHTML(this.props.content, `.markdown_to_html_${this.props.selector || ''}`)
this.props.content && this._markdownToHTML(this.props.content, `markdown_to_html_${this.props.selector || ''}`)
}
render(){
const { style, className } = this.props
let _selector = `markdown_to_html_${this.props.selector || ''}`
return(
<div id="memo_content_editorMd" className={`new_li markdown-body ${className} markdown_to_html_${this.props.selector || ''}`}
<div id={_selector } className={`markdownToHtml new_li markdown-body ${className} ${_selector}`}
// dangerouslySetInnerHTML={{__html: markdownToHTML(this.props.content)}}
style={style}
>

@ -104,19 +104,17 @@ class ListPageIndex extends Component{
{/*头部banner*/}
<CoursesBanner {...this.props}></CoursesBanner>
{yslGuideone===null||yslGuideone===undefined||yslGuideone===false?
(
this.props.isAdmin()===true?
<Guide
setwindowlocal={(b)=>this.setwindowlocal(b)}
>
</Guide>
:""
)
:""
}
{/*{yslGuideone===null||yslGuideone===undefined||yslGuideone===false?*/}
{/* (*/}
{/* this.props.isAdmin()===true?*/}
{/* <Guide*/}
{/* setwindowlocal={(b)=>this.setwindowlocal(b)}*/}
{/* >*/}
{/* </Guide>*/}
{/* :""*/}
{/* )*/}
{/* :""*/}
{/*}*/}
<div className="educontent clearfix" style={{flex: "1 0 auto"}}>

@ -360,7 +360,7 @@ class LoginDialog extends Component {
if(response.status===200){
if (response.data.status === 402) {
window.location.href = response.data.url;
// window.location.href = response.data.url;
}else if (response.data.status === -2) {
notification.open({
message: '提示',

@ -649,20 +649,21 @@ submittojoinclass=(value)=>{
{...this.state}
{...this.props}
/>:""}
<div className="educontent clearfix">
<a href="/" className={" fl"}>
<img alt="高校智能化教学与实训平台" className="logoimg" src={getImageUrl("images/educoder/headNavLogo.png?1526520218")}></img>
</a>
<div className="educontent">
{/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/}
<a href="/">
<img alt="高校智能化教学与实训平台" className="logoimg" src={getImageUrl("images/educoder/headNavLogo.png?1526520218")}></img>
</a>
<div className="head-nav pr">
<ul id="header-nav">
{/*<li className={`${activeIndex === true ? 'active' : ''}`}><a href="/">首页</a></li>*/}
<li className={`${activeIndex === true ? 'active' : ''}`}><a href="/">首页</a></li>
{/*<li><a href={this.props.Headertop===undefined?"":this.props.Headertop.shixun_paths_url}>实训路径</a></li>*/}
<li className={`${activePaths === true ? 'pr active' : 'pr'}`}>
<a href={this.props.Headertop===undefined?"":'/paths'}>实践课程</a></li>
<a href={this.props.Headertop===undefined?"":'/paths'}>实践课程</a>
</li>
{/*<li><a href={this.props.Headertop===undefined?"":'/courses'}>课堂</a></li>*/}
<li className={`${coursestype === true ? 'pr active' : 'pr'}`}>

@ -359,6 +359,12 @@ class LoginRegisterComponent extends Component {
if(weekArray===undefined){
weekArray="/";
}
if(weekArray===null){
weekArray="/";
}
if(weekArray==="null"){
weekArray="/";
}
window.location.href = weekArray;
}
}

@ -37,6 +37,12 @@ class Notcompletedysl extends Component {
if(weekArray===undefined){
weekArray="/";
}
if(weekArray===null){
weekArray="/";
}
if(weekArray==="null"){
weekArray="/";
}
window.location.href = weekArray;
}

@ -6,7 +6,7 @@
float: left;
width: 97px;}
.head-nav{float: left;width: 780px;text-align: center;height: 60px;box-sizing: border-box; min-width: 400px;}
.head-nav ul#header-nav{position: absolute;top: 0px;z-index: 3;height: 60px;box-sizing: border-box;padding-left: 30px;}
.head-nav ul#header-nav{position: absolute;top: 0px;z-index: 3;height: 60px;box-sizing: border-box;}
.head-nav ul#header-nav li{float: left;height: 60px;line-height: 60px;margin-right: 30px;cursor: pointer;position: relative;font-size: 16px}
.head-nav ul#header-nav li a{display: block;height: 100%;width: 100%;color: #fff}
.head-nav ul#header-nav li a:hover{color: #cccccc;}

Loading…
Cancel
Save