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

reader only mode

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50236 954022d7-b5bf-4e40-9824-e11837661b57
parent bd2fbab2
......@@ -1948,7 +1948,7 @@ function CEditorPage(api)
this.ReaderModeDivWrapper.id = "wrapper_reader_id";
this.ReaderModeDivWrapper.innerHTML = "<div id=\"reader_id\" style=\"width:100%;display:block;z-index:9;font-family:arial;font-size:" +
this.ReaderFontSizes[this.ReaderFontSizeCur] + "pt;position:absolute;resize:none;padding-left:5%;padding-right:5%;padding-top:10%;padding-bottom:10%;background-color:#FFFFFF;\">" +
this.ReaderFontSizes[this.ReaderFontSizeCur] + "pt;position:absolute;resize:none;-webkit-box-sizing:border-box;box-sizing:border-box;padding-left:5%;padding-right:5%;padding-top:10%;padding-bottom:10%;background-color:#FFFFFF;\">" +
this.m_oApi.ContentToHTML(true) + "</div>";
this.m_oMainView.HtmlElement.appendChild(this.ReaderModeDivWrapper);
......@@ -3258,7 +3258,9 @@ function CEditorPage(api)
{
this.CalculateDocumentSize();
//setInterval(this.onTimerScroll, this.m_nTimerScrollInterval);
this.StartMainTimer();
if (!this.m_oApi.isOnlyReaderMode)
this.StartMainTimer();
this.m_oHorRuler.CreateBackground(this.m_oDrawingDocument.m_arrPages[0]);
this.m_oVerRuler.CreateBackground(this.m_oDrawingDocument.m_arrPages[0]);
......@@ -3364,7 +3366,7 @@ function CEditorPage(api)
{
var oWordControl = oThis;
if (!oWordControl.m_oApi.bInit_word_control)
if (!oWordControl.m_oApi.bInit_word_control || oWordControl.m_oApi.isOnlyReaderMode)
return;
oWordControl.m_nTimeDrawingLast = new Date().getTime();
......
......@@ -543,6 +543,9 @@ function asc_docs_api(name)
// Chart
this.chartTranslate = new asc_CChartTranslate();
// это чтобы сразу показать ридер, без возможности вернуться в редактор/вьюер
this.isOnlyReaderMode = false;
/**************************************/
......@@ -923,6 +926,11 @@ asc_docs_api.prototype.ChangeReaderMode = function()
{
return this.WordControl.ChangeReaderMode();
}
asc_docs_api.prototype.SetReaderModeOnly = function()
{
this.isOnlyReaderMode = true;
this.ImageLoader.bIsAsyncLoadDocumentImages = false;
}
asc_docs_api.prototype.IncreaseReaderFontSize = function()
{
......@@ -1024,7 +1032,10 @@ asc_docs_api.prototype.GetCopyPasteDivId = function()
asc_docs_api.prototype.ContentToHTML = function(bIsRet)
{
this.DocumentReaderMode = new CDocumentReaderMode();
var _old = copyPasteUseBinery;
copyPasteUseBinery = false;
Editor_Copy(this);
copyPasteUseBinery = _old;
this.DocumentReaderMode = null;
return document.getElementById("SelectId").innerHTML;
}
......@@ -6057,8 +6068,15 @@ asc_docs_api.prototype.OpenDocumentEndCallback = function()
Document.DrawingObjects.calculateAfterOpen();
Document.DrawingObjects.calculateAfterChangeTheme();
Document.Recalculate();
this.WordControl.m_oDrawingDocument.TargetStart();
if (!this.isOnlyReaderMode)
{
Document.Recalculate();
this.WordControl.m_oDrawingDocument.TargetStart();
}
else
{
this.ChangeReaderMode();
}
}
}
}
......
......@@ -216,6 +216,7 @@
var isViewMode = "true" == getURLParameter("isViewMode");
editor.SetViewMode(isViewMode);
editor.SetReaderModeOnly();
editor.zoomFitToWidth();
editor.LoadDocument(c_DocInfo);
......
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