Merge branch 'gitlink_ssr_head' of https://gitlink.org.cn/Gitlink/forgeplus-react into gitlink_ssr_head
This commit is contained in:
commit
625b5ca5c1
File diff suppressed because one or more lines are too long
|
|
@ -93,7 +93,7 @@ export const emojiList = [
|
|||
{ index: 1, code: ':hankey:', name: 'hankey' },
|
||||
{ index: 1, code: ':poop:', name: 'poop' },
|
||||
{ index: 1, code: ':shit:', name: 'shit' },
|
||||
{ index: 1, code: ':+1:', name: '+1' },
|
||||
{ index: 1, code: ':+1:', name: 'plus1' },
|
||||
{ index: 1, code: ':thumbsup:', name: 'thumbsup' },
|
||||
{ index: 1, code: ':-1:', name: '-1' },
|
||||
{ index: 1, code: ':thumbsdown:', name: 'thumbsdown' },
|
||||
|
|
@ -299,7 +299,7 @@ export const emojiList = [
|
|||
{ index: 1, code: ':waning_crescent_moon:', name: 'waning_crescent_moon' },
|
||||
{ index: 1, code: ':last_quarter_moon_with_face:', name: 'last_quarter_moon_with_face' },
|
||||
{ index: 1, code: ':first_quarter_moon_with_face:', name: 'first_quarter_moon_with_face' },
|
||||
{ index: 1, code: ':moon:', name: 'moon' },
|
||||
{ index: 1, code: ':moon:', name: 'waxing_gibbous_moon' },
|
||||
{ index: 1, code: ':earth_africa:', name: 'earth_africa' },
|
||||
{ index: 1, code: ':earth_americas:', name: 'earth_americas' },
|
||||
{ index: 1, code: ':earth_asia:', name: 'earth_asia' },
|
||||
|
|
@ -860,7 +860,7 @@ export const emojiList = [
|
|||
{ index: 1, code: ':white_medium_small_square:', name: 'white_medium_small_square' },
|
||||
{ index: 1, code: ':black_medium_square:', name: 'black_medium_square' },
|
||||
{ index: 1, code: ':white_medium_square:', name: 'white_medium_square' },
|
||||
{ index: 1, code: ':black_large_square:', name: 'black_large_square' },
|
||||
{ index: 1, code: ':black_large_square:', name: 'black_square' },
|
||||
{ index: 1, code: ':white_large_square:', name: 'white_large_square' },
|
||||
{ index: 1, code: ':white_check_mark:', name: 'white_check_mark' },
|
||||
{ index: 1, code: ':black_square_button:', name: 'black_square_button' },
|
||||
|
|
|
|||
|
|
@ -70,11 +70,14 @@ export default ({
|
|||
rs = rs.replace(matchStr[i],getEmoji(matchStr[i]));
|
||||
}
|
||||
}
|
||||
|
||||
if(rs){
|
||||
for(let i = 0;i<emojiList.length;i++){
|
||||
if(rs.indexOf(emojiList[i].code)>=0){
|
||||
const reg = '/\\'+emojiList[i].code+'/g'
|
||||
let reg = '/\\'+emojiList[i].code+'/g'
|
||||
if (emojiList[i].code === ':+1:') {
|
||||
// 匹配+1
|
||||
reg = /:\+1:/g
|
||||
}
|
||||
switch(emojiList[i].index){
|
||||
case 1:
|
||||
rs = rs.replace(eval(reg), `<img style="width:24px;" src="https://testforum.trustie.net/editormd/emoji/${emojiList[i].name}.png"/>`)
|
||||
|
|
|
|||
|
|
@ -1616,6 +1616,7 @@
|
|||
.source_detail_box{
|
||||
background-color: #fff;
|
||||
padding:10px 35px 70px 30px;
|
||||
word-wrap: break-word;
|
||||
.s_d_title{
|
||||
padding:20px 0px 10px;
|
||||
border-bottom: 1px dashed rgba(141, 149, 172, 0.27);
|
||||
|
|
|
|||
|
|
@ -41,34 +41,37 @@ function CoderDepotReadme({ operate , history , readme , ChangeFile }){
|
|||
|
||||
return(
|
||||
<div className="commonBox readBox" id="readme">
|
||||
<Anchor offsetTop={58}>
|
||||
<div className="commonBox-title boxTitle">
|
||||
<div className="AlignCenter">
|
||||
<Dropdown overlay={menu()} trigger={['hover']} overlayClassName="menuslist">
|
||||
<span className="catelogue">
|
||||
<i className="iconfont icon-muluicon font-12 mr5"></i>
|
||||
<span>目录</span>
|
||||
</span>
|
||||
</Dropdown>
|
||||
|
||||
<span className="commonBox-title-read"><a href="#readme ">{readme.name}</a></span>
|
||||
|
||||
<div className="commonBox-title boxTitle">
|
||||
<div className="AlignCenter">
|
||||
{/* <Dropdown overlay={menu()} trigger={['hover']} overlayClassName="menuslist">
|
||||
<span className="catelogue">
|
||||
<i className="iconfont icon-muluicon font-12 mr5"></i>
|
||||
<span>目录</span>
|
||||
</span>
|
||||
</Dropdown> */}
|
||||
|
||||
<span className="commonBox-title-read"><a href="#readme ">{readme.name}</a></span>
|
||||
|
||||
</div>
|
||||
{
|
||||
operate ?
|
||||
<a className="ml20 pull-right" onClick={() =>ChangeFile(readme && readme.path, false)}>
|
||||
<i className="iconfont icon-a-bianji font-17 color-grey-6"></i>
|
||||
</a>
|
||||
:""
|
||||
}
|
||||
</div>
|
||||
<div className='mdFileBox'>
|
||||
<Anchor offsetTop={55}>
|
||||
{menu()}
|
||||
</Anchor>
|
||||
{
|
||||
content &&
|
||||
<div className="commonBox-info">
|
||||
<RenderHtml className="break_word_comments imageLayerParent" value={content} url={history.location}/>
|
||||
</div>
|
||||
{
|
||||
operate ?
|
||||
<a className="ml20 pull-right" onClick={() =>ChangeFile(readme && readme.path, false)}>
|
||||
<i className="iconfont icon-a-bianji font-17 color-grey-6"></i>
|
||||
</a>
|
||||
:""
|
||||
}
|
||||
</div>
|
||||
</Anchor>
|
||||
{
|
||||
content &&
|
||||
<div className="commonBox-info">
|
||||
<RenderHtml className="break_word_comments imageLayerParent readmeFile" value={content} url={history.location}/>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React, { Component } from "react";
|
||||
import React, { Component, Fragment } from "react";
|
||||
import { Popconfirm , Select , Dropdown , Spin , Anchor } from "antd";
|
||||
import "./list.scss";
|
||||
import axios from "axios";
|
||||
|
|
@ -227,8 +227,6 @@ class CoderRootFileDetail extends Component {
|
|||
return(
|
||||
<ReadmeCatelogue menuList={menuList} hash={this.props.history.location.hash}/>
|
||||
)
|
||||
}else{
|
||||
return <Spin />
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -303,7 +301,7 @@ class CoderRootFileDetail extends Component {
|
|||
/>
|
||||
<Anchor className="griditemAnchor" offsetTop={58}>
|
||||
<div className="griditemCate">
|
||||
{
|
||||
{/* {
|
||||
md && readOnly &&
|
||||
<Dropdown overlay={this.menu()} trigger={['hover']} overlayClassName="menuslist">
|
||||
<span className="catelogue mr20">
|
||||
|
|
@ -311,7 +309,7 @@ class CoderRootFileDetail extends Component {
|
|||
<span>目录</span>
|
||||
</span>
|
||||
</Dropdown>
|
||||
}
|
||||
} */}
|
||||
<span className="color-grey-6 font-16">
|
||||
{bytesToSize(detail && detail.size)}
|
||||
</span>
|
||||
|
|
@ -324,7 +322,8 @@ class CoderRootFileDetail extends Component {
|
|||
{
|
||||
!detail.direct_download?
|
||||
<span>
|
||||
<a onClick={() => this.DownLoadFile(detail.download_url)} className="ml20">
|
||||
{/* onClick={() => this.DownLoadFile(detail.download_url)} */}
|
||||
<a href={`/attachments/entries/get_file?download_url=${detail.download_url}`}className="ml20">
|
||||
<i className="iconfont icon-xiazai1 font-15 color-grey-6"></i>
|
||||
</a>
|
||||
{
|
||||
|
|
@ -383,14 +382,14 @@ class CoderRootFileDetail extends Component {
|
|||
)}
|
||||
</p>
|
||||
</Anchor>
|
||||
<div>
|
||||
<div className="pl8">
|
||||
{detail.image_type ? (
|
||||
<div className="edu-txt-center pt20 pb20">
|
||||
<img alt="" src={detail.download_url} style={{ maxWidth: "80%" }} />
|
||||
</div>
|
||||
) : detail.direct_download ? (
|
||||
<div className="pt10 text-center pb10">
|
||||
<a onClick={() => this.DownLoadFile(detail.download_url)} className="color-blue font-15">
|
||||
<a href={`/attachments/entries/get_file?download_url=${detail.download_url}`} className="color-blue font-15">
|
||||
下载原始文件
|
||||
</a>
|
||||
{
|
||||
|
|
@ -400,24 +399,36 @@ class CoderRootFileDetail extends Component {
|
|||
}
|
||||
</div>
|
||||
) : (
|
||||
md && readOnly ?
|
||||
<div className="files-md" id="files-md">
|
||||
<RenderHtml className="file-md imageLayerParent" value={description} url={this.props.history.location}/>
|
||||
md && readOnly ? <Fragment>
|
||||
<div key="readOnly" className="mdFileBox">
|
||||
<Anchor offsetTop={105}>
|
||||
{this.menu()}
|
||||
</Anchor>
|
||||
<div className="files-md" id="files-md">
|
||||
<RenderHtml className="file-md imageLayerParent mdFile" value={description} url={this.props.history.location} />
|
||||
</div>
|
||||
</div>
|
||||
</Fragment>
|
||||
:
|
||||
<Meditor
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
language={language ? language : "javascript"}
|
||||
filepath={`/${detail.path}`}
|
||||
content={detail.content}
|
||||
readOnly={readOnly}
|
||||
md={md}
|
||||
editorType="update"
|
||||
currentBranch={currentBranch}
|
||||
descName={detail && `Update ${detail.name}`}
|
||||
></Meditor>
|
||||
)}
|
||||
<Fragment>
|
||||
<div className="files-md" id="files-md" style={{ display: 'none' }}>
|
||||
<RenderHtml className="file-md imageLayerParent" value={description} url={this.props.history.location} />
|
||||
</div>
|
||||
<Meditor
|
||||
key="editor"
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
language={language ? language : "javascript"}
|
||||
filepath={`/${detail.path}`}
|
||||
content={detail.content}
|
||||
readOnly={readOnly}
|
||||
md={md}
|
||||
editorType="update"
|
||||
currentBranch={currentBranch}
|
||||
descName={detail && `Update ${detail.name}`}
|
||||
></Meditor>
|
||||
</Fragment>
|
||||
)}
|
||||
</div>
|
||||
</React.Fragment>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -339,6 +339,16 @@
|
|||
.listtablebody{
|
||||
border-radius:0px 0px 4px 4px ;
|
||||
border: 1px solid #D0D0D0;
|
||||
.ant-affix{
|
||||
z-index: 8;
|
||||
}
|
||||
.readmeMenu{
|
||||
width: 300px;
|
||||
padding: 20px 10px;
|
||||
.ant-anchor-link{
|
||||
padding: 8px 10px 8px 0px;
|
||||
}
|
||||
}
|
||||
li{
|
||||
a{
|
||||
color: #05101a;
|
||||
|
|
@ -577,4 +587,14 @@
|
|||
img{
|
||||
margin-bottom: 35px;
|
||||
}
|
||||
}
|
||||
.mdFileBox{
|
||||
display: flex;
|
||||
&>div>div, & .ant-anchor-wrapper, & .ant-anchor, & .readmeMenu{
|
||||
height: 100%;
|
||||
}
|
||||
.mdFile{
|
||||
padding: 20px;
|
||||
border-left: 1px solid #D0D0D0;
|
||||
}
|
||||
}
|
||||
|
|
@ -324,6 +324,8 @@
|
|||
}
|
||||
.files-md{
|
||||
padding:20px;
|
||||
flex: 1;
|
||||
width: 0;
|
||||
h1,h2, h3, h4, h5, h6{
|
||||
margin-bottom: .5em !important;
|
||||
}
|
||||
|
|
@ -618,11 +620,26 @@
|
|||
}
|
||||
.readBox{
|
||||
border:none;
|
||||
.ant-affix{
|
||||
z-index: 8;
|
||||
}
|
||||
.readmeMenu{
|
||||
width: 240px;
|
||||
padding: 20px 10px;
|
||||
border:1px solid #D0D0D0;
|
||||
border-top: none;
|
||||
border-right: none;
|
||||
.ant-anchor-link{
|
||||
padding: 8px 10px 8px 0px;
|
||||
}
|
||||
}
|
||||
&.commonBox .commonBox-info{
|
||||
border:1px solid #D0D0D0;
|
||||
border-top: none;
|
||||
border-radius: 0px 0px 4px 4px;
|
||||
padding:20px 38px;
|
||||
border-radius: 0px 0px 4px 0px;
|
||||
padding:20px 18px;
|
||||
flex: 1;
|
||||
width: 0;
|
||||
}
|
||||
}
|
||||
.commonBox .commonBox-title.boxTitle{
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ function ReadmeCatelogue({ menuList , hash }) {
|
|||
}
|
||||
}
|
||||
return(
|
||||
<div>
|
||||
<div className="searchBox">
|
||||
<div className='readmeMenu'>
|
||||
<div className="searchBox mb15">
|
||||
<Input
|
||||
placeholder={"请输入关键字"}
|
||||
value={value}
|
||||
|
|
@ -39,7 +39,7 @@ function ReadmeCatelogue({ menuList , hash }) {
|
|||
{
|
||||
menu.map((item,key)=>{
|
||||
return(
|
||||
<div style={{paddingLeft:`${item.level *15}px`}} className={goHref===item.href?"items active":"items"}>
|
||||
<div style={{paddingLeft:`${(item.level-1) *15}px`}} className={goHref===item.href?"items active":"items"}>
|
||||
<Link href={`${item.href}`} title={item.text} />
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ function BasicInformation(props){
|
|||
if(botDetail){
|
||||
setContent(botDetail.bot_des);
|
||||
setImage(botDetail.logo)
|
||||
window.scrollTo(0,0)
|
||||
}
|
||||
},[botDetail])
|
||||
|
||||
|
|
|
|||
|
|
@ -54,10 +54,11 @@ export default (props) => {
|
|||
|
||||
useEffect(() => {
|
||||
document.title = `${checkItem && checkItem.titleStr || wikiBySearch}-维基预览`
|
||||
if(!(str || checkItem.title_sub)) return
|
||||
const func = sha ? getPreviousWiki : getWiki
|
||||
func({
|
||||
...wikiParams,
|
||||
pageName: str,
|
||||
pageName: str || checkItem.title_sub,
|
||||
sha
|
||||
}).then(res => {
|
||||
if(res && res.code === 200){
|
||||
|
|
|
|||
Loading…
Reference in New Issue