[se][pe] Fix minimization for GetDocumentInfo method

This commit is contained in:
Ilya Kirillov
2025-05-12 19:07:29 +03:00
parent 99fb43dcec
commit 24a560e564
2 changed files with 68 additions and 68 deletions

View File

@ -7957,7 +7957,7 @@
* <b>LastModifiedRaw</b> - the date and time when the file was last modified.
* <b>LastModified</b> - the parsed date and time when the file was last modified.
* <b>LastModifiedBy</b> - the name of the user who has made the latest change to the document.
* <b>Autrors</b> - the persons who has created the file.
* <b>Authors</b> - the persons who has created the file.
* <b>Title</b> - this property allows you to simplify your documents classification.
* <b>Tags</b> - this property allows you to simplify your documents classification.
* <b>Subject</b> - this property allows you to simplify your documents classification.
@ -7970,21 +7970,21 @@
Api.prototype.GetDocumentInfo = function()
{
const oDocInfo = {
Application: '',
CreatedRaw: null,
Created: '',
LastModifiedRaw: null,
LastModified: '',
LastModifiedBy: '',
Autrors: [],
Title: '',
Tags: '',
Subject: '',
Comment: ''
"Application": '',
"CreatedRaw": null,
"Created": '',
"LastModifiedRaw": null,
"LastModified": '',
"LastModifiedBy": '',
"Authors": [],
"Title": '',
"Tags": '',
"Subject": '',
"Comment": ''
};
let props = (this) ? this.asc_getAppProps() : null;
oDocInfo.Application = (props.asc_getApplication() || '') + (props.asc_getAppVersion() ? ' ' : '') + (props.asc_getAppVersion() || '');
oDocInfo["Application"] = (props.asc_getApplication() || '') + (props.asc_getAppVersion() ? ' ' : '') + (props.asc_getAppVersion() || '');
let langCode = 1033; // en-US
let langName = 'en-us';
@ -7997,35 +7997,35 @@
}
props = this.asc_getCoreProps();
oDocInfo.CreatedRaw = props.asc_getCreated();
oDocInfo.LastModifiedRaw = props.asc_getModified();
oDocInfo["CreatedRaw"] = props.asc_getCreated();
oDocInfo["LastModifiedRaw"] = props.asc_getModified();
try {
if (oDocInfo.CreatedRaw)
oDocInfo.Created = (oDocInfo.CreatedRaw.toLocaleString(langName, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' +oDocInfo. CreatedRaw.toLocaleString(langName, {timeStyle: 'short'}));
if (oDocInfo["CreatedRaw"])
oDocInfo["Created"] = (oDocInfo["CreatedRaw"].toLocaleString(langName, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + oDocInfo["CreatedRaw"].toLocaleString(langName, {timeStyle: 'short'}));
if (oDocInfo.LastModifiedRaw)
oDocInfo.LastModified = (oDocInfo.LastModifiedRaw.toLocaleString(langName, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + oDocInfo.LastModifiedRaw.toLocaleString(langName, {timeStyle: 'short'}));
if (oDocInfo["LastModifiedRaw"])
oDocInfo["LastModified"] = (oDocInfo["LastModifiedRaw"].toLocaleString(langName, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + oDocInfo["LastModifiedRaw"].toLocaleString(langName, {timeStyle: 'short'}));
} catch (e) {
langName = 'en';
if (oDocInfo.CreatedRaw)
oDocInfo.Created = (oDocInfo.CreatedRaw.toLocaleString(langName, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + oDocInfo.CreatedRaw.toLocaleString(langName, {timeStyle: 'short'}));
if (oDocInfo["CreatedRaw"])
oDocInfo["Created"] = (oDocInfo["CreatedRaw"].toLocaleString(langName, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + oDocInfo["CreatedRaw"].toLocaleString(langName, {timeStyle: 'short'}));
if (oDocInfo.LastModifiedRaw)
oDocInfo.LastModified = (oDocInfo.LastModifiedRaw.toLocaleString(langName, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + oDocInfo.LastModifiedRaw.toLocaleString(langName, {timeStyle: 'short'}));
if (oDocInfo["LastModifiedRaw"])
oDocInfo["LastModified"] = (oDocInfo["LastModifiedRaw"].toLocaleString(langName, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + oDocInfo["LastModifiedRaw"].toLocaleString(langName, {timeStyle: 'short'}));
}
const LastModifiedBy = props.asc_getLastModifiedBy();
oDocInfo.LastModifiedBy = AscCommon.UserInfoParser.getParsedName(LastModifiedBy);
oDocInfo.Title = (props.asc_getTitle() || '');
oDocInfo.Tags = (props.asc_getKeywords() || '');
oDocInfo.Subject = (props.asc_getSubject() || '');
oDocInfo.Comment = (props.asc_getDescription() || '');
oDocInfo["LastModifiedBy"] = AscCommon.UserInfoParser.getParsedName(LastModifiedBy);
oDocInfo["Title"] = (props.asc_getTitle() || '');
oDocInfo["Tags"] = (props.asc_getKeywords() || '');
oDocInfo["Subject"] = (props.asc_getSubject() || '');
oDocInfo["Comment"] = (props.asc_getDescription() || '');
const authors = props.asc_getCreator();
if (authors)
oDocInfo.Autrors = authors.split(/\s*[,;]\s*/);
oDocInfo["Authors"] = authors.split(/\s*[,;]\s*/);
return oDocInfo;
};

View File

@ -1562,7 +1562,7 @@
* <b>LastModifiedRaw</b> - the date and time when the file was last modified.
* <b>LastModified</b> - the parsed date and time when the file was last modified.
* <b>LastModifiedBy</b> - the name of the user who has made the latest change to the document.
* <b>Autrors</b> - the persons who has created the file.
* <b>Authors</b> - the persons who has created the file.
* <b>Title</b> - this property allows you to simplify your documents classification.
* <b>Tags</b> - this property allows you to simplify your documents classification.
* <b>Subject</b> - this property allows you to simplify your documents classification.
@ -1572,26 +1572,26 @@
* @returns {object}
* @see office-js-api/Examples/{Editor}/ApiPresentation/Methods/GetDocumentInfo.js
*/
ApiPresentation.prototype.GetDocumentInfo = function()
ApiDocument.prototype.GetDocumentInfo = function()
{
const oDocInfo = {
Application: '',
CreatedRaw: null,
Created: '',
LastModifiedRaw: null,
LastModified: '',
LastModifiedBy: '',
Autrors: [],
Title: '',
Tags: '',
Subject: '',
Comment: ''
"Application": '',
"CreatedRaw": null,
"Created": '',
"LastModifiedRaw": null,
"LastModified": '',
"LastModifiedBy": '',
"Authors": [],
"Title": '',
"Tags": '',
"Subject": '',
"Comment": ''
};
const api = this.Presentation.Api;
let props = (api) ? api.asc_getAppProps() : null;
oDocInfo.Application = (props.asc_getApplication() || '') + (props.asc_getAppVersion() ? ' ' : '') + (props.asc_getAppVersion() || '');
oDocInfo["Application"] = (props.asc_getApplication() || '') + (props.asc_getAppVersion() ? ' ' : '') + (props.asc_getAppVersion() || '');
let langCode = 1033; // en-US
let langName = 'en-us';
if (api.asc_getLocale) {
@ -1605,36 +1605,36 @@
}
props = api.asc_getCoreProps();
oDocInfo.CreatedRaw = props.asc_getCreated();
oDocInfo.LastModifiedRaw = props.asc_getModified();
oDocInfo["CreatedRaw"] = props.asc_getCreated();
oDocInfo["LastModifiedRaw"] = props.asc_getModified();
try {
if (oDocInfo.CreatedRaw)
oDocInfo.Created = (oDocInfo.CreatedRaw.toLocaleString(langName, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' +oDocInfo. CreatedRaw.toLocaleString(langName, {timeStyle: 'short'}));
if (oDocInfo["CreatedRaw"])
oDocInfo["Created"] = (oDocInfo["CreatedRaw"].toLocaleString(langName, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + oDocInfo["CreatedRaw"].toLocaleString(langName, {timeStyle: 'short'}));
if (oDocInfo.LastModifiedRaw)
oDocInfo.LastModified = (oDocInfo.LastModifiedRaw.toLocaleString(langName, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + oDocInfo.LastModifiedRaw.toLocaleString(langName, {timeStyle: 'short'}));
if (oDocInfo["LastModifiedRaw"])
oDocInfo["LastModified"] = (oDocInfo["LastModifiedRaw"].toLocaleString(langName, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + oDocInfo["LastModifiedRaw"].toLocaleString(langName, {timeStyle: 'short'}));
} catch (e) {
langName = 'en';
if (oDocInfo.CreatedRaw)
oDocInfo.Created = (oDocInfo.CreatedRaw.toLocaleString(langName, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + oDocInfo.CreatedRaw.toLocaleString(langName, {timeStyle: 'short'}));
if (oDocInfo.LastModifiedRaw)
oDocInfo.LastModified = (oDocInfo.LastModifiedRaw.toLocaleString(langName, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + oDocInfo.LastModifiedRaw.toLocaleString(langName, {timeStyle: 'short'}));
if (oDocInfo["CreatedRaw"])
oDocInfo["Created"] = (oDocInfo["CreatedRaw"].toLocaleString(langName, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + oDocInfo["CreatedRaw"].toLocaleString(langName, {timeStyle: 'short'}));
if (oDocInfo["LastModifiedRaw"])
oDocInfo["LastModified"] = (oDocInfo["LastModifiedRaw"].toLocaleString(langName, {year: 'numeric', month: '2-digit', day: '2-digit'}) + ' ' + oDocInfo["LastModifiedRaw"].toLocaleString(langName, {timeStyle: 'short'}));
}
const LastModifiedBy = props.asc_getLastModifiedBy();
oDocInfo.LastModifiedBy = AscCommon.UserInfoParser.getParsedName(LastModifiedBy);
oDocInfo.Title = (props.asc_getTitle() || '');
oDocInfo.Tags = (props.asc_getKeywords() || '');
oDocInfo.Subject = (props.asc_getSubject() || '');
oDocInfo.Comment = (props.asc_getDescription() || '');
oDocInfo["LastModifiedBy"] = AscCommon.UserInfoParser.getParsedName(LastModifiedBy);
oDocInfo["Title"] = (props.asc_getTitle() || '');
oDocInfo["Tags"] = (props.asc_getKeywords() || '');
oDocInfo["Subject"] = (props.asc_getSubject() || '');
oDocInfo["Comment"] = (props.asc_getDescription() || '');
const authors = props.asc_getCreator();
if (authors)
oDocInfo.Autrors = authors.split(/\s*[,;]\s*/);
oDocInfo["Authors"] = authors.split(/\s*[,;]\s*/);
return oDocInfo;
};