Commit 662cc6f0 authored by Oleg Korshul's avatar Oleg Korshul

mobile version methods

parent 6e987209
......@@ -1097,6 +1097,7 @@ CDrawingPage.prototype =
}
};
var g_page_outline_inner = false;//AscCommon.AscBrowser.isChrome;
function CPage()
{
this.width_mm = 210;
......@@ -1117,19 +1118,47 @@ function CPage()
{
if (null != this.drawingPage.cachedImage)
{
context.strokeStyle = GlobalSkin.PageOutline;
context.strokeRect(xDst, yDst, wDst, hDst);
// ����� ���������� �� �������� ���������
if (!g_page_outline_inner)
{
context.strokeStyle = GlobalSkin.PageOutline;
context.lineWidth = 1;
// ctx.strokeRect(x - 0.5, y - 0.5, w + 1, h + 1);
context.beginPath();
context.moveTo(xDst - 0.5, yDst - 0.5);
context.lineTo(xDst + wDst + 0.5, yDst - 0.5);
context.lineTo(xDst + wDst + 0.5, yDst + hDst + 0.5);
context.lineTo(xDst - 0.5, yDst + hDst + 0.5);
context.closePath();
context.stroke();
context.beginPath();
}
context.drawImage(this.drawingPage.cachedImage.image, xDst, yDst, wDst, hDst);
}
else
{
context.fillStyle = "#ffffff";
context.strokeStyle = GlobalSkin.PageOutline;
context.strokeRect(xDst, yDst, wDst, hDst);
if (!g_page_outline_inner)
{
context.strokeStyle = GlobalSkin.PageOutline;
context.lineWidth = 1;
// ctx.strokeRect(x - 0.5, y - 0.5, w + 1, h + 1);
context.beginPath();
context.moveTo(xDst - 0.5, yDst - 0.5);
context.lineTo(xDst + wDst + 0.5, yDst - 0.5);
context.lineTo(xDst + wDst + 0.5, yDst + hDst + 0.5);
context.lineTo(xDst - 0.5, yDst + hDst + 0.5);
context.closePath();
context.stroke();
context.beginPath();
}
context.fillRect(xDst, yDst, wDst, hDst);
}
}
};
this.DrawSelection = function (overlay, xDst, yDst, wDst, hDst, TextMatrix)
{
......@@ -2405,6 +2434,23 @@ function CDrawingDocument()
else
this.m_oDocumentRenderer.drawPage(pageIndex, g);
if (g_page_outline_inner)
{
var context = page.drawingPage.cachedImage.image.ctx;
context.strokeStyle = GlobalSkin.PageOutline;
context.lineWidth = 1;
context.beginPath();
context.moveTo(0.5, 0.5);
context.lineTo(w - 0.5, 0.5);
context.lineTo(w - 0.5, h - 0.5);
context.lineTo(0.5, h - 0.5);
context.closePath();
context.stroke();
context.beginPath();
}
//var EndTime = new Date().getTime();
//alert("" + ((EndTime - StartTime) / 1000));
......
......@@ -2515,6 +2515,17 @@ background-repeat: no-repeat;\
this.sendEvent("asc_onClearPropObj", prop);
};
// mobile version methods:
asc_docs_api.prototype.asc_GetDefaultTableStyles = function()
{
if (!this.WordControl.m_oLogicDocument)
return;
this.WordControl.m_oDrawingDocument.StartTableStylesCheck();
this.WordControl.m_oDrawingDocument.TableStylesSheckLook = new CTableLook();
this.WordControl.m_oDrawingDocument.EndTableStylesCheck();
};
/*----------------------------------------------------------------*/
/*functions for working with headers*/
/*
......@@ -7251,6 +7262,24 @@ background-repeat: no-repeat;\
}
};
asc_docs_api.prototype.AddShapeOnCurrentPage = function(_type)
{
if (!this.WordControl.m_oLogicDocument)
return;
var _pageNum = this.GetCurrentVisiblePage();
// получаем размеры страницы
var _sectionPr = this.WordControl.m_oLogicDocument.Get_PageLimits(_pageNum);
var _min = Math.min(_sectionPr.XLimit / 2, _sectionPr.YLimit / 2);
this.WordControl.m_oLogicDocument.DrawingObjects.addShapeOnPage(_type, _pageNum,
_sectionPr.X + _sectionPr.XLimit / 4,
_sectionPr.Y + _sectionPr.YLimit / 4,
_min,
_min);
};
asc_docs_api.prototype.AddTextArt = function(nStyle)
{
if (false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Paragraph_Content))
......@@ -8896,6 +8925,7 @@ background-repeat: no-repeat;\
asc_docs_api.prototype['SetMarkerFormat'] = asc_docs_api.prototype.SetMarkerFormat;
asc_docs_api.prototype['sync_MarkerFormatCallback'] = asc_docs_api.prototype.sync_MarkerFormatCallback;
asc_docs_api.prototype['StartAddShape'] = asc_docs_api.prototype.StartAddShape;
asc_docs_api.prototype['AddShapeOnCurrentPage'] = asc_docs_api.prototype.AddShapeOnCurrentPage;
asc_docs_api.prototype['AddTextArt'] = asc_docs_api.prototype.AddTextArt;
asc_docs_api.prototype['sync_StartAddShapeCallback'] = asc_docs_api.prototype.sync_StartAddShapeCallback;
asc_docs_api.prototype['CanGroup'] = asc_docs_api.prototype.CanGroup;
......@@ -8981,6 +9011,9 @@ background-repeat: no-repeat;\
asc_docs_api.prototype["asc_editOleObject"] = asc_docs_api.prototype.asc_editOleObject;
asc_docs_api.prototype["asc_InputClearKeyboardElement"] = asc_docs_api.prototype.asc_InputClearKeyboardElement;
// mobile
asc_docs_api.prototype["asc_GetDefaultTableStyles"] = asc_docs_api.prototype.asc_GetDefaultTableStyles;
CParagraphPropEx.prototype['get_ContextualSpacing'] = CParagraphPropEx.prototype.get_ContextualSpacing;
CParagraphPropEx.prototype['get_Ind'] = CParagraphPropEx.prototype.get_Ind;
CParagraphPropEx.prototype['get_Jc'] = CParagraphPropEx.prototype.get_Jc;
......
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