Commit 4bd67dfe authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander.Trofimov

presentations autosave

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@59862 954022d7-b5bf-4e40-9824-e11837661b57
parent f9bb4c8c
......@@ -279,6 +279,11 @@ function CEditorPage(api)
this.IsUseNullThumbnailsSplitter = false;
this.m_nIntervalSlowAutosave = 600000;
this.m_nIntervalFastAutosave = 2000;
this.m_nIntervalWaitAutoSave = 1000;
this.m_nLastAutosaveTime = -1;
this.m_oApi = api;
var oThis = this;
......@@ -2925,6 +2930,36 @@ function CEditorPage(api)
oWordControl.CheckFontCache();
}
if (oWordControl.m_oApi.autoSaveGap != 0 && !oWordControl.m_oApi.isViewMode && !oWordControl.TextBoxInputFocus)
{
var _curTime = new Date().getTime();
if (-1 == oWordControl.m_nLastAutosaveTime)
{
oWordControl.m_nLastAutosaveTime = _curTime;
}
var _bIsWaitScheme = false;
if (History.Points && History.Index >= 0 && History.Index < History.Points.length)
{
if ((_curTime - History.Points[History.Index].Time) < oWordControl.m_nIntervalWaitAutoSave)
_bIsWaitScheme = true;
}
if (!_bIsWaitScheme)
{
var _interval = (CollaborativeEditing.m_nUseType <= 0) ? oWordControl.m_nIntervalSlowAutosave : oWordControl.m_nIntervalFastAutosave;
if ((_curTime - oWordControl.m_nLastAutosaveTime) > _interval)
{
if (History.Have_Changes() == true)
{
oWordControl.m_oApi.asc_Save();
}
oWordControl.m_nLastAutosaveTime = _curTime;
}
}
}
this.m_nPaintTimerId = setTimeout(oWordControl.onTimerScroll, oWordControl.m_nTimerScrollInterval);
//window.requestAnimationFrame(oWordControl.onTimerScroll);
}
......
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