Commit 5b596fb5 authored by Alexey.Golubev's avatar Alexey.Golubev Committed by Alexander.Trofimov

Добавлен трек для лицензирования по коннекшинам.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50680 954022d7-b5bf-4e40-9824-e11837661b57
parent 5c4eb019
......@@ -126,6 +126,8 @@ function asc_docs_api(name)
this.tableStylesIdCounter = 0;
//выставляем тип copypaste
g_bIsDocumentCopyPaste = false;
this.isTrackingEnable = false;
this.TrackingInterval = 300 * 1000;
var oThis = this;
if(window.addEventListener)
......@@ -727,6 +729,16 @@ asc_docs_api.prototype.asc_getEditorPermissionsCallback = function(incomeObject)
var asc_CAscEditorPermissions = window["Asc"].asc_CAscEditorPermissions;
var oEditorPermissions = new asc_CAscEditorPermissions(oSettings);
editor.asc_fireCallback("asc_onGetEditorPermissions", oEditorPermissions);
if(undefined != oSettings['isTrackingEnable'] &&
null != oSettings['isTrackingEnable'])
editor.isTrackingEnable = oSettings['isTrackingEnable'];
if(undefined != oSettings['TrackingInterval'] &&
null != oSettings['TrackingInterval'])
editor.TrackingInterval = oSettings['TrackingInterval'] * 1000;
editor._StartTracking();
}
}
asc_docs_api.prototype.asc_setDocInfo = function(c_DocInfo)
......@@ -4686,7 +4698,23 @@ asc_docs_api.prototype.sync_closeChartEditor = function()
this.asc_fireCallback("asc_onCloseChartEditor");
}
asc_docs_api.prototype._StartTracking = function ()
{
var t = editor;
if(t.isTrackingEnable)
{
var rData = {
"docId": t.DocInfo.get_Id(),
"clientId": t.DocInfo.get_UserId(),
"isAlive": 1
};
sendTrack( t, function(){
setTimeout(t._StartTracking, t.TrackingInterval);
},
JSON.stringify(rData) );
}
}
//-----------------------------------------------------------------
// События контекстного меню
......@@ -4797,11 +4825,28 @@ function sendCommand(editor, fCallback, rdata){
if(fCallback)
fCallback(incomeObject);
break;
}
}
}
})
};
};
function sendTrack(editor, fCallback, rdata){
asc_ajax({
type: 'POST',
url: g_sTrackingServiceLocalUrl,
data: rdata,
error: function(jqXHR, textStatus, errorThrown){
editor.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.Critical);
if(fCallback)
fCallback();
},
success: function(msg){
var incomeObject = JSON.parse(msg);
if(fCallback)
fCallback(editor, incomeObject);
}
})
};
function _downloadAs(editor, filetype, fCallback, bStart, sSaveKey)
{
var sData;
......
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