Merge pull request #1128 from ONLYOFFICE/feature/Bug-50683

Fix Bug 50683
This commit is contained in:
Julia Radzhabova 2021-08-26 18:11:41 +03:00 committed by GitHub
commit 23fb2b0bbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 34 additions and 13 deletions

View file

@ -1584,7 +1584,7 @@ define([
var checkUrl = value.replace(/ /g, '');
if (!_.isEmpty(checkUrl)) {
me.toolbar.fireEvent('insertimage', me.toolbar);
me.api.AddImageUrl(checkUrl);
me.api.AddImageUrl([checkUrl]);
Common.component.Analytics.trackEvent('ToolBar', 'Image');
} else {
@ -1618,9 +1618,16 @@ define([
},
insertImageFromStorage: function(data) {
if (data && data.url && (!data.c || data.c=='add')) {
if (data && (data.url || data.images) && (!data.c || data.c=='add')) {
this.toolbar.fireEvent('insertimage', this.toolbar);
this.api.AddImageUrl(data.url, undefined, data.token);// for loading from storage
var arr = [];
if (data.images && data.images.length>0) {
for (var i=0; i<data.images.length; i++) {
data.images[i] && data.images[i].url && arr.push( data.images[i].url);
}
} else
data.url && arr.push(data.url);
(arr.length>0) && this.api.AddImageUrl(arr, undefined, data.token);// for loading from storage
Common.component.Analytics.trackEvent('ToolBar', 'Image');
}
},

View file

@ -36,7 +36,7 @@ class AddImageController extends Component {
if ((/((^https?)|(^ftp)):\/\/.+/i.test(_value))) {
this.closeModal();
const api = Common.EditorApi.get();
api.AddImageUrl(_value);
api.AddImageUrl([_value]);
} else {
f7.dialog.alert(_t.txtNotUrl, _t.notcriticalErrorTitle);
}

View file

@ -1584,7 +1584,7 @@ define([
var checkUrl = value.replace(/ /g, '');
if (!_.isEmpty(checkUrl)) {
me.toolbar.fireEvent('insertimage', me.toolbar);
me.api.AddImageUrl(checkUrl);
me.api.AddImageUrl([checkUrl]);
Common.component.Analytics.trackEvent('ToolBar', 'Image');
} else {
@ -1618,9 +1618,16 @@ define([
},
insertImageFromStorage: function(data) {
if (data && data.url && (!data.c || data.c=='add')) {
if (data && (data.url || data.images) && (!data.c || data.c=='add')) {
this.toolbar.fireEvent('insertimage', this.toolbar);
this.api.AddImageUrl(data.url, undefined, data.token);// for loading from storage
var arr = [];
if (data.images && data.images.length>0) {
for (var i=0; i<data.images.length; i++) {
data.images[i] && data.images[i].url && arr.push( data.images[i].url);
}
} else
data.url && arr.push(data.url);
(arr.length>0) && this.api.AddImageUrl(arr, undefined, data.token);// for loading from storage
Common.component.Analytics.trackEvent('ToolBar', 'Image');
}
},

View file

@ -3633,7 +3633,7 @@ define([
var checkUrl = value.replace(/ /g, '');
if (!_.isEmpty(checkUrl)) {
if (placeholder)
me.api.AddImageUrl(checkUrl, undefined, undefined, obj);
me.api.AddImageUrl([checkUrl], undefined, undefined, obj);
else {
var props = new Asc.asc_CImgProperty();
props.put_ImageUrl(checkUrl);

View file

@ -36,7 +36,7 @@ class AddImageController extends Component {
if ((/((^https?)|(^ftp)):\/\/.+/i.test(_value))) {
this.closeModal();
const api = Common.EditorApi.get();
api.AddImageUrl(_value);
api.AddImageUrl([_value]);
} else {
f7.dialog.alert(_t.txtNotUrl, _t.notcriticalErrorTitle);
}

View file

@ -865,7 +865,7 @@ define([
var checkUrl = value.replace(/\s/g, '');
if (!_.isEmpty(checkUrl)) {
me.toolbar.fireEvent('insertimage', me.toolbar);
me.api.asc_addImageDrawingObject(checkUrl);
me.api.asc_addImageDrawingObject([checkUrl]);
Common.component.Analytics.trackEvent('ToolBar', 'Image');
} else {
@ -899,9 +899,16 @@ define([
},
insertImageFromStorage: function(data) {
if (data && data.url && (!data.c || data.c=='add')) {
if (data && (data.url || data.images) && (!data.c || data.c=='add')) {
this.toolbar.fireEvent('insertimage', this.toolbar);
this.api.asc_addImageDrawingObject(data.url, undefined, data.token);// for loading from storage
var arr = [];
if (data.images && data.images.length>0) {
for (var i=0; i<data.images.length; i++) {
data.images[i] && data.images[i].url && arr.push( data.images[i].url);
}
} else
data.url && arr.push(data.url);
(arr.length>0) && this.api.asc_addImageDrawingObject(arr, undefined, data.token);// for loading from storage
Common.component.Analytics.trackEvent('ToolBar', 'Image');
}
},

View file

@ -36,7 +36,7 @@ class AddImageController extends Component {
if ((/((^https?)|(^ftp)):\/\/.+/i.test(_value))) {
this.closeModal();
const api = Common.EditorApi.get();
api.asc_addImageDrawingObject(_value);
api.asc_addImageDrawingObject([_value]);
} else {
f7.dialog.alert(_t.txtNotUrl, _t.notcriticalErrorTitle);
}