|
|
@ -1,5 +1,5 @@
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Copyright (C) Ascensio System SIA 2012-2021. All rights reserved
|
|
|
|
* Copyright (C) Ascensio System SIA 2012-2022. All rights reserved
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* https://www.onlyoffice.com/
|
|
|
|
* https://www.onlyoffice.com/
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -11034,8 +11034,8 @@ oLogicDocument.StartAction(nPointType);callback.apply(this,args);oLogicDocument.
|
|
|
|
arrFields);return _arrFields},TurnOffCheckChartSelection:function(){this.bNoCheckChartTextSelection=true},TurnOnCheckChartSelection:function(){this.bNoCheckChartTextSelection=false},getDrawingDocument:function(){return editor.WordControl.m_oDrawingDocument},sortDrawingArrays:function(){for(var i=0;i<this.graphicPages.length;++i)if(this.graphicPages[i])this.graphicPages[i].sortDrawingArrays()},getSelectedObjects:function(){return this.selectedObjects},getSelectedArray:DrawingObjectsController.prototype.getSelectedArray,
|
|
|
|
arrFields);return _arrFields},TurnOffCheckChartSelection:function(){this.bNoCheckChartTextSelection=true},TurnOnCheckChartSelection:function(){this.bNoCheckChartTextSelection=false},getDrawingDocument:function(){return editor.WordControl.m_oDrawingDocument},sortDrawingArrays:function(){for(var i=0;i<this.graphicPages.length;++i)if(this.graphicPages[i])this.graphicPages[i].sortDrawingArrays()},getSelectedObjects:function(){return this.selectedObjects},getSelectedArray:DrawingObjectsController.prototype.getSelectedArray,
|
|
|
|
getTheme:function(){return this.document.theme},getColorMapOverride:function(){return null},isViewMode:function(){return this.document.IsViewMode()},convertPixToMM:function(v){return this.document.DrawingDocument.GetMMPerDot(v)},getGraphicInfoUnderCursor:function(pageIndex,x,y){this.handleEventMode=HANDLE_EVENT_MODE_CURSOR;var ret=this.curState.onMouseDown(global_mouseEvent,x,y,pageIndex,false);this.handleEventMode=HANDLE_EVENT_MODE_HANDLE;if(ret&&ret.cursorType==="text")if(this.selection.chartSelection&&
|
|
|
|
getTheme:function(){return this.document.theme},getColorMapOverride:function(){return null},isViewMode:function(){return this.document.IsViewMode()},convertPixToMM:function(v){return this.document.DrawingDocument.GetMMPerDot(v)},getGraphicInfoUnderCursor:function(pageIndex,x,y){this.handleEventMode=HANDLE_EVENT_MODE_CURSOR;var ret=this.curState.onMouseDown(global_mouseEvent,x,y,pageIndex,false);this.handleEventMode=HANDLE_EVENT_MODE_HANDLE;if(ret&&ret.cursorType==="text")if(this.selection.chartSelection&&
|
|
|
|
this.selection.chartSelection.selection.textSelection||this.selection.groupSelection&&this.selection.groupSelection.selection.chartSelection&&this.selection.groupSelection.selection.chartSelection.selection.textSelection)ret={};return ret||{}},updateCursorType:function(pageIndex,x,y,e,bTextFlag){var ret;this.handleEventMode=HANDLE_EVENT_MODE_CURSOR;ret=this.curState.onMouseDown(global_mouseEvent,x,y,pageIndex,bTextFlag);this.handleEventMode=HANDLE_EVENT_MODE_HANDLE;if(ret){if(ret.cursorType!=="text"){var oApi=
|
|
|
|
this.selection.chartSelection.selection.textSelection||this.selection.groupSelection&&this.selection.groupSelection.selection.chartSelection&&this.selection.groupSelection.selection.chartSelection.selection.textSelection)ret={};return ret||{}},updateCursorType:function(pageIndex,x,y,e,bTextFlag){var ret;this.handleEventMode=HANDLE_EVENT_MODE_CURSOR;ret=this.curState.onMouseDown(global_mouseEvent,x,y,pageIndex,bTextFlag);this.handleEventMode=HANDLE_EVENT_MODE_HANDLE;if(ret){if(ret.cursorType!=="text"){var oApi=
|
|
|
|
Asc.editor||editor;var isDrawHandles=oApi?oApi.isShowShapeAdjustments():true;var oShape=null;var oInnerForm=null;if((oShape=AscCommon.g_oTableId.Get_ById(ret.objectId))&&oShape.isForm()&&(oInnerForm=oShape.getInnerForm())){if(isDrawHandles&&oInnerForm.IsFormLocked())isDrawHandles=false;var oPara;if(oInnerForm.IsPictureForm()&&oInnerForm.IsFixedForm()&&(oPara=oInnerForm.GetParagraph())){var X=x,Y=y;var oTransform=oPara.Get_ParentTextInvertTransform();if(oTransform){X=oTransform.TransformPointX(x,y);
|
|
|
|
Asc.editor||editor;var isDrawHandles=oApi?oApi.isShowShapeAdjustments():true;var oShape=AscCommon.g_oTableId.Get_ById(ret.objectId);var oInnerForm=null;if(oShape&&oShape.isForm&&oShape.isForm()&&(oInnerForm=oShape.getInnerForm())){if(isDrawHandles&&oInnerForm.IsFormLocked())isDrawHandles=false;var oPara;if(oInnerForm.IsPictureForm()&&oInnerForm.IsFixedForm()&&(oPara=oInnerForm.GetParagraph())){var X=x,Y=y;var oTransform=oPara.Get_ParentTextInvertTransform();if(oTransform){X=oTransform.TransformPointX(x,
|
|
|
|
Y=oTransform.TransformPointY(x,y)}oInnerForm.DrawContentControlsTrack(true,X,Y,0)}}if(isDrawHandles===false){this.drawingDocument.SetCursorType("default");return true}this.drawingDocument.SetCursorType(ret.cursorType)}return true}return false},removeTextSelection:function(){var oTargetDocContent=this.getTargetDocContent();if(oTargetDocContent&&oTargetDocContent.IsSelectionUse())oTargetDocContent.RemoveSelection()},getDefaultText:DrawingObjectsController.prototype.getDefaultText,canEdit:DrawingObjectsController.prototype.canEdit,
|
|
|
|
y);Y=oTransform.TransformPointY(x,y)}oInnerForm.DrawContentControlsTrack(true,X,Y,0)}}if(isDrawHandles===false){this.drawingDocument.SetCursorType("default");return true}this.drawingDocument.SetCursorType(ret.cursorType)}return true}return false},removeTextSelection:function(){var oTargetDocContent=this.getTargetDocContent();if(oTargetDocContent&&oTargetDocContent.IsSelectionUse())oTargetDocContent.RemoveSelection()},getDefaultText:DrawingObjectsController.prototype.getDefaultText,canEdit:DrawingObjectsController.prototype.canEdit,
|
|
|
|
createImage:DrawingObjectsController.prototype.createImage,createOleObject:DrawingObjectsController.prototype.createOleObject,createTextArt:DrawingObjectsController.prototype.createTextArt,getChartObject:DrawingObjectsController.prototype.getChartObject,getChartSpace2:DrawingObjectsController.prototype.getChartSpace2,CreateDocContent:DrawingObjectsController.prototype.CreateDocContent,isSlideShow:function(){return false},clearPreTrackObjects:function(){this.arrPreTrackObjects.length=0},addPreTrackObject:function(preTrackObject){this.arrPreTrackObjects.push(preTrackObject)},
|
|
|
|
createImage:DrawingObjectsController.prototype.createImage,createOleObject:DrawingObjectsController.prototype.createOleObject,createTextArt:DrawingObjectsController.prototype.createTextArt,getChartObject:DrawingObjectsController.prototype.getChartObject,getChartSpace2:DrawingObjectsController.prototype.getChartSpace2,CreateDocContent:DrawingObjectsController.prototype.CreateDocContent,isSlideShow:function(){return false},clearPreTrackObjects:function(){this.arrPreTrackObjects.length=0},addPreTrackObject:function(preTrackObject){this.arrPreTrackObjects.push(preTrackObject)},
|
|
|
|
clearTrackObjects:function(){this.arrTrackObjects.length=0},addTrackObject:function(trackObject){this.arrTrackObjects.push(trackObject)},swapTrackObjects:function(){this.clearTrackObjects();for(var i=0;i<this.arrPreTrackObjects.length;++i)this.addTrackObject(this.arrPreTrackObjects[i]);this.clearPreTrackObjects()},addToRecalculate:function(object){if(typeof object.Get_Id==="function"&&typeof object.recalculate==="function")History.RecalcData_Add({Type:AscDFH.historyitem_recalctype_Drawing,Object:object});
|
|
|
|
clearTrackObjects:function(){this.arrTrackObjects.length=0},addTrackObject:function(trackObject){this.arrTrackObjects.push(trackObject)},swapTrackObjects:function(){this.clearTrackObjects();for(var i=0;i<this.arrPreTrackObjects.length;++i)this.addTrackObject(this.arrPreTrackObjects[i]);this.clearPreTrackObjects()},addToRecalculate:function(object){if(typeof object.Get_Id==="function"&&typeof object.recalculate==="function")History.RecalcData_Add({Type:AscDFH.historyitem_recalctype_Drawing,Object:object});
|
|
|
|
return},createWatermarkImage:DrawingObjectsController.prototype.createWatermarkImage,createWatermark:function(oProps){if(oProps.get_Type()===Asc.c_oAscWatermarkType.None)return null;var bTrackRevisions=false;if(this.document.IsTrackRevisions()){bTrackRevisions=this.document.GetLocalTrackRevisions();this.document.SetLocalTrackRevisions(false)}var oDrawing,extX,extY;var oSectPr=this.document.Get_SectionProps();var dMaxWidth=oSectPr.get_W()-oSectPr.get_LeftMargin()-oSectPr.get_RightMargin();var dMaxHeight=
|
|
|
|
return},createWatermarkImage:DrawingObjectsController.prototype.createWatermarkImage,createWatermark:function(oProps){if(oProps.get_Type()===Asc.c_oAscWatermarkType.None)return null;var bTrackRevisions=false;if(this.document.IsTrackRevisions()){bTrackRevisions=this.document.GetLocalTrackRevisions();this.document.SetLocalTrackRevisions(false)}var oDrawing,extX,extY;var oSectPr=this.document.Get_SectionProps();var dMaxWidth=oSectPr.get_W()-oSectPr.get_LeftMargin()-oSectPr.get_RightMargin();var dMaxHeight=
|
|
|
@ -11230,9 +11230,9 @@ table;return}this.flowTables.push(table)},updateFloatTable:function(table){for(v
|
|
|
|
else drawing_array=this.beforeTextObjects;if(Array.isArray(drawing_array)){for(var i=0;i<drawing_array.length;++i)if(drawing_array[i]===object)break;if(i===drawing_array.length){drawing_array.push(object);if(need_sort)drawing_array.sort(ComparisonByZIndexSimpleParent)}}},concatPage:function(page){this.inlineObjects=this.inlineObjects.concat(page.inlineObjects);this.behindDocObjects=this.behindDocObjects.concat(page.behindDocObjects);this.beforeTextObjects=this.beforeTextObjects.concat(page.beforeTextObjects);
|
|
|
|
else drawing_array=this.beforeTextObjects;if(Array.isArray(drawing_array)){for(var i=0;i<drawing_array.length;++i)if(drawing_array[i]===object)break;if(i===drawing_array.length){drawing_array.push(object);if(need_sort)drawing_array.sort(ComparisonByZIndexSimpleParent)}}},concatPage:function(page){this.inlineObjects=this.inlineObjects.concat(page.inlineObjects);this.behindDocObjects=this.behindDocObjects.concat(page.behindDocObjects);this.beforeTextObjects=this.beforeTextObjects.concat(page.beforeTextObjects);
|
|
|
|
this.flowTables=this.flowTables.concat(page.flowTables)},mergePages:function(page1,page2){if(page1)this.concatPage(page1);if(page2)this.concatPage(page2);this.behindDocObjects.sort(ComparisonByZIndexSimpleParent);this.beforeTextObjects.sort(ComparisonByZIndexSimpleParent)},clear:function(){this.inlineObjects=[];this.behindDocObjects=[];this.beforeTextObjects=[];this.flowTables=[]},CheckRange:function(X0,Y0,X1,Y1,Y0sp,Y1Ssp,LeftField,RightField,HdrFtrRanges,docContent,bMathWrap){return this.wrapManager.checkRanges(X0,
|
|
|
|
this.flowTables=this.flowTables.concat(page.flowTables)},mergePages:function(page1,page2){if(page1)this.concatPage(page1);if(page2)this.concatPage(page2);this.behindDocObjects.sort(ComparisonByZIndexSimpleParent);this.beforeTextObjects.sort(ComparisonByZIndexSimpleParent)},clear:function(){this.inlineObjects=[];this.behindDocObjects=[];this.beforeTextObjects=[];this.flowTables=[]},CheckRange:function(X0,Y0,X1,Y1,Y0sp,Y1Ssp,LeftField,RightField,HdrFtrRanges,docContent,bMathWrap){return this.wrapManager.checkRanges(X0,
|
|
|
|
Y0,X1,Y1,Y0sp,Y1Ssp,LeftField,RightField,HdrFtrRanges,docContent,bMathWrap)},removeFloatTableById:function(id){for(var index=0;index<this.flowTables.length;++index)if(this.flowTables[index].Id===id){this.flowTables.splice(index,1);return}},documentStatistics:function(Statistics){var cur_array=this.inlineObjects.concat(this.behindDocObjects).concat(this.beforeTextObjects);for(var i=0;i<cur_array.length;++i)if(cur_array[i].documentStatistics)cur_array[i].documentStatistics(Statistics)},getTableByXY:function(x,
|
|
|
|
Y0,X1,Y1,Y0sp,Y1Ssp,LeftField,RightField,HdrFtrRanges,docContent,bMathWrap)},removeFloatTableById:function(id){for(var index=0;index<this.flowTables.length;++index)if(this.flowTables[index].Id===id){this.flowTables.splice(index,1);return}},documentStatistics:function(Statistics){var cur_array=this.inlineObjects.concat(this.behindDocObjects).concat(this.beforeTextObjects);for(var i=0;i<cur_array.length;++i)if(cur_array[i].documentStatistics)cur_array[i].documentStatistics(Statistics)},getTableByXY:function(x,
|
|
|
|
y,documentContent){for(var index=this.flowTables.length-1;index>-1;--index)if(this.flowTables[index].IsPointIn(x,y)&&this.flowTables[index].CheckDocumentContent(documentContent))return this.flowTables[index];return null},delObjectById:function(id){var oDrawing=AscCommon.g_oTableId.Get_ById(id);if(oDrawing){var drawing_array;var Type=oDrawing.getDrawingArrayType();if(Type===DRAWING_ARRAY_TYPE_INLINE)drawing_array=this.inlineObjects;else if(Type===DRAWING_ARRAY_TYPE_BEHIND)drawing_array=this.behindDocObjects;
|
|
|
|
y,documentContent){for(var index=this.flowTables.length-1;index>-1;--index)if(this.flowTables[index].IsPointIn(x,y)&&this.flowTables[index].CheckDocumentContent(documentContent))return this.flowTables[index];return null},delObjectById:function(id){var oDrawing=AscCommon.g_oTableId.Get_ById(id);if(oDrawing&&oDrawing.getDrawingArrayType){var drawing_array;var Type=oDrawing.getDrawingArrayType();if(Type===DRAWING_ARRAY_TYPE_INLINE)drawing_array=this.inlineObjects;else if(Type===DRAWING_ARRAY_TYPE_BEHIND)drawing_array=
|
|
|
|
else drawing_array=this.beforeTextObjects;for(var index=0;index<drawing_array.length;++index)if(drawing_array[index].parent===oDrawing)return drawing_array.splice(index,1)}return null},resetDrawingArrays:function(docContent){function findInArrayAndRemove(drawingArray,docContent,document){if(docContent===document){drawingArray.length=0;return}var b_is_top_doc=docContent.Is_TopDocument();for(var i=drawingArray.length-1;i>-1;--i)if(!drawingArray[i].parent||drawingArray[i].parent.DocumentContent===docContent||
|
|
|
|
this.behindDocObjects;else drawing_array=this.beforeTextObjects;for(var index=0;index<drawing_array.length;++index)if(drawing_array[index].parent===oDrawing)return drawing_array.splice(index,1)}return null},resetDrawingArrays:function(docContent){function findInArrayAndRemove(drawingArray,docContent,document){if(docContent===document){drawingArray.length=0;return}var b_is_top_doc=docContent.Is_TopDocument();for(var i=drawingArray.length-1;i>-1;--i)if(!drawingArray[i].parent||drawingArray[i].parent.DocumentContent===
|
|
|
|
b_is_top_doc&&drawingArray[i].parent.DocumentContent.Is_TopDocument(true)===docContent)drawingArray.splice(i,1)}function findTableInArrayAndRemove(drawingArray,docContent,document){if(docContent===document){drawingArray.length=0;return}for(var i=drawingArray.length-1;i>-1;--i)if(drawingArray[i].Table.Parent.GetDocumentContentForRecalcInfo()===docContent)drawingArray.splice(i,1)}function findInArrayAndRemoveFromDrawingPage(drawingPage,docContent,document){if(!drawingPage)return;if(Array.isArray(drawingPage.inlineObjects)){findInArrayAndRemove(drawingPage.inlineObjects,
|
|
|
|
docContent||b_is_top_doc&&drawingArray[i].parent.DocumentContent.Is_TopDocument(true)===docContent)drawingArray.splice(i,1)}function findTableInArrayAndRemove(drawingArray,docContent,document){if(docContent===document){drawingArray.length=0;return}for(var i=drawingArray.length-1;i>-1;--i)if(drawingArray[i].Table.Parent.GetDocumentContentForRecalcInfo()===docContent)drawingArray.splice(i,1)}function findInArrayAndRemoveFromDrawingPage(drawingPage,docContent,document){if(!drawingPage)return;if(Array.isArray(drawingPage.inlineObjects)){findInArrayAndRemove(drawingPage.inlineObjects,
|
|
|
|
docContent,document);findInArrayAndRemove(drawingPage.behindDocObjects,docContent,document);findInArrayAndRemove(drawingPage.beforeTextObjects,docContent,document);findTableInArrayAndRemove(drawingPage.flowTables,docContent,document)}}if(!AscCommon.isRealObject(docContent))docContent=this.graphicObjects.document;findInArrayAndRemoveFromDrawingPage(this,docContent,editor.WordControl.m_oLogicDocument)},draw:function(graphics){for(var _object_index=0;_object_index<this.inlineObjects.length;++_object_index)this.inlineObjects[_object_index].draw(graphics);
|
|
|
|
docContent,document);findInArrayAndRemove(drawingPage.behindDocObjects,docContent,document);findInArrayAndRemove(drawingPage.beforeTextObjects,docContent,document);findTableInArrayAndRemove(drawingPage.flowTables,docContent,document)}}if(!AscCommon.isRealObject(docContent))docContent=this.graphicObjects.document;findInArrayAndRemoveFromDrawingPage(this,docContent,editor.WordControl.m_oLogicDocument)},draw:function(graphics){for(var _object_index=0;_object_index<this.inlineObjects.length;++_object_index)this.inlineObjects[_object_index].draw(graphics);
|
|
|
|
for(_object_index=0;_object_index<this.beforeTextObjects.length;++_object_index)this.beforeTextObjects[_object_index].draw(graphics);for(_object_index=0;_object_index<this.behindDocObjects.length;++_object_index)this.behindDocObjects[_object_index].draw(graphics)},drawSelect:function(){var oApi=Asc.editor||editor;var isDrawHandles=oApi?oApi.isShowShapeAdjustments():true;var _graphic_objects=this.selectionInfo.selectionArray;var _object_index;var _objects_count=_graphic_objects.length;var _graphic_object;
|
|
|
|
for(_object_index=0;_object_index<this.beforeTextObjects.length;++_object_index)this.beforeTextObjects[_object_index].draw(graphics);for(_object_index=0;_object_index<this.behindDocObjects.length;++_object_index)this.behindDocObjects[_object_index].draw(graphics)},drawSelect:function(){var oApi=Asc.editor||editor;var isDrawHandles=oApi?oApi.isShowShapeAdjustments():true;var _graphic_objects=this.selectionInfo.selectionArray;var _object_index;var _objects_count=_graphic_objects.length;var _graphic_object;
|
|
|
|
for(_object_index=0;_object_index<_objects_count;++_object_index){_graphic_object=_graphic_objects[_object_index].graphicObject;var _transform=_graphic_object.getTransformMatrix();if(_transform===null)_transform=new AscCommon.CMatrix;var _extensions=_graphic_object.getExtensions();if(_extensions===null)_extensions={extX:0,extY:0};this.drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.SHAPE,_transform,0,0,_extensions.extX,_extensions.extY,false,undefined,undefined,isDrawHandles)}},selectionCheck:function(x,
|
|
|
|
for(_object_index=0;_object_index<_objects_count;++_object_index){_graphic_object=_graphic_objects[_object_index].graphicObject;var _transform=_graphic_object.getTransformMatrix();if(_transform===null)_transform=new AscCommon.CMatrix;var _extensions=_graphic_object.getExtensions();if(_extensions===null)_extensions={extX:0,extY:0};this.drawingDocument.DrawTrack(AscFormat.TYPE_TRACK.SHAPE,_transform,0,0,_extensions.extX,_extensions.extY,false,undefined,undefined,isDrawHandles)}},selectionCheck:function(x,
|
|
|
@ -13664,8 +13664,8 @@ if(!oRun.m_oContentChanges)return;for(var Index=0,Count=this.Items.length;Index<
|
|
|
|
AscCommon.CollaborativeEditing.Update_DocumentPositionsOnAdd(oRun,Pos);if(Element.SetParent)Element.SetParent(oRun)}}oRun.RecalcInfo.Measure=true;oRun.private_UpdateSpellChecking();oRun.private_UpdateTrackRevisionOnChangeContent(false);oRun.private_UpdateDocumentOutline()};CChangesRunAddItem.prototype.IsRelated=function(oChanges){if(this.Class===oChanges.Class&&(AscDFH.historyitem_ParaRun_AddItem===oChanges.Type||AscDFH.historyitem_ParaRun_RemoveItem===oChanges.Type))return true;return false};CChangesRunAddItem.prototype.CreateReverseChange=
|
|
|
|
AscCommon.CollaborativeEditing.Update_DocumentPositionsOnAdd(oRun,Pos);if(Element.SetParent)Element.SetParent(oRun)}}oRun.RecalcInfo.Measure=true;oRun.private_UpdateSpellChecking();oRun.private_UpdateTrackRevisionOnChangeContent(false);oRun.private_UpdateDocumentOutline()};CChangesRunAddItem.prototype.IsRelated=function(oChanges){if(this.Class===oChanges.Class&&(AscDFH.historyitem_ParaRun_AddItem===oChanges.Type||AscDFH.historyitem_ParaRun_RemoveItem===oChanges.Type))return true;return false};CChangesRunAddItem.prototype.CreateReverseChange=
|
|
|
|
function(){return this.private_CreateReverseChange(CChangesRunRemoveItem)};function CChangesRunRemoveItem(Class,Pos,Items){AscDFH.CChangesBaseContentChange.call(this,Class,Pos,Items,false)}CChangesRunRemoveItem.prototype=Object.create(AscDFH.CChangesBaseContentChange.prototype);CChangesRunRemoveItem.prototype.constructor=CChangesRunRemoveItem;CChangesRunRemoveItem.prototype.Type=AscDFH.historyitem_ParaRun_RemoveItem;CChangesRunRemoveItem.prototype.Undo=function(){var oRun=this.Class;var Array_start=
|
|
|
|
function(){return this.private_CreateReverseChange(CChangesRunRemoveItem)};function CChangesRunRemoveItem(Class,Pos,Items){AscDFH.CChangesBaseContentChange.call(this,Class,Pos,Items,false)}CChangesRunRemoveItem.prototype=Object.create(AscDFH.CChangesBaseContentChange.prototype);CChangesRunRemoveItem.prototype.constructor=CChangesRunRemoveItem;CChangesRunRemoveItem.prototype.Type=AscDFH.historyitem_ParaRun_RemoveItem;CChangesRunRemoveItem.prototype.Undo=function(){var oRun=this.Class;var Array_start=
|
|
|
|
oRun.Content.slice(0,this.Pos);var Array_end=oRun.Content.slice(this.Pos);oRun.Content=Array_start.concat(this.Items,Array_end);oRun.RecalcInfo.Measure=true;oRun.private_UpdateSpellChecking();oRun.private_UpdateTrackRevisionOnChangeContent(false);for(var nIndex=0,nCount=this.Items.length;nIndex<nCount;++nIndex)if(this.Items[nIndex].SetParent)this.Items[nIndex].SetParent(oRun)};CChangesRunRemoveItem.prototype.Redo=function(){var oRun=this.Class;oRun.Content.splice(this.Pos,this.Items.length);oRun.RecalcInfo.Measure=
|
|
|
|
oRun.Content.slice(0,this.Pos);var Array_end=oRun.Content.slice(this.Pos);oRun.Content=Array_start.concat(this.Items,Array_end);oRun.RecalcInfo.Measure=true;oRun.private_UpdateSpellChecking();oRun.private_UpdateTrackRevisionOnChangeContent(false);for(var nIndex=0,nCount=this.Items.length;nIndex<nCount;++nIndex)if(this.Items[nIndex].SetParent)this.Items[nIndex].SetParent(oRun)};CChangesRunRemoveItem.prototype.Redo=function(){var oRun=this.Class;oRun.Content.splice(this.Pos,this.Items.length);oRun.RecalcInfo.Measure=
|
|
|
|
true;oRun.private_UpdateSpellChecking();oRun.private_UpdateTrackRevisionOnChangeContent(false)};CChangesRunRemoveItem.prototype.private_WriteItem=function(Writer,Item){Item.Write_ToBinary(Writer)};CChangesRunRemoveItem.prototype.private_ReadItem=function(Reader){return ParagraphContent_Read_FromBinary(Reader)};CChangesRunRemoveItem.prototype.Load=function(){var oRun=this.Class;var nLastChangesPos=null;var nChangesCount=0;for(var Index=0,Count=this.PosArray.length;Index<Count;Index++){var nChangesPos=
|
|
|
|
true;oRun.private_UpdateSpellChecking();oRun.private_UpdateTrackRevisionOnChangeContent(false)};CChangesRunRemoveItem.prototype.private_WriteItem=function(Writer,Item){Item.Write_ToBinary(Writer)};CChangesRunRemoveItem.prototype.private_ReadItem=function(Reader){return ParagraphContent_Read_FromBinary(Reader)};CChangesRunRemoveItem.prototype.Load=function(){var oRun=this.Class;if(!oRun.m_oContentChanges)return;var nLastChangesPos=null;var nChangesCount=0;for(var Index=0,Count=this.PosArray.length;Index<
|
|
|
|
oRun.m_oContentChanges.Check(AscCommon.contentchanges_Remove,this.PosArray[Index]);if(false===nChangesPos)continue;if(null===nLastChangesPos){nLastChangesPos=nChangesPos;nChangesCount=1}else if(nLastChangesPos===nChangesPos)nChangesCount++;else{oRun.CollaborativeMarks.Update_OnRemove(nLastChangesPos,nChangesCount);oRun.Content.splice(nLastChangesPos,nChangesCount);oRun.private_UpdatePositionsOnRemove(nLastChangesPos,nChangesCount);oRun.private_UpdateCompositeInputPositionsOnRemove(nLastChangesPos,
|
|
|
|
Count;Index++){var nChangesPos=oRun.m_oContentChanges.Check(AscCommon.contentchanges_Remove,this.PosArray[Index]);if(false===nChangesPos)continue;if(null===nLastChangesPos){nLastChangesPos=nChangesPos;nChangesCount=1}else if(nLastChangesPos===nChangesPos)nChangesCount++;else{oRun.CollaborativeMarks.Update_OnRemove(nLastChangesPos,nChangesCount);oRun.Content.splice(nLastChangesPos,nChangesCount);oRun.private_UpdatePositionsOnRemove(nLastChangesPos,nChangesCount);oRun.private_UpdateCompositeInputPositionsOnRemove(nLastChangesPos,
|
|
|
|
nChangesCount);AscCommon.CollaborativeEditing.Update_DocumentPositionsOnRemove(oRun,nLastChangesPos,nChangesCount);nLastChangesPos=nChangesPos;nChangesCount=1}}if(nChangesCount){oRun.CollaborativeMarks.Update_OnRemove(nLastChangesPos,nChangesCount);oRun.Content.splice(nLastChangesPos,nChangesCount);oRun.private_UpdatePositionsOnRemove(nLastChangesPos,nChangesCount);oRun.private_UpdateCompositeInputPositionsOnRemove(nLastChangesPos,nChangesCount);AscCommon.CollaborativeEditing.Update_DocumentPositionsOnRemove(oRun,
|
|
|
|
nChangesCount);AscCommon.CollaborativeEditing.Update_DocumentPositionsOnRemove(oRun,nLastChangesPos,nChangesCount);nLastChangesPos=nChangesPos;nChangesCount=1}}if(nChangesCount){oRun.CollaborativeMarks.Update_OnRemove(nLastChangesPos,nChangesCount);oRun.Content.splice(nLastChangesPos,nChangesCount);oRun.private_UpdatePositionsOnRemove(nLastChangesPos,nChangesCount);oRun.private_UpdateCompositeInputPositionsOnRemove(nLastChangesPos,nChangesCount);AscCommon.CollaborativeEditing.Update_DocumentPositionsOnRemove(oRun,
|
|
|
|
nLastChangesPos,nChangesCount)}oRun.RecalcInfo.Measure=true;oRun.private_UpdateSpellChecking();oRun.private_UpdateTrackRevisionOnChangeContent(false);oRun.private_UpdateDocumentOutline()};CChangesRunRemoveItem.prototype.IsRelated=function(oChanges){if(this.Class===oChanges.Class&&(AscDFH.historyitem_ParaRun_AddItem===oChanges.Type||AscDFH.historyitem_ParaRun_RemoveItem===oChanges.Type))return true;return false};CChangesRunRemoveItem.prototype.CreateReverseChange=function(){return this.private_CreateReverseChange(CChangesRunAddItem)};
|
|
|
|
nLastChangesPos,nChangesCount)}oRun.RecalcInfo.Measure=true;oRun.private_UpdateSpellChecking();oRun.private_UpdateTrackRevisionOnChangeContent(false);oRun.private_UpdateDocumentOutline()};CChangesRunRemoveItem.prototype.IsRelated=function(oChanges){if(this.Class===oChanges.Class&&(AscDFH.historyitem_ParaRun_AddItem===oChanges.Type||AscDFH.historyitem_ParaRun_RemoveItem===oChanges.Type))return true;return false};CChangesRunRemoveItem.prototype.CreateReverseChange=function(){return this.private_CreateReverseChange(CChangesRunAddItem)};
|
|
|
|
function CChangesRunBold(Class,Old,New,Color){AscDFH.CChangesBaseBoolProperty.call(this,Class,Old,New,Color)}CChangesRunBold.prototype=Object.create(AscDFH.CChangesBaseBoolProperty.prototype);CChangesRunBold.prototype.constructor=CChangesRunBold;CChangesRunBold.prototype.Type=AscDFH.historyitem_ParaRun_Bold;CChangesRunBold.prototype.private_SetValue=function(Value){var oRun=this.Class;oRun.Pr.Bold=Value;oRun.Recalc_CompiledPr(true);oRun.private_UpdateTrackRevisionOnChangeTextPr(false)};CChangesRunBold.prototype.Load=
|
|
|
|
function CChangesRunBold(Class,Old,New,Color){AscDFH.CChangesBaseBoolProperty.call(this,Class,Old,New,Color)}CChangesRunBold.prototype=Object.create(AscDFH.CChangesBaseBoolProperty.prototype);CChangesRunBold.prototype.constructor=CChangesRunBold;CChangesRunBold.prototype.Type=AscDFH.historyitem_ParaRun_Bold;CChangesRunBold.prototype.private_SetValue=function(Value){var oRun=this.Class;oRun.Pr.Bold=Value;oRun.Recalc_CompiledPr(true);oRun.private_UpdateTrackRevisionOnChangeTextPr(false)};CChangesRunBold.prototype.Load=
|
|
|
@ -22828,110 +22828,111 @@ this.clearBufferTimerId){if(formats&AscCommon.c_oAscClipboardDataFormat.Text)thi
|
|
|
|
if(!this.Api.asc_IsFocus(true))return;this.ClosureParams._e=e;if(this.IsNeedDivOnCopy)this.CommonDiv_Copy();else{this.LastCopyBinary=null;this.checkCopy(AscCommon.c_oAscClipboardDataFormat.Text|AscCommon.c_oAscClipboardDataFormat.Html|AscCommon.c_oAscClipboardDataFormat.Internal);setTimeout(function(){g_clipboardBase.CommonDiv_End()},0);e.preventDefault();return false}},_private_oncut:function(e){this._console_log("oncut");if(!this.Api.asc_IsFocus(true))return;this.bCut=true;this.ClosureParams._e=
|
|
|
|
if(!this.Api.asc_IsFocus(true))return;this.ClosureParams._e=e;if(this.IsNeedDivOnCopy)this.CommonDiv_Copy();else{this.LastCopyBinary=null;this.checkCopy(AscCommon.c_oAscClipboardDataFormat.Text|AscCommon.c_oAscClipboardDataFormat.Html|AscCommon.c_oAscClipboardDataFormat.Internal);setTimeout(function(){g_clipboardBase.CommonDiv_End()},0);e.preventDefault();return false}},_private_oncut:function(e){this._console_log("oncut");if(!this.Api.asc_IsFocus(true))return;this.bCut=true;this.ClosureParams._e=
|
|
|
|
e;if(this.IsNeedDivOnCopy)this.CommonDiv_Copy();else{this.LastCopyBinary=null;this.checkCopy(AscCommon.c_oAscClipboardDataFormat.Text|AscCommon.c_oAscClipboardDataFormat.Html|AscCommon.c_oAscClipboardDataFormat.Internal)}this.Api.asc_SelectionCut();this.bCut=false;if(!this.IsNeedDivOnCopy){setTimeout(function(){g_clipboardBase.CommonDiv_End()},0);e.preventDefault();return false}},_private_onpaste:function(e){this._console_log("onpaste");if(!this.Api.asc_IsFocus(true))return;if(!this.IsNeedDivOnPaste)e.preventDefault();
|
|
|
|
e;if(this.IsNeedDivOnCopy)this.CommonDiv_Copy();else{this.LastCopyBinary=null;this.checkCopy(AscCommon.c_oAscClipboardDataFormat.Text|AscCommon.c_oAscClipboardDataFormat.Html|AscCommon.c_oAscClipboardDataFormat.Internal)}this.Api.asc_SelectionCut();this.bCut=false;if(!this.IsNeedDivOnCopy){setTimeout(function(){g_clipboardBase.CommonDiv_End()},0);e.preventDefault();return false}},_private_onpaste:function(e){this._console_log("onpaste");if(!this.Api.asc_IsFocus(true))return;if(!this.IsNeedDivOnPaste)e.preventDefault();
|
|
|
|
this.ClosureParams._e=e;if(this.Api.isLongAction())return false;this.PasteFlag=true;this.Api.incrementCounterLongAction();this.pastedFrom=null;if(this.IsNeedDivOnPaste){window.setTimeout(function(){g_clipboardBase.Api.asc_PasteData(AscCommon.c_oAscClipboardDataFormat.HtmlElement,g_clipboardBase.CommonDiv);g_clipboardBase.CommonDiv_End();g_clipboardBase.Paste_End()},0);return}else{var _clipboard=e&&e.clipboardData?e.clipboardData:window.clipboardData;if(!_clipboard||!_clipboard.getData)return false;
|
|
|
|
this.ClosureParams._e=e;if(this.Api.isLongAction())return false;this.PasteFlag=true;this.Api.incrementCounterLongAction();this.pastedFrom=null;if(this.IsNeedDivOnPaste){window.setTimeout(function(){g_clipboardBase.Api.asc_PasteData(AscCommon.c_oAscClipboardDataFormat.HtmlElement,g_clipboardBase.CommonDiv);g_clipboardBase.CommonDiv_End();g_clipboardBase.Paste_End()},0);return}else{var _clipboard=e&&e.clipboardData?e.clipboardData:window.clipboardData;if(!_clipboard||!_clipboard.getData)return false;
|
|
|
|
var _text_format=this.ClosureParams.getData("text/plain");var _internal=this.ClosureParams.getData("text/x-custom");if(_internal&&_internal!=""&&_internal.indexOf("asc_internalData2;")==0){this.Api.asc_PasteData(AscCommon.c_oAscClipboardDataFormat.Internal,_internal.substr("asc_internalData2;".length),null,_text_format);g_clipboardBase.Paste_End();return false}var _html_format=this.ClosureParams.getData("text/html");if(_html_format&&_html_format!=""){var nIndex=_html_format.indexOf("</html>");if(-1!=
|
|
|
|
var _text_format=this.ClosureParams.getData("text/plain");var _internal=this.ClosureParams.getData("text/x-custom");if(_internal&&_internal!=""&&_internal.indexOf("asc_internalData2;")==0){this.Api.asc_PasteData(AscCommon.c_oAscClipboardDataFormat.Internal,_internal.substr("asc_internalData2;".length),null,_text_format);g_clipboardBase.Paste_End();return false}var _html_format=this.ClosureParams.getData("text/html");_html_format=_html_format.replace(/<img[^>]+>/g,"");if(!_html_format){this.PasteFlag=
|
|
|
|
nIndex)_html_format=_html_format.substring(0,nIndex+"</html>".length);this.CommonIframe_PasteStart(_html_format,_text_format);return false}if(_text_format&&_text_format!=""){this.Api.asc_PasteData(AscCommon.c_oAscClipboardDataFormat.Text,_text_format);g_clipboardBase.Paste_End();return false}var items=_clipboard.items;if(null!=items&&0!=items.length){g_clipboardBase.PasteImagesBody="";g_clipboardBase.PasteImagesCount=items.length;g_clipboardBase.PasteImagesCounter=0;for(var i=0;i<items.length;++i)if(items[i].kind==
|
|
|
|
false;g_clipboardBase.Paste_End();return false}if(_html_format&&_html_format!=""){var nIndex=_html_format.indexOf("</html>");if(-1!=nIndex)_html_format=_html_format.substring(0,nIndex+"</html>".length);this.CommonIframe_PasteStart(_html_format,_text_format);return false}if(_text_format&&_text_format!=""){this.Api.asc_PasteData(AscCommon.c_oAscClipboardDataFormat.Text,_text_format);g_clipboardBase.Paste_End();return false}var items=_clipboard.items;if(null!=items&&0!=items.length){g_clipboardBase.PasteImagesBody=
|
|
|
|
"file"&&items[i].type.indexOf("image/")!==-1){var blob=items[i].getAsFile();var reader=new FileReader;reader.onload=function(e){g_clipboardBase.PasteImagesCounter++;g_clipboardBase.PasteImagesBody+='<img src="'+e.target.result+'"/>';if(g_clipboardBase.PasteImagesCounter==g_clipboardBase.PasteImagesCount){g_clipboardBase.CommonIframe_PasteStart("<html><body>"+g_clipboardBase.PasteImagesBody+"</body></html>");g_clipboardBase.PasteImagesBody="";g_clipboardBase.PasteImagesCounter=0;g_clipboardBase.PasteImagesCount=
|
|
|
|
"";g_clipboardBase.PasteImagesCount=items.length;g_clipboardBase.PasteImagesCounter=0;for(var i=0;i<items.length;++i)if(items[i].kind=="file"&&items[i].type.indexOf("image/")!==-1){var blob=items[i].getAsFile();var reader=new FileReader;reader.onload=function(e){g_clipboardBase.PasteImagesCounter++;g_clipboardBase.PasteImagesBody+='<img src="'+e.target.result+'"/>';if(g_clipboardBase.PasteImagesCounter==g_clipboardBase.PasteImagesCount){g_clipboardBase.CommonIframe_PasteStart("<html><body>"+g_clipboardBase.PasteImagesBody+
|
|
|
|
0}};reader.onabort=reader.onerror=function(e){g_clipboardBase.PasteImagesCounter++;if(g_clipboardBase.PasteImagesCounter==g_clipboardBase.PasteImagesCount){g_clipboardBase.CommonIframe_PasteStart("<html><body>"+g_clipboardBase.PasteImagesBody+"</body></html>");g_clipboardBase.PasteImagesBody="";g_clipboardBase.PasteImagesCounter=0;g_clipboardBase.PasteImagesCount=0}};try{reader.readAsDataURL(blob)}catch(err){g_clipboardBase.PasteImagesCounter++}}else g_clipboardBase.PasteImagesCounter++;if(g_clipboardBase.PasteImagesCounter==
|
|
|
|
"</body></html>");g_clipboardBase.PasteImagesBody="";g_clipboardBase.PasteImagesCounter=0;g_clipboardBase.PasteImagesCount=0}};reader.onabort=reader.onerror=function(e){g_clipboardBase.PasteImagesCounter++;if(g_clipboardBase.PasteImagesCounter==g_clipboardBase.PasteImagesCount){g_clipboardBase.CommonIframe_PasteStart("<html><body>"+g_clipboardBase.PasteImagesBody+"</body></html>");g_clipboardBase.PasteImagesBody="";g_clipboardBase.PasteImagesCounter=0;g_clipboardBase.PasteImagesCount=0}};try{reader.readAsDataURL(blob)}catch(err){g_clipboardBase.PasteImagesCounter++}}else g_clipboardBase.PasteImagesCounter++;
|
|
|
|
g_clipboardBase.PasteImagesCount)g_clipboardBase.Paste_End();return false}}g_clipboardBase.Paste_End();return false},_private_onbeforepaste:function(e,isAttackEmulate){this._console_log("onbeforepaste");if(!this.Api.asc_IsFocus(true))return;{this.CommonDiv=this.CommonDiv_Check();this.CommonDiv_Start();this.CommonDiv.focus();this.StartFocus();this.CommonDiv_Select();return}return false},_private_onbeforecopy_select:function(){if(AscBrowser.isIE){this._console_log("onbeforecopy_select");this.CommonDiv=
|
|
|
|
if(g_clipboardBase.PasteImagesCounter==g_clipboardBase.PasteImagesCount)g_clipboardBase.Paste_End();return false}}g_clipboardBase.Paste_End();return false},_private_onbeforepaste:function(e,isAttackEmulate){this._console_log("onbeforepaste");if(!this.Api.asc_IsFocus(true))return;{this.CommonDiv=this.CommonDiv_Check();this.CommonDiv_Start();this.CommonDiv.focus();this.StartFocus();this.CommonDiv_Select();return}return false},_private_onbeforecopy_select:function(){if(AscBrowser.isIE){this._console_log("onbeforecopy_select");
|
|
|
|
this.CommonDiv_Check();this.CommonDiv_Start();this.CommonDiv.innerHTML="<span> </span>";this.CommonDiv.focus();this.StartFocus();this.CommonDiv_Select()}},_private_onbeforecopy:function(e,isAttackEmulate){this._console_log("onbeforecopy");if(!this.Api.asc_IsFocus(true))return;{this.CommonDiv=this.CommonDiv_Check();this.CommonDiv_Start();this.CommonDiv.innerHTML="<span> </span>";this.CommonDiv.focus();this.StartFocus();this.CommonDiv_Select()}return false},Init:function(_api){this.Api=_api;window["AscCommon"].g_specialPasteHelper.Init(_api);
|
|
|
|
this.CommonDiv=this.CommonDiv_Check();this.CommonDiv_Start();this.CommonDiv.innerHTML="<span> </span>";this.CommonDiv.focus();this.StartFocus();this.CommonDiv_Select()}},_private_onbeforecopy:function(e,isAttackEmulate){this._console_log("onbeforecopy");if(!this.Api.asc_IsFocus(true))return;{this.CommonDiv=this.CommonDiv_Check();this.CommonDiv_Start();this.CommonDiv.innerHTML="<span> </span>";this.CommonDiv.focus();this.StartFocus();this.CommonDiv_Select()}return false},Init:function(_api){this.Api=
|
|
|
|
this.ClosureParams.getData=function(type){var _clipboard=this._e&&this._e.clipboardData?this._e.clipboardData:window.clipboardData;if(!_clipboard||!_clipboard.getData)return null;var _type=type;if(AscBrowser.isIE&&(type=="text"||type=="text/plain"))_type="Text";try{return _clipboard.getData(_type)}catch(e){}return null};this.ClosureParams.setData=function(type,_data){var _clipboard=this._e&&this._e.clipboardData?this._e.clipboardData:window.clipboardData;if(!_clipboard||!_clipboard.setData)return null;
|
|
|
|
_api;window["AscCommon"].g_specialPasteHelper.Init(_api);this.ClosureParams.getData=function(type){var _clipboard=this._e&&this._e.clipboardData?this._e.clipboardData:window.clipboardData;if(!_clipboard||!_clipboard.getData)return null;var _type=type;if(AscBrowser.isIE&&(type=="text"||type=="text/plain"))_type="Text";try{return _clipboard.getData(_type)}catch(e){}return null};this.ClosureParams.setData=function(type,_data){var _clipboard=this._e&&this._e.clipboardData?this._e.clipboardData:window.clipboardData;
|
|
|
|
var _type=type;if(AscBrowser.isIE&&(type=="text"||type=="text/plain"))_type="Text";try{_clipboard.setData(_type,_data)}catch(e){}};if(!AscBrowser.isIE){document.oncopy=function(e){return g_clipboardBase._private_oncopy(e)};document.oncut=function(e){return g_clipboardBase._private_oncut(e)};document.onpaste=function(e){return g_clipboardBase._private_onpaste(e)};document["onbeforecopy"]=function(e){return g_clipboardBase._private_onbeforecopy(e)};document["onbeforecut"]=function(e){return g_clipboardBase._private_onbeforecopy(e)};
|
|
|
|
if(!_clipboard||!_clipboard.setData)return null;var _type=type;if(AscBrowser.isIE&&(type=="text"||type=="text/plain"))_type="Text";try{_clipboard.setData(_type,_data)}catch(e){}};if(!AscBrowser.isIE){document.oncopy=function(e){return g_clipboardBase._private_oncopy(e)};document.oncut=function(e){return g_clipboardBase._private_oncut(e)};document.onpaste=function(e){return g_clipboardBase._private_onpaste(e)};document["onbeforecopy"]=function(e){return g_clipboardBase._private_onbeforecopy(e)};document["onbeforecut"]=
|
|
|
|
document["onbeforepaste"]=function(e){return g_clipboardBase._private_onbeforepaste(e)}}else{document.addEventListener("copy",function(e){return g_clipboardBase._private_oncopy(e)});document.addEventListener("cut",function(e){return g_clipboardBase._private_oncut(e)});document.addEventListener("paste",function(e){return g_clipboardBase._private_onpaste(e)});document.addEventListener("beforepaste",function(e){return g_clipboardBase._private_onbeforepaste(e)});document.addEventListener("beforecopy",
|
|
|
|
function(e){return g_clipboardBase._private_onbeforecopy(e)};document["onbeforepaste"]=function(e){return g_clipboardBase._private_onbeforepaste(e)}}else{document.addEventListener("copy",function(e){return g_clipboardBase._private_oncopy(e)});document.addEventListener("cut",function(e){return g_clipboardBase._private_oncut(e)});document.addEventListener("paste",function(e){return g_clipboardBase._private_onpaste(e)});document.addEventListener("beforepaste",function(e){return g_clipboardBase._private_onbeforepaste(e)});
|
|
|
|
function(e){return g_clipboardBase._private_onbeforecopy(e)});document.addEventListener("beforecut",function(e){return g_clipboardBase._private_onbeforecopy(e)})}if(this.IsCopyCutOnlyInEditable||this.IsPasteOnlyInEditable)document.onkeydown=function(e){if(!g_clipboardBase.Api.asc_IsFocus(true)||g_clipboardBase.Api.isLongAction())return;var isAltGr=AscCommon.getAltGr(e);if(isAltGr)return;var isCtrl=e.ctrlKey===true||e.metaKey===true;var isShift=e.shiftKey;var keyCode=e.keyCode;if(g_clipboardBase.IsCopyCutOnlyInEditable){var bIsBeforeCopyCutEmulate=
|
|
|
|
document.addEventListener("beforecopy",function(e){return g_clipboardBase._private_onbeforecopy(e)});document.addEventListener("beforecut",function(e){return g_clipboardBase._private_onbeforecopy(e)})}if(this.IsCopyCutOnlyInEditable||this.IsPasteOnlyInEditable)document.onkeydown=function(e){if(!g_clipboardBase.Api.asc_IsFocus(true)||g_clipboardBase.Api.isLongAction())return;var isAltGr=AscCommon.getAltGr(e);if(isAltGr)return;var isCtrl=e.ctrlKey===true||e.metaKey===true;var isShift=e.shiftKey;var keyCode=
|
|
|
|
false;var _cut=false;if(isCtrl&&!isShift&&(keyCode==67||keyCode==88))bIsBeforeCopyCutEmulate=true;if(!isCtrl&&isShift&&keyCode==45){bIsBeforeCopyCutEmulate=true;_cut=true}if(bIsBeforeCopyCutEmulate){g_clipboardBase._console_log("emulate_beforecopycut");var isEmulate=false;try{isEmulate=_cut?document.execCommand("beforecut"):document.execCommand("beforecopy")}catch(err){}g_clipboardBase._private_onbeforecopy(undefined,!isEmulate)}}if(g_clipboardBase.IsPasteOnlyInEditable){var bIsBeforePasteEmulate=
|
|
|
|
e.keyCode;if(g_clipboardBase.IsCopyCutOnlyInEditable){var bIsBeforeCopyCutEmulate=false;var _cut=false;if(isCtrl&&!isShift&&(keyCode==67||keyCode==88))bIsBeforeCopyCutEmulate=true;if(!isCtrl&&isShift&&keyCode==45){bIsBeforeCopyCutEmulate=true;_cut=true}if(bIsBeforeCopyCutEmulate){g_clipboardBase._console_log("emulate_beforecopycut");var isEmulate=false;try{isEmulate=_cut?document.execCommand("beforecut"):document.execCommand("beforecopy")}catch(err){}g_clipboardBase._private_onbeforecopy(undefined,
|
|
|
|
false;if(isCtrl&&!isShift&&keyCode==86)bIsBeforePasteEmulate=true;if(!isCtrl&&isShift&&keyCode==45)bIsBeforePasteEmulate=true;if(bIsBeforePasteEmulate){g_clipboardBase._console_log("emulate_beforepaste");var isEmulate=false;try{isEmulate=document.execCommand("beforepaste")}catch(err$9){}g_clipboardBase._private_onbeforepaste(undefined,!isEmulate)}}};if(AscBrowser.isSafari&&false){this.CommonDiv=this.CommonDiv_Check();setInterval(function(){if(g_clipboardBase.Api.asc_IsFocus(true))g_clipboardBase.CommonDiv.focus()},
|
|
|
|
!isEmulate)}}if(g_clipboardBase.IsPasteOnlyInEditable){var bIsBeforePasteEmulate=false;if(isCtrl&&!isShift&&keyCode==86)bIsBeforePasteEmulate=true;if(!isCtrl&&isShift&&keyCode==45)bIsBeforePasteEmulate=true;if(bIsBeforePasteEmulate){g_clipboardBase._console_log("emulate_beforepaste");var isEmulate=false;try{isEmulate=document.execCommand("beforepaste")}catch(err$9){}g_clipboardBase._private_onbeforepaste(undefined,!isEmulate)}}};if(AscBrowser.isSafari&&false){this.CommonDiv=this.CommonDiv_Check();
|
|
|
|
100)}},IsWorking:function(){return this.CopyFlag||this.PasteFlag?true:false},StartFocus:function(){this.EndFocus(false);this.CopyPasteFocus=true;this.CopyPasteFocusTimer=setTimeout(function(){g_clipboardBase.EndFocus()},1E3)},EndFocus:function(isFocusToEditor){this.CopyPasteFocus=false;if(-1!=this.CopyPasteFocusTimer){clearTimeout(this.CopyPasteFocusTimer);this.CopyPasteFocusTimer=-1;if(false!==isFocusToEditor&&null!=this.inputContext)if(this.inputContext.HtmlArea)this.inputContext.HtmlArea.focus()}},
|
|
|
|
setInterval(function(){if(g_clipboardBase.Api.asc_IsFocus(true))g_clipboardBase.CommonDiv.focus()},100)}},IsWorking:function(){return this.CopyFlag||this.PasteFlag?true:false},StartFocus:function(){this.EndFocus(false);this.CopyPasteFocus=true;this.CopyPasteFocusTimer=setTimeout(function(){g_clipboardBase.EndFocus()},1E3)},EndFocus:function(isFocusToEditor){this.CopyPasteFocus=false;if(-1!=this.CopyPasteFocusTimer){clearTimeout(this.CopyPasteFocusTimer);this.CopyPasteFocusTimer=-1;if(false!==isFocusToEditor&&
|
|
|
|
IsFocus:function(){return this.CopyPasteFocus},CommonDiv_Check:function(){var ElemToSelect=document.getElementById(this.CommonDivId);if(!ElemToSelect){ElemToSelect=document.createElement("div");ElemToSelect.id=this.CommonDivId;ElemToSelect.className=this.CommonDivClassName;ElemToSelect.style.position="fixed";ElemToSelect.style.left="0px";ElemToSelect.style.top="-100px";ElemToSelect.style.width="10000px";ElemToSelect.style.height="100px";ElemToSelect.style.overflow="hidden";ElemToSelect.style.zIndex=
|
|
|
|
null!=this.inputContext)if(this.inputContext.HtmlArea)this.inputContext.HtmlArea.focus()}},IsFocus:function(){return this.CopyPasteFocus},CommonDiv_Check:function(){var ElemToSelect=document.getElementById(this.CommonDivId);if(!ElemToSelect){ElemToSelect=document.createElement("div");ElemToSelect.id=this.CommonDivId;ElemToSelect.className=this.CommonDivClassName;ElemToSelect.style.position="fixed";ElemToSelect.style.left="0px";ElemToSelect.style.top="-100px";ElemToSelect.style.width="10000px";ElemToSelect.style.height=
|
|
|
|
-1E3;ElemToSelect.style.MozUserSelect="text";ElemToSelect.style.fontFamily="onlyofficeDefaultFont";ElemToSelect.style.fontSize="11pt";ElemToSelect.style.color="black";ElemToSelect.style["-khtml-user-select"]="text";ElemToSelect.style["-o-user-select"]="text";ElemToSelect.style["user-select"]="text";ElemToSelect.style["-webkit-user-select"]="text";ElemToSelect.setAttribute("contentEditable",this.isCopyOutEnabled());var _parent=""==this.CommonDivIdParent?document.body:document.getElementById(this.CommonDivIdParent);
|
|
|
|
"100px";ElemToSelect.style.overflow="hidden";ElemToSelect.style.zIndex=-1E3;ElemToSelect.style.MozUserSelect="text";ElemToSelect.style.fontFamily="onlyofficeDefaultFont";ElemToSelect.style.fontSize="11pt";ElemToSelect.style.color="black";ElemToSelect.style["-khtml-user-select"]="text";ElemToSelect.style["-o-user-select"]="text";ElemToSelect.style["user-select"]="text";ElemToSelect.style["-webkit-user-select"]="text";ElemToSelect.setAttribute("contentEditable",this.isCopyOutEnabled());var _parent=
|
|
|
|
_parent.appendChild(ElemToSelect)}else ElemToSelect.setAttribute("contentEditable",this.isCopyOutEnabled());return ElemToSelect},CommonDiv_Select:function(){var ElemToSelect=this.CommonDiv;if(window.getSelection){var selection=window.getSelection();var rangeToSelect=document.createRange();var is_gecko=AscBrowser.isGecko;if(is_gecko){ElemToSelect.appendChild(document.createTextNode("\u00a0"));ElemToSelect.insertBefore(document.createTextNode("\u00a0"),ElemToSelect.firstChild);rangeToSelect.setStartAfter(ElemToSelect.firstChild);
|
|
|
|
""==this.CommonDivIdParent?document.body:document.getElementById(this.CommonDivIdParent);_parent.appendChild(ElemToSelect)}else ElemToSelect.setAttribute("contentEditable",this.isCopyOutEnabled());return ElemToSelect},CommonDiv_Select:function(){var ElemToSelect=this.CommonDiv;if(window.getSelection){var selection=window.getSelection();var rangeToSelect=document.createRange();var is_gecko=AscBrowser.isGecko;if(is_gecko){ElemToSelect.appendChild(document.createTextNode("\u00a0"));ElemToSelect.insertBefore(document.createTextNode("\u00a0"),
|
|
|
|
rangeToSelect.setEndBefore(ElemToSelect.lastChild)}else{var aChildNodes=ElemToSelect.childNodes;if(aChildNodes.length==1){var elem=aChildNodes[0];var wrap=document.createElement("b");wrap.setAttribute("style","font-weight:normal; background-color: transparent; color: transparent;");elem=ElemToSelect.removeChild(elem);wrap.appendChild(elem);ElemToSelect.appendChild(wrap)}rangeToSelect.selectNodeContents(ElemToSelect)}selection.removeAllRanges();selection.addRange(rangeToSelect)}else if(document.body.createTextRange){var rangeToSelect=
|
|
|
|
ElemToSelect.firstChild);rangeToSelect.setStartAfter(ElemToSelect.firstChild);rangeToSelect.setEndBefore(ElemToSelect.lastChild)}else{var aChildNodes=ElemToSelect.childNodes;if(aChildNodes.length==1){var elem=aChildNodes[0];var wrap=document.createElement("b");wrap.setAttribute("style","font-weight:normal; background-color: transparent; color: transparent;");elem=ElemToSelect.removeChild(elem);wrap.appendChild(elem);ElemToSelect.appendChild(wrap)}rangeToSelect.selectNodeContents(ElemToSelect)}selection.removeAllRanges();
|
|
|
|
document.body.createTextRange();rangeToSelect.moveToElementText(ElemToSelect);rangeToSelect.select()}},CommonDiv_Start:function(){this.ClosureParams.overflowBody=document.body.style.overflow;document.body.style.overflow="hidden";this.ClosureParams.backgroundcolorBody=document.body.style["background-color"];document.body.style["background-color"]="transparent";var ElemToSelect=this.CommonDiv;ElemToSelect.style.display="block";while(ElemToSelect.hasChildNodes())ElemToSelect.removeChild(ElemToSelect.lastChild);
|
|
|
|
selection.addRange(rangeToSelect)}else if(document.body.createTextRange){var rangeToSelect=document.body.createTextRange();rangeToSelect.moveToElementText(ElemToSelect);rangeToSelect.select()}},CommonDiv_Start:function(){this.ClosureParams.overflowBody=document.body.style.overflow;document.body.style.overflow="hidden";this.ClosureParams.backgroundcolorBody=document.body.style["background-color"];document.body.style["background-color"]="transparent";var ElemToSelect=this.CommonDiv;ElemToSelect.style.display=
|
|
|
|
document.body.style.MozUserSelect="text";delete document.body.style["-khtml-user-select"];delete document.body.style["-o-user-select"];delete document.body.style["user-select"];document.body.style["-webkit-user-select"]="text";ElemToSelect.style.MozUserSelect="all"},CommonDiv_End:function(){var ElemToSelect=this.CommonDiv;if(ElemToSelect){ElemToSelect.style.display=AscBrowser.isSafari?"block":"none";ElemToSelect.style.MozUserSelect="none"}document.body.style.MozUserSelect="none";document.body.style["-khtml-user-select"]=
|
|
|
|
"block";while(ElemToSelect.hasChildNodes())ElemToSelect.removeChild(ElemToSelect.lastChild);document.body.style.MozUserSelect="text";delete document.body.style["-khtml-user-select"];delete document.body.style["-o-user-select"];delete document.body.style["user-select"];document.body.style["-webkit-user-select"]="text";ElemToSelect.style.MozUserSelect="all"},CommonDiv_End:function(){var ElemToSelect=this.CommonDiv;if(ElemToSelect){ElemToSelect.style.display=AscBrowser.isSafari?"block":"none";ElemToSelect.style.MozUserSelect=
|
|
|
|
"none";document.body.style["-o-user-select"]="none";document.body.style["user-select"]="none";document.body.style["-webkit-user-select"]="none";document.body.style["background-color"]=this.ClosureParams.backgroundcolorBody;document.body.style.overflow=this.ClosureParams.overflowBody;this.CopyFlag=false;this.bCut=false;this.EndFocus()},CommonDiv_Copy:function(){this.CopyFlag=true;this.CommonDiv=this.CommonDiv_Check();this.CommonDiv_Start();this.ClosureParams.isDivCopy=true;this.DivOnCopyHtmlPresent=
|
|
|
|
"none"}document.body.style.MozUserSelect="none";document.body.style["-khtml-user-select"]="none";document.body.style["-o-user-select"]="none";document.body.style["user-select"]="none";document.body.style["-webkit-user-select"]="none";document.body.style["background-color"]=this.ClosureParams.backgroundcolorBody;document.body.style.overflow=this.ClosureParams.overflowBody;this.CopyFlag=false;this.bCut=false;this.EndFocus()},CommonDiv_Copy:function(){this.CopyFlag=true;this.CommonDiv=this.CommonDiv_Check();
|
|
|
|
false;this.DivOnCopyText="";this.LastCopyBinary=null;this.checkCopy(AscCommon.c_oAscClipboardDataFormat.Text|AscCommon.c_oAscClipboardDataFormat.Html|AscCommon.c_oAscClipboardDataFormat.Internal);this.ClosureParams.isDivCopy=false;if(!this.DivOnCopyHtmlPresent&&this.DivOnCopyText!="")this.CommonDiv.innerHTML=this.DivOnCopyText;this.DivOnCopyHtmlPresent=false;this.DivOnCopyText="";this.CommonDiv_Select();window.setTimeout(function(){g_clipboardBase.CommonDiv_End()},0)},CommonDiv_Execute_CopyCut:function(){if(this.IsCopyCutOnlyInEditable)this._private_onbeforecopy(undefined,
|
|
|
|
this.CommonDiv_Start();this.ClosureParams.isDivCopy=true;this.DivOnCopyHtmlPresent=false;this.DivOnCopyText="";this.LastCopyBinary=null;this.checkCopy(AscCommon.c_oAscClipboardDataFormat.Text|AscCommon.c_oAscClipboardDataFormat.Html|AscCommon.c_oAscClipboardDataFormat.Internal);this.ClosureParams.isDivCopy=false;if(!this.DivOnCopyHtmlPresent&&this.DivOnCopyText!="")this.CommonDiv.innerHTML=this.DivOnCopyText;this.DivOnCopyHtmlPresent=false;this.DivOnCopyText="";this.CommonDiv_Select();window.setTimeout(function(){g_clipboardBase.CommonDiv_End()},
|
|
|
|
true)},CommonIframe_PasteStart:function(_html_data,text_data){var ifr=document.getElementById(this.CommonIframeId);if(!ifr){ifr=document.createElement("iframe");ifr.name=this.CommonIframeId;ifr.id=this.CommonIframeId;ifr.style.position="absolute";ifr.style.top="-100px";ifr.style.left="0px";ifr.style.width="10000px";ifr.style.height="100px";ifr.style.overflow="hidden";ifr.style.zIndex=-1E3;ifr.setAttribute("sandbox","allow-same-origin");document.body.appendChild(ifr);this.CommonIframe=ifr}else ifr.style.width=
|
|
|
|
0)},CommonDiv_Execute_CopyCut:function(){if(this.IsCopyCutOnlyInEditable)this._private_onbeforecopy(undefined,true)},CommonIframe_PasteStart:function(_html_data,text_data){var ifr=document.getElementById(this.CommonIframeId);if(!ifr){ifr=document.createElement("iframe");ifr.name=this.CommonIframeId;ifr.id=this.CommonIframeId;ifr.style.position="absolute";ifr.style.top="-100px";ifr.style.left="0px";ifr.style.width="10000px";ifr.style.height="100px";ifr.style.overflow="hidden";ifr.style.zIndex=-1E3;
|
|
|
|
"10000px";var frameWindow=window.frames[this.CommonIframeId];if(frameWindow){frameWindow.document.open();frameWindow.document.write(_html_data);frameWindow.document.close();if(null!=frameWindow.document&&null!=frameWindow.document.body){ifr.style.display="block";this.pastedFrom=definePastedFrom(frameWindow.document);this.Api.asc_PasteData(AscCommon.c_oAscClipboardDataFormat.HtmlElement,frameWindow.document.body,ifr,text_data)}}ifr.style.width="100px";g_clipboardBase.Paste_End()},CommonIframe_PasteEnd:function(){if(this.CommonIframe&&
|
|
|
|
ifr.setAttribute("sandbox","allow-same-origin");document.body.appendChild(ifr);this.CommonIframe=ifr}else ifr.style.width="10000px";var frameWindow=window.frames[this.CommonIframeId];if(frameWindow){frameWindow.document.open();frameWindow.document.write(_html_data);frameWindow.document.close();if(null!=frameWindow.document&&null!=frameWindow.document.body){ifr.style.display="block";this.pastedFrom=definePastedFrom(frameWindow.document);this.Api.asc_PasteData(AscCommon.c_oAscClipboardDataFormat.HtmlElement,
|
|
|
|
this.CommonIframe.style.display!="none"){this.CommonIframe.blur();this.CommonIframe.style.display="none"}},Paste_End:function(){this.CommonIframe_PasteEnd();this.Api.decrementCounterLongAction();this.PasteFlag=false;this.EndFocus();if(this.needClearBuffer){this.ClearBuffer();this.needClearBuffer=false}},pushData:function(_format,_data){if(null==this.LastCopyBinary)this.LastCopyBinary=[];this.LastCopyBinary.push({type:_format,data:_data});if(this.ClosureParams.isDivCopy===true){if(!this.isCopyOutEnabled())return;
|
|
|
|
frameWindow.document.body,ifr,text_data)}}ifr.style.width="100px";g_clipboardBase.Paste_End()},CommonIframe_PasteEnd:function(){if(this.CommonIframe&&this.CommonIframe.style.display!="none"){this.CommonIframe.blur();this.CommonIframe.style.display="none"}},Paste_End:function(){this.CommonIframe_PasteEnd();this.Api.decrementCounterLongAction();this.PasteFlag=false;this.EndFocus();if(this.needClearBuffer){this.ClearBuffer();this.needClearBuffer=false}},pushData:function(_format,_data){if(null==this.LastCopyBinary)this.LastCopyBinary=
|
|
|
|
if(_format==AscCommon.c_oAscClipboardDataFormat.Html){this.CommonDiv.innerHTML=_data;this.DivOnCopyHtmlPresent=true}if(_format==AscCommon.c_oAscClipboardDataFormat.Text)this.DivOnCopyText=_data;return}var _data_format="";switch(_format){case AscCommon.c_oAscClipboardDataFormat.Html:_data_format="text/html";break;case AscCommon.c_oAscClipboardDataFormat.Text:_data_format="text/plain";break;case AscCommon.c_oAscClipboardDataFormat.Internal:_data_format="text/x-custom";break;default:break}if(_data_format!=
|
|
|
|
[];this.LastCopyBinary.push({type:_format,data:_data});if(this.ClosureParams.isDivCopy===true){if(!this.isCopyOutEnabled())return;if(_format==AscCommon.c_oAscClipboardDataFormat.Html){this.CommonDiv.innerHTML=_data;this.DivOnCopyHtmlPresent=true}if(_format==AscCommon.c_oAscClipboardDataFormat.Text)this.DivOnCopyText=_data;return}var _data_format="";switch(_format){case AscCommon.c_oAscClipboardDataFormat.Html:_data_format="text/html";break;case AscCommon.c_oAscClipboardDataFormat.Text:_data_format=
|
|
|
|
""&&_data!==null&&this.isCopyOutEnabled())if(_data_format=="text/x-custom")this.ClosureParams.setData(_data_format,"asc_internalData2;"+_data);else this.ClosureParams.setData(_data_format,_data)},Button_Copy:function(){if(this.inputContext){if(this.inputContext.isHardCheckKeyboard)this.inputContext.enableVirtualKeyboard_Hard();this.inputContext.HtmlArea.focus()}this.Api.asc_enableKeyEvents(true,true);this.CommonDiv_Execute_CopyCut();var _ret=false;try{_ret=document.execCommand("copy")}catch(err){_ret=
|
|
|
|
"text/plain";break;case AscCommon.c_oAscClipboardDataFormat.Internal:_data_format="text/x-custom";break;default:break}if(_data_format!=""&&_data!==null&&this.isCopyOutEnabled())if(_data_format=="text/x-custom")this.ClosureParams.setData(_data_format,"asc_internalData2;"+_data);else this.ClosureParams.setData(_data_format,_data)},Button_Copy:function(){if(this.inputContext){if(this.inputContext.isHardCheckKeyboard)this.inputContext.enableVirtualKeyboard_Hard();this.inputContext.HtmlArea.focus()}this.Api.asc_enableKeyEvents(true,
|
|
|
|
false}if(!_ret){this.LastCopyBinary=null;this.checkCopy(AscCommon.c_oAscClipboardDataFormat.Text|AscCommon.c_oAscClipboardDataFormat.Html|AscCommon.c_oAscClipboardDataFormat.Internal)}return _ret},Button_Cut:function(){if(this.inputContext){if(this.inputContext.isHardCheckKeyboard)this.inputContext.enableVirtualKeyboard_Hard();this.inputContext.HtmlArea.focus()}this.Api.asc_enableKeyEvents(true,true);this.CommonDiv_Execute_CopyCut();var _ret=false;try{_ret=document.execCommand("cut")}catch(err){_ret=
|
|
|
|
true);this.CommonDiv_Execute_CopyCut();var _ret=false;try{_ret=document.execCommand("copy")}catch(err){_ret=false}if(!_ret){this.LastCopyBinary=null;this.checkCopy(AscCommon.c_oAscClipboardDataFormat.Text|AscCommon.c_oAscClipboardDataFormat.Html|AscCommon.c_oAscClipboardDataFormat.Internal)}return _ret},Button_Cut:function(){if(this.inputContext){if(this.inputContext.isHardCheckKeyboard)this.inputContext.enableVirtualKeyboard_Hard();this.inputContext.HtmlArea.focus()}this.Api.asc_enableKeyEvents(true,
|
|
|
|
false}if(!_ret){this.LastCopyBinary=null;this.bCut=true;this.checkCopy(AscCommon.c_oAscClipboardDataFormat.Text|AscCommon.c_oAscClipboardDataFormat.Html|AscCommon.c_oAscClipboardDataFormat.Internal);this.Api.asc_SelectionCut();this.bCut=false}return _ret},Button_Paste:function(){if(this.inputContext){if(this.inputContext.isHardCheckKeyboard)this.inputContext.enableVirtualKeyboard_Hard();this.inputContext.HtmlArea.focus()}this.Api.asc_enableKeyEvents(true,true);var _ret=false;try{_ret=document.execCommand("paste")}catch(err){_ret=
|
|
|
|
true);this.CommonDiv_Execute_CopyCut();var _ret=false;try{_ret=document.execCommand("cut")}catch(err){_ret=false}if(!_ret){this.LastCopyBinary=null;this.bCut=true;this.checkCopy(AscCommon.c_oAscClipboardDataFormat.Text|AscCommon.c_oAscClipboardDataFormat.Html|AscCommon.c_oAscClipboardDataFormat.Internal);this.Api.asc_SelectionCut();this.bCut=false}return _ret},Button_Paste:function(){if(this.inputContext){if(this.inputContext.isHardCheckKeyboard)this.inputContext.enableVirtualKeyboard_Hard();this.inputContext.HtmlArea.focus()}this.Api.asc_enableKeyEvents(true,
|
|
|
|
false}if(!_ret&&null!=this.LastCopyBinary){var _data=null;var _isInternal=false;for(var i=0;i<this.LastCopyBinary.length;i++)if(c_oAscClipboardDataFormat.Internal==this.LastCopyBinary[i].type){this.Api.asc_PasteData(AscCommon.c_oAscClipboardDataFormat.Internal,this.LastCopyBinary[i].data);_isInternal=true}if(!_isInternal&&this.LastCopyBinary.length>0)this.Api.asc_PasteData(this.LastCopyBinary[0].type,this.LastCopyBinary[0].data)}return _ret},ClearBuffer:function(){if(-1!=this.clearBufferTimerId)clearTimeout(this.clearBufferTimerId);
|
|
|
|
true);var _ret=false;try{_ret=document.execCommand("paste")}catch(err){_ret=false}if(!_ret&&null!=this.LastCopyBinary){var _data=null;var _isInternal=false;for(var i=0;i<this.LastCopyBinary.length;i++)if(c_oAscClipboardDataFormat.Internal==this.LastCopyBinary[i].type){this.Api.asc_PasteData(AscCommon.c_oAscClipboardDataFormat.Internal,this.LastCopyBinary[i].data);_isInternal=true}if(!_isInternal&&this.LastCopyBinary.length>0)this.Api.asc_PasteData(this.LastCopyBinary[0].type,this.LastCopyBinary[0].data)}return _ret},
|
|
|
|
this.clearBufferTimerId=setTimeout(function(){if(AscCommon.g_clipboardBase)AscCommon.g_clipboardBase.clearBufferTimerId=-1},500);this.Button_Copy()},isCopyOutEnabled:function(){if(this.Api&&this.Api.isCopyOutEnabled)return this.Api.isCopyOutEnabled();return true}};function definePastedFrom(doc){if(!doc)return null;var res=null;var metaTags=doc.getElementsByTagName("meta");for(var i=0;i<metaTags.length;i++)if("ProgId"===metaTags[i].getAttribute("name")){var content=metaTags[i].getAttribute("content");
|
|
|
|
ClearBuffer:function(){if(-1!=this.clearBufferTimerId)clearTimeout(this.clearBufferTimerId);this.clearBufferTimerId=setTimeout(function(){if(AscCommon.g_clipboardBase)AscCommon.g_clipboardBase.clearBufferTimerId=-1},500);this.Button_Copy()},isCopyOutEnabled:function(){if(this.Api&&this.Api.isCopyOutEnabled)return this.Api.isCopyOutEnabled();return true}};function definePastedFrom(doc){if(!doc)return null;var res=null;var metaTags=doc.getElementsByTagName("meta");for(var i=0;i<metaTags.length;i++)if("ProgId"===
|
|
|
|
if(null!==content)if(content.startsWith("Word"))res=c_oClipboardPastedFrom.Word;else if(content.startsWith("Excel"))res=c_oClipboardPastedFrom.Excel;else if(content.startsWith("PowerPoint"))res=c_oClipboardPastedFrom.PowerPoint}return res}function CSpecialPasteHelper(){this.Api=null;this.specialPasteData={};this.specialPasteProps=null;this.showSpecialPasteButton=false;this.buttonInfo=new Asc.SpecialPasteShowOptions;this.specialPasteStart=false;this.pasteStart=false;this.bIsEndTransaction=false;this.showButtonIdParagraph=
|
|
|
|
metaTags[i].getAttribute("name")){var content=metaTags[i].getAttribute("content");if(null!==content)if(content.startsWith("Word"))res=c_oClipboardPastedFrom.Word;else if(content.startsWith("Excel"))res=c_oClipboardPastedFrom.Excel;else if(content.startsWith("PowerPoint"))res=c_oClipboardPastedFrom.PowerPoint}return res}function CSpecialPasteHelper(){this.Api=null;this.specialPasteData={};this.specialPasteProps=null;this.showSpecialPasteButton=false;this.buttonInfo=new Asc.SpecialPasteShowOptions;
|
|
|
|
null;this.endRecalcDocument=false;this.doNotShowButton=false;this.visiblePasteButton=true;this.selectionRange=null;this.isAppliedOperation=false;this._formulaError=null}CSpecialPasteHelper.prototype={Init:function(_api){this.Api=_api},Special_Paste:function(props){this.Api.asc_SpecialPasteData(props);return true},Clean_SpecialPasteObj:function(){this.specialPasteData={}},Special_Paste_Start:function(){this.specialPasteStart=true;if(g_clipboardBase.CommonIframe&&g_clipboardBase.CommonIframe.style.display!=
|
|
|
|
this.specialPasteStart=false;this.pasteStart=false;this.bIsEndTransaction=false;this.showButtonIdParagraph=null;this.endRecalcDocument=false;this.doNotShowButton=false;this.visiblePasteButton=true;this.selectionRange=null;this.isAppliedOperation=false;this._formulaError=null}CSpecialPasteHelper.prototype={Init:function(_api){this.Api=_api},Special_Paste:function(props){this.Api.asc_SpecialPasteData(props);return true},Clean_SpecialPasteObj:function(){this.specialPasteData={}},Special_Paste_Start:function(){this.specialPasteStart=
|
|
|
|
"block")g_clipboardBase.CommonIframe.style.display="block"},Special_Paste_End:function(){this.specialPasteStart=false;if(g_clipboardBase.CommonIframe&&g_clipboardBase.CommonIframe.style.display!="none")g_clipboardBase.CommonIframe.style.display="none"},Paste_Process_Start:function(doNotShowButton){if(doNotShowButton)this.Special_Paste_Hide_Button();this.pasteStart=true;this._formulaError=null;AscFonts.IsCheckSymbols=true},Special_Paste_Hide_Button:function(){this.doNotShowButton=true},Paste_Process_End:function(checkEnd){if(!this.Api)return;
|
|
|
|
true;if(g_clipboardBase.CommonIframe&&g_clipboardBase.CommonIframe.style.display!="block")g_clipboardBase.CommonIframe.style.display="block"},Special_Paste_End:function(){this.specialPasteStart=false;if(g_clipboardBase.CommonIframe&&g_clipboardBase.CommonIframe.style.display!="none")g_clipboardBase.CommonIframe.style.display="none"},Paste_Process_Start:function(doNotShowButton){if(doNotShowButton)this.Special_Paste_Hide_Button();this.pasteStart=true;this._formulaError=null;AscFonts.IsCheckSymbols=
|
|
|
|
AscFonts.IsCheckSymbols=false;this.pasteStart=false;this.specialPasteProps=null;this.bSaveFormat=false;if(this.specialPasteStart){this.Special_Paste_End();if(!this.buttonInfo.isClean()){this.buttonInfo.asc_setOptions(null);this.Api.asc_ShowSpecialPasteButton(this.buttonInfo)}}else this.SpecialPasteButton_Show();if(!checkEnd||checkEnd&&this.endRecalcDocument)this.doNotShowButton=false;if(this.bIsEndTransaction){this.bIsEndTransaction=false;History.EndTransaction()}var _logicDoc=this.Api&&this.Api.WordControl?
|
|
|
|
true},Special_Paste_Hide_Button:function(){this.doNotShowButton=true},Paste_Process_End:function(checkEnd){if(!this.Api)return;AscFonts.IsCheckSymbols=false;this.pasteStart=false;this.specialPasteProps=null;this.bSaveFormat=false;if(this.specialPasteStart){this.Special_Paste_End();if(!this.buttonInfo.isClean()){this.buttonInfo.asc_setOptions(null);this.Api.asc_ShowSpecialPasteButton(this.buttonInfo)}}else this.SpecialPasteButton_Show();if(!checkEnd||checkEnd&&this.endRecalcDocument)this.doNotShowButton=
|
|
|
|
this.Api.WordControl.m_oLogicDocument:null;if(_logicDoc&&_logicDoc.Action&&_logicDoc.Action.Start&&this.Api._finalizeAction)this.Api._finalizeAction()},SpecialPasteButton_Show:function(){if(!this.Api||this.doNotShowButton||!this.visiblePasteButton)return;if(this.CheckFastCoEditing())return;var props=this.buttonInfo;if(props&&props.options)if(window["Asc"]&&window["Asc"]["editor"]||props.cellCoord){this.showSpecialPasteButton=true;this.Api.asc_ShowSpecialPasteButton(props)}},SpecialPasteButtonById_Show:function(){if(!this.pasteStart)this.endRecalcDocument=
|
|
|
|
false;if(this.bIsEndTransaction){this.bIsEndTransaction=false;History.EndTransaction()}var _logicDoc=this.Api&&this.Api.WordControl?this.Api.WordControl.m_oLogicDocument:null;if(_logicDoc&&_logicDoc.Action&&_logicDoc.Action.Start&&this.Api._finalizeAction)this.Api._finalizeAction()},SpecialPasteButton_Show:function(){if(!this.Api||this.doNotShowButton||!this.visiblePasteButton)return;if(this.CheckFastCoEditing())return;var props=this.buttonInfo;if(props&&props.options)if(window["Asc"]&&window["Asc"]["editor"]||
|
|
|
|
true;if(!this.showButtonIdParagraph||this.pasteStart)return;if(!this.Api||!this.Api.asc_specialPasteShowButton||this.doNotShowButton||!this.visiblePasteButton){if(this.doNotShowButton)this.showButtonIdParagraph=null;this.doNotShowButton=false;return}if(this.Api.asc_specialPasteShowButton())this.showSpecialPasteButton=true},SpecialPasteButton_Hide:function(needClean){if(!this.Api)return;if(this.showSpecialPasteButton){this.showSpecialPasteButton=false;this.CleanButtonInfo();this.Api.asc_HideSpecialPasteButton()}else if(needClean)this.CleanButtonInfo()},
|
|
|
|
props.cellCoord){this.showSpecialPasteButton=true;this.Api.asc_ShowSpecialPasteButton(props)}},SpecialPasteButtonById_Show:function(){if(!this.pasteStart)this.endRecalcDocument=true;if(!this.showButtonIdParagraph||this.pasteStart)return;if(!this.Api||!this.Api.asc_specialPasteShowButton||this.doNotShowButton||!this.visiblePasteButton){if(this.doNotShowButton)this.showButtonIdParagraph=null;this.doNotShowButton=false;return}if(this.Api.asc_specialPasteShowButton())this.showSpecialPasteButton=true},
|
|
|
|
SpecialPasteButton_Update_Position:function(){if(!this.Api||!this.buttonInfo||this.buttonInfo.isClean())return;if(this.showSpecialPasteButton&&!this.pasteStart)this.Api.asc_UpdateSpecialPasteButton()},CheckFastCoEditing:function(){if(!this.Api)return false;var res=false;var bFast=false;var bIsSingleUser=false;if(this.Api.collaborativeEditing){bFast=this.Api.collaborativeEditing.m_bFast;bIsSingleUser=!this.Api.collaborativeEditing.getCollaborativeEditing()}else{bFast=AscCommon.CollaborativeEditing.m_bFast;
|
|
|
|
SpecialPasteButton_Hide:function(needClean){if(!this.Api)return;if(this.showSpecialPasteButton){this.showSpecialPasteButton=false;this.CleanButtonInfo();this.Api.asc_HideSpecialPasteButton()}else if(needClean)this.CleanButtonInfo()},SpecialPasteButton_Update_Position:function(){if(!this.Api||!this.buttonInfo||this.buttonInfo.isClean())return;if(this.showSpecialPasteButton&&!this.pasteStart)this.Api.asc_UpdateSpecialPasteButton()},CheckFastCoEditing:function(){if(!this.Api)return false;var res=false;
|
|
|
|
bIsSingleUser=AscCommon.CollaborativeEditing.Is_SingleUser()}if(bFast&&!bIsSingleUser)res=true;return res},CleanButtonInfo:function(){this.buttonInfo.clean()},GetPastedData:function(bText){if(bText&&this.specialPasteData.text_data)return this.specialPasteData.text_data;return this.specialPasteData.data1},setVisiblePasteButton:function(val){this.visiblePasteButton=val;if(!val)this.SpecialPasteButton_Hide()}};var g_clipboardBase=new CClipboardBase;window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].g_clipboardBase=
|
|
|
|
var bFast=false;var bIsSingleUser=false;if(this.Api.collaborativeEditing){bFast=this.Api.collaborativeEditing.m_bFast;bIsSingleUser=!this.Api.collaborativeEditing.getCollaborativeEditing()}else{bFast=AscCommon.CollaborativeEditing.m_bFast;bIsSingleUser=AscCommon.CollaborativeEditing.Is_SingleUser()}if(bFast&&!bIsSingleUser)res=true;return res},CleanButtonInfo:function(){this.buttonInfo.clean()},GetPastedData:function(bText){if(bText&&this.specialPasteData.text_data)return this.specialPasteData.text_data;
|
|
|
|
g_clipboardBase;var g_specialPasteHelper=new CSpecialPasteHelper;window["AscCommon"].g_specialPasteHelper=g_specialPasteHelper})(window);window["asc_desktop_copypaste"]=function(_api,_method){var bIsFocus=_api.asc_IsFocus();if(!bIsFocus)_api.asc_enableKeyEvents(true);window["AscDesktopEditor"][_method]();if(!bIsFocus)_api.asc_enableKeyEvents(false)};"use strict";(function(window,undefined){window["AscInputMethod"]=window["AscInputMethod"]||{};function CKeyboardEventWrapper(e){this.altKey=e.altKey;
|
|
|
|
return this.specialPasteData.data1},setVisiblePasteButton:function(val){this.visiblePasteButton=val;if(!val)this.SpecialPasteButton_Hide()}};var g_clipboardBase=new CClipboardBase;window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].g_clipboardBase=g_clipboardBase;var g_specialPasteHelper=new CSpecialPasteHelper;window["AscCommon"].g_specialPasteHelper=g_specialPasteHelper})(window);window["asc_desktop_copypaste"]=function(_api,_method){var bIsFocus=_api.asc_IsFocus();if(!bIsFocus)_api.asc_enableKeyEvents(true);
|
|
|
|
this.ctrlKey=e.ctrlKey;this.metaKey=e.metaKey;this.shiftKey=e.shiftKey;this.charCode=e.charCode;this.keyCode=e.keyCode;this.which=e.which;this.code=e.code;this.key=e.key;this.srcElement=e.srcElement;this.target=e.target;this._isDefaultPrevented=false}CKeyboardEventWrapper.prototype={preventDefault:function(){this._isDefaultPrevented=true},stopPropagation:function(){}};function CTextInput(api){this.Api=api;this.TargetId=null;this.HtmlDiv=null;this.TextArea_Not_ContentEditableDiv=true;this.HtmlArea=
|
|
|
|
window["AscDesktopEditor"][_method]();if(!bIsFocus)_api.asc_enableKeyEvents(false)};"use strict";(function(window,undefined){window["AscInputMethod"]=window["AscInputMethod"]||{};function CKeyboardEventWrapper(e){this.altKey=e.altKey;this.ctrlKey=e.ctrlKey;this.metaKey=e.metaKey;this.shiftKey=e.shiftKey;this.charCode=e.charCode;this.keyCode=e.keyCode;this.which=e.which;this.code=e.code;this.key=e.key;this.srcElement=e.srcElement;this.target=e.target;this._isDefaultPrevented=false}CKeyboardEventWrapper.prototype=
|
|
|
|
null;this.HtmlAreaOffset=50;this.HtmlAreaWidth=200;this.LockerTargetTimer=-1;this.KeyDownFlag=false;this.KeyPressFlag=false;this.IsLockTargetMode=false;this.nativeFocusElement=null;this.nativeFocusElementNoRemoveOnElementFocus=false;this.InterfaceEnableKeyEvents=true;this.debugTexBoxMaxW=100;this.debugTexBoxMaxH=20;this.isDebug=false;this.isSystem=false;this.isShow=false;this.FixedPosCheckElementX=0;this.FixedPosCheckElementY=0;this.virtualKeyboardClickTimeout=-1;this.virtualKeyboardClickPrevent=
|
|
|
|
{preventDefault:function(){this._isDefaultPrevented=true},stopPropagation:function(){}};function CTextInput(api){this.Api=api;this.TargetId=null;this.HtmlDiv=null;this.TextArea_Not_ContentEditableDiv=true;this.HtmlArea=null;this.HtmlAreaOffset=50;this.HtmlAreaWidth=200;this.LockerTargetTimer=-1;this.KeyDownFlag=false;this.KeyPressFlag=false;this.IsLockTargetMode=false;this.nativeFocusElement=null;this.nativeFocusElementNoRemoveOnElementFocus=false;this.InterfaceEnableKeyEvents=true;this.debugTexBoxMaxW=
|
|
|
|
false;this.TextBeforeComposition="";this.Text="";this.Target=0;this.CompositionStart=0;this.CompositionEnd=0;this.IsComposition=false;this.ApiIsComposition=false;this.TargetOffsetY=0;this.editorSdkW=0;this.editorSdkH=0;this.ReadOnlyCounter=0;this.LastReplaceText=[];this.IsLastReplaceFlag=false;this.isNoClearOnFocus=false;this.keyPressInput="";this.isInputHelpersPresent=false;this.isInputHelpers={};this.isKeyPressOnUp=AscCommon.AscBrowser.isAppleDevices;this.keyPressOnUpCodes=[];this.isKeyPressOnUpStackedMode=
|
|
|
|
100;this.debugTexBoxMaxH=20;this.isDebug=false;this.isSystem=false;this.isShow=false;this.FixedPosCheckElementX=0;this.FixedPosCheckElementY=0;this.virtualKeyboardClickTimeout=-1;this.virtualKeyboardClickPrevent=false;this.TextBeforeComposition="";this.Text="";this.Target=0;this.CompositionStart=0;this.CompositionEnd=0;this.IsComposition=false;this.ApiIsComposition=false;this.TargetOffsetY=0;this.editorSdkW=0;this.editorSdkH=0;this.ReadOnlyCounter=0;this.LastReplaceText=[];this.IsLastReplaceFlag=
|
|
|
|
this.isKeyPressOnUp;this.isHardCheckKeyboard=AscCommon.AscBrowser.isSailfish}CTextInput.prototype={log:function(_val){},init:function(target_id,parent_id){this.TargetId=target_id;var oHtmlParent=null;var oHtmlTarget=document.getElementById(this.TargetId);if(undefined==parent_id)oHtmlParent=oHtmlTarget.parentNode;else oHtmlParent=document.getElementById(parent_id);this.HtmlDiv=document.createElement("div");this.HtmlDiv.id="area_id_parent";this.HtmlDiv.style.background="transparent";this.HtmlDiv.style.border=
|
|
|
|
false;this.isNoClearOnFocus=false;this.keyPressInput="";this.isInputHelpersPresent=false;this.isInputHelpers={};this.isKeyPressOnUp=AscCommon.AscBrowser.isAppleDevices;this.keyPressOnUpCodes=[];this.isKeyPressOnUpStackedMode=this.isKeyPressOnUp;this.isHardCheckKeyboard=AscCommon.AscBrowser.isSailfish}CTextInput.prototype={log:function(_val){},init:function(target_id,parent_id){this.TargetId=target_id;var oHtmlParent=null;var oHtmlTarget=document.getElementById(this.TargetId);if(undefined==parent_id)oHtmlParent=
|
|
|
|
"none";if(AscCommon.AscBrowser.isChrome)this.HtmlDiv.style.position="fixed";else this.HtmlDiv.style.position="absolute";this.HtmlDiv.style.zIndex=10;this.HtmlDiv.style.width="20px";this.HtmlDiv.style.height="50px";this.HtmlDiv.style.overflow="hidden";this.HtmlDiv.style.boxSizing="content-box";this.HtmlDiv.style.webkitBoxSizing="content-box";this.HtmlDiv.style.MozBoxSizing="content-box";if(this.TextArea_Not_ContentEditableDiv)this.HtmlArea=document.createElement("textarea");else{this.HtmlArea=document.createElement("div");
|
|
|
|
oHtmlTarget.parentNode;else oHtmlParent=document.getElementById(parent_id);this.HtmlDiv=document.createElement("div");this.HtmlDiv.id="area_id_parent";this.HtmlDiv.style.background="transparent";this.HtmlDiv.style.border="none";if(AscCommon.AscBrowser.isChrome)this.HtmlDiv.style.position="fixed";else this.HtmlDiv.style.position="absolute";this.HtmlDiv.style.zIndex=10;this.HtmlDiv.style.width="20px";this.HtmlDiv.style.height="50px";this.HtmlDiv.style.overflow="hidden";this.HtmlDiv.style.boxSizing=
|
|
|
|
this.HtmlArea.setAttribute("contentEditable",true)}this.HtmlArea.id="area_id";if(this.Api.isViewMode&&this.Api.isMobileVersion)this.setReadOnlyWrapper(true);var _style="left:-"+(this.HtmlAreaWidth>>1)+"px;top:"+-this.HtmlAreaOffset+"px;";_style+="background:transparent;border:none;position:absolute;text-shadow:0 0 0 #000;outline:none;color:transparent;width:"+this.HtmlAreaWidth+"px;height:50px;";_style+="overflow:hidden;padding:0px;margin:0px;font-family:arial;resize:none;font-weight:normal;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;";
|
|
|
|
"content-box";this.HtmlDiv.style.webkitBoxSizing="content-box";this.HtmlDiv.style.MozBoxSizing="content-box";if(this.TextArea_Not_ContentEditableDiv)this.HtmlArea=document.createElement("textarea");else{this.HtmlArea=document.createElement("div");this.HtmlArea.setAttribute("contentEditable",true)}this.HtmlArea.id="area_id";if(this.Api.isViewMode&&this.Api.isMobileVersion)this.setReadOnlyWrapper(true);var _style="left:-"+(this.HtmlAreaWidth>>1)+"px;top:"+-this.HtmlAreaOffset+"px;";_style+="background:transparent;border:none;position:absolute;text-shadow:0 0 0 #000;outline:none;color:transparent;width:"+
|
|
|
|
_style+="touch-action: none;-webkit-touch-callout: none;color:transparent;caret-color:transparent;";_style+=AscCommon.AscBrowser.isAppleDevices?"font-size:0px;":"font-size:8px;";this.HtmlArea.setAttribute("style",_style);this.HtmlArea.setAttribute("spellcheck",false);this.HtmlArea.setAttribute("autocapitalize","none");this.HtmlArea.setAttribute("autocomplete","off");this.HtmlArea.setAttribute("autocorrect","off");this.HtmlDiv.appendChild(this.HtmlArea);if(true){var oHtmlDivScrollable=document.createElement("div");
|
|
|
|
this.HtmlAreaWidth+"px;height:50px;";_style+="overflow:hidden;padding:0px;margin:0px;font-family:arial;resize:none;font-weight:normal;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;";_style+="touch-action: none;-webkit-touch-callout: none;color:transparent;caret-color:transparent;";_style+=AscCommon.AscBrowser.isAppleDevices?"font-size:0px;":"font-size:8px;";this.HtmlArea.setAttribute("style",_style);this.HtmlArea.setAttribute("spellcheck",false);this.HtmlArea.setAttribute("autocapitalize",
|
|
|
|
oHtmlDivScrollable.id="area_id_main";oHtmlDivScrollable.setAttribute("style","background:transparent;border:none;position:absolute;padding:0px;margin:0px;z-index:0;pointer-events:none;");var parentStyle=getComputedStyle(oHtmlParent);oHtmlDivScrollable.style.left=parentStyle.left;oHtmlDivScrollable.style.top=parentStyle.top;oHtmlDivScrollable.style.width=parentStyle.width;oHtmlDivScrollable.style.height=parentStyle.height;oHtmlDivScrollable.style.overflow="hidden";oHtmlDivScrollable.appendChild(this.HtmlDiv);
|
|
|
|
"none");this.HtmlArea.setAttribute("autocomplete","off");this.HtmlArea.setAttribute("autocorrect","off");this.HtmlDiv.appendChild(this.HtmlArea);if(true){var oHtmlDivScrollable=document.createElement("div");oHtmlDivScrollable.id="area_id_main";oHtmlDivScrollable.setAttribute("style","background:transparent;border:none;position:absolute;padding:0px;margin:0px;z-index:0;pointer-events:none;");var parentStyle=getComputedStyle(oHtmlParent);oHtmlDivScrollable.style.left=parentStyle.left;oHtmlDivScrollable.style.top=
|
|
|
|
oHtmlParent.parentNode.appendChild(oHtmlDivScrollable)}else oHtmlParent.appendChild(this.HtmlDiv);var oThis=this;this.HtmlArea["onkeydown"]=function(e){if(AscCommon.AscBrowser.isSafariMacOs){var cmdButton=e.ctrlKey||e.metaKey?true:false;var buttonCode=e.keyCode==67||e.keyCode==88||e.keyCode==86;if(cmdButton&&buttonCode)oThis.IsDisableKeyPress=true;else oThis.IsDisableKeyPress=false}return oThis.onKeyDown(e)};this.HtmlArea["onkeypress"]=function(e){if(oThis.IsDisableKeyPress==true){oThis.IsDisableKeyPress=
|
|
|
|
parentStyle.top;oHtmlDivScrollable.style.width=parentStyle.width;oHtmlDivScrollable.style.height=parentStyle.height;oHtmlDivScrollable.style.overflow="hidden";oHtmlDivScrollable.appendChild(this.HtmlDiv);oHtmlParent.parentNode.appendChild(oHtmlDivScrollable)}else oHtmlParent.appendChild(this.HtmlDiv);var oThis=this;this.HtmlArea["onkeydown"]=function(e){if(AscCommon.AscBrowser.isSafariMacOs){var cmdButton=e.ctrlKey||e.metaKey?true:false;var buttonCode=e.keyCode==67||e.keyCode==88||e.keyCode==86;if(cmdButton&&
|
|
|
|
false;var cmdButton=e.ctrlKey||e.metaKey?true:false;if(cmdButton)return}return oThis.onKeyPress(e)};this.HtmlArea["onkeyup"]=function(e){oThis.IsDisableKeyPress=false;return oThis.onKeyUp(e)};this.HtmlArea.addEventListener("input",function(e){return oThis.onInput(e)},false);this.HtmlArea.addEventListener("compositionstart",function(e){return oThis.onCompositionStart(e)},false);this.HtmlArea.addEventListener("compositionupdate",function(e){return oThis.onCompositionUpdate(e)},false);this.HtmlArea.addEventListener("compositionend",
|
|
|
|
buttonCode)oThis.IsDisableKeyPress=true;else oThis.IsDisableKeyPress=false}return oThis.onKeyDown(e)};this.HtmlArea["onkeypress"]=function(e){if(oThis.IsDisableKeyPress==true){oThis.IsDisableKeyPress=false;var cmdButton=e.ctrlKey||e.metaKey?true:false;if(cmdButton)return}return oThis.onKeyPress(e)};this.HtmlArea["onkeyup"]=function(e){oThis.IsDisableKeyPress=false;return oThis.onKeyUp(e)};this.HtmlArea.addEventListener("input",function(e){return oThis.onInput(e)},false);this.HtmlArea.addEventListener("compositionstart",
|
|
|
|
function(e){return oThis.onCompositionEnd(e)},false);this.show();this.Api.Input_UpdatePos();if(AscCommon.AscBrowser.isAndroid)this.HtmlArea.onclick=function(e){var _this=AscCommon.g_inputContext;if(-1!=_this.virtualKeyboardClickTimeout){clearTimeout(_this.virtualKeyboardClickTimeout);_this.virtualKeyboardClickTimeout=-1}_this.apiCompositeEnd();if(!_this.virtualKeyboardClickPrevent)return;_this.setReadOnlyWrapper(true);_this.virtualKeyboardClickPrevent=false;AscCommon.stopEvent(e);_this.virtualKeyboardClickTimeout=
|
|
|
|
function(e){return oThis.onCompositionStart(e)},false);this.HtmlArea.addEventListener("compositionupdate",function(e){return oThis.onCompositionUpdate(e)},false);this.HtmlArea.addEventListener("compositionend",function(e){return oThis.onCompositionEnd(e)},false);this.show();this.Api.Input_UpdatePos();if(AscCommon.AscBrowser.isAndroid)this.HtmlArea.onclick=function(e){var _this=AscCommon.g_inputContext;if(-1!=_this.virtualKeyboardClickTimeout){clearTimeout(_this.virtualKeyboardClickTimeout);_this.virtualKeyboardClickTimeout=
|
|
|
|
setTimeout(function(){_this.setReadOnlyWrapper(false);_this.virtualKeyboardClickTimeout=-1},1);return false}},onResize:function(_editorContainerId){var _elem=document.getElementById("area_id_main");var _elemSrc=document.getElementById(_editorContainerId);if(!_elem||!_elemSrc)return;if(AscCommon.AscBrowser.isChrome){var rectObject=_elemSrc.getBoundingClientRect();this.FixedPosCheckElementX=rectObject.left;this.FixedPosCheckElementY=rectObject.top}var _width=_elemSrc.style.width;if((null==_width||""==
|
|
|
|
-1}_this.apiCompositeEnd();if(!_this.virtualKeyboardClickPrevent)return;_this.setReadOnlyWrapper(true);_this.virtualKeyboardClickPrevent=false;AscCommon.stopEvent(e);_this.virtualKeyboardClickTimeout=setTimeout(function(){_this.setReadOnlyWrapper(false);_this.virtualKeyboardClickTimeout=-1},1);return false}},onResize:function(_editorContainerId){var _elem=document.getElementById("area_id_main");var _elemSrc=document.getElementById(_editorContainerId);if(!_elem||!_elemSrc)return;if(AscCommon.AscBrowser.isChrome){var rectObject=
|
|
|
|
_width)&&window.getComputedStyle){var _s=window.getComputedStyle(_elemSrc);_elem.style.left=_s.left;_elem.style.top=_s.top;_elem.style.width=_s.width;_elem.style.height=_s.height}else{_elem.style.left=_elemSrc.style.left;_elem.style.top=_elemSrc.style.top;_elem.style.width=_width;_elem.style.height=_elemSrc.style.height}if(this.Api.isMobileVersion){var _elem1=document.getElementById("area_id_parent");var _elem2=document.getElementById("area_id");_elem1.parentNode.style.pointerEvents="";_elem1.style.left=
|
|
|
|
_elemSrc.getBoundingClientRect();this.FixedPosCheckElementX=rectObject.left;this.FixedPosCheckElementY=rectObject.top}var _width=_elemSrc.style.width;if((null==_width||""==_width)&&window.getComputedStyle){var _s=window.getComputedStyle(_elemSrc);_elem.style.left=_s.left;_elem.style.top=_s.top;_elem.style.width=_s.width;_elem.style.height=_s.height}else{_elem.style.left=_elemSrc.style.left;_elem.style.top=_elemSrc.style.top;_elem.style.width=_width;_elem.style.height=_elemSrc.style.height}if(this.Api.isMobileVersion){var _elem1=
|
|
|
|
"0px";_elem1.style.top="-1000px";_elem1.style.right="0px";_elem1.style.bottom="-100px";_elem1.style.width="auto";_elem1.style.height="auto";_elem2.style.left="0px";_elem2.style.top="0px";_elem2.style.right="0px";_elem2.style.bottom="0px";_elem2.style.width="100%";_elem2.style.height="100%";if(AscCommon.AscBrowser.isIE){document.body.style["msTouchAction"]="none";document.body.style["touchAction"]="none"}}var _editorSdk=document.getElementById("editor_sdk");this.editorSdkW=_editorSdk.clientWidth;this.editorSdkH=
|
|
|
|
document.getElementById("area_id_parent");var _elem2=document.getElementById("area_id");_elem1.parentNode.style.pointerEvents="";_elem1.style.left="0px";_elem1.style.top="-1000px";_elem1.style.right="0px";_elem1.style.bottom="-100px";_elem1.style.width="auto";_elem1.style.height="auto";_elem2.style.left="0px";_elem2.style.top="0px";_elem2.style.right="0px";_elem2.style.bottom="0px";_elem2.style.width="100%";_elem2.style.height="100%";if(AscCommon.AscBrowser.isIE){document.body.style["msTouchAction"]=
|
|
|
|
_editorSdk.clientHeight},checkFocus:function(){if(this.Api.asc_IsFocus()&&!AscCommon.g_clipboardBase.IsFocus()&&!AscCommon.g_clipboardBase.IsWorking())if(document.activeElement!=this.HtmlArea)this.HtmlArea.focus()},move:function(x,y){if(this.Api.isMobileVersion)return;var oTarget=document.getElementById(this.TargetId);if(!oTarget)return;var xPos=x?x:parseInt(oTarget.style.left);var yPos=(y?y:parseInt(oTarget.style.top))+parseInt(oTarget.style.height);if(AscCommon.AscBrowser.isSafari&&AscCommon.AscBrowser.isMobile)xPos=
|
|
|
|
"none";document.body.style["touchAction"]="none"}}var _editorSdk=document.getElementById("editor_sdk");this.editorSdkW=_editorSdk.clientWidth;this.editorSdkH=_editorSdk.clientHeight},checkFocus:function(){if(this.Api.asc_IsFocus()&&!AscCommon.g_clipboardBase.IsFocus()&&!AscCommon.g_clipboardBase.IsWorking())if(document.activeElement!=this.HtmlArea)this.HtmlArea.focus()},move:function(x,y){if(this.Api.isMobileVersion)return;var oTarget=document.getElementById(this.TargetId);if(!oTarget)return;var xPos=
|
|
|
|
-100;if(!this.isDebug&&!this.isSystem){this.HtmlDiv.style.left=xPos+this.FixedPosCheckElementX+"px";this.HtmlDiv.style.top=yPos+this.FixedPosCheckElementY+this.TargetOffsetY+this.HtmlAreaOffset+"px";this.HtmlArea.scrollTop=this.HtmlArea.scrollHeight}else this.debugCalculatePlace(xPos+this.FixedPosCheckElementX,yPos+this.FixedPosCheckElementY+this.TargetOffsetY);if(window.g_asc_plugins)window.g_asc_plugins.onPluginEvent("onTargetPositionChanged")},emulateKeyDownApi:function(code){var _e={altKey:false,
|
|
|
|
x?x:parseInt(oTarget.style.left);var yPos=(y?y:parseInt(oTarget.style.top))+parseInt(oTarget.style.height);if(AscCommon.AscBrowser.isSafari&&AscCommon.AscBrowser.isMobile)xPos=-100;if(!this.isDebug&&!this.isSystem){this.HtmlDiv.style.left=xPos+this.FixedPosCheckElementX+"px";this.HtmlDiv.style.top=yPos+this.FixedPosCheckElementY+this.TargetOffsetY+this.HtmlAreaOffset+"px";this.HtmlArea.scrollTop=this.HtmlArea.scrollHeight}else this.debugCalculatePlace(xPos+this.FixedPosCheckElementX,yPos+this.FixedPosCheckElementY+
|
|
|
|
ctrlKey:false,shiftKey:false,target:null,charCode:0,which:code,keyCode:code,code:"",preventDefault:function(){},stopPropagation:function(){}};this.Api.onKeyDown(_e);this.Api.onKeyUp(_e)},clear:function(isFromFocus){if(!this.TextArea_Not_ContentEditableDiv)this.HtmlArea.innerHTML="";else this.HtmlArea.value="";if(isFromFocus!==true)this.HtmlArea.focus();this.TextBeforeComposition="";this.Text="";this.Target=0;this.CompositionStart=0;this.CompositionEnd=0;this.IsComposition=false;this.keyPressInput=
|
|
|
|
this.TargetOffsetY);if(window.g_asc_plugins)window.g_asc_plugins.onPluginEvent("onTargetPositionChanged")},emulateKeyDownApi:function(code){var _e={altKey:false,ctrlKey:false,shiftKey:false,target:null,charCode:0,which:code,keyCode:code,code:"",preventDefault:function(){},stopPropagation:function(){}};this.Api.onKeyDown(_e);this.Api.onKeyUp(_e)},clear:function(isFromFocus){if(!this.TextArea_Not_ContentEditableDiv)this.HtmlArea.innerHTML="";else this.HtmlArea.value="";if(isFromFocus!==true)this.HtmlArea.focus();
|
|
|
|
"";if(window.g_asc_plugins)window.g_asc_plugins.onPluginEvent("onInputHelperClear")},getAreaValue:function(){return this.TextArea_Not_ContentEditableDiv?this.HtmlArea.value:this.HtmlArea.innerText},setReadOnly:function(isLock){if(isLock)this.ReadOnlyCounter++;else this.ReadOnlyCounter--;this.setReadOnlyWrapper(0>=this.ReadOnlyCounter?false:true)},setReadOnlyWrapper:function(val){this.HtmlArea.readOnly=this.Api.isViewMode?true:val},show:function(){if(this.isDebug||this.isSystem){this.log("ti: show");
|
|
|
|
this.TextBeforeComposition="";this.Text="";this.Target=0;this.CompositionStart=0;this.CompositionEnd=0;this.IsComposition=false;this.keyPressInput="";if(window.g_asc_plugins)window.g_asc_plugins.onPluginEvent("onInputHelperClear")},getAreaValue:function(){return this.TextArea_Not_ContentEditableDiv?this.HtmlArea.value:this.HtmlArea.innerText},setReadOnly:function(isLock){if(isLock)this.ReadOnlyCounter++;else this.ReadOnlyCounter--;this.setReadOnlyWrapper(0>=this.ReadOnlyCounter?false:true)},setReadOnlyWrapper:function(val){this.HtmlArea.readOnly=
|
|
|
|
document.getElementById("area_id_main").style.zIndex=10;this.HtmlArea.style.top="0px";this.HtmlArea.style.width="100%";this.HtmlArea.style.height="100%";this.HtmlArea.style.background="#FFFFFF";this.HtmlArea.style.color="black";this.HtmlDiv.style.zIndex=90;this.HtmlDiv.style.border="2px solid #4363A4";this.isShow=true}},unshow:function(isAttack){if(this.isDebug||this.isSystem||true==isAttack){this.log("ti: unshow");document.getElementById("area_id_main").style.zIndex=0;this.HtmlArea.style.top=-this.HtmlAreaOffset+
|
|
|
|
this.Api.isViewMode?true:val},show:function(){if(this.isDebug||this.isSystem){this.log("ti: show");document.getElementById("area_id_main").style.zIndex=10;this.HtmlArea.style.top="0px";this.HtmlArea.style.width="100%";this.HtmlArea.style.height="100%";this.HtmlArea.style.background="#FFFFFF";this.HtmlArea.style.color="black";this.HtmlDiv.style.zIndex=90;this.HtmlDiv.style.border="2px solid #4363A4";this.isShow=true}},unshow:function(isAttack){if(this.isDebug||this.isSystem||true==isAttack){this.log("ti: unshow");
|
|
|
|
"px";this.HtmlArea.style.width="1000px";this.HtmlArea.style.height="50px";this.HtmlArea.style.background="transparent";this.HtmlArea.style.color="transparent";this.HtmlDiv.style.zIndex=0;this.HtmlDiv.style.border="none";this.isShow=false}},debugCalculatePlace:function(x,y){var _left=x;var _top=y;if(undefined==_left)_left=parseInt(this.HtmlDiv.style.left);if(undefined==_top)_top=parseInt(this.HtmlDiv.style.top);var _r_max=this.editorSdkW;var _b_max=this.editorSdkH;_r_max-=60;if(_r_max-_left>50)this.debugTexBoxMaxW=
|
|
|
|
document.getElementById("area_id_main").style.zIndex=0;this.HtmlArea.style.top=-this.HtmlAreaOffset+"px";this.HtmlArea.style.width="1000px";this.HtmlArea.style.height="50px";this.HtmlArea.style.background="transparent";this.HtmlArea.style.color="transparent";this.HtmlDiv.style.zIndex=0;this.HtmlDiv.style.border="none";this.isShow=false}},debugCalculatePlace:function(x,y){var _left=x;var _top=y;if(undefined==_left)_left=parseInt(this.HtmlDiv.style.left);if(undefined==_top)_top=parseInt(this.HtmlDiv.style.top);
|
|
|
|
_r_max-_left;else{_left=_r_max-50;this.debugTexBoxMaxW=50}_b_max-=40;if(_b_max-_top>50)this.debugTexBoxMaxH=_b_max-_top;else{_top=_b_max-50;this.debugTexBoxMaxH=50}if(AscCommon.AscBrowser.isSafari&&AscCommon.AscBrowser.isMobile)_left=-100;this.HtmlDiv.style.left=_left+"px";this.HtmlDiv.style.top=_top+"px";var _height=22;var _t=this.getAreaValue();if(0!=_t.length){var _editorSdk=document.getElementById("editor_sdk");var _p=document.createElement("p");_p.style.zIndex="-1";_p.style.position="absolute";
|
|
|
|
var _r_max=this.editorSdkW;var _b_max=this.editorSdkH;_r_max-=60;if(_r_max-_left>50)this.debugTexBoxMaxW=_r_max-_left;else{_left=_r_max-50;this.debugTexBoxMaxW=50}_b_max-=40;if(_b_max-_top>50)this.debugTexBoxMaxH=_b_max-_top;else{_top=_b_max-50;this.debugTexBoxMaxH=50}if(AscCommon.AscBrowser.isSafari&&AscCommon.AscBrowser.isMobile)_left=-100;this.HtmlDiv.style.left=_left+"px";this.HtmlDiv.style.top=_top+"px";var _height=22;var _t=this.getAreaValue();if(0!=_t.length){var _editorSdk=document.getElementById("editor_sdk");
|
|
|
|
_p.style.fontFamily="arial";_p.style.fontSize="12pt";_p.style.left="0px";_p.style.width=this.debugTexBoxMaxW+"px";_editorSdk.appendChild(_p);_t=_t.replace(/ /g," ");_p.innerHTML="<span>"+_t+"</span>";var _width=_p.firstChild.offsetWidth;_width=Math.min(_width+20,this.debugTexBoxMaxW);if(AscCommon.AscBrowser.isIE)_width+=10;var area=document.createElement("textarea");area.style.zIndex="-1";area.id="area2_id";area.rows=1;area.setAttribute("style","font-family:arial;font-size:12pt;position:absolute;resize:none;padding:0px;margin:0px;font-weight:normal;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;");
|
|
|
|
var _p=document.createElement("p");_p.style.zIndex="-1";_p.style.position="absolute";_p.style.fontFamily="arial";_p.style.fontSize="12pt";_p.style.left="0px";_p.style.width=this.debugTexBoxMaxW+"px";_editorSdk.appendChild(_p);_t=_t.replace(/ /g," ");_p.innerHTML="<span>"+_t+"</span>";var _width=_p.firstChild.offsetWidth;_width=Math.min(_width+20,this.debugTexBoxMaxW);if(AscCommon.AscBrowser.isIE)_width+=10;var area=document.createElement("textarea");area.style.zIndex="-1";area.id="area2_id";
|
|
|
|
area.style.overflow="hidden";area.style.width=_width+"px";_editorSdk.appendChild(area);area.value=this.getAreaValue();_height=area.clientHeight;if(area.scrollHeight>_height)_height=area.scrollHeight;_editorSdk.removeChild(_p);_editorSdk.removeChild(area)}if(_height>this.debugTexBoxMaxH)_height=this.debugTexBoxMaxH;this.HtmlDiv.style.width=_width+"px";this.HtmlDiv.style.height=_height+"px";var oldZindex=parseInt(this.HtmlDiv.style.zIndex);var newZindex=oldZindex==90?"89":"90";this.HtmlDiv.style.zIndex=
|
|
|
|
area.rows=1;area.setAttribute("style","font-family:arial;font-size:12pt;position:absolute;resize:none;padding:0px;margin:0px;font-weight:normal;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;");area.style.overflow="hidden";area.style.width=_width+"px";_editorSdk.appendChild(area);area.value=this.getAreaValue();_height=area.clientHeight;if(area.scrollHeight>_height)_height=area.scrollHeight;_editorSdk.removeChild(_p);_editorSdk.removeChild(area)}if(_height>this.debugTexBoxMaxH)_height=
|
|
|
|
newZindex},onInput:function(e,isFromCompositionUpdate){if(this.Api.isLongAction()||this.Api.isViewMode){AscCommon.stopEvent(e);return false}if(this.isSystem){if(!this.isShow)this.show();this.debugCalculatePlace(undefined,undefined);return}if(this.isKeyPressOnUp&&this.keyPressOnUpCodes.length>0){if(!this.TextArea_Not_ContentEditableDiv)this.HtmlArea.innerHTML="";else this.HtmlArea.value="";this.TextBeforeComposition="";this.Text="";AscCommon.stopEvent(e);return false}this.log("ti: onInput");this.Text=
|
|
|
|
this.debugTexBoxMaxH;this.HtmlDiv.style.width=_width+"px";this.HtmlDiv.style.height=_height+"px";var oldZindex=parseInt(this.HtmlDiv.style.zIndex);var newZindex=oldZindex==90?"89":"90";this.HtmlDiv.style.zIndex=newZindex},onInput:function(e,isFromCompositionUpdate){if(this.Api.isLongAction()||this.Api.isViewMode){AscCommon.stopEvent(e);return false}if(this.isSystem){if(!this.isShow)this.show();this.debugCalculatePlace(undefined,undefined);return}if(this.isKeyPressOnUp&&this.keyPressOnUpCodes.length>
|
|
|
|
this.getAreaValue();this.Text=this.Text.split(" ").join(" ");var codes=[];if(this.IsComposition||this.ApiIsComposition){var ieStart=-1;var ieEnd=-1;if(true){var target=e.target;if(target["msGetInputContext"]){var ctx=target["msGetInputContext"]();if(ctx){ieStart=ctx["compositionStartOffset"];ieEnd=ctx["compositionEndOffset"]}}}this.CompositionEnd=this.Text.length;this.CompositionStart=this.TextBeforeComposition.length;var textReplace=this.Text.substr(this.CompositionStart);var iter;for(iter=
|
|
|
|
0){if(!this.TextArea_Not_ContentEditableDiv)this.HtmlArea.innerHTML="";else this.HtmlArea.value="";this.TextBeforeComposition="";this.Text="";AscCommon.stopEvent(e);return false}this.log("ti: onInput");this.Text=this.getAreaValue();this.Text=this.Text.split(" ").join(" ");var codes=[];if(this.IsComposition||this.ApiIsComposition){var ieStart=-1;var ieEnd=-1;if(true){var target=e.target;if(target["msGetInputContext"]){var ctx=target["msGetInputContext"]();if(ctx){ieStart=ctx["compositionStartOffset"];
|
|
|
|
textReplace.getUnicodeIterator();iter.check();iter.next())codes.push(iter.value());var isAsync=AscFonts.FontPickerByCharacter.checkTextLight(codes,true);if(!isAsync){if(ieStart>this.CompositionStart){textReplace=textReplace.substr(0,ieStart-this.CompositionStart);codes=[];for(iter=textReplace.getUnicodeIterator();iter.check();iter.next())codes.push(iter.value());this.apiCompositeReplace(codes);this.apiCompositeEnd();this.TextBeforeComposition=this.Text.substr(0,ieStart);this.apiCompositeStart();this.CompositionStart=
|
|
|
|
ieEnd=ctx["compositionEndOffset"]}}}this.CompositionEnd=this.Text.length;this.CompositionStart=this.TextBeforeComposition.length;var textReplace=this.Text.substr(this.CompositionStart);var iter;for(iter=textReplace.getUnicodeIterator();iter.check();iter.next())codes.push(iter.value());var isAsync=AscFonts.FontPickerByCharacter.checkTextLight(codes,true);if(!isAsync){if(ieStart>this.CompositionStart){textReplace=textReplace.substr(0,ieStart-this.CompositionStart);codes=[];for(iter=textReplace.getUnicodeIterator();iter.check();iter.next())codes.push(iter.value());
|
|
|
|
ieStart;codes=[];textReplace=this.Text.substr(this.CompositionStart);for(iter=textReplace.getUnicodeIterator();iter.check();iter.next())codes.push(iter.value());this.apiCompositeReplace(codes)}else this.apiCompositeReplace(codes);if(!this.IsComposition){this.apiCompositeEnd();this.TextBeforeComposition=this.Text}}else{AscFonts.FontPickerByCharacter.loadFonts(this,function(){this.apiCompositeReplace(codes);this.apiCompositeEnd();this.clear();this.setReadOnly(false)});AscCommon.stopEvent(e);this.setReadOnly(true);
|
|
|
|
this.apiCompositeReplace(codes);this.apiCompositeEnd();this.TextBeforeComposition=this.Text.substr(0,ieStart);this.apiCompositeStart();this.CompositionStart=ieStart;codes=[];textReplace=this.Text.substr(this.CompositionStart);for(iter=textReplace.getUnicodeIterator();iter.check();iter.next())codes.push(iter.value());this.apiCompositeReplace(codes)}else this.apiCompositeReplace(codes);if(!this.IsComposition){this.apiCompositeEnd();this.TextBeforeComposition=this.Text}}else{AscFonts.FontPickerByCharacter.loadFonts(this,
|
|
|
|
return false}}else{var textToApi=this.Text.substr(this.TextBeforeComposition.length);for(var iter=textToApi.getUnicodeIterator();iter.check();iter.next())codes.push(iter.value());if(codes.length>0)this.apiInputText(codes);this.TextBeforeComposition=this.Text}if(!this.IsComposition)if(this.Text.length>0){var _lastCode=this.Text.charCodeAt(this.Text.length-1);if(_lastCode==12290||_lastCode==46){AscCommon.stopEvent(e);if(AscCommon.AscBrowser.isIE&&!AscCommon.AscBrowser.isIeEdge)setTimeout(function(){window["AscCommon"].g_inputContext.clear();
|
|
|
|
function(){this.apiCompositeReplace(codes);this.apiCompositeEnd();this.clear();this.setReadOnly(false)});AscCommon.stopEvent(e);this.setReadOnly(true);return false}}else{var textToApi=this.Text.substr(this.TextBeforeComposition.length);for(var iter=textToApi.getUnicodeIterator();iter.check();iter.next())codes.push(iter.value());if(codes.length>0)this.apiInputText(codes);this.TextBeforeComposition=this.Text}if(!this.IsComposition)if(this.Text.length>0){var _lastCode=this.Text.charCodeAt(this.Text.length-
|
|
|
|
window["AscCommon"].g_inputContext.HtmlArea.focus()},0);else this.clear();return false}}},emulateNativeKeyDown:function(e,target){var oEvent=document.createEvent("KeyboardEvent");Object.defineProperty(oEvent,"keyCode",{get:function(){return this.keyCodeVal}});Object.defineProperty(oEvent,"which",{get:function(){return this.keyCodeVal}});Object.defineProperty(oEvent,"shiftKey",{get:function(){return this.shiftKeyVal}});Object.defineProperty(oEvent,"altKey",{get:function(){return this.altKeyVal}});
|
|
|
|
1);if(_lastCode==12290||_lastCode==46){AscCommon.stopEvent(e);if(AscCommon.AscBrowser.isIE&&!AscCommon.AscBrowser.isIeEdge)setTimeout(function(){window["AscCommon"].g_inputContext.clear();window["AscCommon"].g_inputContext.HtmlArea.focus()},0);else this.clear();return false}}},emulateNativeKeyDown:function(e,target){var oEvent=document.createEvent("KeyboardEvent");Object.defineProperty(oEvent,"keyCode",{get:function(){return this.keyCodeVal}});Object.defineProperty(oEvent,"which",{get:function(){return this.keyCodeVal}});
|
|
|
|
Object.defineProperty(oEvent,"metaKey",{get:function(){return this.metaKeyVal}});Object.defineProperty(oEvent,"ctrlKey",{get:function(){return this.ctrlKeyVal}});if(AscCommon.AscBrowser.isIE)oEvent.preventDefault=function(){try{Object.defineProperty(this,"defaultPrevented",{get:function(){return true}})}catch(err){}};var k=e.keyCode;if(oEvent.initKeyboardEvent)oEvent.initKeyboardEvent("keydown",true,true,window,false,false,false,false,k,k);else oEvent.initKeyEvent("keydown",true,true,window,false,
|
|
|
|
Object.defineProperty(oEvent,"shiftKey",{get:function(){return this.shiftKeyVal}});Object.defineProperty(oEvent,"altKey",{get:function(){return this.altKeyVal}});Object.defineProperty(oEvent,"metaKey",{get:function(){return this.metaKeyVal}});Object.defineProperty(oEvent,"ctrlKey",{get:function(){return this.ctrlKeyVal}});if(AscCommon.AscBrowser.isIE)oEvent.preventDefault=function(){try{Object.defineProperty(this,"defaultPrevented",{get:function(){return true}})}catch(err){}};var k=e.keyCode;if(oEvent.initKeyboardEvent)oEvent.initKeyboardEvent("keydown",
|
|
|
|
false,false,false,k,0);oEvent.keyCodeVal=k;oEvent.shiftKeyVal=e.shiftKey;oEvent.altKeyVal=e.altKey;oEvent.metaKeyVal=e.metaKey;oEvent.ctrlKeyVal=e.ctrlKey;var _elem=target?target:_getElementKeyboardDown(this.nativeFocusElement,3);_elem.dispatchEvent(oEvent);return oEvent.defaultPrevented},isSpaceSymbol:function(e){if(e.keyCode==32)return true;if(e.keyCode==229&&(e.code=="space"||e.code=="Space"||e.key=="Spacebar"))return true;return false},systemInputEnable:function(isEnabled){if(this.isSystem==isEnabled)return;
|
|
|
|
true,true,window,false,false,false,false,k,k);else oEvent.initKeyEvent("keydown",true,true,window,false,false,false,false,k,0);oEvent.keyCodeVal=k;oEvent.shiftKeyVal=e.shiftKey;oEvent.altKeyVal=e.altKey;oEvent.metaKeyVal=e.metaKey;oEvent.ctrlKeyVal=e.ctrlKey;var _elem=target?target:_getElementKeyboardDown(this.nativeFocusElement,3);_elem.dispatchEvent(oEvent);return oEvent.defaultPrevented},isSpaceSymbol:function(e){if(e.keyCode==32)return true;if(e.keyCode==229&&(e.code=="space"||e.code=="Space"||
|
|
|
|
this.isSystem=isEnabled;this.HtmlArea.style.left=this.isSystem?"0px":"-"+(this.HtmlAreaWidth>>1)+"px";this.clear();if(this.isShow)this.unshow(true);if(this.Api.WordControl&&this.Api.WordControl.m_oLogicDocument&&this.Api.WordControl.m_oLogicDocument.Document_UpdateSelectionState)this.Api.WordControl.m_oLogicDocument.Document_UpdateSelectionState()},debugInputEnable:function(isEnabled){if(this.isDebug==isEnabled)return;this.isDebug=isEnabled;this.HtmlArea.style.left=this.isDebug?"0px":"-"+(this.HtmlAreaWidth>>
|
|
|
|
e.key=="Spacebar"))return true;return false},systemInputEnable:function(isEnabled){if(this.isSystem==isEnabled)return;this.isSystem=isEnabled;this.HtmlArea.style.left=this.isSystem?"0px":"-"+(this.HtmlAreaWidth>>1)+"px";this.clear();if(this.isShow)this.unshow(true);if(this.Api.WordControl&&this.Api.WordControl.m_oLogicDocument&&this.Api.WordControl.m_oLogicDocument.Document_UpdateSelectionState)this.Api.WordControl.m_oLogicDocument.Document_UpdateSelectionState()},debugInputEnable:function(isEnabled){if(this.isDebug==
|
|
|
|
1)+"px"},apiInputText:function(codes){var isAsync=AscFonts.FontPickerByCharacter.checkTextLight(codes,true);if(!isAsync){this.apiCompositeStart();this.apiCompositeReplace(codes);this.apiCompositeEnd()}else{AscFonts.FontPickerByCharacter.loadFonts(this,function(){this.apiCompositeStart();this.apiCompositeReplace(codes);this.apiCompositeEnd();this.setReadOnly(false)});this.setReadOnly(true);return false}},onKeyDown:function(e){if(this.Api.isLongAction()){AscCommon.stopEvent(e);return false}if(this.isInputHelpersPresent)switch(e.keyCode){case 9:case 13:case 38:case 40:case 33:case 34:case 35:case 36:case 27:{window.g_asc_plugins.onPluginEvent2("onKeyDown",
|
|
|
|
isEnabled)return;this.isDebug=isEnabled;this.HtmlArea.style.left=this.isDebug?"0px":"-"+(this.HtmlAreaWidth>>1)+"px"},apiInputText:function(codes){var isAsync=AscFonts.FontPickerByCharacter.checkTextLight(codes,true);if(!isAsync){this.apiCompositeStart();this.apiCompositeReplace(codes);this.apiCompositeEnd()}else{AscFonts.FontPickerByCharacter.loadFonts(this,function(){this.apiCompositeStart();this.apiCompositeReplace(codes);this.apiCompositeEnd();this.setReadOnly(false)});this.setReadOnly(true);
|
|
|
|
{"keyCode":e.keyCode},this.isInputHelpers);AscCommon.stopEvent(e);return false}case 32:{if(window.g_asc_plugins)window.g_asc_plugins.onPluginEvent("onInputHelperInput",{"text":this.keyPressInput})}default:break}else if(32==e.keyCode);if(this.isSystem&&this.isShow){if(e.keyCode==13){var text=this.getAreaValue();var codes=[];for(var iter=text.getUnicodeIterator();iter.check();iter.next())codes.push(iter.value());this.apiInputText(codes);this.clear();this.unshow();AscCommon.stopEvent(e);return false}else if(e.keyCode==
|
|
|
|
return false}},onKeyDown:function(e){if(this.Api.isLongAction()){AscCommon.stopEvent(e);return false}if(this.isInputHelpersPresent)switch(e.keyCode){case 9:case 13:case 38:case 40:case 33:case 34:case 35:case 36:case 27:{window.g_asc_plugins.onPluginEvent2("onKeyDown",{"keyCode":e.keyCode},this.isInputHelpers);AscCommon.stopEvent(e);return false}case 32:{if(window.g_asc_plugins)window.g_asc_plugins.onPluginEvent("onInputHelperInput",{"text":this.keyPressInput})}default:break}else if(32==e.keyCode);
|
|
|
|
27){this.clear();this.unshow();AscCommon.stopEvent(e);return false}return}if(null!=this.nativeFocusElement)if(this.emulateNativeKeyDown(e)){e.preventDefault();return false}var _code=e.keyCode;if(_code!=8&&_code!=46)this.KeyDownFlag=true;AscCommon.check_KeyboardEvent(e);var arrCodes=this.Api.getAddedTextOnKeyDown(AscCommon.global_keyboardEvent);var isAsync=AscFonts.FontPickerByCharacter.checkTextLight(arrCodes,true);if(isAsync){AscFonts.FontPickerByCharacter.loadFonts(this,function(){this.onKeyDown(e);
|
|
|
|
if(this.isSystem&&this.isShow){if(e.keyCode==13){var text=this.getAreaValue();var codes=[];for(var iter=text.getUnicodeIterator();iter.check();iter.next())codes.push(iter.value());this.apiInputText(codes);this.clear();this.unshow();AscCommon.stopEvent(e);return false}else if(e.keyCode==27){this.clear();this.unshow();AscCommon.stopEvent(e);return false}return}if(null!=this.nativeFocusElement)if(this.emulateNativeKeyDown(e)){e.preventDefault();return false}var _code=e.keyCode;if(_code!=8&&_code!=46)this.KeyDownFlag=
|
|
|
|
this.onKeyUp(e);this.setReadOnly(false)});AscCommon.stopEvent(e);this.setReadOnly(true);return false}var ret=this.Api.onKeyDown(e);switch(e.keyCode){case 8:{var oldKeyPressInput=this.keyPressInput;this.clear();if(oldKeyPressInput.length>1){this.keyPressInput=oldKeyPressInput.substr(0,oldKeyPressInput.length-1);if(window.g_asc_plugins)window.g_asc_plugins.onPluginEvent("onInputHelperInput",{"text":this.keyPressInput})}return false}case 9:case 13:case 37:case 38:case 39:case 40:case 33:case 34:case 35:case 36:{this.clear();
|
|
|
|
true;AscCommon.check_KeyboardEvent(e);var arrCodes=this.Api.getAddedTextOnKeyDown(AscCommon.global_keyboardEvent);var isAsync=AscFonts.FontPickerByCharacter.checkTextLight(arrCodes,true);if(isAsync){AscFonts.FontPickerByCharacter.loadFonts(this,function(){this.onKeyDown(e);this.onKeyUp(e);this.setReadOnly(false)});AscCommon.stopEvent(e);this.setReadOnly(true);return false}var ret=this.Api.onKeyDown(e);switch(e.keyCode){case 8:{var oldKeyPressInput=this.keyPressInput;this.clear();if(oldKeyPressInput.length>
|
|
|
|
return false}case 46:case 45:{if(!AscCommon.global_keyboardEvent.CtrlKey&&!AscCommon.global_keyboardEvent.ShiftKey){this.clear();return false}}default:break}if(e.keyCode==32&&AscCommon.global_keyboardEvent.CtrlKey&&!AscCommon.global_keyboardEvent.ShiftKey)if(window.g_asc_plugins)window.g_asc_plugins.onPluginEvent("onClick");return ret},onKeyPress:function(e){if(this.Api.isLongAction()||!this.Api.asc_IsFocus()||this.Api.isViewMode){AscCommon.stopEvent(e);return false}if(this.isSystem)return;if(this.KeyDownFlag)this.KeyPressFlag=
|
|
|
|
1){this.keyPressInput=oldKeyPressInput.substr(0,oldKeyPressInput.length-1);if(window.g_asc_plugins)window.g_asc_plugins.onPluginEvent("onInputHelperInput",{"text":this.keyPressInput})}return false}case 9:case 13:case 37:case 38:case 39:case 40:case 33:case 34:case 35:case 36:{this.clear();return false}case 46:case 45:{if(!AscCommon.global_keyboardEvent.CtrlKey&&!AscCommon.global_keyboardEvent.ShiftKey){this.clear();return false}}default:break}if(e.keyCode==32&&AscCommon.global_keyboardEvent.CtrlKey&&
|
|
|
|
true;if(this.IsComposition)return;if(e.which==13&&e.keyCode==13||e.which==10&&e.keyCode==10){AscCommon.stopEvent(e);return false}var c=e.which||e.keyCode;var isAsync=c>=32?AscFonts.FontPickerByCharacter.checkTextLight([c],true):false;if(isAsync){AscFonts.FontPickerByCharacter.loadFonts(this,function(){this.apiCompositeStart();this.apiCompositeReplace([c]);this.apiCompositeEnd();this.setReadOnly(false)});AscCommon.stopEvent(e);this.setReadOnly(true);return false}if(this.isKeyPressOnUp){var isSaveCode=
|
|
|
|
!AscCommon.global_keyboardEvent.ShiftKey)if(window.g_asc_plugins)window.g_asc_plugins.onPluginEvent("onClick");return ret},onKeyPress:function(e){if(this.Api.isLongAction()||!this.Api.asc_IsFocus()||this.Api.isViewMode){AscCommon.stopEvent(e);return false}if(this.isSystem)return;if(this.KeyDownFlag)this.KeyPressFlag=true;if(this.IsComposition)return;if(e.which==13&&e.keyCode==13||e.which==10&&e.keyCode==10){AscCommon.stopEvent(e);return false}var c=e.which||e.keyCode;var isAsync=c>=32?AscFonts.FontPickerByCharacter.checkTextLight([c],
|
|
|
|
true;switch(e.which){case 46:{isSaveCode=false;break}default:break}if(isSaveCode){if(this.isKeyPressOnUpStackedMode)this.keyPressOnUpCodes.push({which:e.which,charCode:e.charCode,keyCode:e.keyCode,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,altKey:e.altKey,preventDefault:function(){}});return}}var ret=this.Api.onKeyPress(e);switch(e.which){case 46:{AscCommon.stopEvent(e);this.clear();return false}default:break}this.keyPressInput+=String.fromCharCode(e.which);if(window.g_asc_plugins)window.g_asc_plugins.onPluginEvent("onInputHelperInput",
|
|
|
|
true):false;if(isAsync){AscFonts.FontPickerByCharacter.loadFonts(this,function(){this.apiCompositeStart();this.apiCompositeReplace([c]);this.apiCompositeEnd();this.setReadOnly(false)});AscCommon.stopEvent(e);this.setReadOnly(true);return false}if(this.isKeyPressOnUp){var isSaveCode=true;switch(e.which){case 46:{isSaveCode=false;break}default:break}if(isSaveCode){if(this.isKeyPressOnUpStackedMode)this.keyPressOnUpCodes.push({which:e.which,charCode:e.charCode,keyCode:e.keyCode,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,
|
|
|
|
{"text":this.keyPressInput});AscCommon.stopEvent(e);return ret},onKeyUp:function(e){if(this.Api.isLongAction()){AscCommon.stopEvent(e);return false}if(this.isSystem&&this.isShow)return;if(this.isKeyPressOnUp&&this.keyPressOnUpCodes.length>0){this.isKeyPressOnUp=false;for(var i=0;i<this.keyPressOnUpCodes.length;i++)this.onKeyPress(this.keyPressOnUpCodes[i]);this.isKeyPressOnUp=true;this.keyPressOnUpCodes=[]}this.KeyDownFlag=false;this.KeyPressFlag=false;AscCommon.global_keyboardEvent.Up();this.Api.onKeyUp(e)},
|
|
|
|
metaKey:e.metaKey,altKey:e.altKey,preventDefault:function(){}});return}}var ret=this.Api.onKeyPress(e);switch(e.which){case 46:{AscCommon.stopEvent(e);this.clear();return false}default:break}this.keyPressInput+=String.fromCharCode(e.which);if(window.g_asc_plugins)window.g_asc_plugins.onPluginEvent("onInputHelperInput",{"text":this.keyPressInput});AscCommon.stopEvent(e);return ret},onKeyUp:function(e){if(this.Api.isLongAction()){AscCommon.stopEvent(e);return false}if(this.isSystem&&this.isShow)return;
|
|
|
|
getAreaPos:function(){var _offset=0;if(this.TextArea_Not_ContentEditableDiv)_offset=this.HtmlArea.selectionEnd;else{var sel=window.getSelection();if(sel.rangeCount>0){var range=sel.getRangeAt(0);_offset=range.endOffset}}return _offset},checkTargetPosition:function(isCorrect){var _offset=this.getAreaPos();if(false!==isCorrect){var _value=this.getAreaValue();_offset-=_value.length-this.compositionValue.length}if(!this.IsLockTargetMode)if(_offset==0&&this.compositionValue.length==1)_offset=1;this.Api.Set_CursorPosInCompositeText(_offset);
|
|
|
|
if(this.isKeyPressOnUp&&this.keyPressOnUpCodes.length>0){this.isKeyPressOnUp=false;for(var i=0;i<this.keyPressOnUpCodes.length;i++)this.onKeyPress(this.keyPressOnUpCodes[i]);this.isKeyPressOnUp=true;this.keyPressOnUpCodes=[]}this.KeyDownFlag=false;this.KeyPressFlag=false;AscCommon.global_keyboardEvent.Up();this.Api.onKeyUp(e)},getAreaPos:function(){var _offset=0;if(this.TextArea_Not_ContentEditableDiv)_offset=this.HtmlArea.selectionEnd;else{var sel=window.getSelection();if(sel.rangeCount>0){var range=
|
|
|
|
this.unlockTarget()},lockTarget:function(){if(!this.IsLockTargetMode)return;if(-1!=this.LockerTargetTimer)clearTimeout(this.LockerTargetTimer);this.Api.asc_LockTargetUpdate(true);var oThis=this;this.LockerTargetTimer=setTimeout(function(){oThis.unlockTarget()},1E3)},unlockTarget:function(){if(!this.IsLockTargetMode)return;if(-1!=this.LockerTargetTimer)clearTimeout(this.LockerTargetTimer);this.LockerTargetTimer=-1;this.Api.asc_LockTargetUpdate(false)},clearLastCompositeText:function(){this.LastReplaceText=
|
|
|
|
sel.getRangeAt(0);_offset=range.endOffset}}return _offset},checkTargetPosition:function(isCorrect){var _offset=this.getAreaPos();if(false!==isCorrect){var _value=this.getAreaValue();_offset-=_value.length-this.compositionValue.length}if(!this.IsLockTargetMode)if(_offset==0&&this.compositionValue.length==1)_offset=1;this.Api.Set_CursorPosInCompositeText(_offset);this.unlockTarget()},lockTarget:function(){if(!this.IsLockTargetMode)return;if(-1!=this.LockerTargetTimer)clearTimeout(this.LockerTargetTimer);
|
|
|
|
[];this.IsLastReplaceFlag=false},apiCompositeStart:function(){},apiCompositeReplace:function(_value){if(this.Api.isLongAction())return false;if(!this.ApiIsComposition){this.Api.Begin_CompositeInput();this.clearLastCompositeText()}this.ApiIsComposition=true;if(this.IsLastReplaceFlag)if(_value.length==this.LastReplaceText.length){var isEqual=true;for(var nC=0;nC<_value.length;nC++)if(_value[nC]!=this.LastReplaceText[nC]){isEqual=false;break}if(isEqual)return}this.Api.Replace_CompositeText(_value);if(window.g_asc_plugins){this.keyPressInput=
|
|
|
|
this.Api.asc_LockTargetUpdate(true);var oThis=this;this.LockerTargetTimer=setTimeout(function(){oThis.unlockTarget()},1E3)},unlockTarget:function(){if(!this.IsLockTargetMode)return;if(-1!=this.LockerTargetTimer)clearTimeout(this.LockerTargetTimer);this.LockerTargetTimer=-1;this.Api.asc_LockTargetUpdate(false)},clearLastCompositeText:function(){this.LastReplaceText=[];this.IsLastReplaceFlag=false},apiCompositeStart:function(){},apiCompositeReplace:function(_value){if(this.Api.isLongAction())return false;
|
|
|
|
String.fromCodePoint.apply(this,_value);window.g_asc_plugins.onPluginEvent("onInputHelperInput",{"text":this.keyPressInput})}this.LastReplaceText=_value.slice();this.IsLastReplaceFlag=true},apiCompositeEnd:function(){if(!this.ApiIsComposition)return;this.ApiIsComposition=false;this.Api.End_CompositeInput();this.clearLastCompositeText()},onCompositionStart:function(e){if(this.isSystem)return;this.IsComposition=true;this.keyPressOnUpCodes=[]},onCompositionUpdate:function(e){if(this.isSystem)return;
|
|
|
|
if(!this.ApiIsComposition){this.Api.Begin_CompositeInput();this.clearLastCompositeText()}this.ApiIsComposition=true;if(this.IsLastReplaceFlag)if(_value.length==this.LastReplaceText.length){var isEqual=true;for(var nC=0;nC<_value.length;nC++)if(_value[nC]!=this.LastReplaceText[nC]){isEqual=false;break}if(isEqual)return}this.Api.Replace_CompositeText(_value);if(window.g_asc_plugins){this.keyPressInput=String.fromCodePoint.apply(this,_value);window.g_asc_plugins.onPluginEvent("onInputHelperInput",{"text":this.keyPressInput})}this.LastReplaceText=
|
|
|
|
this.IsComposition=true;this.keyPressOnUpCodes=[];this.onInput(e,true)},onCompositionEnd:function(e){if(this.isSystem)return;this.IsComposition=false;this.onInput(e,true)},setInterfaceEnableKeyEvents:function(value){this.InterfaceEnableKeyEvents=value;if(true==this.InterfaceEnableKeyEvents){if(document.activeElement){var _id=document.activeElement.id;if(_id=="area_id"||window.g_asc_plugins&&window.g_asc_plugins.checkRunnedFrameId(_id))return}this.HtmlArea.focus()}},externalEndCompositeInput:function(){this.clear()},
|
|
|
|
_value.slice();this.IsLastReplaceFlag=true},apiCompositeEnd:function(){if(!this.ApiIsComposition)return;this.ApiIsComposition=false;this.Api.End_CompositeInput();this.clearLastCompositeText()},onCompositionStart:function(e){if(this.isSystem)return;this.IsComposition=true;this.keyPressOnUpCodes=[]},onCompositionUpdate:function(e){if(this.isSystem)return;this.IsComposition=true;this.keyPressOnUpCodes=[];this.onInput(e,true)},onCompositionEnd:function(e){if(this.isSystem)return;this.IsComposition=false;
|
|
|
|
externalChangeFocus:function(){if(!this.IsComposition)return false;setTimeout(function(){window["AscCommon"].g_inputContext.clear()},10);return true},isCompositionProcess:function(){return this.IsComposition},preventVirtualKeyboard:function(e){if(this.isHardCheckKeyboard)return;if(AscCommon.AscBrowser.isAndroid){this.setReadOnlyWrapper(true);this.virtualKeyboardClickPrevent=true;this.virtualKeyboardClickTimeout=setTimeout(function(){window["AscCommon"].g_inputContext.setReadOnlyWrapper(false);window["AscCommon"].g_inputContext.virtualKeyboardClickTimeout=
|
|
|
|
this.onInput(e,true)},setInterfaceEnableKeyEvents:function(value){this.InterfaceEnableKeyEvents=value;if(true==this.InterfaceEnableKeyEvents){if(document.activeElement){var _id=document.activeElement.id;if(_id=="area_id"||window.g_asc_plugins&&window.g_asc_plugins.checkRunnedFrameId(_id))return}this.HtmlArea.focus()}},externalEndCompositeInput:function(){this.clear()},externalChangeFocus:function(){if(!this.IsComposition)return false;setTimeout(function(){window["AscCommon"].g_inputContext.clear()},
|
|
|
|
-1},1)}},enableVirtualKeyboard:function(){if(this.isHardCheckKeyboard)return;if(AscCommon.AscBrowser.isAndroid){if(-1!=this.virtualKeyboardClickTimeout){clearTimeout(this.virtualKeyboardClickTimeout);this.virtualKeyboardClickTimeout=-1}this.setReadOnlyWrapper(false);this.virtualKeyboardClickPrevent=false}},preventVirtualKeyboard_Hard:function(){this.setReadOnlyWrapper(true)},enableVirtualKeyboard_Hard:function(){this.setReadOnlyWrapper(false)}};function _getAttirbute(_elem,_attr,_depth){var _elemTest=
|
|
|
|
10);return true},isCompositionProcess:function(){return this.IsComposition},preventVirtualKeyboard:function(e){if(this.isHardCheckKeyboard)return;if(AscCommon.AscBrowser.isAndroid){this.setReadOnlyWrapper(true);this.virtualKeyboardClickPrevent=true;this.virtualKeyboardClickTimeout=setTimeout(function(){window["AscCommon"].g_inputContext.setReadOnlyWrapper(false);window["AscCommon"].g_inputContext.virtualKeyboardClickTimeout=-1},1)}},enableVirtualKeyboard:function(){if(this.isHardCheckKeyboard)return;
|
|
|
|
_elem;for(var _level=0;_elemTest&&_level<_depth;++_level,_elemTest=_elemTest.parentNode){var _res=_elemTest.getAttribute?_elemTest.getAttribute(_attr):null;if(null!=_res)return _res}return null}function _getElementKeyboardDown(_elem,_depth){var _elemTest=_elem;for(var _level=0;_elemTest&&_level<_depth;++_level,_elemTest=_elemTest.parentNode){var _res=_elemTest.getAttribute?_elemTest.getAttribute("oo_editor_keyboard"):null;if(null!=_res)return _elemTest}return null}function _getDefaultKeyboardInput(_elem,
|
|
|
|
if(AscCommon.AscBrowser.isAndroid){if(-1!=this.virtualKeyboardClickTimeout){clearTimeout(this.virtualKeyboardClickTimeout);this.virtualKeyboardClickTimeout=-1}this.setReadOnlyWrapper(false);this.virtualKeyboardClickPrevent=false}},preventVirtualKeyboard_Hard:function(){this.setReadOnlyWrapper(true)},enableVirtualKeyboard_Hard:function(){this.setReadOnlyWrapper(false)}};function _getAttirbute(_elem,_attr,_depth){var _elemTest=_elem;for(var _level=0;_elemTest&&_level<_depth;++_level,_elemTest=_elemTest.parentNode){var _res=
|
|
|
|
_depth){var _elemTest=_elem;for(var _level=0;_elemTest&&_level<_depth;++_level,_elemTest=_elemTest.parentNode){var _name=" "+_elemTest.className+" ";if(_name.indexOf(" dropdown-menu")>-1||_name.indexOf(" dropdown-toggle ")>-1||_name.indexOf(" dropdown-submenu ")>-1||_name.indexOf(" canfocused ")>-1)return"true"}return null}window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].CTextInput=CTextInput;window["AscCommon"].InitBrowserInputContext=function(api,target_id,parent_id){if(window["AscCommon"].g_inputContext)return;
|
|
|
|
_elemTest.getAttribute?_elemTest.getAttribute(_attr):null;if(null!=_res)return _res}return null}function _getElementKeyboardDown(_elem,_depth){var _elemTest=_elem;for(var _level=0;_elemTest&&_level<_depth;++_level,_elemTest=_elemTest.parentNode){var _res=_elemTest.getAttribute?_elemTest.getAttribute("oo_editor_keyboard"):null;if(null!=_res)return _elemTest}return null}function _getDefaultKeyboardInput(_elem,_depth){var _elemTest=_elem;for(var _level=0;_elemTest&&_level<_depth;++_level,_elemTest=_elemTest.parentNode){var _name=
|
|
|
|
window["AscCommon"].g_inputContext=new CTextInput(api);window["AscCommon"].g_inputContext.init(target_id,parent_id);window["AscCommon"].g_clipboardBase.Init(api);window["AscCommon"].g_clipboardBase.inputContext=window["AscCommon"].g_inputContext;if(window["AscCommon"].TextBoxInputMode===true)window["AscCommon"].g_inputContext.systemInputEnable(true);document.addEventListener("focus",function(e){var t=window["AscCommon"].g_inputContext;var _oldNativeFE=t.nativeFocusElement;t.nativeFocusElement=e.target;
|
|
|
|
" "+_elemTest.className+" ";if(_name.indexOf(" dropdown-menu")>-1||_name.indexOf(" dropdown-toggle ")>-1||_name.indexOf(" dropdown-submenu ")>-1||_name.indexOf(" canfocused ")>-1)return"true"}return null}window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].CTextInput=CTextInput;window["AscCommon"].InitBrowserInputContext=function(api,target_id,parent_id){if(window["AscCommon"].g_inputContext)return;window["AscCommon"].g_inputContext=new CTextInput(api);window["AscCommon"].g_inputContext.init(target_id,
|
|
|
|
if(t.IsComposition){t.apiCompositeEnd();t.externalEndCompositeInput()}if(!t.isSystem&&!t.isNoClearOnFocus)t.clear(true);t.isNoClearOnFocus=false;var _nativeFocusElementNoRemoveOnElementFocus=t.nativeFocusElementNoRemoveOnElementFocus;t.nativeFocusElementNoRemoveOnElementFocus=false;if(t.InterfaceEnableKeyEvents==false){t.nativeFocusElement=null;return}if(t.nativeFocusElement&&t.nativeFocusElement.id==t.HtmlArea.id){t.Api.asc_enableKeyEvents(true,true);if(_nativeFocusElementNoRemoveOnElementFocus)t.nativeFocusElement=
|
|
|
|
parent_id);window["AscCommon"].g_clipboardBase.Init(api);window["AscCommon"].g_clipboardBase.inputContext=window["AscCommon"].g_inputContext;if(window["AscCommon"].TextBoxInputMode===true)window["AscCommon"].g_inputContext.systemInputEnable(true);document.addEventListener("focus",function(e){var t=window["AscCommon"].g_inputContext;var _oldNativeFE=t.nativeFocusElement;t.nativeFocusElement=e.target;if(t.IsComposition){t.apiCompositeEnd();t.externalEndCompositeInput()}if(!t.isSystem&&!t.isNoClearOnFocus)t.clear(true);
|
|
|
|
_oldNativeFE;else t.nativeFocusElement=null;return}if(t.nativeFocusElement&&t.nativeFocusElement.id==window["AscCommon"].g_clipboardBase.CommonDivId){t.nativeFocusElement=null;return}t.nativeFocusElementNoRemoveOnElementFocus=false;var _isElementEditable=false;if(t.nativeFocusElement){var _name=t.nativeFocusElement.nodeName;if(_name)_name=_name.toUpperCase();if("INPUT"==_name||"TEXTAREA"==_name)_isElementEditable=true;else if("DIV"==_name)if(t.nativeFocusElement.getAttribute("contenteditable")=="true")_isElementEditable=
|
|
|
|
t.isNoClearOnFocus=false;var _nativeFocusElementNoRemoveOnElementFocus=t.nativeFocusElementNoRemoveOnElementFocus;t.nativeFocusElementNoRemoveOnElementFocus=false;if(t.InterfaceEnableKeyEvents==false){t.nativeFocusElement=null;return}if(t.nativeFocusElement&&t.nativeFocusElement.id==t.HtmlArea.id){t.Api.asc_enableKeyEvents(true,true);if(_nativeFocusElementNoRemoveOnElementFocus)t.nativeFocusElement=_oldNativeFE;else t.nativeFocusElement=null;return}if(t.nativeFocusElement&&t.nativeFocusElement.id==
|
|
|
|
true}if("IFRAME"==_name){t.Api.asc_enableKeyEvents(false,true);t.nativeFocusElement=null;return}var _oo_editor_input=_getAttirbute(t.nativeFocusElement,"oo_editor_input",3);var _oo_editor_keyboard=_getAttirbute(t.nativeFocusElement,"oo_editor_keyboard",3);if(!_oo_editor_input&&!_oo_editor_keyboard)_oo_editor_input=_getDefaultKeyboardInput(t.nativeFocusElement,3);if(_oo_editor_keyboard=="true")_oo_editor_input=undefined;if(_oo_editor_input=="true"){t.Api.asc_enableKeyEvents(false,true);t.nativeFocusElement=
|
|
|
|
window["AscCommon"].g_clipboardBase.CommonDivId){t.nativeFocusElement=null;return}t.nativeFocusElementNoRemoveOnElementFocus=false;var _isElementEditable=false;if(t.nativeFocusElement){var _name=t.nativeFocusElement.nodeName;if(_name)_name=_name.toUpperCase();if("INPUT"==_name||"TEXTAREA"==_name)_isElementEditable=true;else if("DIV"==_name)if(t.nativeFocusElement.getAttribute("contenteditable")=="true")_isElementEditable=true}if("IFRAME"==_name){t.Api.asc_enableKeyEvents(false,true);t.nativeFocusElement=
|
|
|
|
null;return}if(_isElementEditable&&_oo_editor_input!="false"){t.Api.asc_enableKeyEvents(false,true);t.nativeFocusElement=null;return}if(_oo_editor_keyboard!="true")t.nativeFocusElement=null;var _elem=t.nativeFocusElement;t.nativeFocusElementNoRemoveOnElementFocus=true;AscCommon.AscBrowser.isMozilla?setTimeout(function(){t.HtmlArea.focus()},0):t.HtmlArea.focus();t.nativeFocusElement=_elem;t.Api.asc_enableKeyEvents(true,true)},true);if(!api.isMobileVersion&&!api.isEmbedVersion)window["AscCommon"].g_inputContext.HtmlArea.focus()};
|
|
|
|
null;return}var _oo_editor_input=_getAttirbute(t.nativeFocusElement,"oo_editor_input",3);var _oo_editor_keyboard=_getAttirbute(t.nativeFocusElement,"oo_editor_keyboard",3);if(!_oo_editor_input&&!_oo_editor_keyboard)_oo_editor_input=_getDefaultKeyboardInput(t.nativeFocusElement,3);if(_oo_editor_keyboard=="true")_oo_editor_input=undefined;if(_oo_editor_input=="true"){t.Api.asc_enableKeyEvents(false,true);t.nativeFocusElement=null;return}if(_isElementEditable&&_oo_editor_input!="false"){t.Api.asc_enableKeyEvents(false,
|
|
|
|
window["SetInputDebugMode"]=function(){if(!window["AscCommon"].g_inputContext)return;window["AscCommon"].g_inputContext.debugInputEnable(true);window["AscCommon"].g_inputContext.show()}})(window);"use strict";(function(window,undefined){function COleSize(w,h){this.w=w;this.h=h}COleSize.prototype.Write_ToBinary=function(Writer){Writer.WriteLong(this.w);Writer.WriteLong(this.h)};COleSize.prototype.Read_FromBinary=function(Reader){this.w=Reader.GetLong();this.h=Reader.GetLong()};AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetData]=
|
|
|
|
true);t.nativeFocusElement=null;return}if(_oo_editor_keyboard!="true")t.nativeFocusElement=null;var _elem=t.nativeFocusElement;t.nativeFocusElementNoRemoveOnElementFocus=true;AscCommon.AscBrowser.isMozilla?setTimeout(function(){t.HtmlArea.focus()},0):t.HtmlArea.focus();t.nativeFocusElement=_elem;t.Api.asc_enableKeyEvents(true,true)},true);if(!api.isMobileVersion&&!api.isEmbedVersion)window["AscCommon"].g_inputContext.HtmlArea.focus()};window["SetInputDebugMode"]=function(){if(!window["AscCommon"].g_inputContext)return;
|
|
|
|
AscDFH.CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetApplicationId]=AscDFH.CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetPixSizes]=AscDFH.CChangesDrawingsObjectNoId;AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetObjectFile]=AscDFH.CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetOleType]=AscDFH.CChangesDrawingsLong;AscDFH.drawingsConstructorsMap[AscDFH.historyitem_ChartStyleEntryDefRPr]=AscCommonWord.CTextPr;
|
|
|
|
window["AscCommon"].g_inputContext.debugInputEnable(true);window["AscCommon"].g_inputContext.show()}})(window);"use strict";(function(window,undefined){function COleSize(w,h){this.w=w;this.h=h}COleSize.prototype.Write_ToBinary=function(Writer){Writer.WriteLong(this.w);Writer.WriteLong(this.h)};COleSize.prototype.Read_FromBinary=function(Reader){this.w=Reader.GetLong();this.h=Reader.GetLong()};AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetData]=AscDFH.CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetApplicationId]=
|
|
|
|
function CChangesOleObjectBinary(Class,Old,New,Color){AscDFH.CChangesBaseProperty.call(this,Class,Old,New,Color)}CChangesOleObjectBinary.prototype=Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesOleObjectBinary.prototype.Type=AscDFH.historyitem_ImageShapeSetBinaryData;CChangesOleObjectBinary.prototype.private_SetValue=function(Value){this.Class.m_aBinaryData=Value};CChangesOleObjectBinary.prototype.WriteToBinary=function(Writer){Writer.WriteBool(this.New!==null);if(this.New!==null){Writer.WriteLong(this.New.length);
|
|
|
|
AscDFH.CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetPixSizes]=AscDFH.CChangesDrawingsObjectNoId;AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetObjectFile]=AscDFH.CChangesDrawingsString;AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetOleType]=AscDFH.CChangesDrawingsLong;AscDFH.drawingsConstructorsMap[AscDFH.historyitem_ChartStyleEntryDefRPr]=AscCommonWord.CTextPr;function CChangesOleObjectBinary(Class,Old,New,Color){AscDFH.CChangesBaseProperty.call(this,
|
|
|
|
Writer.WriteBuffer(this.New,0,this.New.length)}};CChangesOleObjectBinary.prototype.ReadFromBinary=function(Reader){if(Reader.GetBool()){var length=Reader.GetLong();this.New=Reader.GetBuffer(length)}};AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetBinaryData]=CChangesOleObjectBinary;AscDFH.drawingsChangesMap[AscDFH.historyitem_ImageShapeSetData]=function(oClass,value){oClass.m_sData=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_ImageShapeSetApplicationId]=function(oClass,value){oClass.m_sApplicationId=
|
|
|
|
Class,Old,New,Color)}CChangesOleObjectBinary.prototype=Object.create(AscDFH.CChangesBaseProperty.prototype);CChangesOleObjectBinary.prototype.Type=AscDFH.historyitem_ImageShapeSetBinaryData;CChangesOleObjectBinary.prototype.private_SetValue=function(Value){this.Class.m_aBinaryData=Value};CChangesOleObjectBinary.prototype.WriteToBinary=function(Writer){Writer.WriteBool(this.New!==null);if(this.New!==null){Writer.WriteLong(this.New.length);Writer.WriteBuffer(this.New,0,this.New.length)}};CChangesOleObjectBinary.prototype.ReadFromBinary=
|
|
|
|
value};AscDFH.drawingsChangesMap[AscDFH.historyitem_ImageShapeSetPixSizes]=function(oClass,value){if(value){oClass.m_nPixWidth=value.w;oClass.m_nPixHeight=value.h}};AscDFH.drawingsConstructorsMap[AscDFH.historyitem_ImageShapeSetPixSizes]=COleSize;AscDFH.drawingsChangesMap[AscDFH.historyitem_ImageShapeSetObjectFile]=function(oClass,value){oClass.m_sObjectFile=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_ImageShapeSetOleType]=function(oClass,value){oClass.m_nOleType=value};function COleObject(){AscFormat.CImageShape.call(this);
|
|
|
|
function(Reader){if(Reader.GetBool()){var length=Reader.GetLong();this.New=Reader.GetBuffer(length)}};AscDFH.changesFactory[AscDFH.historyitem_ImageShapeSetBinaryData]=CChangesOleObjectBinary;AscDFH.drawingsChangesMap[AscDFH.historyitem_ImageShapeSetData]=function(oClass,value){oClass.m_sData=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_ImageShapeSetApplicationId]=function(oClass,value){oClass.m_sApplicationId=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_ImageShapeSetPixSizes]=function(oClass,
|
|
|
|
this.m_sData=null;this.m_sApplicationId=null;this.m_nPixWidth=null;this.m_nPixHeight=null;this.m_fDefaultSizeX=null;this.m_fDefaultSizeY=null;this.m_sObjectFile=null;this.m_nOleType=null;this.m_aBinaryData=null}COleObject.prototype=Object.create(AscFormat.CImageShape.prototype);COleObject.prototype.constructor=COleObject;COleObject.prototype.getObjectType=function(){return AscDFH.historyitem_type_OleObject};COleObject.prototype.setData=function(sData){AscCommon.History.Add(new AscDFH.CChangesDrawingsString(this,
|
|
|
|
value){if(value){oClass.m_nPixWidth=value.w;oClass.m_nPixHeight=value.h}};AscDFH.drawingsConstructorsMap[AscDFH.historyitem_ImageShapeSetPixSizes]=COleSize;AscDFH.drawingsChangesMap[AscDFH.historyitem_ImageShapeSetObjectFile]=function(oClass,value){oClass.m_sObjectFile=value};AscDFH.drawingsChangesMap[AscDFH.historyitem_ImageShapeSetOleType]=function(oClass,value){oClass.m_nOleType=value};function COleObject(){AscFormat.CImageShape.call(this);this.m_sData=null;this.m_sApplicationId=null;this.m_nPixWidth=
|
|
|
|
AscDFH.historyitem_ImageShapeSetData,this.m_sData,sData));this.m_sData=sData};COleObject.prototype.setApplicationId=function(sApplicationId){AscCommon.History.Add(new AscDFH.CChangesDrawingsString(this,AscDFH.historyitem_ImageShapeSetApplicationId,this.m_sApplicationId,sApplicationId));this.m_sApplicationId=sApplicationId};COleObject.prototype.setPixSizes=function(nPixWidth,nPixHeight){AscCommon.History.Add(new AscDFH.CChangesDrawingsObjectNoId(this,AscDFH.historyitem_ImageShapeSetPixSizes,new COleSize(this.m_nPixWidth,
|
|
|
|
null;this.m_nPixHeight=null;this.m_fDefaultSizeX=null;this.m_fDefaultSizeY=null;this.m_sObjectFile=null;this.m_nOleType=null;this.m_aBinaryData=null}COleObject.prototype=Object.create(AscFormat.CImageShape.prototype);COleObject.prototype.constructor=COleObject;COleObject.prototype.getObjectType=function(){return AscDFH.historyitem_type_OleObject};COleObject.prototype.setData=function(sData){AscCommon.History.Add(new AscDFH.CChangesDrawingsString(this,AscDFH.historyitem_ImageShapeSetData,this.m_sData,
|
|
|
|
this.m_nPixHeight),new COleSize(nPixWidth,nPixHeight)));this.m_nPixWidth=nPixWidth;this.m_nPixHeight=nPixHeight};COleObject.prototype.setObjectFile=function(sObjectFile){AscCommon.History.Add(new AscDFH.CChangesDrawingsString(this,AscDFH.historyitem_ImageShapeSetObjectFile,this.m_sObjectFile,sObjectFile));this.m_sObjectFile=sObjectFile};COleObject.prototype.setOleType=function(nOleType){AscCommon.History.Add(new AscDFH.CChangesDrawingsLong(this,AscDFH.historyitem_ImageShapeSetOleType,this.m_nOleType,
|
|
|
|
sData));this.m_sData=sData};COleObject.prototype.setApplicationId=function(sApplicationId){AscCommon.History.Add(new AscDFH.CChangesDrawingsString(this,AscDFH.historyitem_ImageShapeSetApplicationId,this.m_sApplicationId,sApplicationId));this.m_sApplicationId=sApplicationId};COleObject.prototype.setPixSizes=function(nPixWidth,nPixHeight){AscCommon.History.Add(new AscDFH.CChangesDrawingsObjectNoId(this,AscDFH.historyitem_ImageShapeSetPixSizes,new COleSize(this.m_nPixWidth,this.m_nPixHeight),new COleSize(nPixWidth,
|
|
|
|
nOleType));this.m_nOleType=nOleType};COleObject.prototype.setBinaryData=function(aBinaryData){AscCommon.History.Add(new CChangesOleObjectBinary(this,this.m_aBinaryData,aBinaryData,false));this.m_aBinaryData=aBinaryData};COleObject.prototype.canRotate=function(){return false};COleObject.prototype.copy=function(){var copy=new COleObject;if(this.nvPicPr)copy.setNvPicPr(this.nvPicPr.createDuplicate());if(this.spPr){copy.setSpPr(this.spPr.createDuplicate());copy.spPr.setParent(copy)}if(this.blipFill)copy.setBlipFill(this.blipFill.createDuplicate());
|
|
|
|
nPixHeight)));this.m_nPixWidth=nPixWidth;this.m_nPixHeight=nPixHeight};COleObject.prototype.setObjectFile=function(sObjectFile){AscCommon.History.Add(new AscDFH.CChangesDrawingsString(this,AscDFH.historyitem_ImageShapeSetObjectFile,this.m_sObjectFile,sObjectFile));this.m_sObjectFile=sObjectFile};COleObject.prototype.setOleType=function(nOleType){AscCommon.History.Add(new AscDFH.CChangesDrawingsLong(this,AscDFH.historyitem_ImageShapeSetOleType,this.m_nOleType,nOleType));this.m_nOleType=nOleType};COleObject.prototype.setBinaryData=
|
|
|
|
if(this.style)copy.setStyle(this.style.createDuplicate());copy.setBDeleted(this.bDeleted);copy.setData(this.m_sData);copy.setApplicationId(this.m_sApplicationId);copy.setPixSizes(this.m_nPixWidth,this.m_nPixHeight);copy.setObjectFile(this.m_sObjectFile);copy.setOleType(this.m_nOleType);if(this.m_aBinaryData!==null)copy.setBinaryData(this.m_aBinaryData.slice(0,this.m_aBinaryData.length));if(this.macro!==null)copy.setMacro(this.macro);if(this.textLink!==null)copy.setTextLink(this.textLink);copy.cachedImage=
|
|
|
|
function(aBinaryData){AscCommon.History.Add(new CChangesOleObjectBinary(this,this.m_aBinaryData,aBinaryData,false));this.m_aBinaryData=aBinaryData};COleObject.prototype.canRotate=function(){return false};COleObject.prototype.copy=function(){var copy=new COleObject;if(this.nvPicPr)copy.setNvPicPr(this.nvPicPr.createDuplicate());if(this.spPr){copy.setSpPr(this.spPr.createDuplicate());copy.spPr.setParent(copy)}if(this.blipFill)copy.setBlipFill(this.blipFill.createDuplicate());if(this.style)copy.setStyle(this.style.createDuplicate());
|
|
|
|
this.getBase64Img();copy.cachedPixH=this.cachedPixH;copy.cachedPixW=this.cachedPixW;return copy};COleObject.prototype.handleUpdateExtents=function(){if(!AscFormat.isRealNumber(this.m_fDefaultSizeX)||!AscFormat.isRealNumber(this.m_fDefaultSizeY))if(this.spPr&&this.spPr.xfrm&&AscFormat.isRealNumber(this.spPr.xfrm.extX)&&AscFormat.isRealNumber(this.spPr.xfrm.extY)&&this.spPr.xfrm.extX>0&&this.spPr.xfrm.extY>0){this.m_fDefaultSizeX=this.spPr.xfrm.extX;this.m_fDefaultSizeY=this.spPr.xfrm.extY}AscFormat.CImageShape.prototype.handleUpdateExtents.call(this,
|
|
|
|
copy.setBDeleted(this.bDeleted);copy.setData(this.m_sData);copy.setApplicationId(this.m_sApplicationId);copy.setPixSizes(this.m_nPixWidth,this.m_nPixHeight);copy.setObjectFile(this.m_sObjectFile);copy.setOleType(this.m_nOleType);if(this.m_aBinaryData!==null)copy.setBinaryData(this.m_aBinaryData.slice(0,this.m_aBinaryData.length));if(this.macro!==null)copy.setMacro(this.macro);if(this.textLink!==null)copy.setTextLink(this.textLink);copy.cachedImage=this.getBase64Img();copy.cachedPixH=this.cachedPixH;
|
|
|
|
|
|
|
|
copy.cachedPixW=this.cachedPixW;return copy};COleObject.prototype.handleUpdateExtents=function(){if(!AscFormat.isRealNumber(this.m_fDefaultSizeX)||!AscFormat.isRealNumber(this.m_fDefaultSizeY))if(this.spPr&&this.spPr.xfrm&&AscFormat.isRealNumber(this.spPr.xfrm.extX)&&AscFormat.isRealNumber(this.spPr.xfrm.extY)&&this.spPr.xfrm.extX>0&&this.spPr.xfrm.extY>0){this.m_fDefaultSizeX=this.spPr.xfrm.extX;this.m_fDefaultSizeY=this.spPr.xfrm.extY}AscFormat.CImageShape.prototype.handleUpdateExtents.call(this,
|
|
|
|
[])};COleObject.prototype.checkTypeCorrect=function(){var bCorrectData=false;if(this.m_sData)bCorrectData=true;else if(this.m_sObjectFile)bCorrectData=true;if(!bCorrectData)return false;if(this.m_sApplicationId===null)return false;return true};window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].COleObject=COleObject})(window);"use strict";(function(window,undefined){function CDrawingDocContent(Parent,DrawingDocument,X,Y,XLimit,YLimit){CDocumentContent.call(this,Parent,DrawingDocument,
|
|
|
|
[])};COleObject.prototype.checkTypeCorrect=function(){var bCorrectData=false;if(this.m_sData)bCorrectData=true;else if(this.m_sObjectFile)bCorrectData=true;if(!bCorrectData)return false;if(this.m_sApplicationId===null)return false;return true};window["AscFormat"]=window["AscFormat"]||{};window["AscFormat"].COleObject=COleObject})(window);"use strict";(function(window,undefined){function CDrawingDocContent(Parent,DrawingDocument,X,Y,XLimit,YLimit){CDocumentContent.call(this,Parent,DrawingDocument,
|
|
|
|
X,Y,XLimit,YLimit,false,false,true);this.FullRecalc=new CDocumentRecalculateState;this.AllFields=[]}CDrawingDocContent.prototype=Object.create(CDocumentContent.prototype);CDrawingDocContent.prototype.constructor=CDrawingDocContent;CDrawingDocContent.prototype.CalculateAllFields=function(){var aParagraphs=this.Content;this.AllFields.length=0;for(var i=0;i<aParagraphs.length;++i){var aContent=aParagraphs[i].Content;for(var j=0;j<aContent.length;++j)if(aContent[j]instanceof AscCommonWord.CPresentationField)this.AllFields.push(aContent[j])}};
|
|
|
|
X,Y,XLimit,YLimit,false,false,true);this.FullRecalc=new CDocumentRecalculateState;this.AllFields=[]}CDrawingDocContent.prototype=Object.create(CDocumentContent.prototype);CDrawingDocContent.prototype.constructor=CDrawingDocContent;CDrawingDocContent.prototype.CalculateAllFields=function(){var aParagraphs=this.Content;this.AllFields.length=0;for(var i=0;i<aParagraphs.length;++i){var aContent=aParagraphs[i].Content;for(var j=0;j<aContent.length;++j)if(aContent[j]instanceof AscCommonWord.CPresentationField)this.AllFields.push(aContent[j])}};
|
|
|
|
CDrawingDocContent.prototype.GetFieldByType=function(sType){var sType_=sType.toLowerCase();var oField;for(var i=0;i<this.AllFields.length;++i){oField=this.AllFields[i];if(oField.GetFieldType()===sType_)return oField}return null};CDrawingDocContent.prototype.GetFieldByType2=function(sType){var sType_=sType.toLowerCase();var oField;var sFieldType;for(var i=0;i<this.AllFields.length;++i){oField=this.AllFields[i];sFieldType=oField.GetFieldType();if(typeof sFieldType==="string"&&sFieldType.indexOf(sType_)===
|
|
|
|
CDrawingDocContent.prototype.GetFieldByType=function(sType){var sType_=sType.toLowerCase();var oField;for(var i=0;i<this.AllFields.length;++i){oField=this.AllFields[i];if(oField.GetFieldType()===sType_)return oField}return null};CDrawingDocContent.prototype.GetFieldByType2=function(sType){var sType_=sType.toLowerCase();var oField;var sFieldType;for(var i=0;i<this.AllFields.length;++i){oField=this.AllFields[i];sFieldType=oField.GetFieldType();if(typeof sFieldType==="string"&&sFieldType.indexOf(sType_)===
|
|
|
|