mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-23 20:37:42 +00:00
clean package.json and repair code style (#2411)
* clean package.json and repair code style * update css style * repair bug
This commit is contained in:
committed by
Daniel Pan
parent
3ab4cbff4f
commit
3a67d78016
@@ -1,5 +1,5 @@
|
||||
import React, { Component } from 'react';
|
||||
import { gettext, repoID, serviceUrl, slug, siteRoot, isPro } from '../../components/constants';
|
||||
import { gettext, repoID, serviceUrl, slug, siteRoot } from '../../components/constants';
|
||||
import CommonToolbar from '../../components/toolbar/common-toolbar';
|
||||
import PathToolbar from '../../components/toolbar/path-toolbar';
|
||||
import MarkdownViewer from '../../components/markdown-viewer';
|
||||
@@ -30,7 +30,7 @@ class MainPanel extends Component {
|
||||
}
|
||||
|
||||
switchViewMode = (e) => {
|
||||
e.preventDefault();
|
||||
e.preventDefault();
|
||||
if (e.target.id === 'wiki') {
|
||||
return;
|
||||
}
|
||||
@@ -41,17 +41,17 @@ class MainPanel extends Component {
|
||||
render() {
|
||||
|
||||
let filePathList = this.props.filePath.split('/');
|
||||
let nodePath = "";
|
||||
let nodePath = '';
|
||||
let pathElem = filePathList.map((item, index) => {
|
||||
if (item === "") {
|
||||
if (item === '') {
|
||||
return;
|
||||
}
|
||||
if (index === (filePathList.length - 1)) {
|
||||
return (
|
||||
<span key={index}><span className="path-split">/</span>{item}</span>
|
||||
)
|
||||
);
|
||||
} else {
|
||||
nodePath += "/" + item;
|
||||
nodePath += '/' + item;
|
||||
return (
|
||||
<span key={index} >
|
||||
<span className="path-split">/</span>
|
||||
@@ -62,7 +62,7 @@ class MainPanel extends Component {
|
||||
{item}
|
||||
</a>
|
||||
</span>
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -73,12 +73,12 @@ class MainPanel extends Component {
|
||||
<span className="sf2-icon-menu hidden-md-up d-md-none side-nav-toggle" title={gettext('Side Nav Menu')} onClick={this.onMenuClick}></span>
|
||||
{
|
||||
this.props.permission === 'rw' &&
|
||||
<button className="btn btn-secondary top-toolbar-btn" title={gettext('Edit File')} onClick={this.onEditClick}>{gettext("Edit")}</button>
|
||||
<button className="btn btn-secondary top-toolbar-btn" title={gettext('Edit File')} onClick={this.onEditClick}>{gettext('Edit')}</button>
|
||||
}
|
||||
<div className="btn-group">
|
||||
<button className="btn btn-secondary btn-icon sf-view-mode-change-btn sf2-icon-list-view" id='list' title={gettext("List")} onClick={this.switchViewMode}></button>
|
||||
<button className="btn btn-secondary btn-icon sf-view-mode-change-btn sf2-icon-grid-view" id='grid' title={gettext("Grid")} onClick={this.switchViewMode}></button>
|
||||
<button className={`btn btn-secondary btn-icon sf-view-mode-change-btn sf2-icon-wiki-view ${this.state.isWikiMode ? 'current-mode' : ''}`} id='wiki' title={gettext("wiki")} onClick={this.switchViewMode}></button>
|
||||
<button className="btn btn-secondary btn-icon sf-view-mode-change-btn sf2-icon-list-view" id='list' title={gettext('List')} onClick={this.switchViewMode}></button>
|
||||
<button className="btn btn-secondary btn-icon sf-view-mode-change-btn sf2-icon-grid-view" id='grid' title={gettext('Grid')} onClick={this.switchViewMode}></button>
|
||||
<button className={`btn btn-secondary btn-icon sf-view-mode-change-btn sf2-icon-wiki-view ${this.state.isWikiMode ? 'current-mode' : ''}`} id='wiki' title={gettext('wiki')} onClick={this.switchViewMode}></button>
|
||||
</div>
|
||||
</div>
|
||||
<CommonToolbar onSearchedClick={this.props.onSearchedClick} searchPlaceholder={'Search files in this library'}/>
|
||||
@@ -86,7 +86,7 @@ class MainPanel extends Component {
|
||||
<div className="cur-view-container">
|
||||
<div className="cur-view-path">
|
||||
<div className="path-containter">
|
||||
<a href={siteRoot + '#common/'} className="normal">{gettext("Libraries")}</a>
|
||||
<a href={siteRoot + '#common/'} className="normal">{gettext('Libraries')}</a>
|
||||
<span className="path-split">/</span>
|
||||
<a href={siteRoot + 'wiki/lib/' + repoID + '/'} className="normal">{slug}</a>
|
||||
{pathElem}
|
||||
@@ -115,8 +115,8 @@ class MainPanel extends Component {
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -25,7 +25,7 @@ class SidePanel extends Component {
|
||||
showAddFileFolder: false,
|
||||
showRename: false,
|
||||
isFile: false
|
||||
}
|
||||
};
|
||||
this.searchedPath = null;
|
||||
}
|
||||
|
||||
@@ -36,18 +36,18 @@ class SidePanel extends Component {
|
||||
onMouseEnter = () => {
|
||||
this.setState({
|
||||
isMenuIconShow: true
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
onMouseLeave = () => {
|
||||
this.setState({
|
||||
isMenuIconShow: false
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
onNodeClick = (e, node) => {
|
||||
this.setState({currentNode: node})
|
||||
this.props.onNodeClick(e, node)
|
||||
this.setState({currentNode: node});
|
||||
this.props.onNodeClick(e, node);
|
||||
}
|
||||
|
||||
onShowContextMenu = (e, node) => {
|
||||
@@ -59,7 +59,7 @@ class SidePanel extends Component {
|
||||
currentNode: node,
|
||||
menuPosition: position,
|
||||
isNodeItemFrezee: true
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
onHeadingMenuClick = (e) => {
|
||||
@@ -72,7 +72,7 @@ class SidePanel extends Component {
|
||||
isShowMenu: !this.state.isShowMenu,
|
||||
currentNode: node,
|
||||
menuPosition: position
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
onHideContextMenu = () => {
|
||||
@@ -82,7 +82,7 @@ class SidePanel extends Component {
|
||||
this.setState({
|
||||
isShowMenu: false,
|
||||
isNodeItemFrezee: false
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
toggleAddFileFolder = (flag) => {
|
||||
@@ -115,13 +115,13 @@ class SidePanel extends Component {
|
||||
}
|
||||
|
||||
onRenameNode = (newName) => {
|
||||
this.setState({showRename: !this.state.showRename})
|
||||
this.setState({showRename: !this.state.showRename});
|
||||
let node = this.state.currentNode;
|
||||
this.props.onRenameNode(node, newName)
|
||||
this.props.onRenameNode(node, newName);
|
||||
}
|
||||
|
||||
onDeleteNode = () => {
|
||||
this.setState({showDelete: !this.state.showDelete})
|
||||
this.setState({showDelete: !this.state.showDelete});
|
||||
let node = this.state.currentNode;
|
||||
this.props.onDeleteNode(node);
|
||||
}
|
||||
@@ -133,7 +133,7 @@ class SidePanel extends Component {
|
||||
componentWillReceiveProps(nextProps) {
|
||||
this.setState({
|
||||
currentNode: nextProps.changedNode
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
@@ -149,16 +149,16 @@ class SidePanel extends Component {
|
||||
}
|
||||
|
||||
deleteCancel = () => {
|
||||
this.setState({showDelete: !this.state.showDelete})
|
||||
this.setState({showDelete: !this.state.showDelete});
|
||||
}
|
||||
|
||||
renameCancel = () => {
|
||||
this.setState({showRename: !this.state.showRename})
|
||||
this.setState({showRename: !this.state.showRename});
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className={`side-panel wiki-side-panel ${this.props.closeSideBar ? "": "left-zero"}`}>
|
||||
<div className={`side-panel wiki-side-panel ${this.props.closeSideBar ? '': 'left-zero'}`}>
|
||||
<div className="side-panel-top panel-top">
|
||||
<a href={siteRoot} id="logo">
|
||||
<img src={mediaUrl + logoPath} title={siteTitle} alt="logo" width={logoWidth} height={logoHeight} />
|
||||
@@ -171,7 +171,7 @@ class SidePanel extends Component {
|
||||
onMouseEnter={this.onMouseEnter}
|
||||
onMouseLeave={this.onMouseLeave}
|
||||
>
|
||||
{gettext("Files")}
|
||||
{gettext('Files')}
|
||||
<div className="heading-icon">
|
||||
<MenuControl
|
||||
isShow={this.state.isMenuIconShow}
|
||||
@@ -227,7 +227,7 @@ class SidePanel extends Component {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
export default SidePanel;
|
||||
|
Reference in New Issue
Block a user