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

Трек используется из trackFile.js

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51201 954022d7-b5bf-4e40-9824-e11837661b57
parent d7b62cc6
......@@ -38,6 +38,7 @@
"../Common/Shapes/Serialize.js",
"../Common/Shapes/SerializeWriter.js",
"../Common/SerializeCommonWordExcel.js",
"../Common/trackFile.js",
"../Common/Charts/libraries/OfficeExcel.common.core.js",
"../Common/Charts/libraries/OfficeExcel.common.annotate.js",
"../Common/Charts/libraries/OfficeExcel.common.context.js",
......
......@@ -34,6 +34,8 @@
<script type="text/javascript" src="../Common/CommonDefines.js"></script>
<script type="text/javascript" src="../Common/NumFormat.js"></script>
<script type="text/javascript" src="../Common/editorscommon.js"></script>
<script type="text/javascript" src="../Common/trackFile.js"></script>
<!-- For chart editor -->
<script type="text/javascript" src="../Excel/apiDefines.js"></script>
......
......@@ -620,8 +620,7 @@ function asc_docs_api(name)
this.ParcedDocument = false;
this.isStartCoAuthoringOnEndLoad = false; // Подсоединились раньше, чем документ загрузился
this.isTrackingEnable = false;
this.TrackingInterval = 300 * 1000;
this.TrackFile = null;
var oThis = this;
if(window.addEventListener)
......@@ -853,15 +852,23 @@ asc_docs_api.prototype.asc_getEditorPermissionsCallback = function(incomeObject)
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['trackingInfo'] &&
null != oSettings['trackingInfo'])
{
var asc_CTrackFile = window["Asc"].CTrackFile;
this.TrackFile = new asc_CTrackFile(oSettings['trackingInfo']);
if(undefined != oSettings['TrackingInterval'] &&
null != oSettings['TrackingInterval'])
editor.TrackingInterval = oSettings['TrackingInterval'] * 1000;
this.TrackFile.setDocId(this.DocInfo.get_Id());
this.TrackFile.setUserId(this.DocInfo.get_UserId());
this.TrackFile.setTrackFunc(sendTrack);
this.TrackFile.setIsDocumentModifiedFunc(this.isDocumentModified);
editor._StartTracking();
if(undefined != oSettings['TrackingInterval'] &&
null != oSettings['TrackingInterval'])
this.TrackFile.setInterval(oSettings['TrackingInterval']);
this.TrackFile.Start();
}
}
}
asc_docs_api.prototype.asc_setDocInfo = function(c_DocInfo)
......@@ -6693,24 +6700,6 @@ asc_docs_api.prototype.asc_setCoAuthoringEnable = function (isCoAuthoringEnable)
this.isCoAuthoringEnable = !!isCoAuthoringEnable;
}
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": t.isDocumentModified()? 1: 0
};
sendTrack( t, function(){
setTimeout(t._StartTracking, t.TrackingInterval);
},
JSON.stringify(rData) );
}
}
var cCharDelimiter = String.fromCharCode(5);
function getURLParameter(name) {
......@@ -6891,20 +6880,19 @@ function sendCommand(editor, fCallback, rdata){
})
};
function sendTrack(editor, fCallback, rdata){
function sendTrack(fCallback, url, rdata){
asc_ajax({
type: 'POST',
url: g_sTrackingServiceLocalUrl,
url: url,
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);
fCallback(incomeObject);
}
})
};
......
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