Merge branch 'feature/mobile-apps-on-reactjs-document-info' into feature/mobile-apps-on-reactjs
This commit is contained in:
commit
dff74786e7
|
@ -53,7 +53,12 @@
|
||||||
"notcriticalErrorTitle": "Warning",
|
"notcriticalErrorTitle": "Warning",
|
||||||
"textDownloadTxt": "If you continue saving in this format all features except the text will be lost. Are you sure you want to continue?",
|
"textDownloadTxt": "If you continue saving in this format all features except the text will be lost. Are you sure you want to continue?",
|
||||||
"textDownloadRtf": "If you continue saving in this format some of the formatting might be lost. Are you sure you want to continue?",
|
"textDownloadRtf": "If you continue saving in this format some of the formatting might be lost. Are you sure you want to continue?",
|
||||||
"textColorSchemes": "Color Schemes"
|
"textColorSchemes": "Color Schemes",
|
||||||
|
"textLocation": "Location",
|
||||||
|
"textTitle": "Title",
|
||||||
|
"textSubject": "Subject",
|
||||||
|
"textComment": "Comment",
|
||||||
|
"textCreated": "Created"
|
||||||
},
|
},
|
||||||
"Collaboration": {
|
"Collaboration": {
|
||||||
"textEditUser": "Users who are editing the file:"
|
"textEditUser": "Users who are editing the file:"
|
||||||
|
|
|
@ -94,7 +94,7 @@ class MainController extends Component {
|
||||||
|
|
||||||
const storeDocumentInfo = this.props.storeDocumentInfo;
|
const storeDocumentInfo = this.props.storeDocumentInfo;
|
||||||
|
|
||||||
storeDocumentInfo.setDataDoc(data.doc);
|
storeDocumentInfo.setDataDoc(this.document);
|
||||||
|
|
||||||
// Common.SharedSettings.set('document', data.doc);
|
// Common.SharedSettings.set('document', data.doc);
|
||||||
|
|
||||||
|
@ -255,12 +255,10 @@ class MainController extends Component {
|
||||||
const storeDocumentInfo = this.props.storeDocumentInfo;
|
const storeDocumentInfo = this.props.storeDocumentInfo;
|
||||||
|
|
||||||
this.api.asc_registerCallback("asc_onGetDocInfoStart", () => {
|
this.api.asc_registerCallback("asc_onGetDocInfoStart", () => {
|
||||||
// console.log("Start");
|
|
||||||
storeDocumentInfo.switchIsLoaded(false);
|
storeDocumentInfo.switchIsLoaded(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.api.asc_registerCallback("asc_onGetDocInfoStop", () => {
|
this.api.asc_registerCallback("asc_onGetDocInfoStop", () => {
|
||||||
// console.log("Stop");
|
|
||||||
storeDocumentInfo.switchIsLoaded(true);
|
storeDocumentInfo.switchIsLoaded(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -269,21 +267,19 @@ class MainController extends Component {
|
||||||
});
|
});
|
||||||
|
|
||||||
this.api.asc_registerCallback('asc_onGetDocInfoEnd', () => {
|
this.api.asc_registerCallback('asc_onGetDocInfoEnd', () => {
|
||||||
// console.log('End');
|
|
||||||
storeDocumentInfo.switchIsLoaded(true);
|
storeDocumentInfo.switchIsLoaded(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.api.asc_registerCallback('asc_onDocumentName', (name) => {
|
||||||
|
// console.log(name);
|
||||||
|
});
|
||||||
|
|
||||||
// Color Schemes
|
// Color Schemes
|
||||||
|
|
||||||
this.api.asc_registerCallback('asc_onSendThemeColorSchemes', (arr) => {
|
this.api.asc_registerCallback('asc_onSendThemeColorSchemes', (arr) => {
|
||||||
// console.log(arr);
|
|
||||||
storeDocumentSettings.addSchemes(arr);
|
storeDocumentSettings.addSchemes(arr);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// me.api.asc_registerCallback('asc_onDocumentName', _.bind(me.onApiDocumentName, me));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
|
@ -9,6 +9,10 @@ class DocumentInfoController extends Component {
|
||||||
this.getModified = this.getModified();
|
this.getModified = this.getModified();
|
||||||
this.getModifiedBy = this.getModifiedBy();
|
this.getModifiedBy = this.getModifiedBy();
|
||||||
this.getCreators = this.getCreators();
|
this.getCreators = this.getCreators();
|
||||||
|
this.title = this.getTitle();
|
||||||
|
this.subject = this.getSubject();
|
||||||
|
this.description = this.getDescription();
|
||||||
|
this.getCreated = this.getCreated();
|
||||||
}
|
}
|
||||||
|
|
||||||
getDocProps() {
|
getDocProps() {
|
||||||
|
@ -58,6 +62,26 @@ class DocumentInfoController extends Component {
|
||||||
return this.docProps.asc_getCreator();
|
return this.docProps.asc_getCreator();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getTitle() {
|
||||||
|
return this.docProps.asc_getTitle();
|
||||||
|
}
|
||||||
|
|
||||||
|
getSubject() {
|
||||||
|
return this.docProps.asc_getSubject();
|
||||||
|
}
|
||||||
|
|
||||||
|
getDescription() {
|
||||||
|
return this.docProps.asc_getDescription();
|
||||||
|
}
|
||||||
|
|
||||||
|
getCreated() {
|
||||||
|
let value = this.docProps.asc_getCreated();
|
||||||
|
|
||||||
|
if(value) {
|
||||||
|
return value.toLocaleString(_lang, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + value.toLocaleTimeString(_lang, {timeStyle: 'short'});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const api = Common.EditorApi.get();
|
const api = Common.EditorApi.get();
|
||||||
api.startGetDocInfo();
|
api.startGetDocInfo();
|
||||||
|
@ -70,6 +94,10 @@ class DocumentInfoController extends Component {
|
||||||
getModified={this.getModified}
|
getModified={this.getModified}
|
||||||
getModifiedBy={this.getModifiedBy}
|
getModifiedBy={this.getModifiedBy}
|
||||||
getCreators={this.getCreators}
|
getCreators={this.getCreators}
|
||||||
|
getCreated={this.getCreated}
|
||||||
|
title={this.title}
|
||||||
|
subject={this.subject}
|
||||||
|
description={this.description}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,24 +20,45 @@ const PageDocumentInfo = (props) => {
|
||||||
wordsCount,
|
wordsCount,
|
||||||
} = storeInfo.infoObj;
|
} = storeInfo.infoObj;
|
||||||
const dataDoc = JSON.parse(JSON.stringify(storeInfo.dataDoc));
|
const dataDoc = JSON.parse(JSON.stringify(storeInfo.dataDoc));
|
||||||
|
// console.log(dataDoc);
|
||||||
const isLoaded = storeInfo.isLoaded;
|
const isLoaded = storeInfo.isLoaded;
|
||||||
// console.log(pageCount, paragraphCount, symbolsCount, symbolsWSCount, wordsCount);
|
// console.log(pageCount, paragraphCount, symbolsCount, symbolsWSCount, wordsCount);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page>
|
<Page>
|
||||||
<Navbar title={_t.textDocumentInfo} backLink={_t.textBack} />
|
<Navbar title={_t.textDocumentInfo} backLink={_t.textBack} />
|
||||||
|
{dataDoc.title ? (
|
||||||
|
<Fragment>
|
||||||
<BlockTitle>{_t.textDocumentTitle}</BlockTitle>
|
<BlockTitle>{_t.textDocumentTitle}</BlockTitle>
|
||||||
<List>
|
<List>
|
||||||
<ListItem title={dataDoc.title}></ListItem>
|
<ListItem title={dataDoc.title}></ListItem>
|
||||||
</List>
|
</List>
|
||||||
|
</Fragment>
|
||||||
|
) : null}
|
||||||
|
{dataDoc.info.author || dataDoc.info.owner ? (
|
||||||
|
<Fragment>
|
||||||
<BlockTitle>{_t.textOwner}</BlockTitle>
|
<BlockTitle>{_t.textOwner}</BlockTitle>
|
||||||
<List>
|
<List>
|
||||||
<ListItem title={dataDoc.info.author}></ListItem>
|
<ListItem title={dataDoc.info.author || dataDoc.info.owner}></ListItem>
|
||||||
</List>
|
</List>
|
||||||
|
</Fragment>
|
||||||
|
) : null}
|
||||||
|
{dataDoc.info.folder ? (
|
||||||
|
<Fragment>
|
||||||
|
<BlockTitle>{_t.textLocation}</BlockTitle>
|
||||||
|
<List>
|
||||||
|
<ListItem title={dataDoc.info.folder}></ListItem>
|
||||||
|
</List>
|
||||||
|
</Fragment>
|
||||||
|
) : null}
|
||||||
|
{dataDoc.info.uploaded || dataDoc.info.created ? (
|
||||||
|
<Fragment>
|
||||||
<BlockTitle>{_t.textUploaded}</BlockTitle>
|
<BlockTitle>{_t.textUploaded}</BlockTitle>
|
||||||
<List>
|
<List>
|
||||||
<ListItem title={dataDoc.info.created}></ListItem>
|
<ListItem title={dataDoc.info.uploaded || dataDoc.info.created}></ListItem>
|
||||||
</List>
|
</List>
|
||||||
|
</Fragment>
|
||||||
|
) : null}
|
||||||
<BlockTitle>{_t.textStatistic}</BlockTitle>
|
<BlockTitle>{_t.textStatistic}</BlockTitle>
|
||||||
<List>
|
<List>
|
||||||
<ListItem title="Pages" after={isLoaded ? String(pageCount) : _t.textLoading}></ListItem>
|
<ListItem title="Pages" after={isLoaded ? String(pageCount) : _t.textLoading}></ListItem>
|
||||||
|
@ -46,18 +67,54 @@ const PageDocumentInfo = (props) => {
|
||||||
<ListItem title="Symbols" after={isLoaded ? String(symbolsCount) : _t.textLoading}></ListItem>
|
<ListItem title="Symbols" after={isLoaded ? String(symbolsCount) : _t.textLoading}></ListItem>
|
||||||
<ListItem title="Spaces" after={isLoaded ? String(symbolsWSCount) : _t.textLoading}></ListItem>
|
<ListItem title="Spaces" after={isLoaded ? String(symbolsWSCount) : _t.textLoading}></ListItem>
|
||||||
</List>
|
</List>
|
||||||
{dataModified && dataModifiedBy ? (
|
{props.title ? (
|
||||||
|
<Fragment>
|
||||||
|
<BlockTitle>{_t.textTitle}</BlockTitle>
|
||||||
|
<List>
|
||||||
|
<ListItem title={props.title}></ListItem>
|
||||||
|
</List>
|
||||||
|
</Fragment>
|
||||||
|
) : null}
|
||||||
|
{props.subject ? (
|
||||||
|
<Fragment>
|
||||||
|
<BlockTitle>{_t.textSubject}</BlockTitle>
|
||||||
|
<List>
|
||||||
|
<ListItem title={props.subject}></ListItem>
|
||||||
|
</List>
|
||||||
|
</Fragment>
|
||||||
|
) : null}
|
||||||
|
{props.description ? (
|
||||||
|
<Fragment>
|
||||||
|
<BlockTitle>{_t.textComment}</BlockTitle>
|
||||||
|
<List>
|
||||||
|
<ListItem title={props.description}></ListItem>
|
||||||
|
</List>
|
||||||
|
</Fragment>
|
||||||
|
) : null}
|
||||||
|
{dataModified ? (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<BlockTitle>{_t.textLastModified}</BlockTitle>
|
<BlockTitle>{_t.textLastModified}</BlockTitle>
|
||||||
<List>
|
<List>
|
||||||
<ListItem title={dataModified}></ListItem>
|
<ListItem title={dataModified}></ListItem>
|
||||||
</List>
|
</List>
|
||||||
|
</Fragment>
|
||||||
|
) : null}
|
||||||
|
{dataModifiedBy ? (
|
||||||
|
<Fragment>
|
||||||
<BlockTitle>{_t.textLastModifiedBy}</BlockTitle>
|
<BlockTitle>{_t.textLastModifiedBy}</BlockTitle>
|
||||||
<List>
|
<List>
|
||||||
<ListItem title={dataModifiedBy}></ListItem>
|
<ListItem title={dataModifiedBy}></ListItem>
|
||||||
</List>
|
</List>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
) : null}
|
) : null}
|
||||||
|
{props.getCreated ? (
|
||||||
|
<Fragment>
|
||||||
|
<BlockTitle>{_t.textCreated}</BlockTitle>
|
||||||
|
<List>
|
||||||
|
<ListItem title={props.getCreated}></ListItem>
|
||||||
|
</List>
|
||||||
|
</Fragment>
|
||||||
|
) : null}
|
||||||
{dataApp ? (
|
{dataApp ? (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<BlockTitle>{_t.textApplication}</BlockTitle>
|
<BlockTitle>{_t.textApplication}</BlockTitle>
|
||||||
|
|
Loading…
Reference in a new issue