diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 5c19fbc84..ed2f9cfb3 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -1618,8 +1618,15 @@ define([ }, insertImageFromStorage: function(data) { - if (data && (data.url || data.images) && (!data.c || data.c=='add')) { + if (data && data._urls && (!data.c || data.c=='add')) { this.toolbar.fireEvent('insertimage', this.toolbar); + (data._urls.length>0) && this.api.AddImageUrl(data._urls, undefined, data.token);// for loading from storage + Common.component.Analytics.trackEvent('ToolBar', 'Image'); + } + }, + + insertImage: function(data) { // gateway + if (data && (data.url || data.images)) { var arr = []; if (data.images && data.images.length>0) { for (var i=0; i0) && this.api.AddImageUrl(arr, undefined, data.token);// for loading from storage - Common.component.Analytics.trackEvent('ToolBar', 'Image'); + data._urls = arr; } - }, - - insertImage: function(data) { // gateway Common.NotificationCenter.trigger('storage:image-insert', data); }, diff --git a/apps/documenteditor/main/app/view/FormSettings.js b/apps/documenteditor/main/app/view/FormSettings.js index f9b071d43..12959beca 100644 --- a/apps/documenteditor/main/app/view/FormSettings.js +++ b/apps/documenteditor/main/app/view/FormSettings.js @@ -711,8 +711,8 @@ define([ }, insertImageFromStorage: function(data) { - if (data && data.url && data.c=='control') { - this.setImageUrl(data.url, data.token); + if (data && data._urls && data.c=='control') { + this.setImageUrl(data._urls[0], data.token); } }, diff --git a/apps/documenteditor/main/app/view/ImageSettings.js b/apps/documenteditor/main/app/view/ImageSettings.js index 4b781e009..9cc3c39cf 100644 --- a/apps/documenteditor/main/app/view/ImageSettings.js +++ b/apps/documenteditor/main/app/view/ImageSettings.js @@ -495,8 +495,8 @@ define([ }, insertImageFromStorage: function(data) { - if (data && data.url && data.c=='change') { - this.setImageUrl(data.url, data.token); + if (data && data._urls && data.c=='change') { + this.setImageUrl(data._urls[0], data.token); } }, diff --git a/apps/documenteditor/main/app/view/ShapeSettings.js b/apps/documenteditor/main/app/view/ShapeSettings.js index 3cb452e10..6bd98fb15 100644 --- a/apps/documenteditor/main/app/view/ShapeSettings.js +++ b/apps/documenteditor/main/app/view/ShapeSettings.js @@ -719,8 +719,8 @@ define([ }, insertImageFromStorage: function(data) { - if (data && data.url && data.c=='fill') { - this.setImageUrl(data.url, data.token); + if (data && data._urls && data.c=='fill') { + this.setImageUrl(data._urls[0], data.token); } }, diff --git a/apps/documenteditor/main/app/view/WatermarkSettingsDialog.js b/apps/documenteditor/main/app/view/WatermarkSettingsDialog.js index 072deeb48..ee81ac628 100644 --- a/apps/documenteditor/main/app/view/WatermarkSettingsDialog.js +++ b/apps/documenteditor/main/app/view/WatermarkSettingsDialog.js @@ -411,8 +411,8 @@ define(['text!documenteditor/main/app/template/WatermarkSettings.template', this.api.asc_registerCallback('asc_onWatermarkImageLoaded', onApiWMLoaded); var insertImageFromStorage = function(data) { - if (data && data.url && data.c=='watermark') { - me.props.put_ImageUrl(data.url, data.token); + if (data && data._urls && data.c=='watermark') { + me.props.put_ImageUrl(data._urls[0], data.token); } }; Common.NotificationCenter.on('storage:image-insert', insertImageFromStorage); diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index eff6bf4c4..cfea951bc 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -1618,8 +1618,15 @@ define([ }, insertImageFromStorage: function(data) { - if (data && (data.url || data.images) && (!data.c || data.c=='add')) { + if (data && data._urls && (!data.c || data.c=='add')) { this.toolbar.fireEvent('insertimage', this.toolbar); + (data._urls.length>0) && this.api.AddImageUrl(data._urls, undefined, data.token);// for loading from storage + Common.component.Analytics.trackEvent('ToolBar', 'Image'); + } + }, + + insertImage: function(data) { // gateway + if (data && (data.url || data.images)) { var arr = []; if (data.images && data.images.length>0) { for (var i=0; i0) && this.api.AddImageUrl(arr, undefined, data.token);// for loading from storage - Common.component.Analytics.trackEvent('ToolBar', 'Image'); + data._urls = arr; } - }, - - insertImage: function(data) { // gateway Common.NotificationCenter.trigger('storage:image-insert', data); }, diff --git a/apps/presentationeditor/main/app/view/ImageSettings.js b/apps/presentationeditor/main/app/view/ImageSettings.js index 39de33f36..a001a63f6 100644 --- a/apps/presentationeditor/main/app/view/ImageSettings.js +++ b/apps/presentationeditor/main/app/view/ImageSettings.js @@ -331,8 +331,8 @@ define([ }, insertImageFromStorage: function(data) { - if (data && data.url && data.c=='change') { - this.setImageUrl(data.url, data.token); + if (data && data._urls && data.c=='change') { + this.setImageUrl(data._urls[0], data.token); } }, diff --git a/apps/presentationeditor/main/app/view/ShapeSettings.js b/apps/presentationeditor/main/app/view/ShapeSettings.js index cd82caf5c..97404aec3 100644 --- a/apps/presentationeditor/main/app/view/ShapeSettings.js +++ b/apps/presentationeditor/main/app/view/ShapeSettings.js @@ -659,8 +659,8 @@ define([ }, insertImageFromStorage: function(data) { - if (data && data.url && data.c=='fill') { - this.setImageUrl(data.url, data.token); + if (data && data._urls && data.c=='fill') { + this.setImageUrl(data._urls[0], data.token); } }, diff --git a/apps/presentationeditor/main/app/view/SlideSettings.js b/apps/presentationeditor/main/app/view/SlideSettings.js index 97bb099fd..dc80ccb8b 100644 --- a/apps/presentationeditor/main/app/view/SlideSettings.js +++ b/apps/presentationeditor/main/app/view/SlideSettings.js @@ -639,8 +639,8 @@ define([ }, insertImageFromStorage: function(data) { - if (data && data.url && data.c=='slide') { - this.setImageUrl(data.url, data.token); + if (data && data._urls && data.c=='slide') { + this.setImageUrl(data._urls[0], data.token); } }, diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index cf64478a0..993366fde 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -899,8 +899,15 @@ define([ }, insertImageFromStorage: function(data) { - if (data && (data.url || data.images) && (!data.c || data.c=='add')) { + if (data && data._urls && (!data.c || data.c=='add')) { this.toolbar.fireEvent('insertimage', this.toolbar); + (data._urls.length>0) && this.api.asc_addImageDrawingObject(data._urls, undefined, data.token);// for loading from storage + Common.component.Analytics.trackEvent('ToolBar', 'Image'); + } + }, + + insertImage: function(data) { // gateway + if (data && (data.url || data.images)) { var arr = []; if (data.images && data.images.length>0) { for (var i=0; i0) && this.api.asc_addImageDrawingObject(arr, undefined, data.token);// for loading from storage - Common.component.Analytics.trackEvent('ToolBar', 'Image'); + data._urls = arr; } - }, - - insertImage: function(data) { // gateway Common.NotificationCenter.trigger('storage:image-insert', data); }, diff --git a/apps/spreadsheeteditor/main/app/view/ImageSettings.js b/apps/spreadsheeteditor/main/app/view/ImageSettings.js index 3047f920b..1dc632327 100644 --- a/apps/spreadsheeteditor/main/app/view/ImageSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ImageSettings.js @@ -468,8 +468,8 @@ define([ }, insertImageFromStorage: function(data) { - if (data && data.url && data.c=='change') { - this.setImageUrl(data.url, data.token); + if (data && data._urls && data.c=='change') { + this.setImageUrl(data._urls[0], data.token); } }, diff --git a/apps/spreadsheeteditor/main/app/view/ShapeSettings.js b/apps/spreadsheeteditor/main/app/view/ShapeSettings.js index affc07f69..fb9c26e30 100644 --- a/apps/spreadsheeteditor/main/app/view/ShapeSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ShapeSettings.js @@ -679,8 +679,8 @@ define([ }, insertImageFromStorage: function(data) { - if (data && data.url && data.c=='fill') { - this.setImageUrl(data.url, data.token); + if (data && data._urls && data.c=='fill') { + this.setImageUrl(data._urls[0], data.token); } },