Fix Bug 50683
This commit is contained in:
parent
ca4f5cb820
commit
f336d0ef0a
|
@ -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');
|
||||
}
|
||||
},
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
},
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
},
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue