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) {
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;
if (!this.rendered)
return;
@ -932,12 +937,14 @@ define([
if (doc.info.folder )
this.lblPlacement.text( doc.info.folder );
visible = this._ShowHideInfoItem(this.lblPlacement, doc.info.folder!==undefined && doc.info.folder!==null) || visible;
if (doc.info.author)
this.lblOwner.text(doc.info.author);
visible = this._ShowHideInfoItem(this.lblOwner, doc.info.author!==undefined && doc.info.author!==null) || visible;
if (doc.info.uploaded)
this.lblUploaded.text(doc.info.uploaded.toLocaleString());
visible = this._ShowHideInfoItem(this.lblUploaded, doc.info.uploaded!==undefined && doc.info.uploaded!==null) || visible;
var value = doc.info.owner || doc.info.author;
if (value)
this.lblOwner.text(value);
visible = this._ShowHideInfoItem(this.lblOwner, !!value) || visible;
value = doc.info.uploaded || doc.info.created;
if (value)
this.lblUploaded.text(value);
visible = this._ShowHideInfoItem(this.lblUploaded, !!value) || visible;
} else
this._ShowHideDocInfo(false);
$('tr.divider.general', this.el)[visible?'show':'hide']();

View file

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

View file

@ -794,6 +794,11 @@ define([
},
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;
if (!this.rendered)
return;
@ -805,12 +810,14 @@ define([
if (doc.info.folder )
this.lblPlacement.text( doc.info.folder );
visible = this._ShowHideInfoItem(this.lblPlacement, doc.info.folder!==undefined && doc.info.folder!==null) || visible;
if (doc.info.author)
this.lblOwner.text(doc.info.author);
visible = this._ShowHideInfoItem(this.lblOwner, doc.info.author!==undefined && doc.info.author!==null) || visible;
if (doc.info.uploaded)
this.lblUploaded.text(doc.info.uploaded.toLocaleString());
visible = this._ShowHideInfoItem(this.lblUploaded, doc.info.uploaded!==undefined && doc.info.uploaded!==null) || visible;
var value = doc.info.owner || doc.info.author;
if (value)
this.lblOwner.text(value);
visible = this._ShowHideInfoItem(this.lblOwner, !!value) || visible;
value = doc.info.uploaded || doc.info.created;
if (value)
this.lblUploaded.text(value);
visible = this._ShowHideInfoItem(this.lblUploaded, !!value) || visible;
} else
this._ShowHideDocInfo(false);
$('tr.divider.general', this.el)[visible?'show':'hide']();

View file

@ -259,6 +259,10 @@ define([
if (data.doc) {
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 || {};
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();
var value = info.owner || info.author;
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();
var appProps = (this.api) ? this.api.asc_getAppProps() : null;
@ -210,8 +212,7 @@ define([
appName ? $('#settings-pe-application').html(appName) : $('.display-application').remove();
}
var props = (this.api) ? this.api.asc_getCoreProps() : null,
value;
var props = (this.api) ? this.api.asc_getCoreProps() : null;
if (props) {
value = props.asc_getTitle();
value ? $('#settings-pe-title').html(value) : $('.display-title').remove();

View file

@ -1243,6 +1243,11 @@ define([
},
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;
if (!this.rendered)
return;
@ -1254,12 +1259,14 @@ define([
if (doc.info.folder )
this.lblPlacement.text( doc.info.folder );
visible = this._ShowHideInfoItem(this.lblPlacement, doc.info.folder!==undefined && doc.info.folder!==null) || visible;
if (doc.info.author)
this.lblOwner.text(doc.info.author);
visible = this._ShowHideInfoItem(this.lblOwner, doc.info.author!==undefined && doc.info.author!==null) || visible;
if (doc.info.uploaded)
this.lblUploaded.text(doc.info.uploaded.toLocaleString());
visible = this._ShowHideInfoItem(this.lblUploaded, doc.info.uploaded!==undefined && doc.info.uploaded!==null) || visible;
var value = doc.info.owner || doc.info.author;
if (value)
this.lblOwner.text(value);
visible = this._ShowHideInfoItem(this.lblOwner, !!value) || visible;
value = doc.info.uploaded || doc.info.created;
if (value)
this.lblUploaded.text(value);
visible = this._ShowHideInfoItem(this.lblUploaded, !!value) || visible;
} else
this._ShowHideDocInfo(false);
$('tr.divider.general', this.el)[visible?'show':'hide']();

View file

@ -265,9 +265,12 @@ define([
Common.SharedSettings.set('document', data.doc);
if (data.doc) {
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 || {};
document.title ? $('#settings-spreadsheet-title').html(document.title) : $('.display-spreadsheet-title').remove();
info.author ? $('#settings-sse-owner').html(info.author) : $('.display-owner').remove();
info.uploaded ? $('#settings-sse-uploaded').html(info.uploaded.toLocaleString()) : $('.display-uploaded').remove();
var value = info.owner || info.author;
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();
var appProps = (this.api) ? this.api.asc_getAppProps() : null;
@ -269,8 +271,7 @@ define([
appName ? $('#settings-sse-application').html(appName) : $('.display-application').remove();
}
var props = (this.api) ? this.api.asc_getCoreProps() : null,
value;
var props = (this.api) ? this.api.asc_getCoreProps() : null;
if (props) {
value = props.asc_getTitle();
value ? $('#settings-sse-title').html(value) : $('.display-title').remove();