Commit 692663c6 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Поправил определение https и http (не по порту, а по протоколу)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57879 954022d7-b5bf-4e40-9824-e11837661b57
parent f0119321
...@@ -30,8 +30,7 @@ ...@@ -30,8 +30,7 @@
} }
}; };
CDocsCoApi.prototype.init = function (user, docid, token, serverHost, serverPort, serverPath, callback, CDocsCoApi.prototype.init = function (user, docid, token, callback, editorType, documentFormatSave, isViewer) {
editorType, documentFormatSave, isViewer) {
if (this._CoAuthoringApi && this._CoAuthoringApi.isRightURL()) { if (this._CoAuthoringApi && this._CoAuthoringApi.isRightURL()) {
var t = this; var t = this;
this._CoAuthoringApi.onAuthParticipantsChanged = function (e, count) {t.callback_OnAuthParticipantsChanged(e, count);}; this._CoAuthoringApi.onAuthParticipantsChanged = function (e, count) {t.callback_OnAuthParticipantsChanged(e, count);};
...@@ -50,8 +49,7 @@ ...@@ -50,8 +49,7 @@
this._CoAuthoringApi.onStartCoAuthoring = function (e) {t.callback_OnStartCoAuthoring(e);}; this._CoAuthoringApi.onStartCoAuthoring = function (e) {t.callback_OnStartCoAuthoring(e);};
this._CoAuthoringApi.onEndCoAuthoring = function (e) {t.callback_OnEndCoAuthoring(e);}; this._CoAuthoringApi.onEndCoAuthoring = function (e) {t.callback_OnEndCoAuthoring(e);};
this._CoAuthoringApi.init(user, docid, token, serverHost, serverPort, serverPath, callback, this._CoAuthoringApi.init(user, docid, token, callback, editorType, documentFormatSave, isViewer);
editorType, documentFormatSave, isViewer);
this._onlineWork = true; this._onlineWork = true;
} }
else { else {
...@@ -300,10 +298,6 @@ ...@@ -300,10 +298,6 @@
this._user = "Anonymous"; this._user = "Anonymous";
this._initCallback = null; this._initCallback = null;
this.ownedLockBlocks = []; this.ownedLockBlocks = [];
// Server info
this._serverHost = null;
this._serverPort = null;
this._serverPath = null;
this.sockjs_url = null; this.sockjs_url = null;
this.sockjs = null; this.sockjs = null;
this._isExcel = false; this._isExcel = false;
...@@ -809,17 +803,12 @@ ...@@ -809,17 +803,12 @@
} }
}; };
DocsCoApi.prototype.init = function (user, docid, token, serverHost, serverPort, serverPath, callback, DocsCoApi.prototype.init = function (user, docid, token, callback, editorType, documentFormatSave, isViewer) {
editorType, documentFormatSave, isViewer) {
this._user = user; this._user = user;
this._docid = docid; this._docid = docid;
this._token = token; this._token = token;
this._initCallback = callback; this._initCallback = callback;
this.ownedLockBlocks = []; this.ownedLockBlocks = [];
// Server info
this._serverHost = serverHost;
this._serverPort = serverPort ? serverPort : '';
this._serverPath = serverPath;
this.sockjs_url = this._url + '/doc/'+docid+'/c'; this.sockjs_url = this._url + '/doc/'+docid+'/c';
this._isExcel = c_oEditorId.Spreadsheet === editorType; this._isExcel = c_oEditorId.Spreadsheet === editorType;
this._isPresentation = c_oEditorId.Presentation === editorType; this._isPresentation = c_oEditorId.Presentation === editorType;
...@@ -860,24 +849,25 @@ ...@@ -860,24 +849,25 @@
} }
t._send( t._send(
{ {
"type":"auth", 'type' : 'auth',
"docid":t._docid, 'docid' : t._docid,
"token":t._token, 'token' : t._token,
"user": { 'user' : {
"id":t._user.asc_getId(), 'id' : t._user.asc_getId(),
"name":t._user.asc_getUserName(), 'name' : t._user.asc_getUserName(),
"color":t._user.asc_getColorValue() 'color' : t._user.asc_getColorValue()
}, },
"locks":t.ownedLockBlocks, 'locks' : t.ownedLockBlocks,
"sessionId":t._id, 'sessionId' : t._id,
"server": { 'server' : {
"host": t._serverHost, 'https' : 'https:' === window.location.protocol
"port": t._serverPort, 'host' : window.location.hostname,
"path":t._serverPath 'port' : window.location.port || '',
'path' : g_sMainServiceLocalUrl
}, },
"documentFormatSave": t._documentFormatSave, 'documentFormatSave' : t._documentFormatSave,
"isViewer": t._isViewer, 'isViewer' : t._isViewer,
"version": asc_coAuthV 'version' : asc_coAuthV
}); });
}; };
......
...@@ -1693,10 +1693,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -1693,10 +1693,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
} }
}; };
this.CoAuthoringApi.init(t.User, t.documentId, 'fghhfgsjdgfjs', window.location.hostname, this.CoAuthoringApi.init(t.User, t.documentId, 'fghhfgsjdgfjs', function(){}, c_oEditorId.Spreadsheet,
window.location.port, g_sMainServiceLocalUrl, function(){ t.documentFormatSave, t.asc_getViewerMode());
}, c_oEditorId.Spreadsheet, t.documentFormatSave, t.asc_getViewerMode());
}; };
// Set CoAuthoring server url // Set CoAuthoring server url
......
...@@ -521,9 +521,8 @@ asc_docs_api.prototype._coAuthoringInit = function () { ...@@ -521,9 +521,8 @@ asc_docs_api.prototype._coAuthoringInit = function () {
} }
}; };
this.CoAuthoringApi.init(this.User, documentId, 'fghhfgsjdgfjs', window.location.hostname, this.CoAuthoringApi.init(this.User, documentId, 'fghhfgsjdgfjs', function(){}, c_oEditorId.Presentation,
window.location.port, g_sMainServiceLocalUrl, function(){ documentFormatSave, this.isViewMode);
}, c_oEditorId.Presentation, documentFormatSave, this.isViewMode);
// ToDo init other callbacks // ToDo init other callbacks
}; };
......
...@@ -1642,9 +1642,8 @@ asc_docs_api.prototype._coAuthoringInit = function() ...@@ -1642,9 +1642,8 @@ asc_docs_api.prototype._coAuthoringInit = function()
} }
}; };
this.CoAuthoringApi.init(this.User, documentId, 'fghhfgsjdgfjs', window.location.hostname, this.CoAuthoringApi.init(this.User, documentId, 'fghhfgsjdgfjs', function(){}, c_oEditorId.Word,
window.location.port, g_sMainServiceLocalUrl, function(){ documentFormatSave, this.isViewMode);
}, c_oEditorId.Word, documentFormatSave, this.isViewMode);
// ToDo init other callbacks // ToDo init other callbacks
}; };
......
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