[DE mobile] Added one more event and loading counters

This commit is contained in:
SergeyEzhin 2020-11-23 20:20:00 +03:00
parent b5058e24ec
commit 3e706114eb
3 changed files with 54 additions and 57 deletions

View file

@ -27,7 +27,8 @@
"textStatistic": "Statistic", "textStatistic": "Statistic",
"textLastModifiedBy": "Last Modified By", "textLastModifiedBy": "Last Modified By",
"textLastModified": "Last Modified", "textLastModified": "Last Modified",
"textApplication": "Application" "textApplication": "Application",
"textLoading": "Loading..."
}, },
"Collaboration": { "Collaboration": {
"textEditUser": "Users who are editing the file:" "textEditUser": "Users who are editing the file:"

View file

@ -254,7 +254,7 @@ class MainController extends Component {
}); });
this.api.asc_registerCallback("asc_onGetDocInfoStop", () => { this.api.asc_registerCallback("asc_onGetDocInfoStop", () => {
console.log("End"); console.log("Stop");
storeDocumentInfo.switchIsLoaded(true); storeDocumentInfo.switchIsLoaded(true);
}); });
@ -262,7 +262,11 @@ class MainController extends Component {
storeDocumentInfo.changeCount(obj); storeDocumentInfo.changeCount(obj);
}); });
// me.api.asc_registerCallback('asc_onGetDocInfoEnd', _.bind(me.onApiGetDocInfoEnd, me)); this.api.asc_registerCallback('asc_onGetDocInfoEnd', () => {
console.log('End');
storeDocumentInfo.switchIsLoaded(true);
});
// me.api.asc_registerCallback('asc_onDocumentName', _.bind(me.onApiDocumentName, me)); // me.api.asc_registerCallback('asc_onDocumentName', _.bind(me.onApiDocumentName, me));
} }

View file

@ -19,61 +19,53 @@ const PageDocumentInfo = (props) => {
} = storeInfo.infoObj; } = storeInfo.infoObj;
const dataDoc = JSON.parse(JSON.stringify(storeInfo.dataDoc)); const dataDoc = JSON.parse(JSON.stringify(storeInfo.dataDoc));
const isLoaded = storeInfo.isLoaded; const isLoaded = storeInfo.isLoaded;
console.log(pageCount, paragraphCount, symbolsCount, symbolsWSCount, wordsCount);
if (!isLoaded) {
console.log( return (
pageCount, <Page>
paragraphCount, <Navbar title={_t.textDocumentInfo} backLink={_t.textBack} />
symbolsCount, <BlockTitle>{_t.textDocumentTitle}</BlockTitle>
symbolsWSCount, <List>
wordsCount <ListItem title={dataDoc.title}></ListItem>
</List>
<BlockTitle>{_t.textOwner}</BlockTitle>
<List>
<ListItem title={dataDoc.info.author}></ListItem>
</List>
<BlockTitle>{_t.textUploaded}</BlockTitle>
<List>
<ListItem title={dataDoc.info.created}></ListItem>
</List>
<BlockTitle>{_t.textStatistic}</BlockTitle>
<List>
<ListItem title="Pages" after={isLoaded ? pageCount : _t.textLoading}></ListItem>
<ListItem title="Paragraphs" after={isLoaded ? paragraphCount : _t.textLoading}></ListItem>
<ListItem title="Words" after={isLoaded ? wordsCount : _t.textLoading}></ListItem>
<ListItem title="Symbols" after={isLoaded ? symbolsCount : _t.textLoading}></ListItem>
<ListItem title="Spaces" after={isLoaded ? symbolsWSCount : _t.textLoading}></ListItem>
</List>
{dataModified && dataModifiedBy ? (
<Fragment>
<BlockTitle>{_t.textLastModified}</BlockTitle>
<List>
<ListItem title={dataModified}></ListItem>
</List>
<BlockTitle>{_t.textLastModifiedBy}</BlockTitle>
<List>
<ListItem title={dataModifiedBy}></ListItem>
</List>
</Fragment>
) : null}
{dataApp ? (
<Fragment>
<BlockTitle>{_t.textApplication}</BlockTitle>
<List>
<ListItem title={dataApp}></ListItem>
</List>
</Fragment>
) : null}
</Page>
); );
return (
<Page>
<Navbar title={_t.textDocumentInfo} backLink={_t.textBack} />
<BlockTitle>{_t.textDocumentTitle}</BlockTitle>
<List>
<ListItem title={dataDoc.title}></ListItem>
</List>
<BlockTitle>{_t.textOwner}</BlockTitle>
<List>
<ListItem title={dataDoc.info.author}></ListItem>
</List>
<BlockTitle>{_t.textUploaded}</BlockTitle>
<List>
<ListItem title={dataDoc.info.created}></ListItem>
</List>
<BlockTitle>{_t.textStatistic}</BlockTitle>
<List>
<ListItem title="Pages" after={pageCount}></ListItem>
<ListItem title="Paragraphs" after={paragraphCount}></ListItem>
<ListItem title="Words" after={wordsCount}></ListItem>
<ListItem title="Symbols" after={symbolsCount}></ListItem>
<ListItem title="Spaces" after={symbolsWSCount}></ListItem>
</List>
{dataModified && dataModifiedBy ? (
<Fragment>
<BlockTitle>{_t.textLastModified}</BlockTitle>
<List>
<ListItem title={dataModified}></ListItem>
</List>
<BlockTitle>{_t.textLastModifiedBy}</BlockTitle>
<List>
<ListItem title={dataModifiedBy}></ListItem>
</List>
</Fragment>
) : null}
{dataApp ? (
<Fragment>
<BlockTitle>{_t.textApplication}</BlockTitle>
<List>
<ListItem title={dataApp}></ListItem>
</List>
</Fragment>
) : null}
</Page>
);
}
}; };
const DocumentInfo = inject("storeDocumentInfo")(observer(PageDocumentInfo)); const DocumentInfo = inject("storeDocumentInfo")(observer(PageDocumentInfo));