Commit d2bab29c authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander.Trofimov

updateversion

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@65274 954022d7-b5bf-4e40-9824-e11837661b57
parent c9ffe772
......@@ -96,6 +96,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
// CoAuthoring and Chat
this.User = undefined;
this.CoAuthoringApi = new CDocsCoApi();
this.isCoAuthoringEnable = true;
this.collaborativeEditing = null;
this.isDocumentCanSave = false; // Флаг, говорит о возможности сохранять документ (активна кнопка save или нет)
......@@ -1557,13 +1558,25 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
case 'open':
{
switch (input["status"]) {
case "updateversion":
case "ok":
var urls = input["data"];
g_oDocumentUrls.init(urls);
if (null != urls['Editor.bin']) {
t._onOpenCommand(function(response) {
t._startOpenDocument(response);
}, urls['Editor.bin']);
if ('ok' === input["status"] || t.asc_getViewerMode()) {
t._onOpenCommand(function(response) {
t._startOpenDocument(response);
}, urls['Editor.bin']);
} else {
t.handlers.trigger("asc_onDocumentUpdateVersion", function () {
if (t.isCoAuthoringEnable) {
t.asc_coAuthoringDisconnect();
}
t._onOpenCommand(function(response) {
t._startOpenDocument(response);
}, urls['Editor.bin']);
});
}
} else {
t.handlers.trigger("asc_onError", c_oAscError.ID.ConvertationError, c_oAscError.Level.Critical);
}
......@@ -1601,8 +1614,6 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
case "err":
t.handlers.trigger("asc_onError", g_fMapAscServerErrorToAscError(parseInt(input["data"])), c_oAscError.Level.Critical);
break;
case "updateversion":
break;
}
}
break;
......@@ -3280,6 +3291,10 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
// server disconnect
spreadsheet_api.prototype.asc_coAuthoringDisconnect = function() {
this.CoAuthoringApi.disconnect();
this.isCoAuthoringEnable = false;
// Выставляем view-режим
this.asc_setViewerMode(true);
};
/////////////////////////////////////////////////////////////////////////
////////////////////////////AutoSave api/////////////////////////////////
......
......@@ -141,6 +141,7 @@ function asc_docs_api(name)
this.User = undefined;
this.CoAuthoringApi = new CDocsCoApi();
this.CoAuthoringApi.isPowerPoint = true;
this.isCoAuthoringEnable = true;
this.isDocumentCanSave = false; // Флаг, говорит о возможности сохранять документ (активна кнопка save или нет)
this.SpellCheckUrl = ''; // Ссылка сервиса для проверки орфографии
......@@ -497,12 +498,21 @@ asc_docs_api.prototype._coAuthoringInit = function () {
case 'open':
{
switch (input["status"]) {
case "updateversion":
case "ok":
var urls = input["data"];
g_oDocumentUrls.init(urls);
if (null != urls['Editor.bin']) {
_onOpenCommand(function() {
}, {'data': urls['Editor.bin']});
if ('ok' === input["status"] || editor.isViewMode) {
_onOpenCommand(function(){}, {'data': urls['Editor.bin']});
} else {
editor.asc_fireCallback("asc_onDocumentUpdateVersion", function () {
if (editor.isCoAuthoringEnable) {
editor.asc_coAuthoringDisconnect();
}
_onOpenCommand(function(){}, {'data': urls['Editor.bin']});
});
}
} else {
t.asc_fireCallback("asc_onError", c_oAscError.ID.ConvertationError, c_oAscError.Level.NoCritical);
}
......@@ -512,8 +522,6 @@ asc_docs_api.prototype._coAuthoringInit = function () {
case "err":
t.asc_fireCallback("asc_onError", g_fMapAscServerErrorToAscError(parseInt(input["data"])), c_oAscError.Level.Critical);
break;
case "updateversion":
break;
}
}
break;
......@@ -556,6 +564,8 @@ asc_docs_api.prototype.sync_CollaborativeChanges = function()
// server disconnect
asc_docs_api.prototype.asc_coAuthoringDisconnect = function () {
this.CoAuthoringApi.disconnect();
this.isCoAuthoringEnable = false;
//Just set viewer mode
this.SetViewMode(true);
};
......
......@@ -1358,11 +1358,21 @@ asc_docs_api.prototype._coAuthoringInit = function()
case 'reopen':
case 'open': {
switch(input["status"]) {
case "updateversion":
case "ok":
var urls = input["data"];
g_oDocumentUrls.init(urls);
if(null != urls['Editor.bin']) {
_onOpenCommand(function(){}, {'data': urls['Editor.bin']});
if ('ok' === input["status"] || editor.isViewMode) {
_onOpenCommand(function(){}, {'data': urls['Editor.bin']});
} else {
editor.asc_fireCallback("asc_onDocumentUpdateVersion", function () {
if (editor.isCoAuthoringEnable) {
editor.asc_coAuthoringDisconnect();
}
_onOpenCommand(function(){}, {'data': urls['Editor.bin']});
});
}
} else {
t.asc_fireCallback("asc_onError", c_oAscError.ID.ConvertationError, c_oAscError.Level.Critical);
}
......@@ -1374,7 +1384,6 @@ asc_docs_api.prototype._coAuthoringInit = function()
case "err":
t.asc_fireCallback("asc_onError", g_fMapAscServerErrorToAscError(parseInt(input["data"])), c_oAscError.Level.Critical);
break;
case "updateversion": break;
}
}
break;
......
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