diff --git a/apps/documenteditor/main/app/template/ImageSettings.template b/apps/documenteditor/main/app/template/ImageSettings.template
index 8967e67d3..7248a6ab9 100644
--- a/apps/documenteditor/main/app/template/ImageSettings.template
+++ b/apps/documenteditor/main/app/template/ImageSettings.template
@@ -39,17 +39,22 @@
diff --git a/apps/documenteditor/main/app/view/ImageSettings.js b/apps/documenteditor/main/app/view/ImageSettings.js
index f7733ef72..30b232785 100644
--- a/apps/documenteditor/main/app/view/ImageSettings.js
+++ b/apps/documenteditor/main/app/view/ImageSettings.js
@@ -73,7 +73,8 @@ define([
Width: 0,
Height: 0,
FromGroup: false,
- DisabledControls: false
+ DisabledControls: false,
+ isOleObject: false
};
this.lockedControls = [];
this._locked = false;
@@ -133,12 +134,21 @@ define([
});
this.lockedControls.push(this.btnInsertFromUrl);
+ this.btnEditObject = new Common.UI.Button({
+ el: $('#image-button-edit-object')
+ });
+ this.lockedControls.push(this.btnEditObject);
+
this.btnOriginalSize.on('click', _.bind(this.setOriginalSize, this));
this.btnInsertFromFile.on('click', _.bind(function(btn){
if (this.api) this.api.ChangeImageFromFile();
this.fireEvent('editcomplete', this);
}, this));
this.btnInsertFromUrl.on('click', _.bind(this.insertFromUrl, this));
+ this.btnEditObject.on('click', _.bind(function(btn){
+ if (this.api) this.api.asc_pluginRun(this._originalProps.asc_getPluginGuid(), 0, this._originalProps.asc_getPluginData());
+ this.fireEvent('editcomplete', this);
+ }, this));
$(this.el).on('click', '#image-advanced-link', _.bind(this.openAdvancedSettings, this));
},
@@ -149,6 +159,7 @@ define([
}));
this.linkAdvanced = $('#image-advanced-link');
+ this.lblReplace = $('#image-lbl-replace');
},
setApi: function(api) {
@@ -215,6 +226,24 @@ define([
}
this.btnOriginalSize.setDisabled(props.get_ImageUrl()===null || props.get_ImageUrl()===undefined || this._locked);
+
+ var pluginGuid = props.asc_getPluginGuid();
+ value = (pluginGuid !== null && pluginGuid !== undefined);
+ if (this._state.isOleObject!==value) {
+ this.btnInsertFromUrl.setVisible(!value);
+ this.btnInsertFromFile.setVisible(!value);
+ this.btnEditObject.setVisible(value);
+ this.lblReplace.text(value ? this.textEditObject : this.textInsert);
+ this._state.isOleObject=value;
+ }
+
+ if (this._state.isOleObject) {
+ var plugin = DE.getCollection('Common.Collections.Plugins').findWhere({guid: pluginGuid});
+ this.btnEditObject.setDisabled(plugin===null || plugin ===undefined);
+ } else {
+ this.btnInsertFromUrl.setDisabled(pluginGuid===null);
+ this.btnInsertFromFile.setDisabled(pluginGuid===null);
+ }
}
},
@@ -372,7 +401,7 @@ define([
textWidth: 'Width',
textHeight: 'Height',
textOriginalSize: 'Default Size',
- textInsert: 'Insert Image',
+ textInsert: 'Replace Image',
textFromUrl: 'From URL',
textFromFile: 'From File',
textAdvanced: 'Show advanced settings',
@@ -382,7 +411,9 @@ define([
txtThrough: 'Through',
txtTopAndBottom: 'Top and bottom',
txtBehind: 'Behind',
- txtInFront: 'In front'
+ txtInFront: 'In front',
+ textEditObject: 'Edit Object',
+ textEdit: 'Edit'
}, DE.Views.ImageSettings || {}));
});
\ No newline at end of file
diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json
index a2b8002dc..1fdd9cf28 100644
--- a/apps/documenteditor/main/locale/en.json
+++ b/apps/documenteditor/main/locale/en.json
@@ -946,6 +946,8 @@
"DE.Views.HyperlinkSettingsDialog.txtEmpty": "This field is required",
"DE.Views.HyperlinkSettingsDialog.txtNotUrl": "This field should be a URL in the \"http://www.example.com\" format",
"DE.Views.ImageSettings.textAdvanced": "Show advanced settings",
+ "DE.Views.ImageSettings.textEdit": "Edit",
+ "DE.Views.ImageSettings.textEditObject": "Edit Object",
"DE.Views.ImageSettings.textFromFile": "From File",
"DE.Views.ImageSettings.textFromUrl": "From URL",
"DE.Views.ImageSettings.textHeight": "Height",
diff --git a/apps/spreadsheeteditor/main/app/template/ImageSettings.template b/apps/spreadsheeteditor/main/app/template/ImageSettings.template
index 13600d94d..a7961eec2 100644
--- a/apps/spreadsheeteditor/main/app/template/ImageSettings.template
+++ b/apps/spreadsheeteditor/main/app/template/ImageSettings.template
@@ -31,7 +31,7 @@
|