From 7844686a749d7f03f074cd81ea220fc27006b3a3 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Tue, 23 Jul 2019 11:18:20 +0300 Subject: [PATCH] [PE mobile] Document Info --- .../mobile/app/controller/Settings.js | 42 ++++++++ .../mobile/app/template/Settings.template | 96 +++++++++++++++++-- .../mobile/app/view/Settings.js | 18 ++-- 3 files changed, 140 insertions(+), 16 deletions(-) diff --git a/apps/presentationeditor/mobile/app/controller/Settings.js b/apps/presentationeditor/mobile/app/controller/Settings.js index 43472adc2..a7580e2a6 100644 --- a/apps/presentationeditor/mobile/app/controller/Settings.js +++ b/apps/presentationeditor/mobile/app/controller/Settings.js @@ -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 + "
  • " + item + "
  • "; + }); + templateCreator ? $('#list-creator').html(templateCreator) : $('.display-author').remove(); + } + + }, + onCollaboration: function() { PE.getController('Common.Controllers.Collaboration').showModal(); }, diff --git a/apps/presentationeditor/mobile/app/template/Settings.template b/apps/presentationeditor/mobile/app/template/Settings.template index 97e870c9d..7bae06462 100644 --- a/apps/presentationeditor/mobile/app/template/Settings.template +++ b/apps/presentationeditor/mobile/app/template/Settings.template @@ -143,8 +143,8 @@
    -
    <%= scope.textPresentTitle %>
    -
    +
    <%= scope.textPresentTitle %>
    +
    • @@ -153,22 +153,102 @@
    -
    <%= scope.textAuthor %>
    -
    +
    <%= scope.textOwner %>
    +
    • -
      <%= scope.textLoading %>
      +
      <%= scope.textLoading %>
    -
    <%= scope.textCreateDate %>
    -
    +
    <%= scope.textUploaded %>
    +
    • -
      <%= scope.textLoading %>
      +
      <%= scope.textLoading %>
      +
      +
    • +
    +
    +
    <%= scope.textSubject %>
    +
    +
      +
    • +
      +
      <%= scope.textLoading %>
      +
      +
    • +
    +
    +
    <%= scope.textTitle %>
    +
    +
      +
    • +
      +
      <%= scope.textLoading %>
      +
      +
    • +
    +
    +
    <%= scope.textComment %>
    +
    +
      +
    • +
      +
      <%= scope.textLoading %>
      +
      +
    • +
    +
    +
    <%= scope.textLastModified %>
    +
    +
      +
    • +
      +
      <%= scope.textLoading %>
      +
      +
    • +
    +
    +
    <%= scope.textLastModifiedBy %>
    +
    +
      +
    • +
      +
      <%= scope.textLoading %>
      +
      +
    • +
    +
    +
    <%= scope.textCreated %>
    +
    +
      +
    • +
      +
      <%= scope.textLoading %>
      +
      +
    • +
    +
    +
    <%= scope.textApplication %>
    +
    +
      +
    • +
      +
      <%= scope.textLoading %>
      +
      +
    • +
    +
    +
    <%= scope.textAuthor %>
    +
    +
      +
    • +
      +
      <%= scope.textLoading %>
    diff --git a/apps/presentationeditor/mobile/app/view/Settings.js b/apps/presentationeditor/mobile/app/view/Settings.js index d9d893ab1..e37e566f6 100644 --- a/apps/presentationeditor/mobile/app/view/Settings.js +++ b/apps/presentationeditor/mobile/app/view/Settings.js @@ -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 || {})) }); \ No newline at end of file