[PE mobile] Document Info

This commit is contained in:
Julia Svinareva 2019-07-23 11:18:20 +03:00
parent bf6f074aed
commit 7844686a74
3 changed files with 140 additions and 16 deletions

View file

@ -190,9 +190,51 @@ define([
me.initPageApplicationSettings();
} else if ('#color-schemes-view' == pageId) {
me.initPageColorSchemes();
} else if ('#settings-info-view' == pageId) {
me.initPageInfo();
}
},
initPageInfo: function() {
var document = Common.SharedSettings.get('document') || {},
info = document.info || {};
document.title ? $('#settings-presentation-title').html(document.title) : $('.display-presentation-title').remove();
info.author ? $('#settings-pe-owner').html(info.author) : $('.display-owner').remove();
info.uploaded ? $('#settings-pe-uploaded').html(info.uploaded.toLocaleString()) : $('.display-uploaded').remove();
/*info.created ? $('#settings-pe-date').html(info.created) : $('.display-created-date').remove();*/
var appProps = (this.api) ? this.api.asc_getAppProps() : null;
if (appProps) {
var appName = (appProps.asc_getApplication() || '') + ' ' + (appProps.asc_getAppVersion() || '');
appName ? $('#settings-pe-application').html(appName) : $('.display-application').remove();
}
var props = (this.api) ? this.api.asc_getCoreProps() : null,
value;
if (props) {
value = props.asc_getTitle();
value ? $('#settings-pe-title').html(value) : $('.display-title').remove();
value = props.asc_getSubject();
value ? $('#settings-pe-subject').html(value) : $('.display-subject').remove();
value = props.asc_getDescription();
value ? $('#settings-pe-comment').html(value) : $('.display-comment').remove();
value = props.asc_getModified();
value ? $('#settings-pe-last-mod').html(value.toLocaleString()) : $('.display-last-mode').remove();
value = props.asc_getLastModifiedBy();
value ? $('#settings-pe-mod-by').html(value) : $('.display-mode-by').remove();
value = props.asc_getCreated();
value ? $('#settings-pe-date').html(value.toLocaleString()) : $('.display-created-date').remove();
value = props.asc_getCreator();
var templateCreator = "";
value && value.split(/\s*[,;]\s*/).forEach(function(item) {
templateCreator = templateCreator + "<li class='item-content'><div class='item-inner'><div class='item-title'>" + item + "</div></div></li>";
});
templateCreator ? $('#list-creator').html(templateCreator) : $('.display-author').remove();
}
},
onCollaboration: function() {
PE.getController('Common.Controllers.Collaboration').showModal();
},

View file

@ -143,8 +143,8 @@
<div class="pages">
<div class="page" data-page="settings-info-view">
<div class="page-content">
<div class="content-block-title"><%= scope.textPresentTitle %></div>
<div class="list-block">
<div class="content-block-title display-presentation-title"><%= scope.textPresentTitle %></div>
<div class="list-block display-presentation-title">
<ul>
<li class="item-content">
<div class="item-inner">
@ -153,22 +153,102 @@
</li>
</ul>
</div>
<div class="content-block-title"><%= scope.textAuthor %></div>
<div class="list-block">
<div class="content-block-title display-owner"><%= scope.textOwner %></div>
<div class="list-block display-owner">
<ul>
<li class="item-content">
<div class="item-inner">
<div id="settings-presentation-autor" class="item-title"><%= scope.textLoading %></div>
<div id="settings-pe-owner" class="item-title"><%= scope.textLoading %></div>
</div>
</li>
</ul>
</div>
<div class="content-block-title"><%= scope.textCreateDate %></div>
<div class="list-block">
<div class="content-block-title display-uploaded"><%= scope.textUploaded %></div>
<div class="list-block display-uploaded">
<ul>
<li class="item-content">
<div class="item-inner">
<div id="settings-presentation-date" class="item-title"><%= scope.textLoading %></div>
<div id="settings-pe-uploaded" class="item-title"><%= scope.textLoading %></div>
</div>
</li>
</ul>
</div>
<div class="content-block-title display-subject"><%= scope.textSubject %></div>
<div class="list-block display-subject">
<ul>
<li class="item-content">
<div class="item-inner">
<div id="settings-pe-subject" class="item-title"><%= scope.textLoading %></div>
</div>
</li>
</ul>
</div>
<div class="content-block-title display-title"><%= scope.textTitle %></div>
<div class="list-block display-title">
<ul>
<li class="item-content">
<div class="item-inner">
<div id="settings-pe-title" class="item-title"><%= scope.textLoading %></div>
</div>
</li>
</ul>
</div>
<div class="content-block-title display-comment"><%= scope.textComment %></div>
<div class="list-block display-comment">
<ul>
<li class="item-content">
<div class="item-inner">
<div id="settings-pe-comment" class="item-title"><%= scope.textLoading %></div>
</div>
</li>
</ul>
</div>
<div class="content-block-title display-last-mode"><%= scope.textLastModified %></div>
<div class="list-block display-last-mode">
<ul>
<li class="item-content">
<div class="item-inner">
<div id="settings-pe-last-mod" class="item-title"><%= scope.textLoading %></div>
</div>
</li>
</ul>
</div>
<div class="content-block-title display-mode-by"><%= scope.textLastModifiedBy %></div>
<div class="list-block display-mode-by">
<ul>
<li class="item-content">
<div class="item-inner">
<div id="settings-pe-mod-by" class="item-title"><%= scope.textLoading %></div>
</div>
</li>
</ul>
</div>
<div class="content-block-title display-created-date"><%= scope.textCreated %></div>
<div class="list-block display-created-date">
<ul>
<li class="item-content">
<div class="item-inner">
<div id="settings-pe-date" class="item-title"><%= scope.textLoading %></div>
</div>
</li>
</ul>
</div>
<div class="content-block-title display-application"><%= scope.textApplication %></div>
<div class="list-block display-application">
<ul>
<li class="item-content">
<div class="item-inner">
<div id="settings-pe-application" class="item-title"><%= scope.textLoading %></div>
</div>
</li>
</ul>
</div>
<div class="content-block-title display-author"><%= scope.textAuthor %></div>
<div class="list-block display-author">
<ul id="list-creator">
<li class="item-content">
<div class="item-inner">
<div id="settings-pe-author" class="item-title"><%= scope.textLoading %></div>
</div>
</li>
</ul>

View file

@ -168,13 +168,6 @@ define([
showInfo: function () {
this.showPage('#settings-info-view');
var document = Common.SharedSettings.get('document') || {},
info = document.info || {};
$('#settings-presentation-title').html(document.title ? document.title : this.unknownText);
$('#settings-presentation-autor').html(info.author ? info.author : this.unknownText);
$('#settings-presentation-date').html(info.created ? info.created : this.unknownText);
},
showDownload: function () {
@ -248,7 +241,16 @@ define([
textPoint: 'Point',
textInch: 'Inch',
textColorSchemes: 'Color Schemes',
textCollaboration: 'Collaboration'
textCollaboration: 'Collaboration',
textSubject: 'Subject',
textTitle: 'Title',
textComment: 'Comment',
textOwner: 'Owner',
textApplication : 'Application',
textCreated: 'Created',
textLastModified: 'Last Modified',
textLastModifiedBy: 'Last Modified By',
textUploaded: 'Uploaded'
}
})(), PE.Views.Settings || {}))
});