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 @@ ...@@ -38,6 +38,7 @@
"../Common/Shapes/Serialize.js", "../Common/Shapes/Serialize.js",
"../Common/Shapes/SerializeWriter.js", "../Common/Shapes/SerializeWriter.js",
"../Common/SerializeCommonWordExcel.js", "../Common/SerializeCommonWordExcel.js",
"../Common/trackFile.js",
"../Common/Charts/libraries/OfficeExcel.common.core.js", "../Common/Charts/libraries/OfficeExcel.common.core.js",
"../Common/Charts/libraries/OfficeExcel.common.annotate.js", "../Common/Charts/libraries/OfficeExcel.common.annotate.js",
"../Common/Charts/libraries/OfficeExcel.common.context.js", "../Common/Charts/libraries/OfficeExcel.common.context.js",
......
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
<script type="text/javascript" src="../Common/NumFormat.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/editorscommon.js"></script>
<script type="text/javascript" src="../Common/trackFile.js"></script>
<!-- For chart editor --> <!-- For chart editor -->
<script type="text/javascript" src="../Excel/apiDefines.js"></script> <script type="text/javascript" src="../Excel/apiDefines.js"></script>
<script type="text/javascript" src="../Common/Charts/DrawingObjects.js"></script> <script type="text/javascript" src="../Common/Charts/DrawingObjects.js"></script>
......
...@@ -620,8 +620,7 @@ function asc_docs_api(name) ...@@ -620,8 +620,7 @@ function asc_docs_api(name)
this.ParcedDocument = false; this.ParcedDocument = false;
this.isStartCoAuthoringOnEndLoad = false; // Подсоединились раньше, чем документ загрузился this.isStartCoAuthoringOnEndLoad = false; // Подсоединились раньше, чем документ загрузился
this.isTrackingEnable = false; this.TrackFile = null;
this.TrackingInterval = 300 * 1000;
var oThis = this; var oThis = this;
if(window.addEventListener) if(window.addEventListener)
...@@ -853,15 +852,23 @@ asc_docs_api.prototype.asc_getEditorPermissionsCallback = function(incomeObject) ...@@ -853,15 +852,23 @@ asc_docs_api.prototype.asc_getEditorPermissionsCallback = function(incomeObject)
var oEditorPermissions = new asc_CAscEditorPermissions(oSettings); var oEditorPermissions = new asc_CAscEditorPermissions(oSettings);
editor.asc_fireCallback("asc_onGetEditorPermissions", oEditorPermissions); editor.asc_fireCallback("asc_onGetEditorPermissions", oEditorPermissions);
if(undefined != oSettings['isTrackingEnable'] && if(undefined != oSettings['trackingInfo'] &&
null != oSettings['isTrackingEnable']) null != oSettings['trackingInfo'])
editor.isTrackingEnable = oSettings['isTrackingEnable']; {
var asc_CTrackFile = window["Asc"].CTrackFile;
this.TrackFile = new asc_CTrackFile(oSettings['trackingInfo']);
this.TrackFile.setDocId(this.DocInfo.get_Id());
this.TrackFile.setUserId(this.DocInfo.get_UserId());
this.TrackFile.setTrackFunc(sendTrack);
this.TrackFile.setIsDocumentModifiedFunc(this.isDocumentModified);
if(undefined != oSettings['TrackingInterval'] && if(undefined != oSettings['TrackingInterval'] &&
null != oSettings['TrackingInterval']) null != oSettings['TrackingInterval'])
editor.TrackingInterval = oSettings['TrackingInterval'] * 1000; this.TrackFile.setInterval(oSettings['TrackingInterval']);
editor._StartTracking(); this.TrackFile.Start();
}
} }
} }
asc_docs_api.prototype.asc_setDocInfo = function(c_DocInfo) asc_docs_api.prototype.asc_setDocInfo = function(c_DocInfo)
...@@ -6693,24 +6700,6 @@ asc_docs_api.prototype.asc_setCoAuthoringEnable = function (isCoAuthoringEnable) ...@@ -6693,24 +6700,6 @@ asc_docs_api.prototype.asc_setCoAuthoringEnable = function (isCoAuthoringEnable)
this.isCoAuthoringEnable = !!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); var cCharDelimiter = String.fromCharCode(5);
function getURLParameter(name) { function getURLParameter(name) {
...@@ -6891,20 +6880,19 @@ function sendCommand(editor, fCallback, rdata){ ...@@ -6891,20 +6880,19 @@ function sendCommand(editor, fCallback, rdata){
}) })
}; };
function sendTrack(editor, fCallback, rdata){ function sendTrack(fCallback, url, rdata){
asc_ajax({ asc_ajax({
type: 'POST', type: 'POST',
url: g_sTrackingServiceLocalUrl, url: url,
data: rdata, data: rdata,
error: function(jqXHR, textStatus, errorThrown){ error: function(jqXHR, textStatus, errorThrown){
editor.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.Critical);
if(fCallback) if(fCallback)
fCallback(); fCallback();
}, },
success: function(msg){ success: function(msg){
var incomeObject = JSON.parse(msg); var incomeObject = JSON.parse(msg);
if(fCallback) 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