Bug 40231

This commit is contained in:
Julia Radzhabova 2019-07-30 12:05:48 +03:00
parent b6ea86057b
commit e669ae922d
9 changed files with 66 additions and 31 deletions

View file

@ -921,6 +921,11 @@ define([
}, },
updateInfo: function(doc) { updateInfo: function(doc) {
if (!this.doc && doc && doc.info) {
doc.info.author && console.log("Obsolete: The 'author' parameter of the document 'info' section is deprecated. Please use 'owner' instead.");
doc.info.created && console.log("Obsolete: The 'created' parameter of the document 'info' section is deprecated. Please use 'uploaded' instead.");
}
this.doc = doc; this.doc = doc;
if (!this.rendered) if (!this.rendered)
return; return;
@ -932,12 +937,14 @@ define([
if (doc.info.folder ) if (doc.info.folder )
this.lblPlacement.text( doc.info.folder ); this.lblPlacement.text( doc.info.folder );
visible = this._ShowHideInfoItem(this.lblPlacement, doc.info.folder!==undefined && doc.info.folder!==null) || visible; visible = this._ShowHideInfoItem(this.lblPlacement, doc.info.folder!==undefined && doc.info.folder!==null) || visible;
if (doc.info.author) var value = doc.info.owner || doc.info.author;
this.lblOwner.text(doc.info.author); if (value)
visible = this._ShowHideInfoItem(this.lblOwner, doc.info.author!==undefined && doc.info.author!==null) || visible; this.lblOwner.text(value);
if (doc.info.uploaded) visible = this._ShowHideInfoItem(this.lblOwner, !!value) || visible;
this.lblUploaded.text(doc.info.uploaded.toLocaleString()); value = doc.info.uploaded || doc.info.created;
visible = this._ShowHideInfoItem(this.lblUploaded, doc.info.uploaded!==undefined && doc.info.uploaded!==null) || visible; if (value)
this.lblUploaded.text(value);
visible = this._ShowHideInfoItem(this.lblUploaded, !!value) || visible;
} else } else
this._ShowHideDocInfo(false); this._ShowHideDocInfo(false);
$('tr.divider.general', this.el)[visible?'show':'hide'](); $('tr.divider.general', this.el)[visible?'show':'hide']();

View file

@ -264,6 +264,10 @@ define([
if (data.doc) { if (data.doc) {
DE.getController('Toolbar').setDocumentTitle(data.doc.title); DE.getController('Toolbar').setDocumentTitle(data.doc.title);
if (data.doc.info) {
data.doc.info.author && console.log("Obsolete: The 'author' parameter of the document 'info' section is deprecated. Please use 'owner' instead.");
data.doc.info.created && console.log("Obsolete: The 'created' parameter of the document 'info' section is deprecated. Please use 'uploaded' instead.");
}
} }
}, },

View file

@ -416,8 +416,10 @@ define([
info = document.info || {}; info = document.info || {};
document.title ? $('#settings-document-title').html(document.title) : $('.display-document-title').remove(); document.title ? $('#settings-document-title').html(document.title) : $('.display-document-title').remove();
info.author ? $('#settings-document-owner').html(info.author) : $('.display-owner').remove(); var value = info.owner || info.author;
info.uploaded ? $('#settings-doc-uploaded').html(info.uploaded.toLocaleString()) : $('.display-uploaded').remove(); value ? $('#settings-document-owner').html(value) : $('.display-owner').remove();
value = info.uploaded || info.created;
value ? $('#settings-doc-uploaded').html(value) : $('.display-uploaded').remove();
info.folder ? $('#settings-doc-location').html(info.folder) : $('.display-location').remove(); info.folder ? $('#settings-doc-location').html(info.folder) : $('.display-location').remove();
var appProps = (this.api) ? this.api.asc_getAppProps() : null; var appProps = (this.api) ? this.api.asc_getAppProps() : null;
@ -425,8 +427,7 @@ define([
var appName = (appProps.asc_getApplication() || '') + ' ' + (appProps.asc_getAppVersion() || ''); var appName = (appProps.asc_getApplication() || '') + ' ' + (appProps.asc_getAppVersion() || '');
appName ? $('#settings-doc-application').html(appName) : $('.display-application').remove(); appName ? $('#settings-doc-application').html(appName) : $('.display-application').remove();
} }
var props = (this.api) ? this.api.asc_getCoreProps() : null, var props = (this.api) ? this.api.asc_getCoreProps() : null;
value;
if (props) { if (props) {
value = props.asc_getTitle(); value = props.asc_getTitle();
value ? $('#settings-doc-title').html(value) : $('.display-title').remove(); value ? $('#settings-doc-title').html(value) : $('.display-title').remove();

View file

@ -794,6 +794,11 @@ define([
}, },
updateInfo: function(doc) { updateInfo: function(doc) {
if (!this.doc && doc && doc.info) {
doc.info.author && console.log("Obsolete: The 'author' parameter of the document 'info' section is deprecated. Please use 'owner' instead.");
doc.info.created && console.log("Obsolete: The 'created' parameter of the document 'info' section is deprecated. Please use 'uploaded' instead.");
}
this.doc = doc; this.doc = doc;
if (!this.rendered) if (!this.rendered)
return; return;
@ -805,12 +810,14 @@ define([
if (doc.info.folder ) if (doc.info.folder )
this.lblPlacement.text( doc.info.folder ); this.lblPlacement.text( doc.info.folder );
visible = this._ShowHideInfoItem(this.lblPlacement, doc.info.folder!==undefined && doc.info.folder!==null) || visible; visible = this._ShowHideInfoItem(this.lblPlacement, doc.info.folder!==undefined && doc.info.folder!==null) || visible;
if (doc.info.author) var value = doc.info.owner || doc.info.author;
this.lblOwner.text(doc.info.author); if (value)
visible = this._ShowHideInfoItem(this.lblOwner, doc.info.author!==undefined && doc.info.author!==null) || visible; this.lblOwner.text(value);
if (doc.info.uploaded) visible = this._ShowHideInfoItem(this.lblOwner, !!value) || visible;
this.lblUploaded.text(doc.info.uploaded.toLocaleString()); value = doc.info.uploaded || doc.info.created;
visible = this._ShowHideInfoItem(this.lblUploaded, doc.info.uploaded!==undefined && doc.info.uploaded!==null) || visible; if (value)
this.lblUploaded.text(value);
visible = this._ShowHideInfoItem(this.lblUploaded, !!value) || visible;
} else } else
this._ShowHideDocInfo(false); this._ShowHideDocInfo(false);
$('tr.divider.general', this.el)[visible?'show':'hide'](); $('tr.divider.general', this.el)[visible?'show':'hide']();

View file

@ -259,6 +259,10 @@ define([
if (data.doc) { if (data.doc) {
PE.getController('Toolbar').setDocumentTitle(data.doc.title); PE.getController('Toolbar').setDocumentTitle(data.doc.title);
if (data.doc.info) {
data.doc.info.author && console.log("Obsolete: The 'author' parameter of the document 'info' section is deprecated. Please use 'owner' instead.");
data.doc.info.created && console.log("Obsolete: The 'created' parameter of the document 'info' section is deprecated. Please use 'uploaded' instead.");
}
} }
}, },

View file

@ -200,8 +200,10 @@ define([
info = document.info || {}; info = document.info || {};
document.title ? $('#settings-presentation-title').html(document.title) : $('.display-presentation-title').remove(); document.title ? $('#settings-presentation-title').html(document.title) : $('.display-presentation-title').remove();
info.author ? $('#settings-pe-owner').html(info.author) : $('.display-owner').remove(); var value = info.owner || info.author;
info.uploaded ? $('#settings-pe-uploaded').html(info.uploaded.toLocaleString()) : $('.display-uploaded').remove(); value ? $('#settings-pe-owner').html(value) : $('.display-owner').remove();
value = info.uploaded || info.created;
value ? $('#settings-pe-uploaded').html(value) : $('.display-uploaded').remove();
info.folder ? $('#settings-pe-location').html(info.folder) : $('.display-location').remove(); info.folder ? $('#settings-pe-location').html(info.folder) : $('.display-location').remove();
var appProps = (this.api) ? this.api.asc_getAppProps() : null; var appProps = (this.api) ? this.api.asc_getAppProps() : null;
@ -210,8 +212,7 @@ define([
appName ? $('#settings-pe-application').html(appName) : $('.display-application').remove(); appName ? $('#settings-pe-application').html(appName) : $('.display-application').remove();
} }
var props = (this.api) ? this.api.asc_getCoreProps() : null, var props = (this.api) ? this.api.asc_getCoreProps() : null;
value;
if (props) { if (props) {
value = props.asc_getTitle(); value = props.asc_getTitle();
value ? $('#settings-pe-title').html(value) : $('.display-title').remove(); value ? $('#settings-pe-title').html(value) : $('.display-title').remove();

View file

@ -1243,6 +1243,11 @@ define([
}, },
updateInfo: function(doc) { updateInfo: function(doc) {
if (!this.doc && doc && doc.info) {
doc.info.author && console.log("Obsolete: The 'author' parameter of the document 'info' section is deprecated. Please use 'owner' instead.");
doc.info.created && console.log("Obsolete: The 'created' parameter of the document 'info' section is deprecated. Please use 'uploaded' instead.");
}
this.doc = doc; this.doc = doc;
if (!this.rendered) if (!this.rendered)
return; return;
@ -1254,12 +1259,14 @@ define([
if (doc.info.folder ) if (doc.info.folder )
this.lblPlacement.text( doc.info.folder ); this.lblPlacement.text( doc.info.folder );
visible = this._ShowHideInfoItem(this.lblPlacement, doc.info.folder!==undefined && doc.info.folder!==null) || visible; visible = this._ShowHideInfoItem(this.lblPlacement, doc.info.folder!==undefined && doc.info.folder!==null) || visible;
if (doc.info.author) var value = doc.info.owner || doc.info.author;
this.lblOwner.text(doc.info.author); if (value)
visible = this._ShowHideInfoItem(this.lblOwner, doc.info.author!==undefined && doc.info.author!==null) || visible; this.lblOwner.text(value);
if (doc.info.uploaded) visible = this._ShowHideInfoItem(this.lblOwner, !!value) || visible;
this.lblUploaded.text(doc.info.uploaded.toLocaleString()); value = doc.info.uploaded || doc.info.created;
visible = this._ShowHideInfoItem(this.lblUploaded, doc.info.uploaded!==undefined && doc.info.uploaded!==null) || visible; if (value)
this.lblUploaded.text(value);
visible = this._ShowHideInfoItem(this.lblUploaded, !!value) || visible;
} else } else
this._ShowHideDocInfo(false); this._ShowHideDocInfo(false);
$('tr.divider.general', this.el)[visible?'show':'hide'](); $('tr.divider.general', this.el)[visible?'show':'hide']();

View file

@ -265,9 +265,12 @@ define([
Common.SharedSettings.set('document', data.doc); Common.SharedSettings.set('document', data.doc);
if (data.doc) { if (data.doc) {
SSE.getController('Toolbar').setDocumentTitle(data.doc.title); SSE.getController('Toolbar').setDocumentTitle(data.doc.title);
if (data.doc.info) {
data.doc.info.author && console.log("Obsolete: The 'author' parameter of the document 'info' section is deprecated. Please use 'owner' instead.");
data.doc.info.created && console.log("Obsolete: The 'created' parameter of the document 'info' section is deprecated. Please use 'uploaded' instead.");
}
} }
}, },

View file

@ -259,8 +259,10 @@ define([
info = document.info || {}; info = document.info || {};
document.title ? $('#settings-spreadsheet-title').html(document.title) : $('.display-spreadsheet-title').remove(); document.title ? $('#settings-spreadsheet-title').html(document.title) : $('.display-spreadsheet-title').remove();
info.author ? $('#settings-sse-owner').html(info.author) : $('.display-owner').remove(); var value = info.owner || info.author;
info.uploaded ? $('#settings-sse-uploaded').html(info.uploaded.toLocaleString()) : $('.display-uploaded').remove(); value ? $('#settings-sse-owner').html(value) : $('.display-owner').remove();
value = info.uploaded || info.created;
value ? $('#settings-sse-uploaded').html(value) : $('.display-uploaded').remove();
info.folder ? $('#settings-sse-location').html(info.folder) : $('.display-location').remove(); info.folder ? $('#settings-sse-location').html(info.folder) : $('.display-location').remove();
var appProps = (this.api) ? this.api.asc_getAppProps() : null; var appProps = (this.api) ? this.api.asc_getAppProps() : null;
@ -269,8 +271,7 @@ define([
appName ? $('#settings-sse-application').html(appName) : $('.display-application').remove(); appName ? $('#settings-sse-application').html(appName) : $('.display-application').remove();
} }
var props = (this.api) ? this.api.asc_getCoreProps() : null, var props = (this.api) ? this.api.asc_getCoreProps() : null;
value;
if (props) { if (props) {
value = props.asc_getTitle(); value = props.asc_getTitle();
value ? $('#settings-sse-title').html(value) : $('.display-title').remove(); value ? $('#settings-sse-title').html(value) : $('.display-title').remove();