Commit 12d5298e authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Добавил _documentCallbackUrl

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@60115 954022d7-b5bf-4e40-9824-e11837661b57
parent ff14f1c7
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
'use strict'; 'use strict';
var asc = window["Asc"]; var asc = window["Asc"];
var asc_coAuthV = '3.0.5'; var asc_coAuthV = '3.0.6';
// Класс надстройка, для online и offline работы // Класс надстройка, для online и offline работы
function CDocsCoApi (options) { function CDocsCoApi (options) {
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
} }
} }
CDocsCoApi.prototype.init = function (user, docid, token, callback, editorType, documentFormatSave, isViewer) { CDocsCoApi.prototype.init = function (user, docid, documentCallbackUrl, token, callback, 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,7 +50,7 @@ ...@@ -50,7 +50,7 @@
this._CoAuthoringApi.onUnSaveLock = function () {t.callback_OnUnSaveLock();}; this._CoAuthoringApi.onUnSaveLock = function () {t.callback_OnUnSaveLock();};
this._CoAuthoringApi.onRecalcLocks = function (e) {t.callback_OnRecalcLocks(e);}; this._CoAuthoringApi.onRecalcLocks = function (e) {t.callback_OnRecalcLocks(e);};
this._CoAuthoringApi.init(user, docid, token, callback, editorType, documentFormatSave, isViewer); this._CoAuthoringApi.init(user, docid, documentCallbackUrl, token, callback, editorType, documentFormatSave, isViewer);
this._onlineWork = true; this._onlineWork = true;
} }
else { else {
...@@ -302,6 +302,7 @@ ...@@ -302,6 +302,7 @@
this.errorTimeOut = 10000; this.errorTimeOut = 10000;
this._docid = null; this._docid = null;
this._documentCallbackUrl = null;
this._token = null; this._token = null;
this._user = "Anonymous"; this._user = "Anonymous";
this._userId = "Anonymous"; this._userId = "Anonymous";
...@@ -847,9 +848,10 @@ ...@@ -847,9 +848,10 @@
} }
}; };
DocsCoApi.prototype.init = function (user, docid, token, callback, editorType, documentFormatSave, isViewer) { DocsCoApi.prototype.init = function (user, docid, documentCallbackUrl, token, callback, editorType, documentFormatSave, isViewer) {
this._user = user; this._user = user;
this._docid = docid; this._docid = docid;
this._documentCallbackUrl = documentCallbackUrl;
this._token = token; this._token = token;
this._initCallback = callback; this._initCallback = callback;
this.ownedLockBlocks = []; this.ownedLockBlocks = [];
...@@ -895,6 +897,7 @@ ...@@ -895,6 +897,7 @@
{ {
'type' : 'auth', 'type' : 'auth',
'docid' : t._docid, 'docid' : t._docid,
'documentCallbackUrl' : t._documentCallbackUrl,
'token' : t._token, 'token' : t._token,
'user' : { 'user' : {
'id' : t._user.asc_getId(), 'id' : t._user.asc_getId(),
......
...@@ -64,6 +64,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -64,6 +64,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
this.documentFormatSaveCsvDelimiter = c_oAscCsvDelimiter.Comma; this.documentFormatSaveCsvDelimiter = c_oAscCsvDelimiter.Comma;
this.chartEditor = undefined; this.chartEditor = undefined;
this.documentOpenOptions = undefined; // Опции при открытии (пока только опции для CSV) this.documentOpenOptions = undefined; // Опции при открытии (пока только опции для CSV)
this.documentCallbackUrl = undefined; // Ссылка для отправления информации о документе
this.DocInfo = null; this.DocInfo = null;
// объекты, нужные для отправки в тулбар (шрифты, стили) // объекты, нужные для отправки в тулбар (шрифты, стили)
...@@ -432,6 +433,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -432,6 +433,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
this.documentVKey = this.DocInfo["VKey"]; this.documentVKey = this.DocInfo["VKey"];
this.chartEditor = this.DocInfo["ChartEditor"]; this.chartEditor = this.DocInfo["ChartEditor"];
this.documentOpenOptions = this.DocInfo["Options"]; this.documentOpenOptions = this.DocInfo["Options"];
this.documentCallbackUrl = this.DocInfo["CallbackUrl"];
// if(this.documentFormat) // if(this.documentFormat)
// { // {
// switch(this.documentFormat) // switch(this.documentFormat)
...@@ -1697,8 +1699,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -1697,8 +1699,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
} }
}; };
this.CoAuthoringApi.init(t.User, t.documentId, 'fghhfgsjdgfjs', function(){}, c_oEditorId.Spreadsheet, this.CoAuthoringApi.init(t.User, t.documentId, t.documentCallbackUrl, 'fghhfgsjdgfjs',
t.documentFormatSave, t.asc_getViewerMode()); function(){}, c_oEditorId.Spreadsheet, t.documentFormatSave, t.asc_getViewerMode());
}; };
// Set CoAuthoring server url // Set CoAuthoring server url
......
...@@ -13,6 +13,7 @@ var documentFormat = 'null'; ...@@ -13,6 +13,7 @@ var documentFormat = 'null';
var documentVKey = null; var documentVKey = null;
var documentOrigin = ""; var documentOrigin = "";
var documentFormatSave = c_oAscFileType.PPTX;//пока не во что другое сохранять не можем. var documentFormatSave = c_oAscFileType.PPTX;//пока не во что другое сохранять не можем.
var documentCallbackUrl = undefined; // Ссылка для отправления информации о документе
var c_oSerFormat = var c_oSerFormat =
{ {
...@@ -515,7 +516,7 @@ asc_docs_api.prototype._coAuthoringInit = function () { ...@@ -515,7 +516,7 @@ asc_docs_api.prototype._coAuthoringInit = function () {
} }
}; };
this.CoAuthoringApi.init(this.User, documentId, 'fghhfgsjdgfjs', function(){}, c_oEditorId.Presentation, this.CoAuthoringApi.init(this.User, documentId, documentCallbackUrl, 'fghhfgsjdgfjs', function(){}, c_oEditorId.Presentation,
documentFormatSave, this.isViewMode); documentFormatSave, this.isViewMode);
// ToDo init other callbacks // ToDo init other callbacks
...@@ -783,6 +784,7 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo) ...@@ -783,6 +784,7 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo)
documentUrl = this.DocInfo.get_Url(); documentUrl = this.DocInfo.get_Url();
documentTitle = this.DocInfo.get_Title(); documentTitle = this.DocInfo.get_Title();
documentFormat = this.DocInfo.get_Format(); documentFormat = this.DocInfo.get_Format();
documentCallbackUrl = this.DocInfo.get_CallbackUrl();
var nIndex = -1; var nIndex = -1;
if(documentTitle) if(documentTitle)
nIndex = documentTitle.lastIndexOf("."); nIndex = documentTitle.lastIndexOf(".");
......
...@@ -125,6 +125,9 @@ function CDocInfo (obj){ ...@@ -125,6 +125,9 @@ function CDocInfo (obj){
if (typeof obj.Options != 'undefined'){ if (typeof obj.Options != 'undefined'){
this.Options = obj.Options; this.Options = obj.Options;
} }
if (typeof obj.CallbackUrl != 'undefined'){
this.CallbackUrl = obj.CallbackUrl;
}
if (obj.OfflineApp === true) if (obj.OfflineApp === true)
this.OfflineApp = true; this.OfflineApp = true;
} }
...@@ -137,26 +140,29 @@ function CDocInfo (obj){ ...@@ -137,26 +140,29 @@ function CDocInfo (obj){
this.UserId = null; this.UserId = null;
this.UserName = null; this.UserName = null;
this.Options = null; this.Options = null;
this.CallbackUrl = null;
} }
} }
CDocInfo.prototype.get_Id = function(){return this.Id} CDocInfo.prototype.get_Id = function(){return this.Id};
CDocInfo.prototype.put_Id = function(v){this.Id = v;} CDocInfo.prototype.put_Id = function(v){this.Id = v;};
CDocInfo.prototype.get_Url = function(){return this.Url;} CDocInfo.prototype.get_Url = function(){return this.Url;};
CDocInfo.prototype.put_Url = function(v){this.Url = v;} CDocInfo.prototype.put_Url = function(v){this.Url = v;};
CDocInfo.prototype.get_Title = function(){return this.Title;} CDocInfo.prototype.get_Title = function(){return this.Title;};
CDocInfo.prototype.put_Title = function(v){this.Title = v;} CDocInfo.prototype.put_Title = function(v){this.Title = v;};
CDocInfo.prototype.get_Format = function(){return this.Format;} CDocInfo.prototype.get_Format = function(){return this.Format;};
CDocInfo.prototype.put_Format = function(v){this.Format = v;} CDocInfo.prototype.put_Format = function(v){this.Format = v;};
CDocInfo.prototype.get_VKey = function(){return this.VKey;} CDocInfo.prototype.get_VKey = function(){return this.VKey;};
CDocInfo.prototype.put_VKey = function(v){this.VKey = v;} CDocInfo.prototype.put_VKey = function(v){this.VKey = v;};
CDocInfo.prototype.get_OfflineApp = function(){return this.OfflineApp;} CDocInfo.prototype.get_OfflineApp = function(){return this.OfflineApp;};
CDocInfo.prototype.put_OfflineApp = function(v){this.OfflineApp = v;} CDocInfo.prototype.put_OfflineApp = function(v){this.OfflineApp = v;};
CDocInfo.prototype.get_UserId = function(){return this.UserId;} CDocInfo.prototype.get_UserId = function(){return this.UserId;};
CDocInfo.prototype.put_UserId = function(v){this.UserId = v;} CDocInfo.prototype.put_UserId = function(v){this.UserId = v;};
CDocInfo.prototype.get_UserName = function(){return this.UserName;} CDocInfo.prototype.get_UserName = function(){return this.UserName;};
CDocInfo.prototype.put_UserName = function(v){this.UserName = v;} CDocInfo.prototype.put_UserName = function(v){this.UserName = v;};
CDocInfo.prototype.get_Options = function(){return this.Options;} CDocInfo.prototype.get_Options = function(){return this.Options;};
CDocInfo.prototype.put_Options = function(v){this.Options = v;} CDocInfo.prototype.put_Options = function(v){this.Options = v;};
CDocInfo.prototype.get_CallbackUrl = function(){return this.CallbackUrl;};
CDocInfo.prototype.put_CallbackUrl = function(v){this.CallbackUrl = v;};
// --------------------------------------------------------------- // ---------------------------------------------------------------
......
...@@ -15,6 +15,7 @@ var documentVKey = null; ...@@ -15,6 +15,7 @@ var documentVKey = null;
var documentOrigin = ""; var documentOrigin = "";
var documentFormatSave = c_oAscFileType.DOCX; var documentFormatSave = c_oAscFileType.DOCX;
var documentFormatSaveTxtCodepage = 65001;//utf8 var documentFormatSaveTxtCodepage = 65001;//utf8
var documentCallbackUrl = undefined; // Ссылка для отправления информации о документе
function CDocOpenProgress() function CDocOpenProgress()
{ {
...@@ -59,6 +60,9 @@ function CDocInfo (obj){ ...@@ -59,6 +60,9 @@ function CDocInfo (obj){
if (typeof obj.Options != 'undefined'){ if (typeof obj.Options != 'undefined'){
this.Options = obj.Options; this.Options = obj.Options;
} }
if (typeof obj.CallbackUrl != 'undefined'){
this.CallbackUrl = obj.CallbackUrl;
}
if (obj.OfflineApp === true) if (obj.OfflineApp === true)
this.OfflineApp = true; this.OfflineApp = true;
} }
...@@ -71,6 +75,7 @@ function CDocInfo (obj){ ...@@ -71,6 +75,7 @@ function CDocInfo (obj){
this.UserId = null; this.UserId = null;
this.UserName = null; this.UserName = null;
this.Options = null; this.Options = null;
this.CallbackUrl = null;
} }
} }
CDocInfo.prototype.get_Id = function(){return this.Id}; CDocInfo.prototype.get_Id = function(){return this.Id};
...@@ -91,6 +96,8 @@ CDocInfo.prototype.get_UserName = function(){return this.UserName;}; ...@@ -91,6 +96,8 @@ CDocInfo.prototype.get_UserName = function(){return this.UserName;};
CDocInfo.prototype.put_UserName = function(v){this.UserName = v;}; CDocInfo.prototype.put_UserName = function(v){this.UserName = v;};
CDocInfo.prototype.get_Options = function(){return this.Options;}; CDocInfo.prototype.get_Options = function(){return this.Options;};
CDocInfo.prototype.put_Options = function(v){this.Options = v;}; CDocInfo.prototype.put_Options = function(v){this.Options = v;};
CDocInfo.prototype.get_CallbackUrl = function(){return this.CallbackUrl;};
CDocInfo.prototype.put_CallbackUrl = function(v){this.CallbackUrl = v;};
function CListType(obj) function CListType(obj)
{ {
...@@ -958,6 +965,7 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo) ...@@ -958,6 +965,7 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo)
documentUrl = this.DocInfo.get_Url(); documentUrl = this.DocInfo.get_Url();
documentTitle = this.DocInfo.get_Title(); documentTitle = this.DocInfo.get_Title();
documentFormat = this.DocInfo.get_Format(); documentFormat = this.DocInfo.get_Format();
documentCallbackUrl = this.DocInfo.get_CallbackUrl();
// if(documentFormat) // if(documentFormat)
// { // {
// switch(documentFormat) // switch(documentFormat)
...@@ -1638,8 +1646,8 @@ asc_docs_api.prototype._coAuthoringInit = function() ...@@ -1638,8 +1646,8 @@ asc_docs_api.prototype._coAuthoringInit = function()
} }
}; };
this.CoAuthoringApi.init(this.User, documentId, 'fghhfgsjdgfjs', function(){}, c_oEditorId.Word, this.CoAuthoringApi.init(this.User, documentId, documentCallbackUrl, 'fghhfgsjdgfjs', 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