Merge pull request #548 from ONLYOFFICE/fix/bugfix

Fix/bugfix
This commit is contained in:
Julia Radzhabova 2020-11-02 19:21:34 +03:00 committed by GitHub
commit 48337f68b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 35 additions and 19 deletions

View file

@ -1361,8 +1361,11 @@ define([
onEditComment: function(comment) { onEditComment: function(comment) {
var value = $('#comment-text')[0].value.trim(); var value = $('#comment-text')[0].value.trim();
if (value && value.length > 0) { if (value && value.length > 0) {
this.getCurrentUser();
if (!_.isUndefined(this.onChangeComment)) { if (!_.isUndefined(this.onChangeComment)) {
comment.comment = value; comment.comment = value;
comment.userid = this.currentUser.asc_getIdOriginal();
comment.username = this.currentUser.asc_getUserName();
this.onChangeComment(comment); this.onChangeComment(comment);
} }
if ($('.container-view-comment').length > 0) { if ($('.container-view-comment').length > 0) {
@ -1441,9 +1444,12 @@ define([
onEditReply: function(comment, indReply) { onEditReply: function(comment, indReply) {
var value = $('.edit-reply-textarea')[0].value.trim(); var value = $('.edit-reply-textarea')[0].value.trim();
if (value && value.length > 0) { if (value && value.length > 0) {
this.getCurrentUser();
if ($('.container-view-comment').length > 0) { if ($('.container-view-comment').length > 0) {
if (!_.isUndefined(this.onChangeComment)) { if (!_.isUndefined(this.onChangeComment)) {
comment.replys[indReply].reply = value; comment.replys[indReply].reply = value;
comment.replys[indReply].userid = this.currentUser.asc_getIdOriginal();
comment.replys[indReply].username = this.currentUser.asc_getUserName();
this.onChangeComment(comment); this.onChangeComment(comment);
} }
if (Common.SharedSettings.get('phone')) { if (Common.SharedSettings.get('phone')) {
@ -1460,6 +1466,8 @@ define([
} else { } else {
if (!_.isUndefined(this.onChangeComment)) { if (!_.isUndefined(this.onChangeComment)) {
comment.replys[indReply].reply = value; comment.replys[indReply].reply = value;
comment.replys[indReply].userid = this.currentUser.asc_getIdOriginal();
comment.replys[indReply].username = this.currentUser.asc_getUserName();
this.onChangeComment(comment); this.onChangeComment(comment);
} }
rootView.router.back(); rootView.router.back();
@ -1534,7 +1542,9 @@ define([
date = (data.asc_getReply(i).asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getReply(i).asc_getOnlyOfficeTime())) : date = (data.asc_getReply(i).asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getReply(i).asc_getOnlyOfficeTime())) :
((data.asc_getReply(i).asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getReply(i).asc_getTime()))); ((data.asc_getReply(i).asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getReply(i).asc_getTime())));
var user = _.findWhere(editUsers, {idOriginal: data.asc_getReply(i).asc_getUserId()}); var user = _.find(editUsers, function(item){
return (item.asc_getIdOriginal()==data.asc_getReply(i).asc_getUserId());
});
var username = data.asc_getReply(i).asc_getUserName(); var username = data.asc_getReply(i).asc_getUserName();
replies.push({ replies.push({
ind : i, ind : i,
@ -1555,8 +1565,10 @@ define([
readSDKComment: function(id, data) { readSDKComment: function(id, data) {
var date = (data.asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getOnlyOfficeTime())) : var date = (data.asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getOnlyOfficeTime())) :
((data.asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getTime()))); ((data.asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getTime())));
var user = _.findWhere(editUsers, {idOriginal: data.asc_getUserId()}), var user = _.find(editUsers, function(item){
groupname = id.substr(0, id.lastIndexOf('_')+1).match(/^(doc|sheet[0-9_]+)_/); return (item.asc_getIdOriginal()==data.asc_getUserId());
});
var groupname = id.substr(0, id.lastIndexOf('_')+1).match(/^(doc|sheet[0-9_]+)_/);
var username = data.asc_getUserName(); var username = data.asc_getUserName();
var comment = { var comment = {
uid : id, uid : id,
@ -1597,7 +1609,9 @@ define([
date = (data.asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getOnlyOfficeTime())) : date = (data.asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getOnlyOfficeTime())) :
((data.asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getTime()))); ((data.asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getTime())));
var user = _.findWhere(editUsers, {idOriginal: data.asc_getUserId()}); var user = _.find(editUsers, function(item){
return (item.asc_getIdOriginal()==data.asc_getUserId());
});
comment.comment = data.asc_getText(); comment.comment = data.asc_getText();
comment.userid = data.asc_getUserId(); comment.userid = data.asc_getUserId();
comment.username = data.asc_getUserName(); comment.username = data.asc_getUserName();
@ -1617,7 +1631,9 @@ define([
dateReply = (data.asc_getReply(i).asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getReply(i).asc_getOnlyOfficeTime())) : dateReply = (data.asc_getReply(i).asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getReply(i).asc_getOnlyOfficeTime())) :
((data.asc_getReply(i).asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getReply(i).asc_getTime()))); ((data.asc_getReply(i).asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getReply(i).asc_getTime())));
user = _.findWhere(editUsers, {idOriginal: data.asc_getReply(i).asc_getUserId()}); user = _.find(editUsers, function(item){
return (item.asc_getIdOriginal()==data.asc_getReply(i).asc_getUserId());
});
var username = data.asc_getReply(i).asc_getUserName(); var username = data.asc_getReply(i).asc_getUserName();
replies.push({ replies.push({
ind : i, ind : i,

View file

@ -1136,7 +1136,7 @@ define([
var appname = (this.api) ? this.api.asc_getAppProps() : null; var appname = (this.api) ? this.api.asc_getAppProps() : null;
if (appname) { if (appname) {
appname = (appname.asc_getApplication() || '') + ' ' + (appname.asc_getAppVersion() || ''); appname = (appname.asc_getApplication() || '') + (appname.asc_getAppVersion() ? ' ' : '') + (appname.asc_getAppVersion() || '');
this.lblApplication.text(appname); this.lblApplication.text(appname);
} }
this._ShowHideInfoItem(this.lblApplication, !!appname); this._ShowHideInfoItem(this.lblApplication, !!appname);

View file

@ -442,7 +442,7 @@ define([
var appProps = (this.api) ? this.api.asc_getAppProps() : null; var appProps = (this.api) ? this.api.asc_getAppProps() : null;
if (appProps) { if (appProps) {
var appName = (appProps.asc_getApplication() || '') + ' ' + (appProps.asc_getAppVersion() || ''); var appName = (appProps.asc_getApplication() || '') + (appProps.asc_getAppVersion() ? ' ' : '') + (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;

View file

@ -132,8 +132,8 @@ define([
_paragraphObject.get_SmallCaps() && $inputTextCaps.val(['small']).prop('prevValue', 'small'); _paragraphObject.get_SmallCaps() && $inputTextCaps.val(['small']).prop('prevValue', 'small');
_paragraphObject.get_AllCaps() && $inputTextCaps.val(['all']).prop('prevValue', 'all'); _paragraphObject.get_AllCaps() && $inputTextCaps.val(['all']).prop('prevValue', 'all');
_fontInfo.letterSpacing = Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_TextSpacing()); _fontInfo.letterSpacing = (_paragraphObject.get_TextSpacing()===null || _paragraphObject.get_TextSpacing()===undefined) ? _paragraphObject.get_TextSpacing() : Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_TextSpacing());
$('#letter-spacing .item-after label').text(_fontInfo.letterSpacing + ' ' + Common.Utils.Metric.getCurrentMetricName()); $('#letter-spacing .item-after label').text((_fontInfo.letterSpacing===null || _fontInfo.letterSpacing===undefined) ? '' : _fontInfo.letterSpacing + ' ' + Common.Utils.Metric.getCurrentMetricName());
} }
}, },
@ -327,9 +327,9 @@ define([
spacing = _fontInfo.letterSpacing; spacing = _fontInfo.letterSpacing;
if ($button.hasClass('decrement')) { if ($button.hasClass('decrement')) {
spacing = Math.max(-100, --spacing); spacing = (spacing===null || spacing===undefined) ? 0 : Math.max(-100, --spacing);
} else { } else {
spacing = Math.min(100, ++spacing); spacing = (spacing===null || spacing===undefined) ? 0 : Math.min(100, ++spacing);
} }
_fontInfo.letterSpacing = spacing; _fontInfo.letterSpacing = spacing;

View file

@ -1007,7 +1007,7 @@ define([
var appname = (this.api) ? this.api.asc_getAppProps() : null; var appname = (this.api) ? this.api.asc_getAppProps() : null;
if (appname) { if (appname) {
appname = (appname.asc_getApplication() || '') + ' ' + (appname.asc_getAppVersion() || ''); appname = (appname.asc_getApplication() || '') + (appname.asc_getAppVersion() ? ' ' : '') + (appname.asc_getAppVersion() || '');
this.lblApplication.text(appname); this.lblApplication.text(appname);
} }
this._ShowHideInfoItem(this.lblApplication, !!appname); this._ShowHideInfoItem(this.lblApplication, !!appname);

View file

@ -226,7 +226,7 @@ define([
var appProps = (this.api) ? this.api.asc_getAppProps() : null; var appProps = (this.api) ? this.api.asc_getAppProps() : null;
if (appProps) { if (appProps) {
var appName = (appProps.asc_getApplication() || '') + ' ' + (appProps.asc_getAppVersion() || ''); var appName = (appProps.asc_getApplication() || '') + (appProps.asc_getAppVersion() ? ' ' : '') + (appProps.asc_getAppVersion() || '');
appName ? $('#settings-pe-application').html(appName) : $('.display-application').remove(); appName ? $('#settings-pe-application').html(appName) : $('.display-application').remove();
} }

View file

@ -146,8 +146,8 @@ define([
_paragraphObject.get_SmallCaps() && $inputTextCaps.val(['small']).prop('prevValue', 'small'); _paragraphObject.get_SmallCaps() && $inputTextCaps.val(['small']).prop('prevValue', 'small');
_paragraphObject.get_AllCaps() && $inputTextCaps.val(['all']).prop('prevValue', 'all'); _paragraphObject.get_AllCaps() && $inputTextCaps.val(['all']).prop('prevValue', 'all');
_fontInfo.letterSpacing = Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_TextSpacing()); _fontInfo.letterSpacing = (_paragraphObject.get_TextSpacing()===null || _paragraphObject.get_TextSpacing()===undefined) ? _paragraphObject.get_TextSpacing() : Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_TextSpacing());
$('#letter-spacing .item-after label').text(_fontInfo.letterSpacing + ' ' + Common.Utils.Metric.getCurrentMetricName()); $('#letter-spacing .item-after label').text((_fontInfo.letterSpacing===null || _fontInfo.letterSpacing===undefined) ? '' : _fontInfo.letterSpacing + ' ' + Common.Utils.Metric.getCurrentMetricName());
} }
_paragraphInfo.spaceBefore = _paragraphObject.get_Spacing().get_Before() < 0 ? _paragraphObject.get_Spacing().get_Before() : Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_Spacing().get_Before()); _paragraphInfo.spaceBefore = _paragraphObject.get_Spacing().get_Before() < 0 ? _paragraphObject.get_Spacing().get_Before() : Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_Spacing().get_Before());
@ -304,9 +304,9 @@ define([
spacing = _fontInfo.letterSpacing; spacing = _fontInfo.letterSpacing;
if ($button.hasClass('decrement')) { if ($button.hasClass('decrement')) {
spacing = Math.max(-100, --spacing); spacing = (spacing===null || spacing===undefined) ? 0 : Math.max(-100, --spacing);
} else { } else {
spacing = Math.min(100, ++spacing); spacing = (spacing===null || spacing===undefined) ? 0 : Math.min(100, ++spacing);
} }
_fontInfo.letterSpacing = spacing; _fontInfo.letterSpacing = spacing;

View file

@ -1862,7 +1862,7 @@ define([
var appname = (this.api) ? this.api.asc_getAppProps() : null; var appname = (this.api) ? this.api.asc_getAppProps() : null;
if (appname) { if (appname) {
appname = (appname.asc_getApplication() || '') + ' ' + (appname.asc_getAppVersion() || ''); appname = (appname.asc_getApplication() || '') + (appname.asc_getAppVersion() ? ' ' : '') + (appname.asc_getAppVersion() || '');
this.lblApplication.text(appname); this.lblApplication.text(appname);
} }
this._ShowHideInfoItem(this.lblApplication, !!appname); this._ShowHideInfoItem(this.lblApplication, !!appname);

View file

@ -295,7 +295,7 @@ define([
var appProps = (this.api) ? this.api.asc_getAppProps() : null; var appProps = (this.api) ? this.api.asc_getAppProps() : null;
if (appProps) { if (appProps) {
var appName = (appProps.asc_getApplication() || '') + ' ' + (appProps.asc_getAppVersion() || ''); var appName = (appProps.asc_getApplication() || '') + (appProps.asc_getAppVersion() ? ' ' : '') + (appProps.asc_getAppVersion() || '');
appName ? $('#settings-sse-application').html(appName) : $('.display-application').remove(); appName ? $('#settings-sse-application').html(appName) : $('.display-application').remove();
} }