Commit 5befcf39 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Добавил обработку Warning

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64834 954022d7-b5bf-4e40-9824-e11837661b57
parent 84743a5d
...@@ -1664,6 +1664,9 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -1664,6 +1664,9 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
t.handlers.trigger("asc_onError", isCloseCoAuthoring ? c_oAscError.ID.UserDrop : c_oAscError.ID.CoAuthoringDisconnect, c_oAscError.Level.NoCritical); t.handlers.trigger("asc_onError", isCloseCoAuthoring ? c_oAscError.ID.UserDrop : c_oAscError.ID.CoAuthoringDisconnect, c_oAscError.Level.NoCritical);
} }
}; };
this.CoAuthoringApi.onWarning = function(e) {
t.handlers.trigger("asc_onError", c_oAscError.ID.Warning, c_oAscError.Level.NoCritical);
};
this.CoAuthoringApi.onDocumentOpen = function(inputWrap) { this.CoAuthoringApi.onDocumentOpen = function(inputWrap) {
if (inputWrap["data"]) { if (inputWrap["data"]) {
var input = inputWrap["data"]; var input = inputWrap["data"];
......
This diff is collapsed.
...@@ -486,62 +486,70 @@ asc_docs_api.prototype._coAuthoringInit = function () { ...@@ -486,62 +486,70 @@ asc_docs_api.prototype._coAuthoringInit = function () {
t.SpellCheckUrl = window['g_cAscSpellCheckUrl'] ? window['g_cAscSpellCheckUrl'] : ''; t.SpellCheckUrl = window['g_cAscSpellCheckUrl'] ? window['g_cAscSpellCheckUrl'] : '';
} }
}; };
/** /**
* Event об отсоединении от сервера * Event об отсоединении от сервера
* @param {jQuery} e event об отсоединении с причиной * @param {jQuery} e event об отсоединении с причиной
* @param {Bool} isDisconnectAtAll окончательно ли отсоединяемся(true) или будем пробовать сделать reconnect(false) + сами отключились * @param {Bool} isDisconnectAtAll окончательно ли отсоединяемся(true) или будем пробовать сделать reconnect(false) + сами отключились
* @param {Bool} isCloseCoAuthoring * @param {Bool} isCloseCoAuthoring
*/ */
this.CoAuthoringApi.onDisconnect = function (e, isDisconnectAtAll, isCloseCoAuthoring) { this.CoAuthoringApi.onDisconnect = function(e, isDisconnectAtAll, isCloseCoAuthoring) {
if (ConnectionState.None === t.CoAuthoringApi.get_state()) if (ConnectionState.None === t.CoAuthoringApi.get_state()) {
t.asyncServerIdEndLoaded(); t.asyncServerIdEndLoaded();
if (isDisconnectAtAll) { }
// Посылаем наверх эвент об отключении от сервера if (isDisconnectAtAll) {
t.asc_fireCallback("asc_onCoAuthoringDisconnect"); // Посылаем наверх эвент об отключении от сервера
t.SetViewMode(true, true); t.asc_fireCallback("asc_onCoAuthoringDisconnect");
t.sync_ErrorCallback(isCloseCoAuthoring ? c_oAscError.ID.UserDrop : c_oAscError.ID.CoAuthoringDisconnect, t.SetViewMode(true, true);
c_oAscError.Level.NoCritical); t.sync_ErrorCallback(isCloseCoAuthoring ? c_oAscError.ID.UserDrop : c_oAscError.ID.CoAuthoringDisconnect, c_oAscError.Level.NoCritical);
}
};
this.CoAuthoringApi.onWarning = function(e) {
t.sync_ErrorCallback(c_oAscError.ID.Warning, c_oAscError.Level.NoCritical);
};
this.CoAuthoringApi.onDocumentOpen = function(inputWrap) {
if (inputWrap["data"]) {
var input = inputWrap["data"];
switch (input["type"]) {
case 'getsettings':
{
t.advancedOptionsAction = c_oAscAdvancedOptionsAction.None;
t.asc_getEditorPermissionsCallback(input);
} }
}; break;
this.CoAuthoringApi.onDocumentOpen = function (inputWrap) { case 'open':
if (inputWrap["data"]) { {
var input = inputWrap["data"]; switch (input["status"]) {
switch(input["type"]){ case "ok":
case 'getsettings':{ var urls = input["data"];
t.advancedOptionsAction = c_oAscAdvancedOptionsAction.None; g_oDocumentUrls.init(urls);
t.asc_getEditorPermissionsCallback(input); if (null != urls['Editor.bin']) {
} _onOpenCommand(function() {
break; }, {'data': urls['Editor.bin']});
case 'open': { } else {
switch(input["status"]) { t.asc_fireCallback("asc_onError", c_oAscError.ID.ConvertationError, c_oAscError.Level.NoCritical);
case "ok": }
var urls = input["data"]; break;
g_oDocumentUrls.init(urls); case "needparams":
if(null != urls['Editor.bin']) { break;
_onOpenCommand(function(){}, {'data': urls['Editor.bin']}); case "err":
} else { t.asc_fireCallback("asc_onError", g_fMapAscServerErrorToAscError(parseInt(input["data"])), c_oAscError.Level.Critical);
t.asc_fireCallback("asc_onError", c_oAscError.ID.ConvertationError, c_oAscError.Level.NoCritical); break;
} case "updateversion":
break; break;
case "needparams": break; }
case "err":
t.asc_fireCallback("asc_onError", g_fMapAscServerErrorToAscError(parseInt(input["data"])), c_oAscError.Level.Critical);
break;
case "updateversion": break;
}
}
break;
default:
if(t.fCurCallback) {
t.fCurCallback(input);
t.fCurCallback = null;
} else {
t.asc_fireCallback("asc_onError", c_oAscError.ID.Unknown, c_oAscError.Level.NoCritical);
}
break;
}
} }
}; break;
default:
if (t.fCurCallback) {
t.fCurCallback(input);
t.fCurCallback = null;
} else {
t.asc_fireCallback("asc_onError", c_oAscError.ID.Unknown, c_oAscError.Level.NoCritical);
}
break;
}
}
};
//в обычном серверном режиме портим ссылку, потому что CoAuthoring теперь имеет встроенный адрес //в обычном серверном режиме портим ссылку, потому что CoAuthoring теперь имеет встроенный адрес
//todo надо использовать проверку get_OfflineApp, но она инициализируется только после loadDocument //todo надо использовать проверку get_OfflineApp, но она инициализируется только после loadDocument
......
"use strict"; "use strict";
var c_oAscZoomType = { var c_oAscZoomType = {
Current :0, Current: 0,
FitWidth:1, FitWidth: 1,
FitPage :2 FitPage: 2
}; };
var c_oAscCollaborativeMarksShowType = { var c_oAscCollaborativeMarksShowType = {
All : 0, All: 0,
LastChanges : 1 LastChanges: 1
}; };
var c_oAscHAnchor = { var c_oAscHAnchor = {
Margin : 0x00, Margin: 0x00,
Page : 0x01, Page: 0x01,
Text : 0x02, Text: 0x02,
PageInternal : 0xFF // только для внутреннего использования PageInternal: 0xFF // только для внутреннего использования
}; };
var c_oAscXAlign = { var c_oAscXAlign = {
Center : 0x00, Center: 0x00,
Inside : 0x01, Inside: 0x01,
Left : 0x02, Left: 0x02,
Outside : 0x03, Outside: 0x03,
Right : 0x04 Right: 0x04
}; };
var c_oAscYAlign = { var c_oAscYAlign = {
Bottom : 0x00, Bottom: 0x00,
Center : 0x01, Center: 0x01,
Inline : 0x02, Inline: 0x02,
Inside : 0x03, Inside: 0x03,
Outside : 0x04, Outside: 0x04,
Top : 0x05 Top: 0x05
}; };
var c_oAscVAnchor = { var c_oAscVAnchor = {
Margin : 0x00, Margin: 0x00,
Page : 0x01, Page: 0x01,
Text : 0x02 Text: 0x02
}; };
var c_oAscVertAlignJc = { var c_oAscVertAlignJc = {
Top : 0x00, // var vertalignjc_Top = 0x00; Top: 0x00, // var vertalignjc_Top = 0x00;
Center : 0x01, // var vertalignjc_Center = 0x01; Center: 0x01, // var vertalignjc_Center = 0x01;
Bottom : 0x02 // var vertalignjc_Bottom = 0x02 Bottom: 0x02 // var vertalignjc_Bottom = 0x02
}; };
// Right = 0; Left = 1; Center = 2; Justify = 3; // Right = 0; Left = 1; Center = 2; Justify = 3;
var c_oAscAlignType = { var c_oAscAlignType = {
LEFT:0, LEFT: 0,
CENTER:1, CENTER: 1,
RIGHT:2, RIGHT: 2,
JUSTIFY:3, JUSTIFY: 3,
TOP:4, TOP: 4,
MIDDLE:5, MIDDLE: 5,
BOTTOM:6 BOTTOM: 6
}; };
// image wrap style // image wrap style
var c_oAscWrapStyle = { var c_oAscWrapStyle = {
Inline:0, Inline: 0,
Flow : 1 Flow: 1
}; };
/*Error level & ID*/ /*Error level & ID*/
var c_oAscError = { var c_oAscError = {
Level: { Level: {
Critical:-1, Critical: -1,
NoCritical:0 NoCritical: 0
}, },
ID : { ID: {
ServerSaveComplete: 3, ServerSaveComplete: 3,
ConvertationProgress: 2, ConvertationProgress: 2,
DownloadProgress: 1, DownloadProgress: 1,
No: 0, No: 0,
Unknown: -1, Unknown: -1,
ConvertationTimeout: -2, ConvertationTimeout: -2,
ConvertationError: -3, ConvertationError: -3,
DownloadError: -4, DownloadError: -4,
UnexpectedGuid: -5, UnexpectedGuid: -5,
Database: -6, Database: -6,
FileRequest: -7, FileRequest: -7,
FileVKey: -8, FileVKey: -8,
UplImageSize: -9, UplImageSize: -9,
UplImageExt: -10, UplImageExt: -10,
UplImageFileCount: -11, UplImageFileCount: -11,
NoSupportClipdoard: -12, NoSupportClipdoard: -12,
StockChartError: -16, StockChartError: -16,
CoAuthoringDisconnect: -18, CoAuthoringDisconnect: -18,
ConvertationPassword: -19, ConvertationPassword: -19,
VKeyEncrypt: -20, VKeyEncrypt: -20,
KeyExpire: -21, KeyExpire: -21,
UserCountExceed: -22, UserCountExceed: -22,
SplitCellMaxRows: -23, SplitCellMaxRows: -23,
SplitCellMaxCols: -24, SplitCellMaxCols: -24,
SplitCellRowsDivider: -25, SplitCellRowsDivider: -25,
UserDrop: -100 UserDrop: -100,
} Warning: -101
}
}; };
var c_oAscContextMenuTypes = { var c_oAscContextMenuTypes = {
Main : 0, Main: 0,
Thumbnails : 1 Thumbnails: 1
}; };
var THEME_THUMBNAIL_WIDTH = 180; var THEME_THUMBNAIL_WIDTH = 180;
...@@ -117,77 +118,77 @@ var hdrftr_Header = 0x01; ...@@ -117,77 +118,77 @@ var hdrftr_Header = 0x01;
var hdrftr_Footer = 0x02; var hdrftr_Footer = 0x02;
var c_oAscTableSelectionType = { var c_oAscTableSelectionType = {
Cell : 0, Cell: 0,
Row : 1, Row: 1,
Column : 2, Column: 2,
Table : 3 Table: 3
}; };
var c_oAscAlignShapeType = { var c_oAscAlignShapeType = {
ALIGN_LEFT: 0, ALIGN_LEFT: 0,
ALIGN_RIGHT: 1, ALIGN_RIGHT: 1,
ALIGN_TOP : 2, ALIGN_TOP: 2,
ALIGN_BOTTOM : 3, ALIGN_BOTTOM: 3,
ALIGN_CENTER : 4, ALIGN_CENTER: 4,
ALIGN_MIDDLE: 5 ALIGN_MIDDLE: 5
}; };
var c_oAscTableLayout = { var c_oAscTableLayout = {
AutoFit : 0x00, AutoFit: 0x00,
Fixed : 0x01 Fixed: 0x01
}; };
var c_oAscMouseMoveDataTypes = { var c_oAscMouseMoveDataTypes = {
Common : 0, Common: 0,
Hyperlink : 1, Hyperlink: 1,
LockedObject : 2 LockedObject: 2
}; };
var c_oAscSlideTransitionTypes = { var c_oAscSlideTransitionTypes = {
None : 0, None: 0,
Fade : 1, Fade: 1,
Push : 2, Push: 2,
Wipe : 3, Wipe: 3,
Split : 4, Split: 4,
UnCover : 5, UnCover: 5,
Cover : 6, Cover: 6,
Clock : 7, Clock: 7,
Zoom : 8 Zoom: 8
}; };
var c_oAscSlideTransitionParams = { var c_oAscSlideTransitionParams = {
Fade_Smoothly : 0, Fade_Smoothly: 0,
Fade_Through_Black : 1, Fade_Through_Black: 1,
Param_Left : 0, Param_Left: 0,
Param_Top : 1, Param_Top: 1,
Param_Right : 2, Param_Right: 2,
Param_Bottom : 3, Param_Bottom: 3,
Param_TopLeft : 4, Param_TopLeft: 4,
Param_TopRight : 5, Param_TopRight: 5,
Param_BottomLeft : 6, Param_BottomLeft: 6,
Param_BottomRight : 7, Param_BottomRight: 7,
Split_VerticalIn : 8, Split_VerticalIn: 8,
Split_VerticalOut : 9, Split_VerticalOut: 9,
Split_HorizontalIn : 10, Split_HorizontalIn: 10,
Split_HorizontalOut : 11, Split_HorizontalOut: 11,
Clock_Clockwise : 0, Clock_Clockwise: 0,
Clock_Counterclockwise : 1, Clock_Counterclockwise: 1,
Clock_Wedge : 2, Clock_Wedge: 2,
Zoom_In : 0, Zoom_In: 0,
Zoom_Out : 1, Zoom_Out: 1,
Zoom_AndRotate : 2 Zoom_AndRotate: 2
}; };
var c_oAscLockTypeElemPresentation = { var c_oAscLockTypeElemPresentation = {
Object : 1, Object: 1,
Slide : 2, Slide: 2,
Presentation: 3 Presentation: 3
}; };
var TABLE_STYLE_WIDTH_PIX = 70; var TABLE_STYLE_WIDTH_PIX = 70;
var TABLE_STYLE_HEIGHT_PIX = 50; var TABLE_STYLE_HEIGHT_PIX = 50;
\ No newline at end of file \ No newline at end of file
...@@ -1373,23 +1373,26 @@ asc_docs_api.prototype._coAuthoringInit = function() ...@@ -1373,23 +1373,26 @@ asc_docs_api.prototype._coAuthoringInit = function()
t._coSpellCheckInit(); t._coSpellCheckInit();
} }
}; };
/** /**
* Event об отсоединении от сервера * Event об отсоединении от сервера
* @param {jQuery} e event об отсоединении с причиной * @param {jQuery} e event об отсоединении с причиной
* @param {Bool} isDisconnectAtAll окончательно ли отсоединяемся(true) или будем пробовать сделать reconnect(false) + сами отключились * @param {Bool} isDisconnectAtAll окончательно ли отсоединяемся(true) или будем пробовать сделать reconnect(false) + сами отключились
* @param {Bool} isCloseCoAuthoring * @param {Bool} isCloseCoAuthoring
*/ */
this.CoAuthoringApi.onDisconnect = function (e, isDisconnectAtAll, isCloseCoAuthoring) { this.CoAuthoringApi.onDisconnect = function(e, isDisconnectAtAll, isCloseCoAuthoring) {
if (ConnectionState.None === t.CoAuthoringApi.get_state()) if (ConnectionState.None === t.CoAuthoringApi.get_state()) {
t.asyncServerIdEndLoaded(); t.asyncServerIdEndLoaded();
if (isDisconnectAtAll) { }
// Посылаем наверх эвент об отключении от сервера if (isDisconnectAtAll) {
t.asc_fireCallback("asc_onCoAuthoringDisconnect"); // Посылаем наверх эвент об отключении от сервера
t.SetViewMode(true); t.asc_fireCallback("asc_onCoAuthoringDisconnect");
t.sync_ErrorCallback(isCloseCoAuthoring ? c_oAscError.ID.UserDrop : c_oAscError.ID.CoAuthoringDisconnect, t.SetViewMode(true);
c_oAscError.Level.NoCritical); t.sync_ErrorCallback(isCloseCoAuthoring ? c_oAscError.ID.UserDrop : c_oAscError.ID.CoAuthoringDisconnect, c_oAscError.Level.NoCritical);
} }
}; };
this.CoAuthoringApi.onWarning = function(e) {
t.sync_ErrorCallback(c_oAscError.ID.Warning, c_oAscError.Level.NoCritical);
};
this.CoAuthoringApi.onDocumentOpen = function (inputWrap) { this.CoAuthoringApi.onDocumentOpen = function (inputWrap) {
if (inputWrap["data"]) { if (inputWrap["data"]) {
var input = inputWrap["data"]; var input = inputWrap["data"];
......
This diff is collapsed.
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