Commit 1acf1e11 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Добавил общую функцию добавления изображения в baseEditorsApi

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@66421 954022d7-b5bf-4e40-9824-e11837661b57
parent c97b6d03
...@@ -165,6 +165,18 @@ baseEditorsApi.prototype.asc_getChartPreviews = function(chartType) { ...@@ -165,6 +165,18 @@ baseEditorsApi.prototype.asc_getChartPreviews = function(chartType) {
baseEditorsApi.prototype.asc_getTextArtPreviews = function() { baseEditorsApi.prototype.asc_getTextArtPreviews = function() {
return this.textArtPreviewManager.getWordArtStyles(); return this.textArtPreviewManager.getWordArtStyles();
}; };
// Add image
baseEditorsApi.prototype.asc_addImage = function() {
var t = this;
ShowImageFileDialog(this.documentId, this.documentUserId, function(error, files) {
t._uploadCallback(error, files);
}, function(error) {
if (c_oAscError.ID.No !== error) {
t.sendEvent("asc_onError", error, c_oAscError.Level.NoCritical);
}
t.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
});
};
// Version History // Version History
baseEditorsApi.prototype.asc_showRevision = function(newObj) { baseEditorsApi.prototype.asc_showRevision = function(newObj) {
}; };
......
...@@ -2333,15 +2333,8 @@ var editor; ...@@ -2333,15 +2333,8 @@ var editor;
}; };
spreadsheet_api.prototype.asc_showImageFileDialog = function() { spreadsheet_api.prototype.asc_showImageFileDialog = function() {
var t = this; // ToDo заменить на общую функцию для всех
ShowImageFileDialog(this.documentId, this.documentUserId, function(error, files) { this.asc_addImage();
t._uploadCallback(error, files);
}, function(error) {
if (c_oAscError.ID.No !== error) {
t.handlers.trigger("asc_onError", error, c_oAscError.Level.NoCritical);
}
t.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
});
}; };
spreadsheet_api.prototype._uploadCallback = function(error, files) { spreadsheet_api.prototype._uploadCallback = function(error, files) {
var t = this; var t = this;
......
...@@ -2851,14 +2851,7 @@ asc_docs_api.prototype.ChangeArtImageFromFile = function() ...@@ -2851,14 +2851,7 @@ asc_docs_api.prototype.ChangeArtImageFromFile = function()
}; };
asc_docs_api.prototype.AddImage = function(){ asc_docs_api.prototype.AddImage = function(){
var t = this; this.asc_addImage();
ShowImageFileDialog(this.documentId, this.documentUserId, function (error, files) {
t._uploadCallback(error, files);
}, function (error) {
if (c_oAscError.ID.No !== error)
t.asc_fireCallback("asc_onError", error, c_oAscError.Level.NoCritical);
t.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
});
}; };
asc_docs_api.prototype._uploadCallback = function(error, files) { asc_docs_api.prototype._uploadCallback = function(error, files) {
var t =this; var t =this;
......
...@@ -4349,14 +4349,7 @@ asc_docs_api.prototype.ChangeShapeImageFromFile = function() ...@@ -4349,14 +4349,7 @@ asc_docs_api.prototype.ChangeShapeImageFromFile = function()
}; };
asc_docs_api.prototype.AddImage = function(){ asc_docs_api.prototype.AddImage = function(){
var t = this; this.asc_addImage();
ShowImageFileDialog(this.documentId, this.documentUserId, function(error, files){
t._uploadCallback(error, files);
}, function (error) {
if (c_oAscError.ID.No !== error)
t.asc_fireCallback("asc_onError", error, c_oAscError.Level.NoCritical);
t.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
});
}; };
asc_docs_api.prototype._uploadCallback = function(error, files){ asc_docs_api.prototype._uploadCallback = function(error, files){
var t = this; var t = this;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment