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) {
baseEditorsApi.prototype.asc_getTextArtPreviews = function() {
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
baseEditorsApi.prototype.asc_showRevision = function(newObj) {
};
......
......@@ -2333,15 +2333,8 @@ var editor;
};
spreadsheet_api.prototype.asc_showImageFileDialog = 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.handlers.trigger("asc_onError", error, c_oAscError.Level.NoCritical);
}
t.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
});
// ToDo заменить на общую функцию для всех
this.asc_addImage();
};
spreadsheet_api.prototype._uploadCallback = function(error, files) {
var t = this;
......
......@@ -2851,14 +2851,7 @@ asc_docs_api.prototype.ChangeArtImageFromFile = function()
};
asc_docs_api.prototype.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.asc_fireCallback("asc_onError", error, c_oAscError.Level.NoCritical);
t.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
});
this.asc_addImage();
};
asc_docs_api.prototype._uploadCallback = function(error, files) {
var t =this;
......
......@@ -4349,14 +4349,7 @@ asc_docs_api.prototype.ChangeShapeImageFromFile = function()
};
asc_docs_api.prototype.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.asc_fireCallback("asc_onError", error, c_oAscError.Level.NoCritical);
t.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
});
this.asc_addImage();
};
asc_docs_api.prototype._uploadCallback = function(error, files){
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