diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index 82d750102..c44582882 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -52,7 +52,12 @@ "textDownloadAs": "Download As", "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?", - "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?", + "textLocation": "Location", + "textTitle": "Title", + "textSubject": "Subject", + "textComment": "Comment", + "textCreated": "Created" }, "Collaboration": { "textEditUser": "Users who are editing the file:" diff --git a/apps/documenteditor/mobile/src/controller/Main.jsx b/apps/documenteditor/mobile/src/controller/Main.jsx index 04fe5cbc2..e40c5d646 100644 --- a/apps/documenteditor/mobile/src/controller/Main.jsx +++ b/apps/documenteditor/mobile/src/controller/Main.jsx @@ -94,7 +94,8 @@ class MainController extends Component { const storeDocumentInfo = this.props.storeDocumentInfo; - storeDocumentInfo.setDataDoc(data.doc); + storeDocumentInfo.setDataDoc(this.document); + // console.log(this.document); // Common.SharedSettings.set('document', data.doc); @@ -255,25 +256,27 @@ class MainController extends Component { const storeDocumentInfo = this.props.storeDocumentInfo; this.api.asc_registerCallback("asc_onGetDocInfoStart", () => { - console.log("Start"); - storeDocumentInfo.switchIsLoaded(false); + // console.log("Start"); + storeDocumentInfo.switchIsLoaded(false); }); this.api.asc_registerCallback("asc_onGetDocInfoStop", () => { - console.log("Stop"); - storeDocumentInfo.switchIsLoaded(true); + // console.log("Stop"); + storeDocumentInfo.switchIsLoaded(true); }); this.api.asc_registerCallback("asc_onDocInfo", (obj) => { - storeDocumentInfo.changeCount(obj); + storeDocumentInfo.changeCount(obj); }); this.api.asc_registerCallback('asc_onGetDocInfoEnd', () => { - console.log('End'); - storeDocumentInfo.switchIsLoaded(true); + // console.log('End'); + storeDocumentInfo.switchIsLoaded(true); }); - // me.api.asc_registerCallback('asc_onDocumentName', _.bind(me.onApiDocumentName, me)); + this.api.asc_registerCallback('asc_onDocumentName', (name) => { + // console.log(name); + }); } diff --git a/apps/documenteditor/mobile/src/controller/settings/DocumentInfo.jsx b/apps/documenteditor/mobile/src/controller/settings/DocumentInfo.jsx index 9e004f863..53ceb4ab3 100644 --- a/apps/documenteditor/mobile/src/controller/settings/DocumentInfo.jsx +++ b/apps/documenteditor/mobile/src/controller/settings/DocumentInfo.jsx @@ -9,6 +9,10 @@ class DocumentInfoController extends Component { this.getModified = this.getModified(); this.getModifiedBy = this.getModifiedBy(); this.getCreators = this.getCreators(); + this.title = this.getTitle(); + this.subject = this.getSubject(); + this.description = this.getDescription(); + this.getCreated = this.getCreated(); } getDocProps() { @@ -58,6 +62,26 @@ class DocumentInfoController extends Component { 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() { const api = Common.EditorApi.get(); api.startGetDocInfo(); @@ -69,7 +93,11 @@ class DocumentInfoController extends Component { getAppProps={this.getAppProps} getModified={this.getModified} getModifiedBy={this.getModifiedBy} - getCreators={this.getCreators} + getCreators={this.getCreators} + getCreated={this.getCreated} + title={this.title} + subject={this.subject} + description={this.description} /> ); } diff --git a/apps/documenteditor/mobile/src/view/settings/DocumentInfo.jsx b/apps/documenteditor/mobile/src/view/settings/DocumentInfo.jsx index 69ac1869b..6a78cb121 100644 --- a/apps/documenteditor/mobile/src/view/settings/DocumentInfo.jsx +++ b/apps/documenteditor/mobile/src/view/settings/DocumentInfo.jsx @@ -20,24 +20,45 @@ const PageDocumentInfo = (props) => { wordsCount, } = storeInfo.infoObj; const dataDoc = JSON.parse(JSON.stringify(storeInfo.dataDoc)); + // console.log(dataDoc); const isLoaded = storeInfo.isLoaded; // console.log(pageCount, paragraphCount, symbolsCount, symbolsWSCount, wordsCount); return ( - {_t.textDocumentTitle} - - - - {_t.textOwner} - - - - {_t.textUploaded} - - - + {dataDoc.title ? ( + + {_t.textDocumentTitle} + + + + + ) : null} + {dataDoc.info.author || dataDoc.info.owner ? ( + + {_t.textOwner} + + + + + ) : null} + {dataDoc.info.folder ? ( + + {_t.textLocation} + + + + + ) : null} + {dataDoc.info.uploaded || dataDoc.info.created ? ( + + {_t.textUploaded} + + + + + ) : null} {_t.textStatistic} @@ -46,18 +67,54 @@ const PageDocumentInfo = (props) => { - {dataModified && dataModifiedBy ? ( + {props.title ? ( + + {_t.textTitle} + + + + + ) : null} + {props.subject ? ( + + {_t.textSubject} + + + + + ) : null} + {props.description ? ( + + {_t.textComment} + + + + + ) : null} + {dataModified ? ( {_t.textLastModified} + + ) : null} + {dataModifiedBy ? ( + {_t.textLastModifiedBy} ) : null} + {props.getCreated ? ( + + {_t.textCreated} + + + + + ) : null} {dataApp ? ( {_t.textApplication}