Commit c52aba3e authored by Sergey.Konovalov's avatar Sergey.Konovalov

to Revision: 64905(напутал с кодами ошибок)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64915 954022d7-b5bf-4e40-9824-e11837661b57
parent ca6d0ca7
......@@ -605,7 +605,7 @@ function InitOnMessage (callback) {
break;
}
}
callback(c_oAscServerError.NoError, firstUrl);
callback(c_oAscError.ID.No, firstUrl);
}
} else
......@@ -623,9 +623,9 @@ function ShowImageFileDialog (documentId, documentUserId, callback, callbackOld)
fileName = GetUploadInput(function (e) {
if (e && e.target && e.target.files) {
var nError = ValidateUploadImage(e.target.files);
callback(nError, e.target.files);
callback(g_fMapAscServerErrorToAscError(nError), e.target.files);
} else {
callback(c_oAscServerError.Unknown);
callback(c_oAscError.ID.Unknown);
}
});
} else {
......@@ -642,11 +642,11 @@ function ShowImageFileDialog (documentId, documentUserId, callback, callbackOld)
if (e && e.target && e.target.files) {
var nError = ValidateUploadImage(e.target.files);
if (c_oAscServerError.NoError != nError) {
callbackOld(nError);
callbackOld(g_fMapAscServerErrorToAscError(nError));
return;
}
}
callbackOld(c_oAscServerError.NoError);
callbackOld(c_oAscError.ID.No);
fileSubmit.click();
};
}
......@@ -668,7 +668,7 @@ function InitDragAndDrop (oHtmlElement, callback) {
e.preventDefault();
var files = e.dataTransfer.files;
var nError = ValidateUploadImage(files);
callback(nError, files);
callback(g_fMapAscServerErrorToAscError(nError), files);
};
}
}
......@@ -688,7 +688,7 @@ function UploadImageFiles (files, documentId, documentUserId, callback) {
break;
}
}
callback(c_oAscServerError.NoError, firstUrl);
callback(c_oAscError.ID.No, firstUrl);
} else
callback(c_oAscError.ID.Unknown);
}
......
......@@ -175,7 +175,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
this.topLineEditorElement = document.getElementById(this.topLineEditorName);
// init OnMessage
InitOnMessage(function(error, url) {
if (c_oAscServerError.NoError !== error) {
if (c_oAscError.ID.No !== error) {
t.handlers.trigger("asc_onError", error, c_oAscError.Level.NoCritical);
} else {
t._addImageUrl(url);
......@@ -2620,7 +2620,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
ShowImageFileDialog(this.documentId, this.documentUserId, function(error, files) {
t._uploadCallback(error, files);
}, function(error) {
if (c_oAscServerError.NoError !== error) {
if (c_oAscError.ID.No !== error) {
t.handlers.trigger("asc_onError", error, c_oAscError.Level.NoCritical);
}
t.handlers.trigger("asc_onStartAction", c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
......@@ -2628,12 +2628,12 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
};
spreadsheet_api.prototype._uploadCallback = function(error, files) {
var t = this;
if (c_oAscServerError.NoError !== error) {
if (c_oAscError.ID.No !== error) {
t.handlers.trigger("asc_onError", error, c_oAscError.Level.NoCritical);
} else {
t.handlers.trigger("asc_onStartAction", c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
UploadImageFiles(files, t.documentId, t.documentUserId, function(error, url) {
if (c_oAscServerError.NoError !== error) {
if (c_oAscError.ID.No !== error) {
t.handlers.trigger("asc_onError", error, c_oAscError.Level.NoCritical);
} else {
t._addImageUrl(url);
......
......@@ -178,7 +178,7 @@ function asc_docs_api(name)
var oThis = this;
// init OnMessage
InitOnMessage(function (error, url) {
if (c_oAscServerError.NoError !== error)
if (c_oAscError.ID.No !== error)
oThis.sync_ErrorCallback(error, c_oAscError.Level.NoCritical);
else
oThis.AddImageUrl(url);
......@@ -3010,19 +3010,19 @@ asc_docs_api.prototype.AddImage = function(){
ShowImageFileDialog(documentId, documentUserId, function (error, files) {
t._uploadCallback(error, files);
}, function (error) {
if (c_oAscServerError.NoError !== 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) {
var t =this;
if (c_oAscServerError.NoError !== error) {
if (c_oAscError.ID.No !== error) {
t.sync_ErrorCallback(error, c_oAscError.Level.NoCritical);
} else {
t.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
UploadImageFiles(files, documentId, documentUserId, function (error, url) {
if (c_oAscServerError.NoError !== error)
if (c_oAscError.ID.No !== error)
t.sync_ErrorCallback(error, c_oAscError.Level.NoCritical);
else
t.AddImageUrl(url);
......
......@@ -528,7 +528,7 @@ function asc_docs_api(name)
var oThis = this;
// init OnMessage
InitOnMessage(function (error, url) {
if (c_oAscServerError.NoError !== error)
if (c_oAscError.ID.No !== error)
oThis.sync_ErrorCallback(error, c_oAscError.Level.NoCritical);
else
oThis.AddImageUrl(url);
......@@ -4710,19 +4710,19 @@ asc_docs_api.prototype.AddImage = function(){
ShowImageFileDialog(documentId, documentUserId, function(error, files){
t._uploadCallback(error, files);
}, function (error) {
if (c_oAscServerError.NoError !== 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){
var t = this;
if (c_oAscServerError.NoError !== error) {
if (c_oAscError.ID.No !== error) {
t.sync_ErrorCallback(error, c_oAscError.Level.NoCritical);
} else {
t.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
UploadImageFiles(files, documentId, documentUserId, function (error, url) {
if (c_oAscServerError.NoError !== error)
if (c_oAscError.ID.No !== error)
t.sync_ErrorCallback(error, c_oAscError.Level.NoCritical);
else
t.AddImageUrl(url);
......
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