Commit 94689ceb 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@51205 954022d7-b5bf-4e40-9824-e11837661b57
parent 43989d29
......@@ -55,6 +55,8 @@
"../Common/Charts/charts.js",
"../Excel/graphics/DrawingContextWord.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",
......
......@@ -62,7 +62,8 @@
<script type="text/javascript" src="../../OfficeWeb/Common/Charts/charts.js"></script>
<script type="text/javascript" src="../../OfficeWeb/Excel/graphics/DrawingContextWord.js"></script>
<script type="text/javascript" src="../../OfficeWeb/Word/Editor/Serialize2.js"></script>
<script type="text/javascript" src="../../OfficeWeb/Common/trackFile.js"></script>
<script src="../../OfficeWeb/Common/commonDefines.js"></script>
......
......@@ -126,8 +126,8 @@ function asc_docs_api(name)
this.tableStylesIdCounter = 0;
//выставляем тип copypaste
g_bIsDocumentCopyPaste = false;
this.isTrackingEnable = false;
this.TrackingInterval = 300 * 1000;
this.TrackFile = null;
var oThis = this;
if(window.addEventListener)
......@@ -727,15 +727,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)
......@@ -4776,24 +4784,6 @@ 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": t.isDocumentModified()? 1: 0
};
sendTrack( t, function(){
setTimeout(t._StartTracking, t.TrackingInterval);
},
JSON.stringify(rData) );
}
}
//-----------------------------------------------------------------
// События контекстного меню
//-----------------------------------------------------------------
......@@ -4924,20 +4914,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