2016-04-01 13:17:09 +00:00
/ *
*
2019-01-17 13:05:03 +00:00
* ( c ) Copyright Ascensio System SIA 2010 - 2019
2016-04-01 13:17:09 +00:00
*
* This program is a free software product . You can redistribute it and / or
* modify it under the terms of the GNU Affero General Public License ( AGPL )
* version 3 as published by the Free Software Foundation . In accordance with
* Section 7 ( a ) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non - infringement
* of any third - party rights .
*
* This program is distributed WITHOUT ANY WARRANTY ; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . For
* details , see the GNU AGPL at : http : //www.gnu.org/licenses/agpl-3.0.html
*
2019-01-17 13:00:34 +00:00
* You can contact Ascensio System SIA at 20 A - 12 Ernesta Birznieka - Upisha
* street , Riga , Latvia , EU , LV - 1050.
2016-04-01 13:17:09 +00:00
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices , as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7 ( b ) of the License you must retain the original Product
* logo when distributing the program . Pursuant to Section 7 ( e ) we decline to
* grant you any rights under trademark law for use of our trademarks .
*
* All the Product ' s GUI elements , including illustrations and icon sets , as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution - ShareAlike 4.0 International . See the License
* terms at http : //creativecommons.org/licenses/by-sa/4.0/legalcode
*
* /
2016-03-11 00:48:53 +00:00
/ * *
* DocumentHolder . js
*
* DocumentHolder controller
*
* Created by Julia Radzhabova on 3 / 28 / 14
2018-03-01 12:16:38 +00:00
* Copyright ( c ) 2018 Ascensio System SIA . All rights reserved .
2016-03-11 00:48:53 +00:00
*
* /
2019-08-07 09:17:08 +00:00
var c _paragraphLinerule = {
LINERULE _AUTO : 1 ,
LINERULE _EXACT : 2
} ;
var c _paragraphTextAlignment = {
RIGHT : 0 ,
LEFT : 1 ,
CENTERED : 2 ,
JUSTIFIED : 3
} ;
var c _paragraphSpecial = {
NONE _SPECIAL : 0 ,
FIRST _LINE : 1 ,
HANGING : 2
} ;
2016-03-11 00:48:53 +00:00
define ( [
'core' ,
'common/main/lib/util/utils' ,
2018-09-26 13:05:00 +00:00
'common/main/lib/util/Shortcuts' ,
2016-03-11 00:48:53 +00:00
'common/main/lib/view/CopyWarningDialog' ,
2019-04-17 13:16:02 +00:00
'common/main/lib/view/OpenDialog' ,
2019-11-07 11:01:07 +00:00
'common/main/lib/view/ListSettingsDialog' ,
2016-03-11 00:48:53 +00:00
'spreadsheeteditor/main/app/view/DocumentHolder' ,
'spreadsheeteditor/main/app/view/HyperlinkSettingsDialog' ,
'spreadsheeteditor/main/app/view/ParagraphSettingsAdvanced' ,
2017-04-11 11:05:56 +00:00
'spreadsheeteditor/main/app/view/ImageSettingsAdvanced' ,
2016-03-11 00:48:53 +00:00
'spreadsheeteditor/main/app/view/SetValueDialog' ,
2020-02-28 13:30:58 +00:00
'spreadsheeteditor/main/app/view/AutoFilterDialog' ,
2020-05-25 17:25:16 +00:00
'spreadsheeteditor/main/app/view/SpecialPasteDialog' ,
2020-05-26 14:14:58 +00:00
'spreadsheeteditor/main/app/view/SlicerSettingsAdvanced'
2016-03-11 00:48:53 +00:00
] , function ( ) {
'use strict' ;
SSE . Controllers . DocumentHolder = Backbone . Controller . extend ( _ . extend ( {
models : [ ] ,
collections : [ ] ,
views : [
'DocumentHolder'
] ,
initialize : function ( ) {
var me = this ;
me . tooltips = {
hyperlink : { } ,
/** coauthoring begin **/
comment : { } ,
/** coauthoring end **/
coauth : {
ttHeight : 20
} ,
row _column : {
ttHeight : 20
2018-05-31 07:27:38 +00:00
} ,
2020-05-28 10:58:38 +00:00
slicer : {
ttHeight : 20
} ,
2019-03-07 12:13:46 +00:00
filter : { ttHeight : 40 } ,
2019-07-30 12:24:47 +00:00
func _arg : { } ,
input _msg : { }
2016-03-11 00:48:53 +00:00
} ;
me . mouse = { } ;
me . popupmenu = false ;
me . rangeSelectionMode = false ;
me . namedrange _locked = false ;
2016-10-24 11:56:11 +00:00
me . _currentMathObj = undefined ;
me . _currentParaObjDisabled = false ;
2017-11-10 07:50:01 +00:00
me . _isDisabled = false ;
2018-04-13 13:29:31 +00:00
me . _state = { } ;
2016-03-11 00:48:53 +00:00
/** coauthoring begin **/
this . wrapEvents = {
apiHideComment : _ . bind ( this . onApiHideComment , this )
} ;
/** coauthoring end **/
this . addListeners ( {
'DocumentHolder' : {
'createdelayedelements' : this . onCreateDelayedElements
}
} ) ;
var keymap = { } ;
this . hkComments = 'alt+h' ;
keymap [ this . hkComments ] = function ( ) {
me . onAddComment ( ) ;
2017-09-19 11:13:07 +00:00
return false ;
2016-03-11 00:48:53 +00:00
} ;
Common . util . Shortcuts . delegateShortcuts ( { shortcuts : keymap } ) ;
} ,
onLaunch : function ( ) {
var me = this ;
me . documentHolder = this . createView ( 'DocumentHolder' ) ;
// me.documentHolder.on('render:after', _.bind(me.onAfterRender, me));
me . documentHolder . render ( ) ;
me . documentHolder . el . tabIndex = - 1 ;
$ ( document ) . on ( 'mousedown' , _ . bind ( me . onDocumentRightDown , me ) ) ;
$ ( document ) . on ( 'mouseup' , _ . bind ( me . onDocumentRightUp , me ) ) ;
$ ( document ) . on ( 'keydown' , _ . bind ( me . onDocumentKeyDown , me ) ) ;
2019-04-03 13:03:20 +00:00
$ ( document ) . on ( 'mousemove' , _ . bind ( me . onDocumentMouseMove , me ) ) ;
2016-03-11 00:48:53 +00:00
$ ( window ) . on ( 'resize' , _ . bind ( me . onDocumentResize , me ) ) ;
var viewport = SSE . getController ( 'Viewport' ) . getView ( 'Viewport' ) ;
viewport . hlayout . on ( 'layout:resizedrag' , _ . bind ( me . onDocumentResize , me ) ) ;
Common . NotificationCenter . on ( {
'window:show' : function ( e ) {
me . hideHyperlinkTip ( ) ;
2020-03-05 11:38:25 +00:00
me . permissions && me . permissions . isDesktopApp && me . api && me . api . asc _onShowPopupWindow ( ) ;
2016-03-11 00:48:53 +00:00
} ,
'modal:show' : function ( e ) {
me . hideCoAuthTips ( ) ;
} ,
'layout:changed' : function ( e ) {
me . hideHyperlinkTip ( ) ;
me . hideCoAuthTips ( ) ;
me . onDocumentResize ( ) ;
} ,
'cells:range' : function ( status ) {
me . onCellsRange ( status ) ;
2020-02-25 11:37:43 +00:00
} ,
'tabs:dragend' : _ . bind ( me . onDragEndMouseUp , me )
2016-03-11 00:48:53 +00:00
} ) ;
2017-11-02 08:13:24 +00:00
Common . Gateway . on ( 'processmouse' , _ . bind ( me . onProcessMouse , me ) ) ;
2016-03-11 00:48:53 +00:00
} ,
onCreateDelayedElements : function ( view ) {
var me = this ;
2017-06-06 08:04:04 +00:00
if ( me . permissions . isEdit ) {
view . pmiCut . on ( 'click' , _ . bind ( me . onCopyPaste , me ) ) ;
view . pmiCopy . on ( 'click' , _ . bind ( me . onCopyPaste , me ) ) ;
view . pmiPaste . on ( 'click' , _ . bind ( me . onCopyPaste , me ) ) ;
view . pmiImgCut . on ( 'click' , _ . bind ( me . onCopyPaste , me ) ) ;
view . pmiImgCopy . on ( 'click' , _ . bind ( me . onCopyPaste , me ) ) ;
view . pmiImgPaste . on ( 'click' , _ . bind ( me . onCopyPaste , me ) ) ;
view . pmiTextCut . on ( 'click' , _ . bind ( me . onCopyPaste , me ) ) ;
view . pmiTextCopy . on ( 'click' , _ . bind ( me . onCopyPaste , me ) ) ;
view . pmiTextPaste . on ( 'click' , _ . bind ( me . onCopyPaste , me ) ) ;
2019-07-23 10:24:38 +00:00
view . pmiCommonCut . on ( 'click' , _ . bind ( me . onCopyPaste , me ) ) ;
view . pmiCommonCopy . on ( 'click' , _ . bind ( me . onCopyPaste , me ) ) ;
view . pmiCommonPaste . on ( 'click' , _ . bind ( me . onCopyPaste , me ) ) ;
2017-06-06 08:04:04 +00:00
view . pmiInsertEntire . on ( 'click' , _ . bind ( me . onInsertEntire , me ) ) ;
view . pmiDeleteEntire . on ( 'click' , _ . bind ( me . onDeleteEntire , me ) ) ;
view . pmiInsertCells . menu . on ( 'item:click' , _ . bind ( me . onInsertCells , me ) ) ;
view . pmiDeleteCells . menu . on ( 'item:click' , _ . bind ( me . onDeleteCells , me ) ) ;
view . pmiSparklines . menu . on ( 'item:click' , _ . bind ( me . onClear , me ) ) ;
view . pmiSortCells . menu . on ( 'item:click' , _ . bind ( me . onSortCells , me ) ) ;
view . pmiFilterCells . menu . on ( 'item:click' , _ . bind ( me . onFilterCells , me ) ) ;
view . pmiReapply . on ( 'click' , _ . bind ( me . onReapply , me ) ) ;
view . pmiClear . menu . on ( 'item:click' , _ . bind ( me . onClear , me ) ) ;
view . pmiSelectTable . menu . on ( 'item:click' , _ . bind ( me . onSelectTable , me ) ) ;
view . pmiInsertTable . menu . on ( 'item:click' , _ . bind ( me . onInsertTable , me ) ) ;
view . pmiDeleteTable . menu . on ( 'item:click' , _ . bind ( me . onDeleteTable , me ) ) ;
view . pmiInsFunction . on ( 'click' , _ . bind ( me . onInsFunction , me ) ) ;
view . menuAddHyperlink . on ( 'click' , _ . bind ( me . onInsHyperlink , me ) ) ;
view . menuEditHyperlink . on ( 'click' , _ . bind ( me . onInsHyperlink , me ) ) ;
view . menuRemoveHyperlink . on ( 'click' , _ . bind ( me . onDelHyperlink , me ) ) ;
view . pmiRowHeight . menu . on ( 'item:click' , _ . bind ( me . onSetSize , me ) ) ;
view . pmiColumnWidth . menu . on ( 'item:click' , _ . bind ( me . onSetSize , me ) ) ;
view . pmiEntireHide . on ( 'click' , _ . bind ( me . onEntireHide , me ) ) ;
view . pmiEntireShow . on ( 'click' , _ . bind ( me . onEntireShow , me ) ) ;
view . pmiFreezePanes . on ( 'click' , _ . bind ( me . onFreezePanes , me ) ) ;
view . pmiEntriesList . on ( 'click' , _ . bind ( me . onEntriesList , me ) ) ;
/** coauthoring begin **/
view . pmiAddComment . on ( 'click' , _ . bind ( me . onAddComment , me ) ) ;
/** coauthoring end **/
view . pmiAddNamedRange . on ( 'click' , _ . bind ( me . onAddNamedRange , me ) ) ;
2019-02-27 09:52:19 +00:00
view . menuImageArrange . menu . on ( 'item:click' , _ . bind ( me . onImgMenu , me ) ) ;
view . menuImgRotate . menu . on ( 'item:click' , _ . bind ( me . onImgMenu , me ) ) ;
2019-04-09 11:29:51 +00:00
view . menuImgCrop . menu . on ( 'item:click' , _ . bind ( me . onImgCrop , me ) ) ;
2019-02-27 09:52:19 +00:00
view . menuImageAlign . menu . on ( 'item:click' , _ . bind ( me . onImgMenuAlign , me ) ) ;
2017-06-06 08:04:04 +00:00
view . menuParagraphVAlign . menu . on ( 'item:click' , _ . bind ( me . onParagraphVAlign , me ) ) ;
view . menuParagraphDirection . menu . on ( 'item:click' , _ . bind ( me . onParagraphDirection , me ) ) ;
2019-11-07 11:01:07 +00:00
view . menuParagraphBullets . menu . on ( 'item:click' , _ . bind ( me . onSelectBulletMenu , me ) ) ;
2017-06-06 08:04:04 +00:00
view . menuAddHyperlinkShape . on ( 'click' , _ . bind ( me . onInsHyperlink , me ) ) ;
view . menuEditHyperlinkShape . on ( 'click' , _ . bind ( me . onInsHyperlink , me ) ) ;
view . menuRemoveHyperlinkShape . on ( 'click' , _ . bind ( me . onRemoveHyperlinkShape , me ) ) ;
view . pmiTextAdvanced . on ( 'click' , _ . bind ( me . onTextAdvanced , me ) ) ;
view . mnuShapeAdvanced . on ( 'click' , _ . bind ( me . onShapeAdvanced , me ) ) ;
view . mnuChartEdit . on ( 'click' , _ . bind ( me . onChartEdit , me ) ) ;
view . mnuImgAdvanced . on ( 'click' , _ . bind ( me . onImgAdvanced , me ) ) ;
2020-05-25 17:25:16 +00:00
view . mnuSlicerAdvanced . on ( 'click' , _ . bind ( me . onSlicerAdvanced , me ) ) ;
2017-06-06 08:04:04 +00:00
view . textInShapeMenu . on ( 'render:after' , _ . bind ( me . onTextInShapeAfterRender , me ) ) ;
2017-11-22 08:41:47 +00:00
view . menuSignatureEditSign . on ( 'click' , _ . bind ( me . onSignatureClick , me ) ) ;
view . menuSignatureEditSetup . on ( 'click' , _ . bind ( me . onSignatureClick , me ) ) ;
2018-04-11 13:46:44 +00:00
view . menuImgOriginalSize . on ( 'click' , _ . bind ( me . onOriginalSizeClick , me ) ) ;
view . menuImgReplace . menu . on ( 'item:click' , _ . bind ( me . onImgReplace , me ) ) ;
2018-04-13 13:29:31 +00:00
view . pmiNumFormat . menu . on ( 'item:click' , _ . bind ( me . onNumberFormatSelect , me ) ) ;
view . pmiNumFormat . menu . on ( 'show:after' , _ . bind ( me . onNumberFormatOpenAfter , me ) ) ;
view . pmiAdvancedNumFormat . on ( 'click' , _ . bind ( me . onCustomNumberFormat , me ) ) ;
2017-06-06 08:04:04 +00:00
} else {
view . menuViewCopy . on ( 'click' , _ . bind ( me . onCopyPaste , me ) ) ;
view . menuViewUndo . on ( 'click' , _ . bind ( me . onUndo , me ) ) ;
view . menuViewAddComment . on ( 'click' , _ . bind ( me . onAddComment , me ) ) ;
2017-11-22 08:41:47 +00:00
view . menuSignatureViewSign . on ( 'click' , _ . bind ( me . onSignatureClick , me ) ) ;
view . menuSignatureDetails . on ( 'click' , _ . bind ( me . onSignatureClick , me ) ) ;
view . menuSignatureViewSetup . on ( 'click' , _ . bind ( me . onSignatureClick , me ) ) ;
view . menuSignatureRemove . on ( 'click' , _ . bind ( me . onSignatureClick , me ) ) ;
2017-06-06 08:04:04 +00:00
}
2016-03-11 00:48:53 +00:00
2020-04-30 10:36:02 +00:00
var addEvent = function ( elem , type , fn , options ) {
elem . addEventListener ? elem . addEventListener ( type , fn , options ) : elem . attachEvent ( "on" + type , fn ) ;
} ;
2016-03-11 00:48:53 +00:00
2020-04-30 10:36:02 +00:00
var documentHolderEl = view . cmpEl ;
2016-03-11 00:48:53 +00:00
if ( documentHolderEl ) {
documentHolderEl . on ( {
mousedown : function ( e ) {
if ( e . target . localName == 'canvas' && e . button != 2 ) {
Common . UI . Menu . Manager . hideAll ( ) ;
}
} ,
click : function ( e ) {
if ( me . api ) {
me . api . isTextAreaBlur = false ;
2020-05-18 11:00:10 +00:00
if ( e . target . localName == 'canvas' && ( ! me . isEditFormula || me . rangeSelectionMode ) ) {
2020-03-16 12:36:47 +00:00
if ( me . _preventClick )
me . _preventClick = false ;
else
documentHolderEl . focus ( ) ;
2016-03-11 00:48:53 +00:00
}
}
}
} ) ;
//NOTE: set mouse wheel handler
var eventname = ( /Firefox/i . test ( navigator . userAgent ) ) ? 'DOMMouseScroll' : 'mousewheel' ;
2020-04-30 10:36:02 +00:00
addEvent ( view . el , eventname , _ . bind ( this . onDocumentWheel , this ) , false ) ;
2016-03-11 00:48:53 +00:00
me . cellEditor = $ ( '#ce-cell-content' ) ;
}
2020-04-30 10:36:02 +00:00
Common . Utils . isChrome ? addEvent ( document , 'mousewheel' , _ . bind ( this . onDocumentWheel , this ) , { passive : false } ) :
$ ( document ) . on ( 'mousewheel' , _ . bind ( this . onDocumentWheel , this ) ) ;
2016-03-11 00:48:53 +00:00
} ,
loadConfig : function ( data ) {
this . editorConfig = data . config ;
} ,
setMode : function ( permissions ) {
this . permissions = permissions ;
/** coauthoring begin **/
2017-06-14 11:53:29 +00:00
! ( this . permissions . canCoAuthoring && this . permissions . canComments )
2016-03-11 00:48:53 +00:00
? Common . util . Shortcuts . suspendEvents ( this . hkComments )
: Common . util . Shortcuts . resumeEvents ( this . hkComments ) ;
/** coauthoring end **/
} ,
setApi : function ( api ) {
this . api = api ;
this . api . asc _registerCallback ( 'asc_onContextMenu' , _ . bind ( this . onApiContextMenu , this ) ) ;
this . api . asc _registerCallback ( 'asc_onMouseMove' , _ . bind ( this . onApiMouseMove , this ) ) ;
/** coauthoring begin **/
this . api . asc _registerCallback ( 'asc_onHideComment' , this . wrapEvents . apiHideComment ) ;
// this.api.asc_registerCallback('asc_onShowComment', this.wrapEvents.apiShowComment);
/** coauthoring end **/
this . api . asc _registerCallback ( 'asc_onHyperlinkClick' , _ . bind ( this . onApiHyperlinkClick , this ) ) ;
this . api . asc _registerCallback ( 'asc_onCoAuthoringDisconnect' , _ . bind ( this . onApiCoAuthoringDisconnect , this ) ) ;
Common . NotificationCenter . on ( 'api:disconnect' , _ . bind ( this . onApiCoAuthoringDisconnect , this ) ) ;
2017-06-14 11:53:29 +00:00
this . api . asc _registerCallback ( 'asc_onSelectionChanged' , _ . bind ( this . onSelectionChanged , this ) ) ;
if ( this . permissions . isEdit === true ) {
this . api . asc _registerCallback ( 'asc_onSetAFDialog' , _ . bind ( this . onApiAutofilter , this ) ) ;
this . api . asc _registerCallback ( 'asc_onEditCell' , _ . bind ( this . onApiEditCell , this ) ) ;
this . api . asc _registerCallback ( 'asc_onLockDefNameManager' , _ . bind ( this . onLockDefNameManager , this ) ) ;
2020-03-16 12:06:56 +00:00
this . api . asc _registerCallback ( 'asc_onEntriesListMenu' , _ . bind ( this . onEntriesListMenu , this , false ) ) ; // Alt + Down
this . api . asc _registerCallback ( 'asc_onValidationListMenu' , _ . bind ( this . onEntriesListMenu , this , true ) ) ;
2017-06-14 11:53:29 +00:00
this . api . asc _registerCallback ( 'asc_onFormulaCompleteMenu' , _ . bind ( this . onFormulaCompleteMenu , this ) ) ;
this . api . asc _registerCallback ( 'asc_onShowSpecialPasteOptions' , _ . bind ( this . onShowSpecialPasteOptions , this ) ) ;
this . api . asc _registerCallback ( 'asc_onHideSpecialPasteOptions' , _ . bind ( this . onHideSpecialPasteOptions , this ) ) ;
2017-12-01 09:20:06 +00:00
this . api . asc _registerCallback ( 'asc_onToggleAutoCorrectOptions' , _ . bind ( this . onToggleAutoCorrectOptions , this ) ) ;
2019-03-07 12:13:46 +00:00
this . api . asc _registerCallback ( 'asc_onFormulaInfo' , _ . bind ( this . onFormulaInfo , this ) ) ;
2019-04-09 11:29:51 +00:00
this . api . asc _registerCallback ( 'asc_ChangeCropState' , _ . bind ( this . onChangeCropState , this ) ) ;
2019-07-30 12:24:47 +00:00
this . api . asc _registerCallback ( 'asc_onInputMessage' , _ . bind ( this . onInputMessage , this ) ) ;
2017-06-14 11:53:29 +00:00
}
2016-03-11 00:48:53 +00:00
return this ;
} ,
resetApi : function ( api ) {
/** coauthoring begin **/
this . api . asc _unregisterCallback ( 'asc_onHideComment' , this . wrapEvents . apiHideComment ) ;
// this.api.asc_unregisterCallback('asc_onShowComment', this.wrapEvents.apiShowComment);
this . api . asc _registerCallback ( 'asc_onHideComment' , this . wrapEvents . apiHideComment ) ;
// this.api.asc_registerCallback('asc_onShowComment', this.wrapEvents.apiShowComment);
/** coauthoring end **/
} ,
onCopyPaste : function ( item ) {
var me = this ;
if ( me . api ) {
2016-07-26 14:46:42 +00:00
var res = ( item . value == 'cut' ) ? me . api . asc _Cut ( ) : ( ( item . value == 'copy' ) ? me . api . asc _Copy ( ) : me . api . asc _Paste ( ) ) ;
if ( ! res ) {
2016-03-11 00:48:53 +00:00
var value = Common . localStorage . getItem ( "sse-hide-copywarning" ) ;
if ( ! ( value && parseInt ( value ) == 1 ) ) {
( new Common . Views . CopyWarningDialog ( {
handler : function ( dontshow ) {
if ( dontshow ) Common . localStorage . setItem ( "sse-hide-copywarning" , 1 ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , me . documentHolder ) ;
}
} ) ) . show ( ) ;
}
2016-07-26 14:46:42 +00:00
} else
2016-03-11 00:48:53 +00:00
Common . component . Analytics . trackEvent ( 'ToolBar' , 'Copy Warning' ) ;
}
2016-07-26 14:46:42 +00:00
Common . NotificationCenter . trigger ( 'edit:complete' , me . documentHolder ) ;
2016-03-11 00:48:53 +00:00
} ,
onInsertEntire : function ( item ) {
if ( this . api ) {
2020-05-14 08:39:04 +00:00
switch ( this . api . asc _getCellInfo ( ) . asc _getSelectionType ( ) ) {
2016-04-05 11:52:34 +00:00
case Asc . c _oAscSelectionType . RangeRow :
this . api . asc _insertCells ( Asc . c _oAscInsertOptions . InsertRows ) ;
2016-03-11 00:48:53 +00:00
break ;
2016-04-05 11:52:34 +00:00
case Asc . c _oAscSelectionType . RangeCol :
this . api . asc _insertCells ( Asc . c _oAscInsertOptions . InsertColumns ) ;
2016-03-11 00:48:53 +00:00
break ;
}
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Insert Entire' ) ;
}
} ,
onInsertCells : function ( menu , item ) {
if ( this . api ) {
this . api . asc _insertCells ( item . value ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Insert Cells' ) ;
}
} ,
onDeleteEntire : function ( item ) {
if ( this . api ) {
2020-05-14 08:39:04 +00:00
switch ( this . api . asc _getCellInfo ( ) . asc _getSelectionType ( ) ) {
2016-04-05 11:52:34 +00:00
case Asc . c _oAscSelectionType . RangeRow :
this . api . asc _deleteCells ( Asc . c _oAscDeleteOptions . DeleteRows ) ;
2016-03-11 00:48:53 +00:00
break ;
2016-04-05 11:52:34 +00:00
case Asc . c _oAscSelectionType . RangeCol :
this . api . asc _deleteCells ( Asc . c _oAscDeleteOptions . DeleteColumns ) ;
2016-03-11 00:48:53 +00:00
break ;
}
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Delete Entire' ) ;
}
} ,
onDeleteCells : function ( menu , item ) {
if ( this . api ) {
this . api . asc _deleteCells ( item . value ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Delete Cells' ) ;
}
} ,
onSortCells : function ( menu , item ) {
if ( this . api ) {
2017-02-06 14:12:59 +00:00
var res = this . api . asc _sortCellsRangeExpand ( ) ;
if ( res ) {
var config = {
width : 500 ,
title : this . txtSorting ,
msg : this . txtExpandSort ,
buttons : [ { caption : this . txtExpand , primary : true , value : 'expand' } ,
{ caption : this . txtSortSelected , primary : true , value : 'sort' } ,
'cancel' ] ,
callback : _ . bind ( function ( btn ) {
if ( btn == 'expand' || btn == 'sort' ) {
this . api . asc _sortColFilter ( item . value , '' , undefined , ( item . value == Asc . c _oAscSortOptions . ByColorFill ) ? this . documentHolder . ssMenu . cellColor : this . documentHolder . ssMenu . fontColor , btn == 'expand' ) ;
}
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Sort Cells' ) ;
} , this )
} ;
Common . UI . alert ( config ) ;
} else {
this . api . asc _sortColFilter ( item . value , '' , undefined , ( item . value == Asc . c _oAscSortOptions . ByColorFill ) ? this . documentHolder . ssMenu . cellColor : this . documentHolder . ssMenu . fontColor , res !== null ) ;
2016-03-11 00:48:53 +00:00
2017-02-06 14:12:59 +00:00
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Sort Cells' ) ;
}
2016-03-11 00:48:53 +00:00
}
} ,
2016-05-17 08:01:41 +00:00
onFilterCells : function ( menu , item ) {
if ( this . api ) {
var autoFilterObject = new Asc . AutoFiltersOptions ( ) ,
filterObj = new Asc . AutoFilterObj ( ) ;
if ( item . value > 0 ) {
filterObj . asc _setFilter ( new Asc . ColorFilter ( ) ) ;
filterObj . asc _setType ( Asc . c _oAscAutoFilterTypes . ColorFilter ) ;
var colorFilter = filterObj . asc _getFilter ( ) ;
colorFilter . asc _setCellColor ( ( item . value == 1 ) ? null : false ) ;
colorFilter . asc _setCColor ( ( item . value == 1 ) ? this . documentHolder . ssMenu . cellColor : this . documentHolder . ssMenu . fontColor ) ;
} else {
filterObj . asc _setFilter ( new Asc . CustomFilters ( ) ) ;
filterObj . asc _setType ( Asc . c _oAscAutoFilterTypes . CustomFilters ) ;
var customFilter = filterObj . asc _getFilter ( ) ;
customFilter . asc _setCustomFilters ( [ new Asc . CustomFilter ( ) ] ) ;
customFilter . asc _setAnd ( true ) ;
var customFilters = customFilter . asc _getCustomFilters ( ) ;
customFilters [ 0 ] . asc _setOperator ( Asc . c _oAscCustomAutoFilter . equals ) ;
// customFilters[0].asc_setVal('');
}
autoFilterObject . asc _setFilterObj ( filterObj ) ;
this . api . asc _applyAutoFilterByType ( autoFilterObject ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Filter Cells' ) ;
}
} ,
onReapply : function ( ) {
2016-05-17 09:34:10 +00:00
this . api . asc _reapplyAutoFilter ( this . documentHolder . ssMenu . formatTableName ) ;
2016-05-17 08:01:41 +00:00
} ,
2016-03-11 00:48:53 +00:00
onClear : function ( menu , item ) {
if ( this . api ) {
this . api . asc _emptyCells ( item . value ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Clear' ) ;
}
} ,
2016-03-30 12:27:16 +00:00
onSelectTable : function ( menu , item ) {
if ( this . api && this . documentHolder . ssMenu . formatTableName ) {
this . api . asc _changeSelectionFormatTable ( this . documentHolder . ssMenu . formatTableName , item . value ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Select Table' ) ;
}
} ,
onInsertTable : function ( menu , item ) {
if ( this . api && this . documentHolder . ssMenu . formatTableName ) {
this . api . asc _insertCellsInTable ( this . documentHolder . ssMenu . formatTableName , item . value ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Insert to Table' ) ;
}
} ,
onDeleteTable : function ( menu , item ) {
if ( this . api && this . documentHolder . ssMenu . formatTableName ) {
this . api . asc _deleteCellsInTable ( this . documentHolder . ssMenu . formatTableName , item . value ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Delete from Table' ) ;
}
} ,
2016-03-11 00:48:53 +00:00
onInsFunction : function ( item ) {
var controller = this . getApplication ( ) . getController ( 'FormulaDialog' ) ;
if ( controller && this . api ) {
controller . showDialog ( ) ;
}
} ,
onInsHyperlink : function ( item ) {
var me = this ;
var win ,
props ;
if ( me . api ) {
var wc = me . api . asc _getWorksheetsCount ( ) ,
i = - 1 ,
items = [ ] ;
while ( ++ i < wc ) {
2020-03-16 10:30:51 +00:00
items . push ( { name : me . api . asc _getWorksheetName ( i ) , hidden : me . api . asc _isWorksheetHidden ( i ) } ) ;
2016-03-11 00:48:53 +00:00
}
var handlerDlg = function ( dlg , result ) {
if ( result == 'ok' ) {
props = dlg . getSettings ( ) ;
me . api . asc _insertHyperlink ( props ) ;
}
Common . NotificationCenter . trigger ( 'edit:complete' , me . documentHolder ) ;
} ;
var cell = me . api . asc _getCellInfo ( ) ;
props = cell . asc _getHyperlink ( ) ;
win = new SSE . Views . HyperlinkSettingsDialog ( {
api : me . api ,
2020-03-20 12:29:47 +00:00
appOptions : me . permissions ,
2016-03-11 00:48:53 +00:00
handler : handlerDlg
} ) ;
win . show ( ) ;
win . setSettings ( {
sheets : items ,
2020-03-04 07:28:12 +00:00
ranges : me . api . asc _getDefinedNames ( Asc . c _oAscGetDefinedNamesList . All ) ,
2016-03-11 00:48:53 +00:00
currentSheet : me . api . asc _getWorksheetName ( me . api . asc _getActiveWorksheetIndex ( ) ) ,
props : props ,
text : cell . asc _getText ( ) ,
2020-05-14 08:50:34 +00:00
isLock : cell . asc _getLockText ( ) ,
2016-03-11 00:48:53 +00:00
allowInternal : item . options . inCell
} ) ;
}
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Add Hyperlink' ) ;
} ,
onDelHyperlink : function ( item ) {
if ( this . api ) {
this . api . asc _removeHyperlink ( ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Remove Hyperlink' ) ;
}
} ,
2016-07-26 12:47:48 +00:00
onSetSize : function ( menu , item ) {
if ( item . value == 'row-height' || item . value == 'column-width' ) {
var me = this ;
( new SSE . Views . SetValueDialog ( {
title : item . caption ,
startvalue : item . value == 'row-height' ? me . api . asc _getRowHeight ( ) : me . api . asc _getColumnWidth ( ) ,
maxvalue : item . value == 'row-height' ? Asc . c _oAscMaxRowHeight : Asc . c _oAscMaxColumnWidth ,
step : item . value == 'row-height' ? 0.75 : 1 ,
2018-06-08 14:51:40 +00:00
rounding : ( item . value == 'row-height' ) ,
2016-07-26 12:47:48 +00:00
defaultUnit : item . value == 'row-height' ? Common . Utils . Metric . getMetricName ( Common . Utils . Metric . c _MetricUnits . pt ) : me . textSym ,
handler : function ( dlg , result ) {
if ( result == 'ok' ) {
var val = dlg . getSettings ( ) ;
if ( ! isNaN ( val ) )
( item . value == 'row-height' ) ? me . api . asc _setRowHeight ( val ) : me . api . asc _setColumnWidth ( val ) ;
}
2016-03-11 00:48:53 +00:00
2016-07-26 12:47:48 +00:00
Common . NotificationCenter . trigger ( 'edit:complete' , me . documentHolder ) ;
}
} ) ) . show ( ) ;
} else {
( item . value == 'auto-row-height' ) ? this . api . asc _autoFitRowHeight ( ) : this . api . asc _autoFitColumnWidth ( ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
}
2016-03-11 00:48:53 +00:00
} ,
onEntireHide : function ( item ) {
if ( this . api )
this . api [ item . isrowmenu ? 'asc_hideRows' : 'asc_hideColumns' ] ( ) ;
} ,
onEntireShow : function ( item ) {
if ( this . api )
this . api [ item . isrowmenu ? 'asc_showRows' : 'asc_showColumns' ] ( ) ;
} ,
onFreezePanes : function ( item ) {
if ( this . api )
this . api . asc _freezePane ( ) ;
} ,
2016-10-25 13:22:22 +00:00
onEntriesList : function ( item ) {
if ( this . api ) {
var me = this ;
setTimeout ( function ( ) {
me . api . asc _showAutoComplete ( ) ;
} , 10 ) ;
}
} ,
2016-03-11 00:48:53 +00:00
onAddComment : function ( item ) {
2017-06-14 11:53:29 +00:00
if ( this . api && this . permissions . canCoAuthoring && this . permissions . canComments ) {
2016-03-11 00:48:53 +00:00
var controller = SSE . getController ( 'Common.Controllers.Comments' ) ,
cellinfo = this . api . asc _getCellInfo ( ) ;
if ( controller ) {
var comments = cellinfo . asc _getComments ( ) ;
if ( comments . length ) {
controller . onEditComments ( comments ) ;
} else if ( this . permissions . canCoAuthoring || this . commentsCollection . getCommentsReplysCount ( ) < 3 ) {
controller . addDummyComment ( ) ;
}
}
}
} ,
onAddNamedRange : function ( item ) {
if ( this . namedrange _locked ) {
Common . NotificationCenter . trigger ( 'namedrange:locked' ) ;
return ;
}
var me = this ,
wc = me . api . asc _getWorksheetsCount ( ) ,
i = - 1 ,
items = [ ] ;
while ( ++ i < wc ) {
if ( ! this . api . asc _isWorksheetHidden ( i ) ) {
items . push ( { displayValue : me . api . asc _getWorksheetName ( i ) , value : i } ) ;
}
}
var handlerDlg = function ( result , settings ) {
if ( result == 'ok' && settings ) {
me . api . asc _setDefinedNames ( settings ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'New Named Range' ) ;
}
Common . NotificationCenter . trigger ( 'edit:complete' , me . documentHolder ) ;
} ;
( new SSE . Views . NamedRangeEditDlg ( {
api : me . api ,
handler : handlerDlg ,
sheets : items ,
currentSheet : me . api . asc _getActiveWorksheetIndex ( ) ,
props : me . api . asc _getDefaultDefinedName ( ) ,
isEdit : false
} ) ) . show ( ) ;
} ,
onImgMenu : function ( menu , item ) {
if ( this . api ) {
if ( item . options . type == 'arrange' ) {
this . api . asc _setSelectedDrawingObjectLayer ( item . value ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Arrange' ) ;
} else if ( item . options . type == 'group' ) {
this . api [ ( item . value == 'grouping' ) ? 'asc_groupGraphicsObjects' : 'asc_unGroupGraphicsObjects' ] ( ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , ( item . value == 'grouping' ) ? 'Grouping' : 'Ungrouping' ) ;
2019-02-27 09:52:19 +00:00
} else if ( item . options . type == 'rotate' ) {
var properties = new Asc . asc _CImgProperty ( ) ;
properties . asc _putRotAdd ( ( item . value == 1 ? 90 : 270 ) * 3.14159265358979 / 180 ) ;
this . api . asc _setGraphicObjectProps ( properties ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Rotate' ) ;
} else if ( item . options . type == 'flip' ) {
var properties = new Asc . asc _CImgProperty ( ) ;
if ( item . value == 1 )
properties . asc _putFlipHInvert ( true ) ;
else
properties . asc _putFlipVInvert ( true ) ;
this . api . asc _setGraphicObjectProps ( properties ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Flip' ) ;
}
}
} ,
2019-04-09 11:29:51 +00:00
onImgCrop : function ( menu , item ) {
if ( this . api ) {
if ( item . value == 1 ) {
this . api . asc _cropFill ( ) ;
} else if ( item . value == 2 ) {
this . api . asc _cropFit ( ) ;
} else {
item . checked ? this . api . asc _startEditCrop ( ) : this . api . asc _endEditCrop ( ) ;
}
}
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
} ,
2019-02-27 09:52:19 +00:00
onImgMenuAlign : function ( menu , item ) {
if ( this . api ) {
if ( item . value > - 1 && item . value < 6 ) {
this . api . asc _setSelectedDrawingObjectAlign ( item . value ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Objects Align' ) ;
} else if ( item . value == 6 ) {
this . api . asc _DistributeSelectedDrawingObjectHor ( ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Distribute' ) ;
} else if ( item . value == 7 ) {
this . api . asc _DistributeSelectedDrawingObjectVer ( ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Distribute' ) ;
2016-03-11 00:48:53 +00:00
}
}
} ,
onParagraphVAlign : function ( menu , item ) {
if ( this . api ) {
var properties = new Asc . asc _CImgProperty ( ) ;
properties . asc _putVerticalTextAlign ( item . value ) ;
this . api . asc _setGraphicObjectProps ( properties ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Paragraph Vertical Align' ) ;
}
} ,
onParagraphDirection : function ( menu , item ) {
if ( this . api ) {
var properties = new Asc . asc _CImgProperty ( ) ;
properties . asc _putVert ( item . options . direction ) ;
this . api . asc _setGraphicObjectProps ( properties ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
2017-05-15 13:32:01 +00:00
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Text Direction' ) ;
2016-03-11 00:48:53 +00:00
}
} ,
2019-11-07 11:01:07 +00:00
onSelectBulletMenu : function ( menu , item ) {
if ( this . api ) {
if ( item . options . value == - 1 ) {
this . api . asc _setListType ( item . options . value ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'List Type' ) ;
} else if ( item . options . value == 'settings' ) {
var me = this ,
props ;
var selectedObjects = me . api . asc _getGraphicObjectProps ( ) ;
for ( var i = 0 ; i < selectedObjects . length ; i ++ ) {
if ( selectedObjects [ i ] . asc _getObjectType ( ) == Asc . c _oAscTypeSelectElement . Paragraph ) {
props = selectedObjects [ i ] . asc _getObjectValue ( ) ;
break ;
}
}
if ( props ) {
( new Common . Views . ListSettingsDialog ( {
2019-11-19 14:05:02 +00:00
api : me . api ,
2019-11-07 11:01:07 +00:00
props : props ,
2019-11-19 14:05:02 +00:00
type : me . api . asc _getCurrentListType ( ) . get _ListType ( ) ,
interfaceLang : me . permissions . lang ,
2019-11-07 11:01:07 +00:00
handler : function ( result , value ) {
if ( result == 'ok' ) {
if ( me . api ) {
me . api . asc _setGraphicObjectProps ( value ) ;
}
}
Common . NotificationCenter . trigger ( 'edit:complete' , me . documentHolder ) ;
}
} ) ) . show ( ) ;
}
}
2017-05-18 07:31:18 +00:00
}
} ,
onSelectBullets : function ( picker , itemView , record , e ) {
var rawData = { } ,
isPickerSelect = _ . isFunction ( record . toJSON ) ;
if ( isPickerSelect ) {
if ( record . get ( 'selected' ) ) {
rawData = record . toJSON ( ) ;
} else {
// record deselected
return ;
}
} else {
rawData = record ;
}
2017-05-18 11:28:09 +00:00
if ( this . api )
this . api . asc _setListType ( rawData . type , rawData . subtype ) ;
2017-05-18 07:31:18 +00:00
if ( e . type !== 'click' )
this . documentHolder . textInShapeMenu . hide ( ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'List Type' ) ;
} ,
2016-03-11 00:48:53 +00:00
onRemoveHyperlinkShape : function ( item ) {
if ( this . api ) {
this . api . asc _removeHyperlink ( ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Remove Hyperlink' ) ;
}
} ,
onTextAdvanced : function ( item ) {
var me = this ;
( new SSE . Views . ParagraphSettingsAdvanced ( {
paragraphProps : item . textInfo ,
api : me . api ,
handler : function ( result , value ) {
if ( result == 'ok' ) {
if ( me . api ) {
me . api . asc _setGraphicObjectProps ( value . paragraphProps ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Apply advanced paragraph settings' ) ;
}
}
Common . NotificationCenter . trigger ( 'edit:complete' , me ) ;
}
} ) ) . show ( ) ;
} ,
onShapeAdvanced : function ( item ) {
var me = this ;
( new SSE . Views . ShapeSettingsAdvanced ( {
shapeProps : item . shapeInfo ,
api : me . api ,
handler : function ( result , value ) {
if ( result == 'ok' ) {
if ( me . api ) {
me . api . asc _setGraphicObjectProps ( value . shapeProps ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Apply advanced shape settings' ) ;
}
}
Common . NotificationCenter . trigger ( 'edit:complete' , me ) ;
}
} ) ) . show ( ) ;
} ,
2017-04-11 11:05:56 +00:00
onImgAdvanced : function ( item ) {
var me = this ;
( new SSE . Views . ImageSettingsAdvanced ( {
imageProps : item . imageInfo ,
api : me . api ,
handler : function ( result , value ) {
if ( result == 'ok' ) {
if ( me . api ) {
me . api . asc _setGraphicObjectProps ( value . imageProps ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Apply advanced image settings' ) ;
}
}
Common . NotificationCenter . trigger ( 'edit:complete' , me ) ;
}
} ) ) . show ( ) ;
} ,
2020-05-25 17:25:16 +00:00
onSlicerAdvanced : function ( item ) {
var me = this ;
2020-05-26 14:14:58 +00:00
( new SSE . Views . SlicerSettingsAdvanced ( {
2020-05-27 20:28:27 +00:00
imageProps : item . imageInfo ,
api : me . api ,
styles : item . imageInfo . asc _getSlicerProperties ( ) . asc _getStylesPictures ( ) ,
handler : function ( result , value ) {
2020-05-25 17:25:16 +00:00
if ( result == 'ok' ) {
if ( me . api ) {
2020-05-27 13:33:34 +00:00
me . api . asc _setGraphicObjectProps ( value . imageProps ) ;
2020-05-25 17:25:16 +00:00
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Apply slicer settings' ) ;
}
}
Common . NotificationCenter . trigger ( 'edit:complete' , me ) ;
}
} ) ) . show ( ) ;
} ,
2016-03-11 00:48:53 +00:00
onChartEdit : function ( item ) {
var me = this ;
var win , props ;
if ( me . api ) {
props = me . api . asc _getChartObject ( ) ;
if ( props ) {
( new SSE . Views . ChartSettingsDlg (
{
chartSettings : props ,
2017-04-11 11:05:56 +00:00
imageSettings : item . chartInfo ,
2016-09-14 13:34:08 +00:00
isChart : true ,
2016-03-11 00:48:53 +00:00
api : me . api ,
handler : function ( result , value ) {
if ( result == 'ok' ) {
if ( me . api ) {
me . api . asc _editChartDrawingObject ( value . chartSettings ) ;
2017-04-11 11:05:56 +00:00
if ( value . imageSettings )
me . api . asc _setGraphicObjectProps ( value . imageSettings ) ;
2016-03-11 00:48:53 +00:00
}
}
Common . NotificationCenter . trigger ( 'edit:complete' , me ) ;
}
} ) ) . show ( ) ;
}
}
} ,
onApiCoAuthoringDisconnect : function ( ) {
this . permissions . isEdit = false ;
} ,
hideCoAuthTips : function ( ) {
if ( this . tooltips . coauth . ref ) {
$ ( this . tooltips . coauth . ref ) . remove ( ) ;
this . tooltips . coauth . ref = undefined ;
this . tooltips . coauth . x _point = undefined ;
this . tooltips . coauth . y _point = undefined ;
}
} ,
2019-03-15 13:11:37 +00:00
hideHyperlinkTip : function ( ) {
2016-03-11 00:48:53 +00:00
if ( ! this . tooltips . hyperlink . isHidden && this . tooltips . hyperlink . ref ) {
2019-03-15 13:11:37 +00:00
this . tooltips . hyperlink . ref . hide ( ) ;
this . tooltips . hyperlink . ref = undefined ;
this . tooltips . hyperlink . text = '' ;
2016-03-11 00:48:53 +00:00
this . tooltips . hyperlink . isHidden = true ;
}
} ,
onApiMouseMove : function ( dataarray ) {
if ( ! this . _isFullscreenMenu && dataarray . length ) {
var index _hyperlink ,
/** coauthoring begin **/
index _comments ,
/** coauthoring end **/
index _locked ,
2018-05-31 07:27:38 +00:00
index _column , index _row ,
2020-05-28 10:58:38 +00:00
index _filter ,
index _slicer ;
2016-03-11 00:48:53 +00:00
for ( var i = dataarray . length ; i > 0 ; i -- ) {
switch ( dataarray [ i - 1 ] . asc _getType ( ) ) {
2016-04-05 11:52:34 +00:00
case Asc . c _oAscMouseMoveType . Hyperlink :
2016-03-11 00:48:53 +00:00
index _hyperlink = i ;
break ;
/** coauthoring begin **/
2016-04-05 11:52:34 +00:00
case Asc . c _oAscMouseMoveType . Comment :
2016-03-11 00:48:53 +00:00
index _comments = i ;
break ;
/** coauthoring end **/
2016-04-05 11:52:34 +00:00
case Asc . c _oAscMouseMoveType . LockedObject :
2016-03-11 00:48:53 +00:00
index _locked = i ;
break ;
2016-04-05 11:52:34 +00:00
case Asc . c _oAscMouseMoveType . ResizeColumn :
2016-03-11 00:48:53 +00:00
index _column = i ;
break ;
2016-04-05 11:52:34 +00:00
case Asc . c _oAscMouseMoveType . ResizeRow :
2016-03-11 00:48:53 +00:00
index _row = i ;
break ;
2018-05-31 07:27:38 +00:00
case Asc . c _oAscMouseMoveType . Filter :
index _filter = i ;
break ;
2020-05-28 10:58:38 +00:00
case Asc . c _oAscMouseMoveType . Tooltip :
index _slicer = i ;
break ;
2016-03-11 00:48:53 +00:00
}
}
var me = this ,
showPoint = [ 0 , 0 ] ,
/** coauthoring begin **/
coAuthTip = me . tooltips . coauth ,
commentTip = me . tooltips . comment ,
/** coauthoring end **/
hyperlinkTip = me . tooltips . hyperlink ,
2018-05-31 07:27:38 +00:00
row _columnTip = me . tooltips . row _column ,
filterTip = me . tooltips . filter ,
2020-05-28 10:58:38 +00:00
slicerTip = me . tooltips . slicer ,
2016-03-11 00:48:53 +00:00
pos = [
me . documentHolder . cmpEl . offset ( ) . left - $ ( window ) . scrollLeft ( ) ,
me . documentHolder . cmpEl . offset ( ) . top - $ ( window ) . scrollTop ( )
2019-03-15 13:11:37 +00:00
] ;
//close all tooltips
if ( ! index _hyperlink ) {
me . hideHyperlinkTip ( ) ;
}
if ( index _column === undefined && index _row === undefined ) {
if ( ! row _columnTip . isHidden && row _columnTip . ref ) {
row _columnTip . ref . hide ( ) ;
row _columnTip . ref = undefined ;
row _columnTip . text = '' ;
row _columnTip . isHidden = true ;
2019-03-06 13:41:54 +00:00
}
2019-03-15 13:11:37 +00:00
}
if ( me . permissions . isEdit || me . permissions . canViewComments ) {
if ( ! index _comments || this . popupmenu ) {
commentTip . moveCommentId = undefined ;
if ( commentTip . viewCommentId != undefined ) {
commentTip = { } ;
var commentsController = this . getApplication ( ) . getController ( 'Common.Controllers.Comments' ) ;
if ( commentsController ) {
if ( this . permissions . canCoAuthoring && this . permissions . canViewComments )
setTimeout ( function ( ) { commentsController . onApiHideComment ( true ) ; } , 200 ) ;
else
commentsController . onApiHideComment ( true ) ;
2019-03-06 13:41:54 +00:00
}
}
}
2019-03-15 13:11:37 +00:00
}
if ( me . permissions . isEdit ) {
if ( ! index _locked ) {
me . hideCoAuthTips ( ) ;
2019-03-06 13:41:54 +00:00
}
2020-05-28 10:58:38 +00:00
if ( index _slicer === undefined ) {
if ( ! slicerTip . isHidden && slicerTip . ref ) {
slicerTip . ref . hide ( ) ;
slicerTip . ref = undefined ;
slicerTip . text = '' ;
slicerTip . isHidden = true ;
}
}
2019-03-15 13:11:37 +00:00
}
if ( index _filter === undefined || ( me . dlgFilter && me . dlgFilter . isVisible ( ) ) || ( me . currentMenu && me . currentMenu . isVisible ( ) ) ) {
if ( ! filterTip . isHidden && filterTip . ref ) {
filterTip . ref . hide ( ) ;
filterTip . ref = undefined ;
filterTip . text = '' ;
filterTip . isHidden = true ;
2019-03-06 13:41:54 +00:00
}
}
2019-03-15 13:11:37 +00:00
// show tooltips
2016-03-11 00:48:53 +00:00
/** coauthoring begin **/
var getUserName = function ( id ) {
var usersStore = SSE . getCollection ( 'Common.Collections.Users' ) ;
if ( usersStore ) {
var rec = usersStore . findUser ( id ) ;
if ( rec )
return rec . get ( 'username' ) ;
}
return me . guestText ;
} ;
/** coauthoring end **/
if ( index _hyperlink ) {
2019-03-21 08:09:11 +00:00
if ( ! hyperlinkTip . parentEl ) {
hyperlinkTip . parentEl = $ ( '<div id="tip-container-hyperlinktip" style="position: absolute; z-index: 10000;"></div>' ) ;
me . documentHolder . cmpEl . append ( hyperlinkTip . parentEl ) ;
}
2016-03-11 00:48:53 +00:00
var data = dataarray [ index _hyperlink - 1 ] ,
props = data . asc _getHyperlink ( ) ;
2016-04-05 11:52:34 +00:00
if ( props . asc _getType ( ) == Asc . c _oAscHyperlinkType . WebLink ) {
2016-03-11 00:48:53 +00:00
var linkstr = props . asc _getTooltip ( ) ;
if ( linkstr ) {
linkstr = Common . Utils . String . htmlEncode ( linkstr ) + '<br><b>' + me . textCtrlClick + '</b>' ;
} else {
linkstr = props . asc _getHyperlinkUrl ( ) + '<br><b>' + me . textCtrlClick + '</b>' ;
}
} else {
2020-03-13 13:26:27 +00:00
linkstr = Common . Utils . String . htmlEncode ( props . asc _getTooltip ( ) || ( props . asc _getLocation ( ) ) ) ;
2017-11-24 09:26:56 +00:00
linkstr += '<br><b>' + me . textCtrlClick + '</b>' ;
2016-03-11 00:48:53 +00:00
}
if ( hyperlinkTip . ref && hyperlinkTip . ref . isVisible ( ) ) {
if ( hyperlinkTip . text != linkstr ) {
hyperlinkTip . ref . hide ( ) ;
2019-03-15 13:11:37 +00:00
hyperlinkTip . ref = undefined ;
hyperlinkTip . text = '' ;
2016-03-11 00:48:53 +00:00
hyperlinkTip . isHidden = true ;
}
}
if ( ! hyperlinkTip . ref || ! hyperlinkTip . ref . isVisible ( ) ) {
hyperlinkTip . text = linkstr ;
hyperlinkTip . ref = new Common . UI . Tooltip ( {
2019-03-21 08:09:11 +00:00
owner : hyperlinkTip . parentEl ,
2016-03-11 00:48:53 +00:00
html : true ,
title : linkstr
} ) ;
hyperlinkTip . ref . show ( [ - 10000 , - 10000 ] ) ;
hyperlinkTip . isHidden = false ;
2019-03-06 13:41:54 +00:00
showPoint = [ data . asc _getX ( ) , data . asc _getY ( ) ] ;
showPoint [ 0 ] += ( pos [ 0 ] + 6 ) ;
showPoint [ 1 ] += ( pos [ 1 ] - 20 ) ;
showPoint [ 1 ] -= hyperlinkTip . ref . getBSTip ( ) . $tip . height ( ) ;
var tipwidth = hyperlinkTip . ref . getBSTip ( ) . $tip . width ( ) ;
if ( showPoint [ 0 ] + tipwidth > me . tooltips . coauth . bodyWidth )
showPoint [ 0 ] = me . tooltips . coauth . bodyWidth - tipwidth ;
hyperlinkTip . ref . getBSTip ( ) . $tip . css ( {
top : showPoint [ 1 ] + 'px' ,
left : showPoint [ 0 ] + 'px'
} ) ;
2016-03-11 00:48:53 +00:00
}
}
if ( index _column !== undefined || index _row !== undefined ) {
2019-03-21 08:09:11 +00:00
if ( ! row _columnTip . parentEl ) {
row _columnTip . parentEl = $ ( '<div id="tip-container-rowcolumntip" style="position: absolute; z-index: 10000;"></div>' ) ;
me . documentHolder . cmpEl . append ( row _columnTip . parentEl ) ;
}
2016-03-11 00:48:53 +00:00
var data = dataarray [ ( index _column !== undefined ) ? ( index _column - 1 ) : ( index _row - 1 ) ] ;
2016-11-11 08:47:22 +00:00
var str = Common . Utils . String . format ( ( index _column !== undefined ) ? this . textChangeColumnWidth : this . textChangeRowHeight , data . asc _getSizeCCOrPt ( ) . toFixed ( 2 ) , data . asc _getSizePx ( ) . toFixed ( ) ) ;
2016-03-11 00:48:53 +00:00
if ( row _columnTip . ref && row _columnTip . ref . isVisible ( ) ) {
if ( row _columnTip . text != str ) {
row _columnTip . text = str ;
row _columnTip . ref . setTitle ( str ) ;
row _columnTip . ref . updateTitle ( ) ;
}
}
if ( ! row _columnTip . ref || ! row _columnTip . ref . isVisible ( ) ) {
row _columnTip . text = str ;
row _columnTip . ref = new Common . UI . Tooltip ( {
2019-03-21 08:09:11 +00:00
owner : row _columnTip . parentEl ,
2016-03-11 00:48:53 +00:00
html : true ,
title : str
} ) ;
row _columnTip . ref . show ( [ - 10000 , - 10000 ] ) ;
row _columnTip . isHidden = false ;
showPoint = [ data . asc _getX ( ) , data . asc _getY ( ) ] ;
showPoint [ 0 ] += ( pos [ 0 ] + 6 ) ;
showPoint [ 1 ] += ( pos [ 1 ] - 20 - row _columnTip . ttHeight ) ;
var tipwidth = row _columnTip . ref . getBSTip ( ) . $tip . width ( ) ;
if ( showPoint [ 0 ] + tipwidth > me . tooltips . coauth . bodyWidth )
showPoint [ 0 ] = me . tooltips . coauth . bodyWidth - tipwidth - 20 ;
row _columnTip . ref . getBSTip ( ) . $tip . css ( {
top : showPoint [ 1 ] + 'px' ,
left : showPoint [ 0 ] + 'px'
} ) ;
}
2019-03-15 13:11:37 +00:00
}
2016-03-11 00:48:53 +00:00
2018-12-17 08:37:43 +00:00
if ( me . permissions . isEdit || me . permissions . canViewComments ) {
2016-03-11 00:48:53 +00:00
if ( index _comments && ! this . popupmenu ) {
data = dataarray [ index _comments - 1 ] ;
if ( ! commentTip . editCommentId && commentTip . moveCommentId != data . asc _getCommentIndexes ( ) [ 0 ] ) {
commentTip . moveCommentId = data . asc _getCommentIndexes ( ) [ 0 ] ;
if ( commentTip . moveCommentTimer ) {
clearTimeout ( commentTip . moveCommentTimer ) ;
}
var idxs = data . asc _getCommentIndexes ( ) ,
x = data . asc _getX ( ) ,
y = data . asc _getY ( ) ,
leftx = data . asc _getReverseX ( ) ;
commentTip . moveCommentTimer = setTimeout ( function ( ) {
if ( commentTip . moveCommentId && ! commentTip . editCommentId ) {
commentTip . viewCommentId = commentTip . moveCommentId ;
var commentsController = me . getApplication ( ) . getController ( 'Common.Controllers.Comments' ) ;
if ( commentsController ) {
if ( ! commentsController . isSelectedComment ) {
commentsController . onApiShowComment ( idxs , x , y , leftx , false , true ) ;
}
}
}
} , 400 ) ;
}
}
2017-06-14 11:53:29 +00:00
}
2016-03-11 00:48:53 +00:00
2017-06-14 11:53:29 +00:00
if ( me . permissions . isEdit ) {
2016-03-11 00:48:53 +00:00
if ( index _locked ) {
data = dataarray [ index _locked - 1 ] ;
if ( ! coAuthTip . XY )
me . onDocumentResize ( ) ;
if ( coAuthTip . x _point != data . asc _getX ( ) || coAuthTip . y _point != data . asc _getY ( ) ) {
me . hideCoAuthTips ( ) ;
coAuthTip . x _point = data . asc _getX ( ) ;
coAuthTip . y _point = data . asc _getY ( ) ;
var src = $ ( document . createElement ( "div" ) ) ,
2016-04-05 11:52:34 +00:00
is _sheet _lock = data . asc _getLockedObjectType ( ) == Asc . c _oAscMouseMoveLockedObjectType . Sheet ||
data . asc _getLockedObjectType ( ) == Asc . c _oAscMouseMoveLockedObjectType . TableProperties ;
2016-03-11 00:48:53 +00:00
coAuthTip . ref = src ;
src . addClass ( 'username-tip' ) ;
src . css ( {
height : coAuthTip . ttHeight + 'px' ,
position : 'absolute' ,
zIndex : '900' ,
visibility : 'visible'
} ) ;
$ ( document . body ) . append ( src ) ;
showPoint = [
2016-11-24 12:30:38 +00:00
( is _sheet _lock ) ? ( coAuthTip . x _point + coAuthTip . rightMenuWidth ) : ( coAuthTip . bodyWidth - ( coAuthTip . x _point + coAuthTip . XY [ 0 ] ) ) ,
2016-03-11 00:48:53 +00:00
coAuthTip . y _point + coAuthTip . XY [ 1 ]
] ;
2018-07-19 13:40:19 +00:00
if ( showPoint [ 1 ] >= coAuthTip . XY [ 1 ] &&
2016-03-11 00:48:53 +00:00
showPoint [ 1 ] + coAuthTip . ttHeight < coAuthTip . XY [ 1 ] + coAuthTip . apiHeight ) {
src . text ( getUserName ( data . asc _getUserId ( ) ) ) ;
if ( coAuthTip . bodyWidth - showPoint [ 0 ] < coAuthTip . ref . width ( ) ) {
src . css ( {
visibility : 'visible' ,
left : '0px' ,
top : ( showPoint [ 1 ] - coAuthTip . ttHeight ) + 'px'
} ) ;
} else
src . css ( {
visibility : 'visible' ,
right : showPoint [ 0 ] + 'px' ,
top : showPoint [ 1 ] + 'px'
} ) ;
}
}
}
}
2018-05-31 07:27:38 +00:00
2018-07-26 12:26:52 +00:00
if ( index _filter !== undefined && ! ( me . dlgFilter && me . dlgFilter . isVisible ( ) ) && ! ( me . currentMenu && me . currentMenu . isVisible ( ) ) ) {
2019-03-21 08:09:11 +00:00
if ( ! filterTip . parentEl ) {
filterTip . parentEl = $ ( '<div id="tip-container-filtertip" style="position: absolute; z-index: 10000;"></div>' ) ;
me . documentHolder . cmpEl . append ( filterTip . parentEl ) ;
}
2018-05-31 07:27:38 +00:00
var data = dataarray [ index _filter - 1 ] ,
str = me . makeFilterTip ( data . asc _getFilter ( ) ) ;
if ( filterTip . ref && filterTip . ref . isVisible ( ) ) {
if ( filterTip . text != str ) {
filterTip . text = str ;
filterTip . ref . setTitle ( str ) ;
filterTip . ref . updateTitle ( ) ;
}
}
if ( ! filterTip . ref || ! filterTip . ref . isVisible ( ) ) {
filterTip . text = str ;
filterTip . ref = new Common . UI . Tooltip ( {
2019-03-21 08:09:11 +00:00
owner : filterTip . parentEl ,
2018-05-31 07:27:38 +00:00
html : true ,
title : str ,
cls : 'auto-tooltip'
} ) ;
filterTip . ref . show ( [ - 10000 , - 10000 ] ) ;
filterTip . isHidden = false ;
showPoint = [ data . asc _getX ( ) + pos [ 0 ] - 10 , data . asc _getY ( ) + pos [ 1 ] + 20 ] ;
var tipheight = filterTip . ref . getBSTip ( ) . $tip . width ( ) ;
if ( showPoint [ 1 ] + filterTip . ttHeight > me . tooltips . coauth . bodyHeight ) {
showPoint [ 1 ] = me . tooltips . coauth . bodyHeight - filterTip . ttHeight - 5 ;
showPoint [ 0 ] += 20 ;
}
var tipwidth = filterTip . ref . getBSTip ( ) . $tip . width ( ) ;
if ( showPoint [ 0 ] + tipwidth > me . tooltips . coauth . bodyWidth )
showPoint [ 0 ] = me . tooltips . coauth . bodyWidth - tipwidth - 20 ;
filterTip . ref . getBSTip ( ) . $tip . css ( {
top : showPoint [ 1 ] + 'px' ,
left : showPoint [ 0 ] + 'px'
} ) ;
}
}
2020-05-28 10:58:38 +00:00
if ( index _slicer !== undefined && me . permissions . isEdit ) {
if ( ! slicerTip . parentEl ) {
slicerTip . parentEl = $ ( '<div id="tip-container-slicertip" style="position: absolute; z-index: 10000;"></div>' ) ;
me . documentHolder . cmpEl . append ( slicerTip . parentEl ) ;
}
var data = dataarray [ index _slicer - 1 ] ,
str = data . asc _getTooltip ( ) ;
if ( slicerTip . ref && slicerTip . ref . isVisible ( ) ) {
if ( slicerTip . text != str ) {
slicerTip . text = str ;
slicerTip . ref . setTitle ( str ) ;
slicerTip . ref . updateTitle ( ) ;
}
}
if ( ! slicerTip . ref || ! slicerTip . ref . isVisible ( ) ) {
slicerTip . text = str ;
slicerTip . ref = new Common . UI . Tooltip ( {
owner : slicerTip . parentEl ,
html : true ,
title : str
} ) ;
slicerTip . ref . show ( [ - 10000 , - 10000 ] ) ;
slicerTip . isHidden = false ;
showPoint = [ data . asc _getX ( ) , data . asc _getY ( ) ] ;
showPoint [ 0 ] += ( pos [ 0 ] + 6 ) ;
showPoint [ 1 ] += ( pos [ 1 ] - 20 - slicerTip . ttHeight ) ;
var tipwidth = slicerTip . ref . getBSTip ( ) . $tip . width ( ) ;
if ( showPoint [ 0 ] + tipwidth > me . tooltips . coauth . bodyWidth )
showPoint [ 0 ] = me . tooltips . coauth . bodyWidth - tipwidth - 20 ;
slicerTip . ref . getBSTip ( ) . $tip . css ( {
top : showPoint [ 1 ] + 'px' ,
left : showPoint [ 0 ] + 'px'
} ) ;
}
}
2016-03-11 00:48:53 +00:00
}
} ,
onApiHideComment : function ( ) {
this . tooltips . comment . viewCommentId =
this . tooltips . comment . editCommentId =
this . tooltips . comment . moveCommentId = undefined ;
} ,
onApiHyperlinkClick : function ( url ) {
2016-08-05 11:40:47 +00:00
if ( ! url ) {
Common . UI . alert ( {
msg : this . errorInvalidLink ,
title : this . notcriticalErrorTitle ,
iconCls : 'warn' ,
buttons : [ 'ok' ] ,
callback : _ . bind ( function ( btn ) {
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
} , this )
} ) ;
return ;
}
2020-03-31 15:21:06 +00:00
// if (this.api.asc_getUrlType(url)>0) {
2016-03-11 00:48:53 +00:00
var newDocumentPage = window . open ( url , '_blank' ) ;
if ( newDocumentPage )
newDocumentPage . focus ( ) ;
2020-03-31 15:21:06 +00:00
// }
2016-03-11 00:48:53 +00:00
} ,
onApiAutofilter : function ( config ) {
var me = this ;
2018-05-31 07:27:38 +00:00
if ( ! me . tooltips . filter . isHidden && me . tooltips . filter . ref ) {
me . tooltips . filter . ref . hide ( ) ;
2019-03-15 13:11:37 +00:00
me . tooltips . filter . ref = undefined ;
me . tooltips . filter . text = '' ;
2018-05-31 07:27:38 +00:00
me . tooltips . filter . isHidden = true ;
}
2020-03-25 15:03:35 +00:00
if ( me . permissions . isEdit ) {
if ( ! me . dlgFilter ) {
me . dlgFilter = new SSE . Views . AutoFilterDialog ( { api : this . api } ) . on ( {
2016-03-11 00:48:53 +00:00
'close' : function ( ) {
if ( me . api ) {
me . api . asc _enableKeyEvents ( true ) ;
}
2016-05-20 11:28:40 +00:00
me . dlgFilter = undefined ;
2016-03-11 00:48:53 +00:00
}
} ) ;
2020-03-25 15:03:35 +00:00
if ( me . api ) {
me . api . asc _enableKeyEvents ( false ) ;
}
2016-03-11 00:48:53 +00:00
2020-03-25 15:03:35 +00:00
Common . UI . Menu . Manager . hideAll ( ) ;
me . dlgFilter . setSettings ( config ) ;
var offset = me . documentHolder . cmpEl . offset ( ) ,
rect = config . asc _getCellCoord ( ) ,
x = rect . asc _getX ( ) + rect . asc _getWidth ( ) + offset . left ,
y = rect . asc _getY ( ) + rect . asc _getHeight ( ) + offset . top ;
var docwidth = Common . Utils . innerWidth ( ) ,
docheight = Common . Utils . innerHeight ( ) ;
if ( x + me . dlgFilter . options . width > docwidth )
x = docwidth - me . dlgFilter . options . width - 5 ;
if ( y + me . dlgFilter . options . height > docheight )
y = docheight - me . dlgFilter . options . height - 5 ;
me . dlgFilter . show ( x , y ) ;
} else
me . dlgFilter . close ( ) ;
2016-03-11 00:48:53 +00:00
}
} ,
2018-05-31 07:27:38 +00:00
makeFilterTip : function ( props ) {
var filterObj = props . asc _getFilterObj ( ) ,
filterType = filterObj . asc _getType ( ) ,
isTextFilter = props . asc _getIsTextFilter ( ) ,
colorsFill = props . asc _getColorsFill ( ) ,
colorsFont = props . asc _getColorsFont ( ) ,
str = "" ;
if ( filterType === Asc . c _oAscAutoFilterTypes . CustomFilters ) {
var customFilter = filterObj . asc _getFilter ( ) ,
customFilters = customFilter . asc _getCustomFilters ( ) ;
str = this . getFilterName ( Asc . c _oAscAutoFilterTypes . CustomFilters , customFilters [ 0 ] . asc _getOperator ( ) ) + " \"" + customFilters [ 0 ] . asc _getVal ( ) + "\"" ;
if ( customFilters . length > 1 ) {
2018-08-03 11:06:29 +00:00
str = str + " " + ( customFilter . asc _getAnd ( ) ? this . txtAnd : this . txtOr ) ;
2018-05-31 07:27:38 +00:00
str = str + " " + this . getFilterName ( Asc . c _oAscAutoFilterTypes . CustomFilters , customFilters [ 1 ] . asc _getOperator ( ) ) + " \"" + customFilters [ 1 ] . asc _getVal ( ) + "\"" ;
}
} else if ( filterType === Asc . c _oAscAutoFilterTypes . ColorFilter ) {
var colorFilter = filterObj . asc _getFilter ( ) ;
if ( colorFilter . asc _getCellColor ( ) === null ) { // cell color
str = this . txtEqualsToCellColor ;
} else if ( colorFilter . asc _getCellColor ( ) === false ) { // font color
str = this . txtEqualsToFontColor ;
}
} else if ( filterType === Asc . c _oAscAutoFilterTypes . DynamicFilter ) {
str = this . getFilterName ( Asc . c _oAscAutoFilterTypes . DynamicFilter , filterObj . asc _getFilter ( ) . asc _getType ( ) ) ;
} else if ( filterType === Asc . c _oAscAutoFilterTypes . Top10 ) {
var top10Filter = filterObj . asc _getFilter ( ) ,
percent = top10Filter . asc _getPercent ( ) ;
str = this . getFilterName ( Asc . c _oAscAutoFilterTypes . Top10 , top10Filter . asc _getTop ( ) ) ;
str += " " + top10Filter . asc _getVal ( ) + " " + ( ( percent || percent === null ) ? this . txtPercent : this . txtItems ) ;
} else if ( filterType === Asc . c _oAscAutoFilterTypes . Filters ) {
var strlen = 0 , visibleItems = 0 , isBlankVisible = undefined ,
values = props . asc _getValues ( ) ;
values . forEach ( function ( item ) {
if ( item . asc _getVisible ( ) ) {
visibleItems ++ ;
if ( strlen < 100 && item . asc _getText ( ) ) {
str += item . asc _getText ( ) + "; " ;
strlen = str . length ;
}
}
if ( ! item . asc _getText ( ) )
isBlankVisible = item . asc _getVisible ( ) ;
} ) ;
if ( visibleItems == values . length )
str = this . txtAll ;
else if ( visibleItems == 1 && isBlankVisible )
str = this . txtEquals + " \"" + this . txtBlanks + "\"" ;
else if ( visibleItems == values . length - 1 && ( isBlankVisible == false ) )
str = this . txtNotEquals + " \"" + this . txtBlanks + "\"" ;
else {
isBlankVisible && ( str += this . txtBlanks + "; " ) ;
str = this . txtEquals + " \"" + str . substring ( 0 , str . length - 2 ) + "\"" ;
}
} else if ( filterType === Asc . c _oAscAutoFilterTypes . None ) {
str = this . txtAll ;
}
if ( str . length > 100 )
str = str . substring ( 0 , 100 ) + '...' ;
2018-07-26 14:03:47 +00:00
str = "<b>" + ( props . asc _getColumnName ( ) || '(' + this . txtColumn + ' ' + props . asc _getSheetColumnName ( ) + ')' ) + ":</b><br>" + str ;
2018-05-31 07:27:38 +00:00
return str ;
} ,
getFilterName : function ( type , subtype ) {
var str = '' ;
if ( type == Asc . c _oAscAutoFilterTypes . CustomFilters ) {
switch ( subtype ) {
case Asc . c _oAscCustomAutoFilter . equals : str = this . txtEquals ; break ;
case Asc . c _oAscCustomAutoFilter . isGreaterThan : str = this . txtGreater ; break ;
case Asc . c _oAscCustomAutoFilter . isGreaterThanOrEqualTo : str = this . txtGreaterEquals ; break ;
case Asc . c _oAscCustomAutoFilter . isLessThan : str = this . txtLess ; break ;
case Asc . c _oAscCustomAutoFilter . isLessThanOrEqualTo : str = this . txtLessEquals ; break ;
case Asc . c _oAscCustomAutoFilter . doesNotEqual : str = this . txtNotEquals ; break ;
case Asc . c _oAscCustomAutoFilter . beginsWith : str = this . txtBegins ; break ;
case Asc . c _oAscCustomAutoFilter . doesNotBeginWith : str = this . txtNotBegins ; break ;
case Asc . c _oAscCustomAutoFilter . endsWith : str = this . txtEnds ; break ;
case Asc . c _oAscCustomAutoFilter . doesNotEndWith : str = this . txtNotEnds ; break ;
case Asc . c _oAscCustomAutoFilter . contains : str = this . txtContains ; break ;
case Asc . c _oAscCustomAutoFilter . doesNotContain : str = this . txtNotContains ; break ;
}
} else if ( type == Asc . c _oAscAutoFilterTypes . DynamicFilter ) {
switch ( subtype ) {
case Asc . c _oAscDynamicAutoFilter . aboveAverage : str = this . txtAboveAve ; break ;
case Asc . c _oAscDynamicAutoFilter . belowAverage : str = this . txtBelowAve ; break ;
}
} else if ( type == Asc . c _oAscAutoFilterTypes . Top10 ) {
str = ( subtype || subtype === null ) ? this . txtFilterTop : this . txtFilterBottom ;
}
return str ;
} ,
2017-06-06 08:04:04 +00:00
onUndo : function ( ) {
if ( this . api ) {
this . api . asc _Undo ( ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
}
} ,
2016-03-11 00:48:53 +00:00
onApiContextMenu : function ( event ) {
var me = this ;
_ . delay ( function ( ) {
me . showObjectMenu . call ( me , event ) ;
} , 10 ) ;
} ,
onAfterRender : function ( view ) {
} ,
onDocumentResize : function ( e ) {
var me = this ;
if ( me . documentHolder ) {
me . tooltips . coauth . XY = [
me . documentHolder . cmpEl . offset ( ) . left - $ ( window ) . scrollLeft ( ) ,
me . documentHolder . cmpEl . offset ( ) . top - $ ( window ) . scrollTop ( )
] ;
me . tooltips . coauth . apiHeight = me . documentHolder . cmpEl . height ( ) ;
2016-11-24 12:30:38 +00:00
me . tooltips . coauth . rightMenuWidth = $ ( '#right-menu' ) . width ( ) ;
2016-03-11 00:48:53 +00:00
me . tooltips . coauth . bodyWidth = $ ( window ) . width ( ) ;
2018-05-31 07:27:38 +00:00
me . tooltips . coauth . bodyHeight = $ ( window ) . height ( ) ;
2016-03-11 00:48:53 +00:00
}
} ,
onDocumentWheel : function ( e ) {
if ( this . api && ! this . isEditCell ) {
var delta = ( _ . isUndefined ( e . originalEvent ) ) ? e . wheelDelta : e . originalEvent . wheelDelta ;
if ( _ . isUndefined ( delta ) ) {
delta = e . deltaY ;
}
if ( ( e . ctrlKey || e . metaKey ) && ! e . altKey ) {
var factor = this . api . asc _getZoom ( ) ;
if ( delta < 0 ) {
factor = Math . ceil ( factor * 10 ) / 10 ;
factor -= 0.1 ;
if ( ! ( factor < . 5 ) ) {
this . api . asc _setZoom ( factor ) ;
}
} else if ( delta > 0 ) {
factor = Math . floor ( factor * 10 ) / 10 ;
factor += 0.1 ;
if ( factor > 0 && ! ( factor > 2. ) ) {
this . api . asc _setZoom ( factor ) ;
}
}
e . preventDefault ( ) ;
e . stopPropagation ( ) ;
}
}
} ,
onDocumentKeyDown : function ( event ) {
if ( this . api ) {
var key = event . keyCode ;
if ( ( event . ctrlKey || event . metaKey ) && ! event . shiftKey && ! event . altKey ) {
2017-09-19 14:26:09 +00:00
if ( key === Common . UI . Keys . NUM _PLUS || key === Common . UI . Keys . EQUALITY || ( Common . Utils . isGecko && key === Common . UI . Keys . EQUALITY _FF ) || ( Common . Utils . isOpera && key == 43 ) ) {
2016-03-11 00:48:53 +00:00
if ( ! this . api . isCellEdited ) {
var factor = Math . floor ( this . api . asc _getZoom ( ) * 10 ) / 10 ;
factor += . 1 ;
if ( factor > 0 && ! ( factor > 2. ) ) {
this . api . asc _setZoom ( factor ) ;
}
event . preventDefault ( ) ;
event . stopPropagation ( ) ;
return false ;
}
2017-09-19 14:26:09 +00:00
} else if ( key === Common . UI . Keys . NUM _MINUS || key === Common . UI . Keys . MINUS || ( Common . Utils . isGecko && key === Common . UI . Keys . MINUS _FF ) || ( Common . Utils . isOpera && key == 45 ) ) {
2016-03-11 00:48:53 +00:00
if ( ! this . api . isCellEdited ) {
factor = Math . ceil ( this . api . asc _getZoom ( ) * 10 ) / 10 ;
factor -= . 1 ;
if ( ! ( factor < . 5 ) ) {
this . api . asc _setZoom ( factor ) ;
}
2020-04-09 15:35:36 +00:00
event . preventDefault ( ) ;
event . stopPropagation ( ) ;
return false ;
}
} else if ( key === 48 || key === 96 ) { // 0
if ( ! this . api . isCellEdited ) {
this . api . asc _setZoom ( 1 ) ;
2016-03-11 00:48:53 +00:00
event . preventDefault ( ) ;
event . stopPropagation ( ) ;
return false ;
}
}
} else
if ( key == Common . UI . Keys . F10 && event . shiftKey ) {
this . showObjectMenu ( event ) ;
event . preventDefault ( ) ;
event . stopPropagation ( ) ;
return false ;
}
}
} ,
onDocumentRightDown : function ( event ) {
event . button == 0 && ( this . mouse . isLeftButtonDown = true ) ;
// event.button == 2 && (this.mouse.isRightButtonDown = true);
} ,
onDocumentRightUp : function ( event ) {
event . button == 0 && ( this . mouse . isLeftButtonDown = false ) ;
} ,
2017-11-02 08:13:24 +00:00
onProcessMouse : function ( data ) {
( data . type == 'mouseup' ) && ( this . mouse . isLeftButtonDown = false ) ;
} ,
2020-02-25 11:37:43 +00:00
onDragEndMouseUp : function ( ) {
this . mouse . isLeftButtonDown = false ;
} ,
2019-04-03 13:03:20 +00:00
onDocumentMouseMove : function ( e ) {
if ( e . target . localName !== 'canvas' ) {
this . hideHyperlinkTip ( ) ;
}
} ,
2016-03-11 00:48:53 +00:00
showObjectMenu : function ( event ) {
2017-06-06 08:04:04 +00:00
if ( this . api && ! this . mouse . isLeftButtonDown && ! this . rangeSelectionMode ) {
2017-11-10 07:50:01 +00:00
( this . permissions . isEdit && ! this . _isDisabled ) ? this . fillMenuProps ( this . api . asc _getCellInfo ( ) , true , event ) : this . fillViewMenuProps ( this . api . asc _getCellInfo ( ) , true , event ) ;
2016-03-11 00:48:53 +00:00
}
} ,
onSelectionChanged : function ( info ) {
2017-06-06 08:04:04 +00:00
if ( ! this . mouse . isLeftButtonDown && ! this . rangeSelectionMode &&
2016-03-11 00:48:53 +00:00
this . currentMenu && this . currentMenu . isVisible ( ) ) {
2017-11-10 07:50:01 +00:00
( this . permissions . isEdit && ! this . _isDisabled ) ? this . fillMenuProps ( info , true ) : this . fillViewMenuProps ( info , true ) ;
2016-03-11 00:48:53 +00:00
}
} ,
fillMenuProps : function ( cellinfo , showMenu , event ) {
2020-05-26 14:27:49 +00:00
var iscellmenu , isrowmenu , iscolmenu , isallmenu , ischartmenu , isimagemenu , istextshapemenu , isshapemenu , istextchartmenu , isimageonly , isslicermenu ,
2016-03-11 00:48:53 +00:00
documentHolder = this . documentHolder ,
2020-05-14 08:39:04 +00:00
seltype = cellinfo . asc _getSelectionType ( ) ,
2016-03-11 00:48:53 +00:00
isCellLocked = cellinfo . asc _getLocked ( ) ,
2016-11-24 07:23:02 +00:00
isTableLocked = cellinfo . asc _getLockedTable ( ) === true ,
2016-03-11 00:48:53 +00:00
isObjLocked = false ,
commentsController = this . getApplication ( ) . getController ( 'Common.Controllers.Comments' ) ,
2020-05-15 10:52:52 +00:00
internaleditor = this . permissions . isEditMailMerge || this . permissions . isEditDiagram ,
xfs = cellinfo . asc _getXfs ( ) ;
2017-09-28 13:56:10 +00:00
switch ( seltype ) {
case Asc . c _oAscSelectionType . RangeCells : iscellmenu = true ; break ;
case Asc . c _oAscSelectionType . RangeRow : isrowmenu = true ; break ;
case Asc . c _oAscSelectionType . RangeCol : iscolmenu = true ; break ;
case Asc . c _oAscSelectionType . RangeMax : isallmenu = true ; break ;
2020-06-05 16:28:11 +00:00
case Asc . c _oAscSelectionType . RangeSlicer :
2017-09-28 13:56:10 +00:00
case Asc . c _oAscSelectionType . RangeImage : isimagemenu = ! internaleditor ; break ;
case Asc . c _oAscSelectionType . RangeShape : isshapemenu = ! internaleditor ; break ;
case Asc . c _oAscSelectionType . RangeChart : ischartmenu = ! internaleditor ; break ;
case Asc . c _oAscSelectionType . RangeChartText : istextchartmenu = ! internaleditor ; break ;
case Asc . c _oAscSelectionType . RangeShapeText : istextshapemenu = ! internaleditor ; break ;
2016-03-11 00:48:53 +00:00
}
2019-07-23 10:24:38 +00:00
if ( this . api . asc _getHeaderFooterMode ( ) ) {
if ( ! documentHolder . copyPasteMenu || ! showMenu && ! documentHolder . copyPasteMenu . isVisible ( ) ) return ;
if ( showMenu ) this . showPopupMenu ( documentHolder . copyPasteMenu , { } , event ) ;
} else if ( isimagemenu || isshapemenu || ischartmenu ) {
2018-12-06 11:00:25 +00:00
if ( ! documentHolder . imgMenu || ! showMenu && ! documentHolder . imgMenu . isVisible ( ) ) return ;
2016-03-11 00:48:53 +00:00
2020-05-26 14:27:49 +00:00
isimagemenu = isshapemenu = ischartmenu = isslicermenu = false ;
2019-02-27 11:51:52 +00:00
documentHolder . mnuImgAdvanced . imageInfo = undefined ;
2017-11-22 08:41:47 +00:00
var has _chartprops = false ,
signGuid ;
2016-03-11 00:48:53 +00:00
var selectedObjects = this . api . asc _getGraphicObjectProps ( ) ;
for ( var i = 0 ; i < selectedObjects . length ; i ++ ) {
2016-04-05 11:52:34 +00:00
if ( selectedObjects [ i ] . asc _getObjectType ( ) == Asc . c _oAscTypeSelectElement . Image ) {
2016-03-11 00:48:53 +00:00
var elValue = selectedObjects [ i ] . asc _getObjectValue ( ) ;
isObjLocked = isObjLocked || elValue . asc _getLocked ( ) ;
var shapeprops = elValue . asc _getShapeProperties ( ) ;
if ( shapeprops ) {
if ( shapeprops . asc _getFromChart ( ) )
ischartmenu = true ;
2018-02-06 08:56:13 +00:00
else if ( shapeprops . asc _getFromImage ( ) )
isimageonly = true ;
2016-03-11 00:48:53 +00:00
else {
documentHolder . mnuShapeAdvanced . shapeInfo = elValue ;
isshapemenu = true ;
}
} else if ( elValue . asc _getChartProperties ( ) ) {
2017-04-11 11:05:56 +00:00
documentHolder . mnuChartEdit . chartInfo = elValue ;
2016-03-11 00:48:53 +00:00
ischartmenu = true ;
has _chartprops = true ;
2020-05-26 14:27:49 +00:00
} if ( elValue . asc _getSlicerProperties ( ) ) {
documentHolder . mnuSlicerAdvanced . imageInfo = elValue ;
isslicermenu = true ;
2017-04-11 11:05:56 +00:00
} else {
documentHolder . mnuImgAdvanced . imageInfo = elValue ;
2016-03-11 00:48:53 +00:00
isimagemenu = true ;
2017-04-11 11:05:56 +00:00
}
2018-09-24 09:18:00 +00:00
if ( this . permissions . isSignatureSupport )
2017-11-23 11:29:41 +00:00
signGuid = elValue . asc _getSignatureId ( ) ;
2016-03-11 00:48:53 +00:00
}
}
2019-02-27 09:52:19 +00:00
var cangroup = this . api . asc _canGroupGraphicsObjects ( ) ;
2016-03-11 00:48:53 +00:00
documentHolder . mnuUnGroupImg . setDisabled ( isObjLocked || ! this . api . asc _canUnGroupGraphicsObjects ( ) ) ;
2019-02-27 09:52:19 +00:00
documentHolder . mnuGroupImg . setDisabled ( isObjLocked || ! cangroup ) ;
documentHolder . menuImageAlign . setDisabled ( isObjLocked || ! cangroup ) ;
var objcount = this . api . asc _getSelectedDrawingObjectsCount ( ) ;
documentHolder . menuImageAlign . menu . items [ 7 ] . setDisabled ( objcount < 3 ) ;
documentHolder . menuImageAlign . menu . items [ 8 ] . setDisabled ( objcount < 3 ) ;
2016-03-11 00:48:53 +00:00
documentHolder . mnuShapeAdvanced . setVisible ( isshapemenu && ! isimagemenu && ! ischartmenu ) ;
documentHolder . mnuShapeAdvanced . setDisabled ( isObjLocked ) ;
documentHolder . mnuChartEdit . setVisible ( ischartmenu && ! isimagemenu && ! isshapemenu && has _chartprops ) ;
documentHolder . mnuChartEdit . setDisabled ( isObjLocked ) ;
documentHolder . pmiImgCut . setDisabled ( isObjLocked ) ;
documentHolder . pmiImgPaste . setDisabled ( isObjLocked ) ;
2018-02-06 08:56:13 +00:00
documentHolder . mnuImgAdvanced . setVisible ( isimagemenu && ( ! isshapemenu || isimageonly ) && ! ischartmenu ) ;
2017-04-11 11:05:56 +00:00
documentHolder . mnuImgAdvanced . setDisabled ( isObjLocked ) ;
2018-04-11 13:46:44 +00:00
documentHolder . menuImgOriginalSize . setVisible ( isimagemenu && ( ! isshapemenu || isimageonly ) && ! ischartmenu ) ;
if ( documentHolder . mnuImgAdvanced . imageInfo )
documentHolder . menuImgOriginalSize . setDisabled ( isObjLocked || documentHolder . mnuImgAdvanced . imageInfo . get _ImageUrl ( ) === null || documentHolder . mnuImgAdvanced . imageInfo . get _ImageUrl ( ) === undefined ) ;
2020-05-26 14:27:49 +00:00
documentHolder . mnuSlicerAdvanced . setVisible ( isslicermenu ) ;
2020-05-25 17:25:16 +00:00
documentHolder . mnuSlicerAdvanced . setDisabled ( isObjLocked ) ;
2018-04-11 13:46:44 +00:00
var pluginGuid = ( documentHolder . mnuImgAdvanced . imageInfo ) ? documentHolder . mnuImgAdvanced . imageInfo . asc _getPluginGuid ( ) : null ;
documentHolder . menuImgReplace . setVisible ( isimageonly && ( pluginGuid === null || pluginGuid === undefined ) ) ;
documentHolder . menuImgReplace . setDisabled ( isObjLocked || pluginGuid === null ) ;
2020-05-13 14:43:45 +00:00
documentHolder . menuImgReplace . menu . items [ 2 ] . setVisible ( this . permissions . canRequestInsertImage || this . permissions . fileChoiceUrl && this . permissions . fileChoiceUrl . indexOf ( "{documentType}" ) > - 1 ) ;
2019-02-27 09:52:19 +00:00
documentHolder . menuImageArrange . setDisabled ( isObjLocked ) ;
2020-05-26 14:27:49 +00:00
documentHolder . menuImgRotate . setVisible ( ! ischartmenu && ( pluginGuid === null || pluginGuid === undefined ) && ! isslicermenu ) ;
2019-02-27 09:52:19 +00:00
documentHolder . menuImgRotate . setDisabled ( isObjLocked ) ;
2017-11-22 08:41:47 +00:00
2019-04-09 11:29:51 +00:00
documentHolder . menuImgCrop . setVisible ( this . api . asc _canEditCrop ( ) ) ;
if ( documentHolder . menuImgCrop . isVisible ( ) )
documentHolder . menuImgCrop . setDisabled ( isObjLocked ) ;
2017-11-24 11:47:48 +00:00
var isInSign = ! ! signGuid ;
2017-11-22 08:41:47 +00:00
documentHolder . menuSignatureEditSign . setVisible ( isInSign ) ;
documentHolder . menuSignatureEditSetup . setVisible ( isInSign ) ;
documentHolder . menuEditSignSeparator . setVisible ( isInSign ) ;
if ( isInSign ) {
documentHolder . menuSignatureEditSign . cmpEl . attr ( 'data-value' , signGuid ) ; // sign
documentHolder . menuSignatureEditSetup . cmpEl . attr ( 'data-value' , signGuid ) ; // edit signature settings
}
2016-03-11 00:48:53 +00:00
if ( showMenu ) this . showPopupMenu ( documentHolder . imgMenu , { } , event ) ;
2017-04-11 11:05:56 +00:00
documentHolder . mnuShapeSeparator . setVisible ( documentHolder . mnuShapeAdvanced . isVisible ( ) || documentHolder . mnuChartEdit . isVisible ( ) || documentHolder . mnuImgAdvanced . isVisible ( ) ) ;
2020-05-25 17:25:16 +00:00
documentHolder . mnuSlicerSeparator . setVisible ( documentHolder . mnuSlicerAdvanced . isVisible ( ) ) ;
2016-03-11 00:48:53 +00:00
} else if ( istextshapemenu || istextchartmenu ) {
2018-12-06 11:00:25 +00:00
if ( ! documentHolder . textInShapeMenu || ! showMenu && ! documentHolder . textInShapeMenu . isVisible ( ) ) return ;
2016-03-11 00:48:53 +00:00
documentHolder . pmiTextAdvanced . textInfo = undefined ;
2016-10-24 11:56:11 +00:00
var selectedObjects = this . api . asc _getGraphicObjectProps ( ) ,
isEquation = false ;
2016-03-11 00:48:53 +00:00
for ( var i = 0 ; i < selectedObjects . length ; i ++ ) {
var elType = selectedObjects [ i ] . asc _getObjectType ( ) ;
2016-04-05 11:52:34 +00:00
if ( elType == Asc . c _oAscTypeSelectElement . Image ) {
2016-03-11 00:48:53 +00:00
var value = selectedObjects [ i ] . asc _getObjectValue ( ) ,
align = value . asc _getVerticalTextAlign ( ) ,
2017-05-18 07:31:18 +00:00
direct = value . asc _getVert ( ) ,
2017-05-18 11:28:09 +00:00
listtype = this . api . asc _getCurrentListType ( ) ;
2016-03-11 00:48:53 +00:00
isObjLocked = isObjLocked || value . asc _getLocked ( ) ;
2016-11-10 11:24:18 +00:00
documentHolder . menuParagraphTop . setChecked ( align == Asc . c _oAscVAlign . Top ) ;
documentHolder . menuParagraphCenter . setChecked ( align == Asc . c _oAscVAlign . Center ) ;
documentHolder . menuParagraphBottom . setChecked ( align == Asc . c _oAscVAlign . Bottom ) ;
2016-04-05 11:52:34 +00:00
documentHolder . menuParagraphDirectH . setChecked ( direct == Asc . c _oAscVertDrawingText . normal ) ;
documentHolder . menuParagraphDirect90 . setChecked ( direct == Asc . c _oAscVertDrawingText . vert ) ;
documentHolder . menuParagraphDirect270 . setChecked ( direct == Asc . c _oAscVertDrawingText . vert270 ) ;
2017-05-18 07:31:18 +00:00
2017-05-18 11:28:09 +00:00
documentHolder . menuParagraphBulletNone . setChecked ( listtype . get _ListType ( ) == - 1 ) ;
2019-11-07 11:01:07 +00:00
documentHolder . mnuListSettings . setDisabled ( listtype . get _ListType ( ) == - 1 ) ;
2017-05-18 11:28:09 +00:00
var rec = documentHolder . paraBulletsPicker . store . findWhere ( { type : listtype . get _ListType ( ) , subtype : listtype . get _ListSubType ( ) } ) ;
2017-05-18 07:31:18 +00:00
documentHolder . paraBulletsPicker . selectRecord ( rec , true ) ;
2016-04-05 11:52:34 +00:00
} else if ( elType == Asc . c _oAscTypeSelectElement . Paragraph ) {
2016-03-11 00:48:53 +00:00
documentHolder . pmiTextAdvanced . textInfo = selectedObjects [ i ] . asc _getObjectValue ( ) ;
isObjLocked = isObjLocked || documentHolder . pmiTextAdvanced . textInfo . asc _getLocked ( ) ;
2016-10-24 11:56:11 +00:00
} else if ( elType == Asc . c _oAscTypeSelectElement . Math ) {
this . _currentMathObj = selectedObjects [ i ] . asc _getObjectValue ( ) ;
isEquation = true ;
2016-03-11 00:48:53 +00:00
}
}
var hyperinfo = cellinfo . asc _getHyperlink ( ) ,
can _add _hyperlink = this . api . asc _canAddShapeHyperlink ( ) ;
2019-11-20 08:36:05 +00:00
documentHolder . menuParagraphBullets . setVisible ( istextchartmenu !== true ) ;
2016-03-11 00:48:53 +00:00
documentHolder . menuHyperlinkShape . setVisible ( istextshapemenu && can _add _hyperlink !== false && hyperinfo ) ;
documentHolder . menuAddHyperlinkShape . setVisible ( istextshapemenu && can _add _hyperlink !== false && ! hyperinfo ) ;
2016-10-24 11:56:11 +00:00
documentHolder . menuParagraphVAlign . setVisible ( istextchartmenu !== true && ! isEquation ) ; // убрать после того, как заголовок можно будет растягивать по вертикали!!
documentHolder . menuParagraphDirection . setVisible ( istextchartmenu !== true && ! isEquation ) ; // убрать после того, как заголовок можно будет растягивать по вертикали!!
2019-11-20 08:36:05 +00:00
documentHolder . textInShapeMenu . items [ 3 ] . setVisible ( istextchartmenu !== true || istextshapemenu && can _add _hyperlink !== false ) ;
2016-03-11 00:48:53 +00:00
documentHolder . pmiTextAdvanced . setVisible ( documentHolder . pmiTextAdvanced . textInfo !== undefined ) ;
2016-10-24 11:56:11 +00:00
2016-03-11 00:48:53 +00:00
_ . each ( documentHolder . textInShapeMenu . items , function ( item ) {
item . setDisabled ( isObjLocked ) ;
} ) ;
documentHolder . pmiTextCopy . setDisabled ( false ) ;
2016-10-24 11:56:11 +00:00
//equation menu
var eqlen = 0 ;
this . _currentParaObjDisabled = isObjLocked ;
if ( isEquation ) {
eqlen = this . addEquationMenu ( 4 ) ;
} else
this . clearEquationMenu ( 4 ) ;
2016-03-11 00:48:53 +00:00
if ( showMenu ) this . showPopupMenu ( documentHolder . textInShapeMenu , { } , event ) ;
2016-04-05 11:52:34 +00:00
} else if ( ! this . permissions . isEditMailMerge && ! this . permissions . isEditDiagram || ( seltype !== Asc . c _oAscSelectionType . RangeImage && seltype !== Asc . c _oAscSelectionType . RangeShape &&
2020-06-05 16:28:11 +00:00
seltype !== Asc . c _oAscSelectionType . RangeChart && seltype !== Asc . c _oAscSelectionType . RangeChartText && seltype !== Asc . c _oAscSelectionType . RangeShapeText && seltype !== Asc . c _oAscSelectionType . RangeSlicer ) ) {
2018-12-06 11:00:25 +00:00
if ( ! documentHolder . ssMenu || ! showMenu && ! documentHolder . ssMenu . isVisible ( ) ) return ;
2016-03-11 00:48:53 +00:00
2016-03-30 12:27:16 +00:00
var iscelledit = this . api . isCellEdited ,
formatTableInfo = cellinfo . asc _getFormatTableInfo ( ) ,
2016-11-25 12:58:57 +00:00
isinsparkline = ( cellinfo . asc _getSparklineInfo ( ) !== null ) ,
2016-11-01 15:04:35 +00:00
isintable = ( formatTableInfo !== null ) ,
2020-05-14 08:45:23 +00:00
ismultiselect = cellinfo . asc _getMultiselect ( ) ;
2016-03-30 12:27:16 +00:00
documentHolder . ssMenu . formatTableName = ( isintable ) ? formatTableInfo . asc _getTableName ( ) : null ;
2020-05-15 10:52:52 +00:00
documentHolder . ssMenu . cellColor = xfs . asc _getFillColor ( ) ;
documentHolder . ssMenu . fontColor = xfs . asc _getFontColor ( ) ;
2016-03-11 00:48:53 +00:00
documentHolder . pmiInsertEntire . setVisible ( isrowmenu || iscolmenu ) ;
documentHolder . pmiInsertEntire . setCaption ( ( isrowmenu ) ? this . textInsertTop : this . textInsertLeft ) ;
documentHolder . pmiDeleteEntire . setVisible ( isrowmenu || iscolmenu ) ;
2016-03-30 12:27:16 +00:00
documentHolder . pmiInsertCells . setVisible ( iscellmenu && ! iscelledit && ! isintable ) ;
documentHolder . pmiDeleteCells . setVisible ( iscellmenu && ! iscelledit && ! isintable ) ;
documentHolder . pmiSelectTable . setVisible ( iscellmenu && ! iscelledit && isintable ) ;
documentHolder . pmiInsertTable . setVisible ( iscellmenu && ! iscelledit && isintable ) ;
documentHolder . pmiDeleteTable . setVisible ( iscellmenu && ! iscelledit && isintable ) ;
2016-11-25 12:58:57 +00:00
documentHolder . pmiSparklines . setVisible ( isinsparkline ) ;
2017-09-28 13:56:10 +00:00
documentHolder . pmiSortCells . setVisible ( ( iscellmenu || isallmenu ) && ! iscelledit ) ;
documentHolder . pmiSortCells . menu . items [ 2 ] . setVisible ( ! internaleditor ) ;
documentHolder . pmiSortCells . menu . items [ 3 ] . setVisible ( ! internaleditor ) ;
documentHolder . pmiFilterCells . setVisible ( iscellmenu && ! iscelledit && ! internaleditor ) ;
documentHolder . pmiReapply . setVisible ( ( iscellmenu || isallmenu ) && ! iscelledit && ! internaleditor ) ;
documentHolder . ssMenu . items [ 12 ] . setVisible ( ( iscellmenu || isallmenu || isinsparkline ) && ! iscelledit ) ;
2018-03-28 14:02:30 +00:00
documentHolder . pmiInsFunction . setVisible ( iscellmenu && ! iscelledit ) ;
2017-09-28 13:56:10 +00:00
documentHolder . pmiAddNamedRange . setVisible ( iscellmenu && ! iscelledit && ! internaleditor ) ;
2016-03-11 00:48:53 +00:00
2016-04-01 13:30:53 +00:00
if ( isintable ) {
documentHolder . pmiInsertTable . menu . items [ 0 ] . setDisabled ( ! formatTableInfo . asc _getIsInsertRowAbove ( ) ) ;
documentHolder . pmiInsertTable . menu . items [ 1 ] . setDisabled ( ! formatTableInfo . asc _getIsInsertRowBelow ( ) ) ;
documentHolder . pmiInsertTable . menu . items [ 2 ] . setDisabled ( ! formatTableInfo . asc _getIsInsertColumnLeft ( ) ) ;
documentHolder . pmiInsertTable . menu . items [ 3 ] . setDisabled ( ! formatTableInfo . asc _getIsInsertColumnRight ( ) ) ;
documentHolder . pmiDeleteTable . menu . items [ 0 ] . setDisabled ( ! formatTableInfo . asc _getIsDeleteRow ( ) ) ;
documentHolder . pmiDeleteTable . menu . items [ 1 ] . setDisabled ( ! formatTableInfo . asc _getIsDeleteColumn ( ) ) ;
documentHolder . pmiDeleteTable . menu . items [ 2 ] . setDisabled ( ! formatTableInfo . asc _getIsDeleteTable ( ) ) ;
}
2016-03-11 00:48:53 +00:00
var hyperinfo = cellinfo . asc _getHyperlink ( ) ;
2017-09-28 13:56:10 +00:00
documentHolder . menuHyperlink . setVisible ( iscellmenu && hyperinfo && ! iscelledit && ! ismultiselect && ! internaleditor ) ;
documentHolder . menuAddHyperlink . setVisible ( iscellmenu && ! hyperinfo && ! iscelledit && ! ismultiselect && ! internaleditor ) ;
2016-03-11 00:48:53 +00:00
documentHolder . pmiRowHeight . setVisible ( isrowmenu || isallmenu ) ;
documentHolder . pmiColumnWidth . setVisible ( iscolmenu || isallmenu ) ;
documentHolder . pmiEntireHide . setVisible ( iscolmenu || isrowmenu ) ;
documentHolder . pmiEntireShow . setVisible ( iscolmenu || isrowmenu ) ;
documentHolder . pmiFreezePanes . setVisible ( ! iscelledit ) ;
documentHolder . pmiFreezePanes . setCaption ( this . api . asc _getSheetViewSettings ( ) . asc _getIsFreezePane ( ) ? documentHolder . textUnFreezePanes : documentHolder . textFreezePanes ) ;
/** coauthoring begin **/
2019-04-12 13:23:21 +00:00
var count = cellinfo . asc _getComments ( ) . length ;
documentHolder . ssMenu . items [ 17 ] . setVisible ( iscellmenu && ! iscelledit && this . permissions . canCoAuthoring && this . permissions . canComments && count < 1 ) ;
documentHolder . pmiAddComment . setVisible ( iscellmenu && ! iscelledit && this . permissions . canCoAuthoring && this . permissions . canComments && count < 1 ) ;
2016-03-11 00:48:53 +00:00
/** coauthoring end **/
2018-03-28 14:02:30 +00:00
documentHolder . pmiCellMenuSeparator . setVisible ( iscellmenu && ! iscelledit || isrowmenu || iscolmenu || isallmenu ) ;
2016-03-11 00:48:53 +00:00
documentHolder . pmiEntireHide . isrowmenu = isrowmenu ;
documentHolder . pmiEntireShow . isrowmenu = isrowmenu ;
commentsController && commentsController . blockPopover ( true ) ;
2017-10-19 10:14:12 +00:00
documentHolder . pmiClear . menu . items [ 0 ] . setDisabled ( ! this . permissions . canModifyFilter ) ;
2016-03-11 00:48:53 +00:00
documentHolder . pmiClear . menu . items [ 1 ] . setDisabled ( iscelledit ) ;
2017-10-19 10:14:12 +00:00
documentHolder . pmiClear . menu . items [ 2 ] . setDisabled ( iscelledit || ! this . permissions . canModifyFilter ) ;
2016-03-11 00:48:53 +00:00
documentHolder . pmiClear . menu . items [ 3 ] . setDisabled ( iscelledit ) ;
documentHolder . pmiClear . menu . items [ 4 ] . setDisabled ( iscelledit ) ;
documentHolder . pmiClear . menu . items [ 3 ] . setVisible ( ! this . permissions . isEditDiagram ) ;
documentHolder . pmiClear . menu . items [ 4 ] . setVisible ( ! this . permissions . isEditDiagram ) ;
2016-05-17 08:01:41 +00:00
var filterInfo = cellinfo . asc _getAutoFilterInfo ( ) ,
isApplyAutoFilter = ( filterInfo ) ? filterInfo . asc _getIsApplyAutoFilter ( ) : false ;
filterInfo = ( filterInfo ) ? filterInfo . asc _getIsAutoFilter ( ) : null ;
documentHolder . pmiInsertCells . menu . items [ 0 ] . setDisabled ( isApplyAutoFilter ) ;
documentHolder . pmiDeleteCells . menu . items [ 0 ] . setDisabled ( isApplyAutoFilter ) ;
documentHolder . pmiInsertCells . menu . items [ 1 ] . setDisabled ( isApplyAutoFilter ) ;
documentHolder . pmiDeleteCells . menu . items [ 1 ] . setDisabled ( isApplyAutoFilter ) ;
2016-03-11 00:48:53 +00:00
2017-06-21 09:47:22 +00:00
var inPivot = ! ! cellinfo . asc _getPivotTableInfo ( ) ;
2017-09-18 13:53:29 +00:00
documentHolder . pmiEntriesList . setVisible ( ! iscelledit && ! inPivot ) ;
2018-04-13 13:29:31 +00:00
documentHolder . pmiNumFormat . setVisible ( ! iscelledit ) ;
2020-05-15 10:52:52 +00:00
documentHolder . pmiAdvancedNumFormat . options . numformatinfo = documentHolder . pmiNumFormat . menu . options . numformatinfo = xfs . asc _getNumFormatInfo ( ) ;
documentHolder . pmiAdvancedNumFormat . options . numformat = xfs . asc _getNumFormat ( ) ;
2018-04-13 13:29:31 +00:00
2016-03-11 00:48:53 +00:00
_ . each ( documentHolder . ssMenu . items , function ( item ) {
item . setDisabled ( isCellLocked ) ;
} ) ;
documentHolder . pmiCopy . setDisabled ( false ) ;
2018-03-20 12:35:17 +00:00
documentHolder . pmiCut . setDisabled ( isCellLocked || inPivot ) ; // can't edit pivot cells
documentHolder . pmiPaste . setDisabled ( isCellLocked || inPivot ) ;
2016-11-24 07:23:02 +00:00
documentHolder . pmiInsertEntire . setDisabled ( isCellLocked || isTableLocked ) ;
2018-02-16 11:18:20 +00:00
documentHolder . pmiInsertCells . setDisabled ( isCellLocked || isTableLocked || inPivot ) ;
2016-11-24 07:23:02 +00:00
documentHolder . pmiInsertTable . setDisabled ( isCellLocked || isTableLocked ) ;
documentHolder . pmiDeleteEntire . setDisabled ( isCellLocked || isTableLocked ) ;
2018-02-16 11:18:20 +00:00
documentHolder . pmiDeleteCells . setDisabled ( isCellLocked || isTableLocked || inPivot ) ;
2016-11-24 07:23:02 +00:00
documentHolder . pmiDeleteTable . setDisabled ( isCellLocked || isTableLocked ) ;
2018-02-16 11:18:20 +00:00
documentHolder . pmiClear . setDisabled ( isCellLocked || inPivot ) ;
2017-10-19 10:14:12 +00:00
documentHolder . pmiFilterCells . setDisabled ( isCellLocked || isTableLocked || ( filterInfo == null ) || inPivot || ! filterInfo && ! this . permissions . canModifyFilter ) ;
documentHolder . pmiSortCells . setDisabled ( isCellLocked || isTableLocked || ( filterInfo == null ) || inPivot || ! this . permissions . canModifyFilter ) ;
2016-11-24 07:23:02 +00:00
documentHolder . pmiReapply . setDisabled ( isCellLocked || isTableLocked || ( isApplyAutoFilter !== true ) ) ;
2017-06-21 09:47:22 +00:00
documentHolder . menuHyperlink . setDisabled ( isCellLocked || inPivot ) ;
documentHolder . menuAddHyperlink . setDisabled ( isCellLocked || inPivot ) ;
2018-03-20 12:35:17 +00:00
documentHolder . pmiInsFunction . setDisabled ( isCellLocked || inPivot ) ;
2017-06-21 09:47:22 +00:00
2016-03-11 00:48:53 +00:00
if ( showMenu ) this . showPopupMenu ( documentHolder . ssMenu , { } , event ) ;
2016-04-05 11:52:34 +00:00
} else if ( this . permissions . isEditDiagram && seltype == Asc . c _oAscSelectionType . RangeChartText ) {
2016-03-11 00:48:53 +00:00
if ( ! showMenu && ! documentHolder . textInShapeMenu . isVisible ( ) ) return ;
documentHolder . pmiTextAdvanced . textInfo = undefined ;
documentHolder . menuHyperlinkShape . setVisible ( false ) ;
documentHolder . menuAddHyperlinkShape . setVisible ( false ) ;
documentHolder . menuParagraphVAlign . setVisible ( false ) ; // убрать после того, как заголовок можно будет растягивать по вертикали!!
documentHolder . menuParagraphDirection . setVisible ( false ) ; // убрать после того, как заголовок можно будет растягивать по вертикали!!
documentHolder . pmiTextAdvanced . setVisible ( false ) ;
2018-02-28 10:47:39 +00:00
documentHolder . textInShapeMenu . items [ 9 ] . setVisible ( false ) ;
2019-11-20 08:20:05 +00:00
documentHolder . menuParagraphBullets . setVisible ( false ) ;
documentHolder . textInShapeMenu . items [ 3 ] . setVisible ( false ) ;
2016-03-11 00:48:53 +00:00
documentHolder . pmiTextCopy . setDisabled ( false ) ;
if ( showMenu ) this . showPopupMenu ( documentHolder . textInShapeMenu , { } , event ) ;
}
} ,
2017-06-06 08:04:04 +00:00
fillViewMenuProps : function ( cellinfo , showMenu , event ) {
var documentHolder = this . documentHolder ,
2020-05-14 08:39:04 +00:00
seltype = cellinfo . asc _getSelectionType ( ) ,
2017-06-06 08:04:04 +00:00
isCellLocked = cellinfo . asc _getLocked ( ) ,
isTableLocked = cellinfo . asc _getLockedTable ( ) === true ,
commentsController = this . getApplication ( ) . getController ( 'Common.Controllers.Comments' ) ,
iscellmenu = ( seltype == Asc . c _oAscSelectionType . RangeCells ) && ! this . permissions . isEditMailMerge && ! this . permissions . isEditDiagram ,
2017-11-22 08:41:47 +00:00
iscelledit = this . api . isCellEdited ,
isimagemenu = ( seltype == Asc . c _oAscSelectionType . RangeImage ) && ! this . permissions . isEditMailMerge && ! this . permissions . isEditDiagram ,
signGuid ;
2017-06-06 08:04:04 +00:00
2017-11-10 07:50:01 +00:00
if ( ! documentHolder . viewModeMenu )
documentHolder . createDelayedElementsViewer ( ) ;
2017-06-06 08:04:04 +00:00
2017-11-23 10:40:45 +00:00
if ( ! documentHolder . viewModeMenu )
documentHolder . createDelayedElementsViewer ( ) ;
2017-06-06 08:04:04 +00:00
if ( ! showMenu && ! documentHolder . viewModeMenu . isVisible ( ) ) return ;
2018-09-24 09:18:00 +00:00
if ( isimagemenu && this . permissions . isSignatureSupport ) {
2017-11-22 08:41:47 +00:00
var selectedObjects = this . api . asc _getGraphicObjectProps ( ) ;
for ( var i = 0 ; i < selectedObjects . length ; i ++ ) {
if ( selectedObjects [ i ] . asc _getObjectType ( ) == Asc . c _oAscTypeSelectElement . Image ) {
2017-11-23 11:29:41 +00:00
signGuid = selectedObjects [ i ] . asc _getObjectValue ( ) . asc _getSignatureId ( ) ;
2017-11-22 08:41:47 +00:00
}
}
}
2017-11-23 11:29:41 +00:00
var signProps = ( signGuid ) ? this . api . asc _getSignatureSetup ( signGuid ) : null ,
2017-11-22 08:41:47 +00:00
isInSign = ! ! signProps && this . _canProtect ,
2019-04-12 13:23:21 +00:00
canComment = iscellmenu && ! iscelledit && this . permissions . canCoAuthoring && this . permissions . canComments && ! this . _isDisabled && cellinfo . asc _getComments ( ) . length < 1 ;
2017-11-22 08:41:47 +00:00
2017-11-10 07:50:01 +00:00
documentHolder . menuViewUndo . setVisible ( this . permissions . canCoAuthoring && this . permissions . canComments && ! this . _isDisabled ) ;
documentHolder . menuViewUndo . setDisabled ( ! this . api . asc _getCanUndo ( ) && ! this . _isDisabled ) ;
2017-11-22 08:41:47 +00:00
documentHolder . menuViewCopySeparator . setVisible ( isInSign ) ;
var isRequested = ( signProps ) ? signProps . asc _getRequested ( ) : false ;
documentHolder . menuSignatureViewSign . setVisible ( isInSign && isRequested ) ;
documentHolder . menuSignatureDetails . setVisible ( isInSign && ! isRequested ) ;
documentHolder . menuSignatureViewSetup . setVisible ( isInSign ) ;
documentHolder . menuSignatureRemove . setVisible ( isInSign && ! isRequested ) ;
documentHolder . menuViewSignSeparator . setVisible ( canComment ) ;
if ( isInSign ) {
documentHolder . menuSignatureViewSign . cmpEl . attr ( 'data-value' , signGuid ) ; // sign
2017-11-23 11:29:41 +00:00
documentHolder . menuSignatureDetails . cmpEl . attr ( 'data-value' , signProps . asc _getId ( ) ) ; // view certificate
2017-11-22 08:41:47 +00:00
documentHolder . menuSignatureViewSetup . cmpEl . attr ( 'data-value' , signGuid ) ; // view signature settings
documentHolder . menuSignatureRemove . cmpEl . attr ( 'data-value' , signGuid ) ;
}
documentHolder . menuViewAddComment . setVisible ( canComment ) ;
2017-06-06 08:04:04 +00:00
commentsController && commentsController . blockPopover ( true ) ;
documentHolder . menuViewAddComment . setDisabled ( isCellLocked || isTableLocked ) ;
if ( showMenu ) this . showPopupMenu ( documentHolder . viewModeMenu , { } , event ) ;
} ,
2016-03-11 00:48:53 +00:00
showPopupMenu : function ( menu , value , event ) {
2017-09-18 13:00:10 +00:00
if ( ! _ . isUndefined ( menu ) && menu !== null && event ) {
2016-03-11 00:48:53 +00:00
Common . UI . Menu . Manager . hideAll ( ) ;
var me = this ,
documentHolderView = me . documentHolder ,
2016-08-19 13:41:48 +00:00
showPoint = [ event . pageX * Common . Utils . zoom ( ) - documentHolderView . cmpEl . offset ( ) . left , event . pageY * Common . Utils . zoom ( ) - documentHolderView . cmpEl . offset ( ) . top ] ,
2016-03-11 00:48:53 +00:00
menuContainer = documentHolderView . cmpEl . find ( Common . Utils . String . format ( '#menu-container-{0}' , menu . id ) ) ;
if ( ! menu . rendered ) {
// Prepare menu container
if ( menuContainer . length < 1 ) {
menuContainer = $ ( Common . Utils . String . format ( '<div id="menu-container-{0}" style="position: absolute; z-index: 10000;"><div class="dropdown-toggle" data-toggle="dropdown"></div></div>' , menu . id ) ) ;
documentHolderView . cmpEl . append ( menuContainer ) ;
}
menu . render ( menuContainer ) ;
menu . cmpEl . attr ( { tabindex : "-1" } ) ;
}
if ( /*!this.mouse.isRightButtonDown &&*/ event . button !== 2 ) {
var coord = me . api . asc _getActiveCellCoord ( ) ,
offset = { left : 0 , top : 0 } /*documentHolderView.cmpEl.offset()*/ ;
showPoint [ 0 ] = coord . asc _getX ( ) + coord . asc _getWidth ( ) + offset . left ;
showPoint [ 1 ] = ( coord . asc _getY ( ) < 0 ? 0 : coord . asc _getY ( ) ) + coord . asc _getHeight ( ) + offset . top ;
}
menuContainer . css ( {
left : showPoint [ 0 ] ,
top : showPoint [ 1 ]
} ) ;
if ( _ . isFunction ( menu . options . initMenu ) ) {
menu . options . initMenu ( value ) ;
menu . alignPosition ( ) ;
}
_ . delay ( function ( ) {
menu . cmpEl . focus ( ) ;
} , 10 ) ;
menu . show ( ) ;
me . currentMenu = menu ;
}
} ,
2020-04-03 15:36:43 +00:00
onEntriesListMenu : function ( validation , textarr , addarr ) {
2016-03-11 00:48:53 +00:00
if ( textarr && textarr . length > 0 ) {
var me = this ,
documentHolderView = me . documentHolder ,
menu = documentHolderView . entriesMenu ,
menuContainer = documentHolderView . cmpEl . find ( Common . Utils . String . format ( '#menu-container-{0}' , menu . id ) ) ;
2020-03-16 12:06:56 +00:00
if ( validation && menu . isVisible ( ) ) {
menu . hide ( ) ;
return ;
}
2016-03-11 00:48:53 +00:00
for ( var i = 0 ; i < menu . items . length ; i ++ ) {
menu . removeItem ( menu . items [ i ] ) ;
i -- ;
}
_ . each ( textarr , function ( menuItem , index ) {
var mnu = new Common . UI . MenuItem ( {
2020-03-30 14:03:46 +00:00
caption : menuItem ,
2020-04-03 15:36:43 +00:00
value : addarr ? addarr [ index ] : menuItem ,
2020-03-30 14:03:46 +00:00
style : ( typeof menuItem == 'string' && _ . isEmpty ( menuItem . trim ( ) ) ) ? 'min-height: 25px;' : ''
2016-03-11 00:48:53 +00:00
} ) . on ( 'click' , function ( item , e ) {
2020-04-23 10:10:34 +00:00
me . api . asc _insertInCell ( item . value , Asc . c _oAscPopUpSelectorType . None , false ) ;
2016-03-11 00:48:53 +00:00
} ) ;
menu . addItem ( mnu ) ;
} ) ;
Common . UI . Menu . Manager . hideAll ( ) ;
if ( ! menu . rendered ) {
// Prepare menu container
if ( menuContainer . length < 1 ) {
menuContainer = $ ( Common . Utils . String . format ( '<div id="menu-container-{0}" style="position: absolute; z-index: 10000;"><div class="dropdown-toggle" data-toggle="dropdown"></div></div>' , menu . id ) ) ;
documentHolderView . cmpEl . append ( menuContainer ) ;
}
menu . render ( menuContainer ) ;
menu . cmpEl . attr ( { tabindex : "-1" } ) ;
}
var coord = me . api . asc _getActiveCellCoord ( ) ,
offset = { left : 0 , top : 0 } ,
showPoint = [ coord . asc _getX ( ) + offset . left , ( coord . asc _getY ( ) < 0 ? 0 : coord . asc _getY ( ) ) + coord . asc _getHeight ( ) + offset . top ] ;
menuContainer . css ( { left : showPoint [ 0 ] , top : showPoint [ 1 ] } ) ;
2020-03-16 12:36:47 +00:00
me . _preventClick = validation ;
validation && menuContainer . attr ( 'data-value' , 'prevent-canvas-click' ) ;
2016-03-11 00:48:53 +00:00
menu . show ( ) ;
menu . alignPosition ( ) ;
_ . delay ( function ( ) {
menu . cmpEl . focus ( ) ;
} , 10 ) ;
} else {
this . documentHolder . entriesMenu . hide ( ) ;
2020-03-16 12:06:56 +00:00
! validation && Common . UI . warning ( {
2016-11-11 13:22:35 +00:00
title : this . notcriticalErrorTitle ,
maxwidth : 600 ,
msg : this . txtNoChoices ,
callback : _ . bind ( function ( btn ) {
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
} , this )
} ) ;
2016-03-11 00:48:53 +00:00
}
} ,
onFormulaCompleteMenu : function ( funcarr ) {
2020-05-18 11:00:10 +00:00
if ( ! this . documentHolder . funcMenu || Common . Utils . ModalWindow . isVisible ( ) || this . rangeSelectionMode ) return ;
2018-11-08 12:08:55 +00:00
2016-03-11 00:48:53 +00:00
if ( funcarr ) {
var me = this ,
documentHolderView = me . documentHolder ,
menu = documentHolderView . funcMenu ,
2019-03-04 09:18:01 +00:00
menuContainer = documentHolderView . cmpEl . find ( '#menu-formula-selection' ) ,
2019-05-17 08:40:40 +00:00
funcdesc = me . getApplication ( ) . getController ( 'FormulaDialog' ) . getDescription ( Common . Utils . InternalSettings . get ( "sse-settings-func-locale" ) ) ;
2016-03-11 00:48:53 +00:00
for ( var i = 0 ; i < menu . items . length ; i ++ ) {
2019-03-04 09:18:01 +00:00
var tip = menu . items [ i ] . cmpEl . data ( 'bs.tooltip' ) ;
if ( tip )
tip . hide ( ) ;
2016-03-11 00:48:53 +00:00
menu . removeItem ( menu . items [ i ] ) ;
i -- ;
}
2018-08-14 07:52:03 +00:00
funcarr . sort ( function ( a , b ) {
2019-03-06 08:47:46 +00:00
var aname = a . asc _getName ( true ) . toLocaleUpperCase ( ) ,
bname = b . asc _getName ( true ) . toLocaleUpperCase ( ) ;
2018-08-14 07:52:03 +00:00
if ( aname < bname ) return - 1 ;
if ( aname > bname ) return 1 ;
return 0 ;
} ) ;
2016-03-11 00:48:53 +00:00
_ . each ( funcarr , function ( menuItem , index ) {
var type = menuItem . asc _getType ( ) ,
2019-03-06 08:47:46 +00:00
name = menuItem . asc _getName ( true ) ,
2019-03-04 09:18:01 +00:00
origname = me . api . asc _getFormulaNameByLocale ( name ) ,
2020-06-10 12:32:23 +00:00
iconCls = 'btn-named-range' ;
switch ( type ) {
case Asc . c _oAscPopUpSelectorType . Func :
iconCls = 'btn-function' ;
break ;
case Asc . c _oAscPopUpSelectorType . Table :
iconCls = 'btn-menu-table' ;
break ;
case Asc . c _oAscPopUpSelectorType . Slicer :
iconCls = 'btn-slicer' ;
break ;
}
var mnu = new Common . UI . MenuItem ( {
iconCls : 'menu__icon ' + iconCls ,
caption : name ,
hint : ( funcdesc && funcdesc [ origname ] ) ? funcdesc [ origname ] . d : ''
2016-03-11 00:48:53 +00:00
} ) . on ( 'click' , function ( item , e ) {
2020-04-23 10:10:34 +00:00
setTimeout ( function ( ) { me . api . asc _insertInCell ( item . caption , type , false ) ; } , 10 ) ;
2016-03-11 00:48:53 +00:00
} ) ;
menu . addItem ( mnu ) ;
} ) ;
if ( ! menu . rendered ) {
// Prepare menu container
if ( menuContainer . length < 1 ) {
menuContainer = $ ( Common . Utils . String . format ( '<div id="menu-formula-selection" style="position: absolute; z-index: 10000;" class="no-stop-propagate"><div class="dropdown-toggle" data-toggle="dropdown"></div></div>' ) ) ;
documentHolderView . cmpEl . append ( menuContainer ) ;
}
2016-03-14 14:59:38 +00:00
menu . onAfterKeydownMenu = function ( e ) {
if ( e . keyCode == Common . UI . Keys . RETURN && ( e . ctrlKey || e . altKey ) ) return ;
2016-07-06 13:15:13 +00:00
// Common.UI.Menu.prototype.onAfterKeydownMenu.call(menu, e);
2016-03-11 00:48:53 +00:00
var li ;
2016-07-22 14:16:08 +00:00
if ( arguments . length > 1 && arguments [ 1 ] instanceof KeyboardEvent ) // when typing in cell editor
2016-03-11 00:48:53 +00:00
e = arguments [ 1 ] ;
2016-07-06 13:15:13 +00:00
if ( menuContainer . hasClass ( 'open' ) ) {
if ( e . keyCode == Common . UI . Keys . TAB || e . keyCode == Common . UI . Keys . RETURN && ! e . ctrlKey && ! e . altKey )
li = menuContainer . find ( 'a.focus' ) . closest ( 'li' ) ;
else if ( e . keyCode == Common . UI . Keys . UP || e . keyCode == Common . UI . Keys . DOWN ) {
var innerEl = menu . cmpEl ,
inner _top = innerEl . offset ( ) . top ,
li _focused = menuContainer . find ( 'a.focus' ) . closest ( 'li' ) ;
var li _top = li _focused . offset ( ) . top ;
if ( li _top < inner _top || li _top + li _focused . outerHeight ( ) > inner _top + innerEl . height ( ) ) {
if ( menu . scroller ) {
menu . scroller . scrollTop ( innerEl . scrollTop ( ) + li _top - inner _top , 0 ) ;
} else {
innerEl . scrollTop ( innerEl . scrollTop ( ) + li _top - inner _top ) ;
2016-03-11 00:48:53 +00:00
}
}
}
2016-07-06 13:15:13 +00:00
}
// } else if (e.keyCode == Common.UI.Keys.TAB)
// li = $(e.target).closest('li');
2016-03-14 14:59:38 +00:00
2016-03-11 00:48:53 +00:00
if ( li ) {
if ( li . length > 0 ) li . click ( ) ;
Common . UI . Menu . Manager . hideAll ( ) ;
}
2016-03-14 14:59:38 +00:00
} ;
2019-03-04 09:18:01 +00:00
menu . on ( 'hide:after' , function ( ) {
for ( var i = 0 ; i < menu . items . length ; i ++ ) {
var tip = menu . items [ i ] . cmpEl . data ( 'bs.tooltip' ) ;
if ( tip )
tip . hide ( ) ;
}
} ) ;
2016-03-14 14:59:38 +00:00
menu . render ( menuContainer ) ;
menu . cmpEl . attr ( { tabindex : "-1" } ) ;
2016-03-11 00:48:53 +00:00
}
var coord = me . api . asc _getActiveCellCoord ( ) ,
offset = { left : 0 , top : 0 } ,
showPoint = [ coord . asc _getX ( ) + offset . left , ( coord . asc _getY ( ) < 0 ? 0 : coord . asc _getY ( ) ) + coord . asc _getHeight ( ) + offset . top ] ;
menuContainer . css ( { left : showPoint [ 0 ] , top : showPoint [ 1 ] } ) ;
menu . alignPosition ( ) ;
var infocus = me . cellEditor . is ( ":focus" ) ;
2016-03-14 14:59:38 +00:00
if ( ! menu . isVisible ( ) )
Common . UI . Menu . Manager . hideAll ( ) ;
2016-03-11 00:48:53 +00:00
_ . delay ( function ( ) {
2016-03-14 14:59:38 +00:00
if ( ! menu . isVisible ( ) ) menu . show ( ) ;
if ( menu . scroller ) {
menu . scroller . update ( { alwaysVisibleY : true } ) ;
menu . scroller . scrollTop ( 0 ) ;
}
2016-07-06 13:15:13 +00:00
if ( infocus )
2016-03-11 00:48:53 +00:00
me . cellEditor . focus ( ) ;
2016-07-22 14:16:08 +00:00
menu . cmpEl . toggleClass ( 'from-cell-edit' , infocus ) ;
2016-07-06 13:15:13 +00:00
_ . delay ( function ( ) {
2019-03-04 09:18:01 +00:00
var a = menu . cmpEl . find ( 'li:first a' ) ;
a . addClass ( 'focus' ) ;
var tip = a . parent ( ) . data ( 'bs.tooltip' ) ;
if ( tip )
tip . show ( ) ;
2016-07-06 13:15:13 +00:00
} , 10 ) ;
2016-11-18 14:17:20 +00:00
if ( ! infocus )
_ . delay ( function ( ) {
menu . cmpEl . focus ( ) ;
} , 10 ) ;
2016-03-11 00:48:53 +00:00
} , 1 ) ;
} else {
this . documentHolder . funcMenu . hide ( ) ;
}
} ,
2019-03-07 12:13:46 +00:00
onFormulaInfo : function ( name ) {
var functip = this . tooltips . func _arg ;
if ( name ) {
2019-03-21 08:09:11 +00:00
if ( ! functip . parentEl ) {
functip . parentEl = $ ( '<div id="tip-container-functip" style="position: absolute; z-index: 10000;"></div>' ) ;
this . documentHolder . cmpEl . append ( functip . parentEl ) ;
}
2019-05-17 08:40:40 +00:00
var funcdesc = this . getApplication ( ) . getController ( 'FormulaDialog' ) . getDescription ( Common . Utils . InternalSettings . get ( "sse-settings-func-locale" ) ) ,
2019-03-07 12:13:46 +00:00
hint = ( ( funcdesc && funcdesc [ name ] ) ? ( this . api . asc _getFormulaLocaleName ( name ) + funcdesc [ name ] . a ) : '' ) . replace ( /[,;]/g , this . api . asc _getFunctionArgumentSeparator ( ) ) ;
if ( functip . ref && functip . ref . isVisible ( ) ) {
if ( functip . text != hint ) {
functip . ref . hide ( ) ;
2019-03-15 13:11:37 +00:00
functip . ref = undefined ;
functip . text = '' ;
2019-03-07 12:13:46 +00:00
functip . isHidden = true ;
}
}
2019-03-26 11:23:03 +00:00
if ( ! hint ) return ;
2019-03-07 12:13:46 +00:00
if ( ! functip . ref || ! functip . ref . isVisible ( ) ) {
functip . text = hint ;
functip . ref = new Common . UI . Tooltip ( {
2019-03-21 08:09:11 +00:00
owner : functip . parentEl ,
2019-03-07 12:13:46 +00:00
html : true ,
title : hint ,
cls : 'auto-tooltip'
} ) ;
functip . ref . show ( [ - 10000 , - 10000 ] ) ;
functip . isHidden = false ;
}
var pos = [
this . documentHolder . cmpEl . offset ( ) . left - $ ( window ) . scrollLeft ( ) ,
this . documentHolder . cmpEl . offset ( ) . top - $ ( window ) . scrollTop ( )
] ,
coord = this . api . asc _getActiveCellCoord ( ) ,
showPoint = [ coord . asc _getX ( ) + pos [ 0 ] - 3 , coord . asc _getY ( ) + pos [ 1 ] - functip . ref . getBSTip ( ) . $tip . height ( ) - 5 ] ;
var tipwidth = functip . ref . getBSTip ( ) . $tip . width ( ) ;
if ( showPoint [ 0 ] + tipwidth > this . tooltips . coauth . bodyWidth )
showPoint [ 0 ] = this . tooltips . coauth . bodyWidth - tipwidth ;
functip . ref . getBSTip ( ) . $tip . css ( {
top : showPoint [ 1 ] + 'px' ,
left : showPoint [ 0 ] + 'px'
} ) ;
} else {
if ( ! functip . isHidden && functip . ref ) {
functip . ref . hide ( ) ;
2019-03-15 13:11:37 +00:00
functip . ref = undefined ;
functip . text = '' ;
2019-03-07 12:13:46 +00:00
functip . isHidden = true ;
}
}
} ,
2019-07-30 12:24:47 +00:00
onInputMessage : function ( title , message ) {
var inputtip = this . tooltips . input _msg ;
if ( message ) {
if ( ! inputtip . parentEl ) {
inputtip . parentEl = $ ( '<div id="tip-container-inputtip" style="position: absolute; z-index: 10000;"></div>' ) ;
this . documentHolder . cmpEl . append ( inputtip . parentEl ) ;
}
2020-04-10 10:14:55 +00:00
var hint = title ? ( '<b>' + ( Common . Utils . String . htmlEncode ( title || '' ) ) + '</b><br>' ) : '' ;
hint += ( Common . Utils . String . htmlEncode ( message || '' ) ) ;
2019-07-30 12:24:47 +00:00
if ( inputtip . ref && inputtip . ref . isVisible ( ) ) {
if ( inputtip . text != hint ) {
inputtip . ref . hide ( ) ;
inputtip . ref = undefined ;
inputtip . text = '' ;
inputtip . isHidden = true ;
}
}
if ( ! inputtip . ref || ! inputtip . ref . isVisible ( ) ) {
inputtip . text = hint ;
inputtip . ref = new Common . UI . Tooltip ( {
owner : inputtip . parentEl ,
html : true ,
title : hint
} ) ;
inputtip . ref . show ( [ - 10000 , - 10000 ] ) ;
inputtip . isHidden = false ;
}
var pos = [
this . documentHolder . cmpEl . offset ( ) . left - $ ( window ) . scrollLeft ( ) ,
this . documentHolder . cmpEl . offset ( ) . top - $ ( window ) . scrollTop ( )
] ,
coord = this . api . asc _getActiveCellCoord ( ) ,
showPoint = [ coord . asc _getX ( ) + pos [ 0 ] - 3 , coord . asc _getY ( ) + pos [ 1 ] - inputtip . ref . getBSTip ( ) . $tip . height ( ) - 5 ] ;
var tipwidth = inputtip . ref . getBSTip ( ) . $tip . width ( ) ;
if ( showPoint [ 0 ] + tipwidth > this . tooltips . coauth . bodyWidth )
showPoint [ 0 ] = this . tooltips . coauth . bodyWidth - tipwidth ;
inputtip . ref . getBSTip ( ) . $tip . css ( {
top : showPoint [ 1 ] + 'px' ,
2020-03-27 17:00:50 +00:00
left : showPoint [ 0 ] + 'px' ,
'z-index' : 900
2019-07-30 12:24:47 +00:00
} ) ;
} else {
if ( ! inputtip . isHidden && inputtip . ref ) {
inputtip . ref . hide ( ) ;
inputtip . ref = undefined ;
inputtip . text = '' ;
inputtip . isHidden = true ;
}
}
} ,
2017-04-11 11:05:56 +00:00
onShowSpecialPasteOptions : function ( specialPasteShowOptions ) {
var me = this ,
documentHolderView = me . documentHolder ,
coord = specialPasteShowOptions . asc _getCellCoord ( ) ,
pasteContainer = documentHolderView . cmpEl . find ( '#special-paste-container' ) ,
2020-03-03 11:01:20 +00:00
pasteItems = specialPasteShowOptions . asc _getOptions ( ) ,
isTable = ! ! specialPasteShowOptions . asc _getContainTables ( ) ;
2018-11-13 15:06:00 +00:00
if ( ! pasteItems ) return ;
2017-04-11 11:05:56 +00:00
// Prepare menu container
if ( pasteContainer . length < 1 ) {
me . _arrSpecialPaste = [ ] ;
2019-04-16 12:28:07 +00:00
me . _arrSpecialPaste [ Asc . c _oSpecialPasteProps . paste ] = [ me . txtPaste , 0 ] ;
me . _arrSpecialPaste [ Asc . c _oSpecialPasteProps . pasteOnlyFormula ] = [ me . txtPasteFormulas , 0 ] ;
me . _arrSpecialPaste [ Asc . c _oSpecialPasteProps . formulaNumberFormat ] = [ me . txtPasteFormulaNumFormat , 0 ] ;
me . _arrSpecialPaste [ Asc . c _oSpecialPasteProps . formulaAllFormatting ] = [ me . txtPasteKeepSourceFormat , 0 ] ;
me . _arrSpecialPaste [ Asc . c _oSpecialPasteProps . formulaWithoutBorders ] = [ me . txtPasteBorders , 0 ] ;
me . _arrSpecialPaste [ Asc . c _oSpecialPasteProps . formulaColumnWidth ] = [ me . txtPasteColWidths , 0 ] ;
me . _arrSpecialPaste [ Asc . c _oSpecialPasteProps . mergeConditionalFormating ] = [ me . txtPasteMerge , 0 ] ;
me . _arrSpecialPaste [ Asc . c _oSpecialPasteProps . transpose ] = [ me . txtPasteTranspose , 0 ] ;
me . _arrSpecialPaste [ Asc . c _oSpecialPasteProps . pasteOnlyValues ] = [ me . txtPasteValues , 1 ] ;
me . _arrSpecialPaste [ Asc . c _oSpecialPasteProps . valueNumberFormat ] = [ me . txtPasteValNumFormat , 1 ] ;
me . _arrSpecialPaste [ Asc . c _oSpecialPasteProps . valueAllFormating ] = [ me . txtPasteValFormat , 1 ] ;
me . _arrSpecialPaste [ Asc . c _oSpecialPasteProps . pasteOnlyFormating ] = [ me . txtPasteFormat , 2 ] ;
me . _arrSpecialPaste [ Asc . c _oSpecialPasteProps . link ] = [ me . txtPasteLink , 2 ] ;
me . _arrSpecialPaste [ Asc . c _oSpecialPasteProps . picture ] = [ me . txtPastePicture , 2 ] ;
me . _arrSpecialPaste [ Asc . c _oSpecialPasteProps . linkedPicture ] = [ me . txtPasteLinkPicture , 2 ] ;
me . _arrSpecialPaste [ Asc . c _oSpecialPasteProps . sourceformatting ] = [ me . txtPasteSourceFormat , 2 ] ;
me . _arrSpecialPaste [ Asc . c _oSpecialPasteProps . destinationFormatting ] = [ me . txtPasteDestFormat , 2 ] ;
me . _arrSpecialPaste [ Asc . c _oSpecialPasteProps . keepTextOnly ] = [ me . txtKeepTextOnly , 2 ] ;
me . _arrSpecialPaste [ Asc . c _oSpecialPasteProps . useTextImport ] = [ me . txtUseTextImport , 3 ] ;
2017-04-11 11:05:56 +00:00
pasteContainer = $ ( '<div id="special-paste-container" style="position: absolute;"><div id="id-document-holder-btn-special-paste"></div></div>' ) ;
documentHolderView . cmpEl . append ( pasteContainer ) ;
me . btnSpecialPaste = new Common . UI . Button ( {
2020-04-29 07:36:53 +00:00
parentEl : $ ( '#id-document-holder-btn-special-paste' ) ,
2017-04-11 11:05:56 +00:00
cls : 'btn-toolbar' ,
2019-12-10 13:49:35 +00:00
iconCls : 'toolbar__icon btn-paste' ,
2017-04-11 11:05:56 +00:00
menu : new Common . UI . Menu ( { items : [ ] } )
} ) ;
}
if ( pasteItems . length > 0 ) {
var menu = me . btnSpecialPaste . menu ;
for ( var i = 0 ; i < menu . items . length ; i ++ ) {
menu . removeItem ( menu . items [ i ] ) ;
i -- ;
}
2019-04-16 12:28:07 +00:00
var groups = [ ] ;
for ( var i = 0 ; i < 3 ; i ++ ) {
groups [ i ] = [ ] ;
}
2017-04-11 11:05:56 +00:00
2019-04-16 12:28:07 +00:00
var importText ;
2017-04-11 11:05:56 +00:00
_ . each ( pasteItems , function ( menuItem , index ) {
2019-04-16 12:28:07 +00:00
if ( menuItem == Asc . c _oSpecialPasteProps . useTextImport ) {
importText = new Common . UI . MenuItem ( {
caption : me . _arrSpecialPaste [ menuItem ] [ 0 ] ,
2019-04-17 12:58:55 +00:00
value : menuItem ,
checkable : true ,
toggleGroup : 'specialPasteGroup'
2019-04-16 12:28:07 +00:00
} ) . on ( 'click' , function ( item , e ) {
2019-04-17 09:01:20 +00:00
( new Common . Views . OpenDialog ( {
title : me . txtImportWizard ,
closable : true ,
type : Common . Utils . importTextType . Paste ,
preview : true ,
api : me . api ,
handler : function ( result , encoding , delimiter , delimiterChar ) {
if ( result == 'ok' ) {
if ( me && me . api ) {
var props = new Asc . SpecialPasteProps ( ) ;
props . asc _setProps ( Asc . c _oSpecialPasteProps . useTextImport ) ;
2019-07-25 07:14:45 +00:00
props . asc _setAdvancedOptions ( new Asc . asc _CTextOptions ( encoding , delimiter , delimiterChar ) ) ;
2019-04-17 09:01:20 +00:00
me . api . asc _SpecialPaste ( props ) ;
}
2019-04-17 12:58:55 +00:00
me . _state . lastSpecPasteChecked = item ;
} else {
item . setChecked ( false , true ) ;
me . _state . lastSpecPasteChecked && me . _state . lastSpecPasteChecked . setChecked ( true , true ) ;
2019-04-17 09:01:20 +00:00
}
}
} ) ) . show ( ) ;
2019-04-16 12:28:07 +00:00
setTimeout ( function ( ) { menu . hide ( ) ; } , 100 ) ;
} ) ;
2020-02-28 13:30:58 +00:00
me . _arrSpecialPaste [ menuItem ] [ 2 ] = importText ;
2020-02-28 14:23:06 +00:00
} else if ( me . _arrSpecialPaste [ menuItem ] ) {
2019-04-16 12:28:07 +00:00
var mnu = new Common . UI . MenuItem ( {
caption : me . _arrSpecialPaste [ menuItem ] [ 0 ] ,
value : menuItem ,
checkable : true ,
toggleGroup : 'specialPasteGroup'
} ) . on ( 'click' , function ( item , e ) {
2019-04-17 12:58:55 +00:00
me . _state . lastSpecPasteChecked = item ;
2019-04-16 12:28:07 +00:00
var props = new Asc . SpecialPasteProps ( ) ;
props . asc _setProps ( item . value ) ;
me . api . asc _SpecialPaste ( props ) ;
setTimeout ( function ( ) { menu . hide ( ) ; } , 100 ) ;
} ) ;
groups [ me . _arrSpecialPaste [ menuItem ] [ 1 ] ] . push ( mnu ) ;
2020-02-28 13:30:58 +00:00
me . _arrSpecialPaste [ menuItem ] [ 2 ] = mnu ;
2019-04-16 12:28:07 +00:00
}
} ) ;
var newgroup = false ;
for ( var i = 0 ; i < 3 ; i ++ ) {
if ( newgroup && groups [ i ] . length > 0 ) {
2017-04-11 11:05:56 +00:00
menu . addItem ( new Common . UI . MenuItem ( { caption : '--' } ) ) ;
2019-04-16 12:28:07 +00:00
newgroup = false ;
}
_ . each ( groups [ i ] , function ( menuItem , index ) {
menu . addItem ( menuItem ) ;
newgroup = true ;
2017-04-11 11:05:56 +00:00
} ) ;
2019-04-16 12:28:07 +00:00
}
2017-04-11 11:05:56 +00:00
( menu . items . length > 0 ) && menu . items [ 0 ] . setChecked ( true , true ) ;
2019-04-17 12:58:55 +00:00
me . _state . lastSpecPasteChecked = ( menu . items . length > 0 ) ? menu . items [ 0 ] : null ;
2019-04-16 12:28:07 +00:00
if ( importText ) {
menu . addItem ( new Common . UI . MenuItem ( { caption : '--' } ) ) ;
menu . addItem ( importText ) ;
}
2020-02-28 13:30:58 +00:00
if ( menu . items . length > 0 && specialPasteShowOptions . asc _getShowPasteSpecial ( ) ) {
menu . addItem ( new Common . UI . MenuItem ( { caption : '--' } ) ) ;
var mnu = new Common . UI . MenuItem ( {
caption : me . textPasteSpecial ,
value : 'special'
} ) . on ( 'click' , function ( item , e ) {
( new SSE . Views . SpecialPasteDialog ( {
2020-03-03 11:01:20 +00:00
props : pasteItems ,
isTable : isTable ,
2020-02-28 13:30:58 +00:00
handler : function ( result , settings ) {
if ( result == 'ok' ) {
me . _state . lastSpecPasteChecked && me . _state . lastSpecPasteChecked . setChecked ( false , true ) ;
me . _state . lastSpecPasteChecked = settings && me . _arrSpecialPaste [ settings . asc _getProps ( ) ] ? me . _arrSpecialPaste [ settings . asc _getProps ( ) ] [ 2 ] : null ;
me . _state . lastSpecPasteChecked && me . _state . lastSpecPasteChecked . setChecked ( true , true ) ;
2020-03-03 11:01:20 +00:00
if ( me && me . api ) {
me . api . asc _SpecialPaste ( settings ) ;
}
2020-02-28 13:30:58 +00:00
}
}
} ) ) . show ( ) ;
setTimeout ( function ( ) { menu . hide ( ) ; } , 100 ) ;
} ) ;
menu . addItem ( mnu ) ;
}
2017-04-11 11:05:56 +00:00
}
2017-11-07 11:42:51 +00:00
2017-11-07 13:23:40 +00:00
if ( coord [ 0 ] . asc _getX ( ) < 0 || coord [ 0 ] . asc _getY ( ) < 0 ) {
2017-04-11 11:05:56 +00:00
if ( pasteContainer . is ( ':visible' ) ) pasteContainer . hide ( ) ;
2017-11-07 13:23:40 +00:00
return ;
2017-04-11 11:05:56 +00:00
}
2017-11-07 13:23:40 +00:00
2017-11-07 11:42:51 +00:00
var rightBottom = coord [ 0 ] ,
leftTop = coord [ 1 ] ,
width = me . tooltips . coauth . bodyWidth - me . tooltips . coauth . XY [ 0 ] - me . tooltips . coauth . rightMenuWidth - 15 ,
height = me . tooltips . coauth . apiHeight - 15 , // height - scrollbar height
showPoint = [ ] ,
2017-11-07 13:23:40 +00:00
btnSize = [ 31 , 20 ] ,
right = rightBottom . asc _getX ( ) + rightBottom . asc _getWidth ( ) + 3 + btnSize [ 0 ] ,
2017-11-07 11:42:51 +00:00
bottom = rightBottom . asc _getY ( ) + rightBottom . asc _getHeight ( ) + 3 + btnSize [ 1 ] ;
2017-11-07 13:23:40 +00:00
2017-11-07 11:42:51 +00:00
if ( right > width ) {
2018-08-30 14:30:38 +00:00
showPoint [ 0 ] = ( leftTop !== undefined ) ? leftTop . asc _getX ( ) : ( width - btnSize [ 0 ] - 3 ) ; // leftTop is undefined when paste to text box
2017-11-07 11:42:51 +00:00
if ( bottom > height )
showPoint [ 0 ] -= ( btnSize [ 0 ] + 3 ) ;
if ( showPoint [ 0 ] < 0 ) showPoint [ 0 ] = width - 3 - btnSize [ 0 ] ;
} else
showPoint [ 0 ] = right - btnSize [ 0 ] ;
showPoint [ 1 ] = ( bottom > height ) ? height - 3 - btnSize [ 1 ] : bottom - btnSize [ 1 ] ;
pasteContainer . css ( { left : showPoint [ 0 ] , top : showPoint [ 1 ] } ) ;
pasteContainer . show ( ) ;
2017-04-11 11:05:56 +00:00
} ,
onHideSpecialPasteOptions : function ( ) {
var pasteContainer = this . documentHolder . cmpEl . find ( '#special-paste-container' ) ;
if ( pasteContainer . is ( ':visible' ) )
pasteContainer . hide ( ) ;
} ,
2017-12-01 09:20:06 +00:00
onToggleAutoCorrectOptions : function ( autoCorrectOptions ) {
if ( ! autoCorrectOptions ) {
var pasteContainer = this . documentHolder . cmpEl . find ( '#autocorrect-paste-container' ) ;
if ( pasteContainer . is ( ':visible' ) )
pasteContainer . hide ( ) ;
return ;
}
2017-11-28 10:22:25 +00:00
var me = this ,
documentHolderView = me . documentHolder ,
coord = autoCorrectOptions . asc _getCellCoord ( ) ,
pasteContainer = documentHolderView . cmpEl . find ( '#autocorrect-paste-container' ) ,
pasteItems = autoCorrectOptions . asc _getOptions ( ) ;
// Prepare menu container
if ( pasteContainer . length < 1 ) {
me . _arrAutoCorrectPaste = [ ] ;
me . _arrAutoCorrectPaste [ Asc . c _oAscAutoCorrectOptions . UndoTableAutoExpansion ] = me . txtUndoExpansion ;
me . _arrAutoCorrectPaste [ Asc . c _oAscAutoCorrectOptions . RedoTableAutoExpansion ] = me . txtRedoExpansion ;
pasteContainer = $ ( '<div id="autocorrect-paste-container" style="position: absolute;"><div id="id-document-holder-btn-autocorrect-paste"></div></div>' ) ;
documentHolderView . cmpEl . append ( pasteContainer ) ;
me . btnAutoCorrectPaste = new Common . UI . Button ( {
2020-04-29 07:36:53 +00:00
parentEl : $ ( '#id-document-holder-btn-autocorrect-paste' ) ,
2017-11-28 10:22:25 +00:00
cls : 'btn-toolbar' ,
2019-12-10 13:49:35 +00:00
iconCls : 'toolbar__icon btn-paste' ,
2017-11-28 10:22:25 +00:00
menu : new Common . UI . Menu ( { items : [ ] } )
} ) ;
}
if ( pasteItems . length > 0 ) {
var menu = me . btnAutoCorrectPaste . menu ;
for ( var i = 0 ; i < menu . items . length ; i ++ ) {
menu . removeItem ( menu . items [ i ] ) ;
i -- ;
}
var group _prev = - 1 ;
_ . each ( pasteItems , function ( menuItem , index ) {
var mnu = new Common . UI . MenuItem ( {
caption : me . _arrAutoCorrectPaste [ menuItem ] ,
value : menuItem
} ) . on ( 'click' , function ( item , e ) {
me . api . asc _applyAutoCorrectOptions ( item . value ) ;
setTimeout ( function ( ) { menu . hide ( ) ; } , 100 ) ;
} ) ;
menu . addItem ( mnu ) ;
} ) ;
}
2017-12-01 10:28:41 +00:00
var width = me . tooltips . coauth . bodyWidth - me . tooltips . coauth . XY [ 0 ] - me . tooltips . coauth . rightMenuWidth - 15 ,
height = me . tooltips . coauth . apiHeight - 15 , // height - scrollbar height
btnSize = [ 31 , 20 ] ,
right = coord . asc _getX ( ) + coord . asc _getWidth ( ) + 2 + btnSize [ 0 ] ,
bottom = coord . asc _getY ( ) + coord . asc _getHeight ( ) + 1 + btnSize [ 1 ] ;
if ( right > width || bottom > height || coord . asc _getX ( ) < 0 || coord . asc _getY ( ) < 0 ) {
2017-11-28 10:22:25 +00:00
if ( pasteContainer . is ( ':visible' ) ) pasteContainer . hide ( ) ;
} else {
2017-12-01 10:28:41 +00:00
pasteContainer . css ( { left : right - btnSize [ 0 ] , top : bottom - btnSize [ 1 ] } ) ;
2017-11-28 10:22:25 +00:00
pasteContainer . show ( ) ;
}
} ,
2016-03-11 00:48:53 +00:00
onCellsRange : function ( status ) {
2016-04-05 11:52:34 +00:00
this . rangeSelectionMode = ( status != Asc . c _oAscSelectionDialogType . None ) ;
2016-03-11 00:48:53 +00:00
} ,
onApiEditCell : function ( state ) {
2016-04-05 11:52:34 +00:00
this . isEditFormula = ( state == Asc . c _oAscCellEditorState . editFormula ) ;
this . isEditCell = ( state != Asc . c _oAscCellEditorState . editEnd ) ;
2016-03-11 00:48:53 +00:00
} ,
onLockDefNameManager : function ( state ) {
2016-04-05 11:52:34 +00:00
this . namedrange _locked = ( state == Asc . c _oAscDefinedNameReason . LockDefNameManager ) ;
2016-03-11 00:48:53 +00:00
} ,
2019-04-09 11:29:51 +00:00
onChangeCropState : function ( state ) {
this . documentHolder . menuImgCrop . menu . items [ 0 ] . setChecked ( state , true ) ;
} ,
2016-10-24 11:56:11 +00:00
initEquationMenu : function ( ) {
2016-10-24 13:40:06 +00:00
if ( ! this . _currentMathObj ) return ;
2016-10-24 11:56:11 +00:00
var me = this ,
type = me . _currentMathObj . get _Type ( ) ,
value = me . _currentMathObj ,
mnu , arr = [ ] ;
switch ( type ) {
case Asc . c _oAscMathInterfaceType . Accent :
mnu = new Common . UI . MenuItem ( {
caption : me . txtRemoveAccentChar ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'remove_AccentCharacter' }
} ) ;
arr . push ( mnu ) ;
break ;
case Asc . c _oAscMathInterfaceType . BorderBox :
mnu = new Common . UI . MenuItem ( {
caption : me . txtBorderProps ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
menu : new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
{
caption : value . get _HideTop ( ) ? me . txtAddTop : me . txtHideTop ,
equationProps : { type : type , callback : 'put_HideTop' , value : ! value . get _HideTop ( ) }
} ,
{
caption : value . get _HideBottom ( ) ? me . txtAddBottom : me . txtHideBottom ,
equationProps : { type : type , callback : 'put_HideBottom' , value : ! value . get _HideBottom ( ) }
} ,
{
caption : value . get _HideLeft ( ) ? me . txtAddLeft : me . txtHideLeft ,
equationProps : { type : type , callback : 'put_HideLeft' , value : ! value . get _HideLeft ( ) }
} ,
{
caption : value . get _HideRight ( ) ? me . txtAddRight : me . txtHideRight ,
equationProps : { type : type , callback : 'put_HideRight' , value : ! value . get _HideRight ( ) }
} ,
{
caption : value . get _HideHor ( ) ? me . txtAddHor : me . txtHideHor ,
equationProps : { type : type , callback : 'put_HideHor' , value : ! value . get _HideHor ( ) }
} ,
{
caption : value . get _HideVer ( ) ? me . txtAddVer : me . txtHideVer ,
equationProps : { type : type , callback : 'put_HideVer' , value : ! value . get _HideVer ( ) }
} ,
{
caption : value . get _HideTopLTR ( ) ? me . txtAddLT : me . txtHideLT ,
equationProps : { type : type , callback : 'put_HideTopLTR' , value : ! value . get _HideTopLTR ( ) }
} ,
{
caption : value . get _HideTopRTL ( ) ? me . txtAddLB : me . txtHideLB ,
equationProps : { type : type , callback : 'put_HideTopRTL' , value : ! value . get _HideTopRTL ( ) }
}
]
} )
} ) ;
arr . push ( mnu ) ;
break ;
case Asc . c _oAscMathInterfaceType . Bar :
mnu = new Common . UI . MenuItem ( {
caption : me . txtRemoveBar ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'remove_Bar' }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : ( value . get _Pos ( ) == Asc . c _oAscMathInterfaceBarPos . Top ) ? me . txtUnderbar : me . txtOverbar ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_Pos' , value : ( value . get _Pos ( ) == Asc . c _oAscMathInterfaceBarPos . Top ) ? Asc . c _oAscMathInterfaceBarPos . Bottom : Asc . c _oAscMathInterfaceBarPos . Top }
} ) ;
arr . push ( mnu ) ;
break ;
case Asc . c _oAscMathInterfaceType . Script :
var scripttype = value . get _ScriptType ( ) ;
if ( scripttype == Asc . c _oAscMathInterfaceScript . PreSubSup ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtScriptsAfter ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_ScriptType' , value : Asc . c _oAscMathInterfaceScript . SubSup }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . txtRemScripts ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_ScriptType' , value : Asc . c _oAscMathInterfaceScript . None }
} ) ;
arr . push ( mnu ) ;
} else {
if ( scripttype == Asc . c _oAscMathInterfaceScript . SubSup ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtScriptsBefore ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_ScriptType' , value : Asc . c _oAscMathInterfaceScript . PreSubSup }
} ) ;
arr . push ( mnu ) ;
}
if ( scripttype == Asc . c _oAscMathInterfaceScript . SubSup || scripttype == Asc . c _oAscMathInterfaceScript . Sub ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtRemSubscript ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_ScriptType' , value : ( scripttype == Asc . c _oAscMathInterfaceScript . SubSup ) ? Asc . c _oAscMathInterfaceScript . Sup : Asc . c _oAscMathInterfaceScript . None }
} ) ;
arr . push ( mnu ) ;
}
if ( scripttype == Asc . c _oAscMathInterfaceScript . SubSup || scripttype == Asc . c _oAscMathInterfaceScript . Sup ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtRemSuperscript ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_ScriptType' , value : ( scripttype == Asc . c _oAscMathInterfaceScript . SubSup ) ? Asc . c _oAscMathInterfaceScript . Sub : Asc . c _oAscMathInterfaceScript . None }
} ) ;
arr . push ( mnu ) ;
}
}
break ;
case Asc . c _oAscMathInterfaceType . Fraction :
var fraction = value . get _FractionType ( ) ;
if ( fraction == Asc . c _oAscMathInterfaceFraction . Skewed || fraction == Asc . c _oAscMathInterfaceFraction . Linear ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtFractionStacked ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_FractionType' , value : Asc . c _oAscMathInterfaceFraction . Bar }
} ) ;
arr . push ( mnu ) ;
}
if ( fraction == Asc . c _oAscMathInterfaceFraction . Bar || fraction == Asc . c _oAscMathInterfaceFraction . Linear ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtFractionSkewed ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_FractionType' , value : Asc . c _oAscMathInterfaceFraction . Skewed }
} ) ;
arr . push ( mnu ) ;
}
if ( fraction == Asc . c _oAscMathInterfaceFraction . Bar || fraction == Asc . c _oAscMathInterfaceFraction . Skewed ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtFractionLinear ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_FractionType' , value : Asc . c _oAscMathInterfaceFraction . Linear }
} ) ;
arr . push ( mnu ) ;
}
if ( fraction == Asc . c _oAscMathInterfaceFraction . Bar || fraction == Asc . c _oAscMathInterfaceFraction . NoBar ) {
mnu = new Common . UI . MenuItem ( {
caption : ( fraction == Asc . c _oAscMathInterfaceFraction . Bar ) ? me . txtRemFractionBar : me . txtAddFractionBar ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_FractionType' , value : ( fraction == Asc . c _oAscMathInterfaceFraction . Bar ) ? Asc . c _oAscMathInterfaceFraction . NoBar : Asc . c _oAscMathInterfaceFraction . Bar }
} ) ;
arr . push ( mnu ) ;
}
break ;
case Asc . c _oAscMathInterfaceType . Limit :
mnu = new Common . UI . MenuItem ( {
caption : ( value . get _Pos ( ) == Asc . c _oAscMathInterfaceLimitPos . Top ) ? me . txtLimitUnder : me . txtLimitOver ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_Pos' , value : ( value . get _Pos ( ) == Asc . c _oAscMathInterfaceLimitPos . Top ) ? Asc . c _oAscMathInterfaceLimitPos . Bottom : Asc . c _oAscMathInterfaceLimitPos . Top }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . txtRemLimit ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_Pos' , value : Asc . c _oAscMathInterfaceLimitPos . None }
} ) ;
arr . push ( mnu ) ;
break ;
case Asc . c _oAscMathInterfaceType . Matrix :
mnu = new Common . UI . MenuItem ( {
caption : value . get _HidePlaceholder ( ) ? me . txtShowPlaceholder : me . txtHidePlaceholder ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_HidePlaceholder' , value : ! value . get _HidePlaceholder ( ) }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . insertText ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
menu : new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
{
caption : me . insertRowAboveText ,
equationProps : { type : type , callback : 'insert_MatrixRow' , value : true }
} ,
{
caption : me . insertRowBelowText ,
equationProps : { type : type , callback : 'insert_MatrixRow' , value : false }
} ,
{
caption : me . insertColumnLeftText ,
equationProps : { type : type , callback : 'insert_MatrixColumn' , value : true }
} ,
{
caption : me . insertColumnRightText ,
equationProps : { type : type , callback : 'insert_MatrixColumn' , value : false }
}
]
} )
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . deleteText ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
menu : new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
{
caption : me . deleteRowText ,
equationProps : { type : type , callback : 'delete_MatrixRow' }
} ,
{
caption : me . deleteColumnText ,
equationProps : { type : type , callback : 'delete_MatrixColumn' }
}
]
} )
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . txtMatrixAlign ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
menu : new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
{
caption : me . txtTop ,
checkable : true ,
checked : ( value . get _MatrixAlign ( ) == Asc . c _oAscMathInterfaceMatrixMatrixAlign . Top ) ,
equationProps : { type : type , callback : 'put_MatrixAlign' , value : Asc . c _oAscMathInterfaceMatrixMatrixAlign . Top }
} ,
{
caption : me . centerText ,
checkable : true ,
checked : ( value . get _MatrixAlign ( ) == Asc . c _oAscMathInterfaceMatrixMatrixAlign . Center ) ,
equationProps : { type : type , callback : 'put_MatrixAlign' , value : Asc . c _oAscMathInterfaceMatrixMatrixAlign . Center }
} ,
{
caption : me . txtBottom ,
checkable : true ,
checked : ( value . get _MatrixAlign ( ) == Asc . c _oAscMathInterfaceMatrixMatrixAlign . Bottom ) ,
equationProps : { type : type , callback : 'put_MatrixAlign' , value : Asc . c _oAscMathInterfaceMatrixMatrixAlign . Bottom }
}
]
} )
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . txtColumnAlign ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
menu : new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
{
caption : me . leftText ,
checkable : true ,
checked : ( value . get _ColumnAlign ( ) == Asc . c _oAscMathInterfaceMatrixColumnAlign . Left ) ,
equationProps : { type : type , callback : 'put_ColumnAlign' , value : Asc . c _oAscMathInterfaceMatrixColumnAlign . Left }
} ,
{
caption : me . centerText ,
checkable : true ,
checked : ( value . get _ColumnAlign ( ) == Asc . c _oAscMathInterfaceMatrixColumnAlign . Center ) ,
equationProps : { type : type , callback : 'put_ColumnAlign' , value : Asc . c _oAscMathInterfaceMatrixColumnAlign . Center }
} ,
{
caption : me . rightText ,
checkable : true ,
checked : ( value . get _ColumnAlign ( ) == Asc . c _oAscMathInterfaceMatrixColumnAlign . Right ) ,
equationProps : { type : type , callback : 'put_ColumnAlign' , value : Asc . c _oAscMathInterfaceMatrixColumnAlign . Right }
}
]
} )
} ) ;
arr . push ( mnu ) ;
break ;
case Asc . c _oAscMathInterfaceType . EqArray :
mnu = new Common . UI . MenuItem ( {
caption : me . txtInsertEqBefore ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'insert_Equation' , value : true }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . txtInsertEqAfter ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'insert_Equation' , value : false }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . txtDeleteEq ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'delete_Equation' }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . alignmentText ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
menu : new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
{
caption : me . txtTop ,
checkable : true ,
checked : ( value . get _Align ( ) == Asc . c _oAscMathInterfaceEqArrayAlign . Top ) ,
equationProps : { type : type , callback : 'put_Align' , value : Asc . c _oAscMathInterfaceEqArrayAlign . Top }
} ,
{
caption : me . centerText ,
checkable : true ,
checked : ( value . get _Align ( ) == Asc . c _oAscMathInterfaceEqArrayAlign . Center ) ,
equationProps : { type : type , callback : 'put_Align' , value : Asc . c _oAscMathInterfaceEqArrayAlign . Center }
} ,
{
caption : me . txtBottom ,
checkable : true ,
checked : ( value . get _Align ( ) == Asc . c _oAscMathInterfaceEqArrayAlign . Bottom ) ,
equationProps : { type : type , callback : 'put_Align' , value : Asc . c _oAscMathInterfaceEqArrayAlign . Bottom }
}
]
} )
} ) ;
arr . push ( mnu ) ;
break ;
case Asc . c _oAscMathInterfaceType . LargeOperator :
mnu = new Common . UI . MenuItem ( {
caption : me . txtLimitChange ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_LimitLocation' , value : ( value . get _LimitLocation ( ) == Asc . c _oAscMathInterfaceNaryLimitLocation . UndOvr ) ? Asc . c _oAscMathInterfaceNaryLimitLocation . SubSup : Asc . c _oAscMathInterfaceNaryLimitLocation . UndOvr }
} ) ;
arr . push ( mnu ) ;
if ( value . get _HideUpper ( ) !== undefined ) {
mnu = new Common . UI . MenuItem ( {
caption : value . get _HideUpper ( ) ? me . txtShowTopLimit : me . txtHideTopLimit ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_HideUpper' , value : ! value . get _HideUpper ( ) }
} ) ;
arr . push ( mnu ) ;
}
if ( value . get _HideLower ( ) !== undefined ) {
mnu = new Common . UI . MenuItem ( {
caption : value . get _HideLower ( ) ? me . txtShowBottomLimit : me . txtHideBottomLimit ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_HideLower' , value : ! value . get _HideLower ( ) }
} ) ;
arr . push ( mnu ) ;
}
break ;
case Asc . c _oAscMathInterfaceType . Delimiter :
mnu = new Common . UI . MenuItem ( {
caption : me . txtInsertArgBefore ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'insert_DelimiterArgument' , value : true }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . txtInsertArgAfter ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'insert_DelimiterArgument' , value : false }
} ) ;
arr . push ( mnu ) ;
if ( value . can _DeleteArgument ( ) ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtDeleteArg ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'delete_DelimiterArgument' }
} ) ;
arr . push ( mnu ) ;
}
mnu = new Common . UI . MenuItem ( {
caption : value . has _Separators ( ) ? me . txtDeleteCharsAndSeparators : me . txtDeleteChars ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'remove_DelimiterCharacters' }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : value . get _HideOpeningBracket ( ) ? me . txtShowOpenBracket : me . txtHideOpenBracket ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_HideOpeningBracket' , value : ! value . get _HideOpeningBracket ( ) }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : value . get _HideClosingBracket ( ) ? me . txtShowCloseBracket : me . txtHideCloseBracket ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_HideClosingBracket' , value : ! value . get _HideClosingBracket ( ) }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . txtStretchBrackets ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
checkable : true ,
checked : value . get _StretchBrackets ( ) ,
equationProps : { type : type , callback : 'put_StretchBrackets' , value : ! value . get _StretchBrackets ( ) }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . txtMatchBrackets ,
equation : true ,
disabled : ( ! value . get _StretchBrackets ( ) || me . _currentParaObjDisabled ) ,
checkable : true ,
checked : value . get _StretchBrackets ( ) && value . get _MatchBrackets ( ) ,
equationProps : { type : type , callback : 'put_MatchBrackets' , value : ! value . get _MatchBrackets ( ) }
} ) ;
arr . push ( mnu ) ;
break ;
case Asc . c _oAscMathInterfaceType . GroupChar :
if ( value . can _ChangePos ( ) ) {
mnu = new Common . UI . MenuItem ( {
caption : ( value . get _Pos ( ) == Asc . c _oAscMathInterfaceGroupCharPos . Top ) ? me . txtGroupCharUnder : me . txtGroupCharOver ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_Pos' , value : ( value . get _Pos ( ) == Asc . c _oAscMathInterfaceGroupCharPos . Top ) ? Asc . c _oAscMathInterfaceGroupCharPos . Bottom : Asc . c _oAscMathInterfaceGroupCharPos . Top }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . txtDeleteGroupChar ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_Pos' , value : Asc . c _oAscMathInterfaceGroupCharPos . None }
} ) ;
arr . push ( mnu ) ;
}
break ;
case Asc . c _oAscMathInterfaceType . Radical :
if ( value . get _HideDegree ( ) !== undefined ) {
mnu = new Common . UI . MenuItem ( {
caption : value . get _HideDegree ( ) ? me . txtShowDegree : me . txtHideDegree ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_HideDegree' , value : ! value . get _HideDegree ( ) }
} ) ;
arr . push ( mnu ) ;
}
mnu = new Common . UI . MenuItem ( {
caption : me . txtDeleteRadical ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'remove_Radical' }
} ) ;
arr . push ( mnu ) ;
break ;
}
if ( value . can _IncreaseArgumentSize ( ) ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtIncreaseArg ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'increase_ArgumentSize' }
} ) ;
arr . push ( mnu ) ;
}
if ( value . can _DecreaseArgumentSize ( ) ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtDecreaseArg ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'decrease_ArgumentSize' }
} ) ;
arr . push ( mnu ) ;
}
if ( value . can _InsertManualBreak ( ) ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtInsertBreak ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'insert_ManualBreak' }
} ) ;
arr . push ( mnu ) ;
}
if ( value . can _DeleteManualBreak ( ) ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtDeleteBreak ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'delete_ManualBreak' }
} ) ;
arr . push ( mnu ) ;
}
if ( value . can _AlignToCharacter ( ) ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtAlignToChar ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'align_ToCharacter' }
} ) ;
arr . push ( mnu ) ;
}
return arr ;
} ,
addEquationMenu : function ( insertIdx ) {
var me = this ;
me . clearEquationMenu ( insertIdx ) ;
var equationMenu = me . documentHolder . textInShapeMenu ,
menuItems = me . initEquationMenu ( ) ;
if ( menuItems . length > 0 ) {
_ . each ( menuItems , function ( menuItem , index ) {
if ( menuItem . menu ) {
_ . each ( menuItem . menu . items , function ( item ) {
item . on ( 'click' , _ . bind ( me . equationCallback , me , item . options . equationProps ) ) ;
} ) ;
} else
menuItem . on ( 'click' , _ . bind ( me . equationCallback , me , menuItem . options . equationProps ) ) ;
equationMenu . insertItem ( insertIdx , menuItem ) ;
insertIdx ++ ;
} ) ;
}
return menuItems . length ;
} ,
clearEquationMenu : function ( insertIdx ) {
var me = this ;
var equationMenu = me . documentHolder . textInShapeMenu ;
for ( var i = insertIdx ; i < equationMenu . items . length ; i ++ ) {
if ( equationMenu . items [ i ] . options . equation ) {
if ( equationMenu . items [ i ] . menu ) {
_ . each ( equationMenu . items [ i ] . menu . items , function ( item ) {
item . off ( 'click' ) ;
} ) ;
} else
equationMenu . items [ i ] . off ( 'click' ) ;
equationMenu . removeItem ( equationMenu . items [ i ] ) ;
i -- ;
} else
break ;
}
} ,
equationCallback : function ( eqProps ) {
var me = this ;
if ( eqProps ) {
var eqObj ;
switch ( eqProps . type ) {
case Asc . c _oAscMathInterfaceType . Accent :
eqObj = new CMathMenuAccent ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . BorderBox :
eqObj = new CMathMenuBorderBox ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . Box :
eqObj = new CMathMenuBox ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . Bar :
eqObj = new CMathMenuBar ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . Script :
eqObj = new CMathMenuScript ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . Fraction :
eqObj = new CMathMenuFraction ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . Limit :
eqObj = new CMathMenuLimit ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . Matrix :
eqObj = new CMathMenuMatrix ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . EqArray :
eqObj = new CMathMenuEqArray ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . LargeOperator :
eqObj = new CMathMenuNary ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . Delimiter :
eqObj = new CMathMenuDelimiter ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . GroupChar :
eqObj = new CMathMenuGroupCharacter ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . Radical :
eqObj = new CMathMenuRadical ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . Common :
eqObj = new CMathMenuBase ( ) ;
break ;
}
if ( eqObj ) {
eqObj [ eqProps . callback ] ( eqProps . value ) ;
me . api . asc _SetMathProps ( eqObj ) ;
}
}
Common . NotificationCenter . trigger ( 'edit:complete' , me . documentHolder ) ;
} ,
2017-05-18 07:31:18 +00:00
onTextInShapeAfterRender : function ( cmp ) {
var view = this . documentHolder ,
_conf = view . paraBulletsPicker . conf ;
view . paraBulletsPicker = new Common . UI . DataView ( {
el : $ ( '#id-docholder-menu-bullets' ) ,
parentMenu : view . menuParagraphBullets . menu ,
store : view . paraBulletsPicker . store ,
itemTemplate : _ . template ( '<div id="<%= id %>" class="item-markerlist" style="background-position: 0 -<%= offsety %>px;"></div>' )
} ) ;
view . paraBulletsPicker . on ( 'item:click' , _ . bind ( this . onSelectBullets , this ) ) ;
_conf && view . paraBulletsPicker . selectRecord ( _conf . rec , true ) ;
} ,
2017-11-24 11:47:48 +00:00
onSignatureClick : function ( item ) {
2017-11-22 08:41:47 +00:00
var datavalue = item . cmpEl . attr ( 'data-value' ) ;
switch ( item . value ) {
case 0 :
Common . NotificationCenter . trigger ( 'protect:sign' , datavalue ) ; //guid
break ;
case 1 :
this . api . asc _ViewCertificate ( datavalue ) ; //certificate id
break ;
case 2 :
2017-11-24 11:47:48 +00:00
Common . NotificationCenter . trigger ( 'protect:signature' , 'visible' , this . _isDisabled , datavalue ) ; //guid, can edit settings for requested signature
2017-11-22 08:41:47 +00:00
break ;
case 3 :
this . api . asc _RemoveSignature ( datavalue ) ; //guid
break ;
}
} ,
2018-04-11 13:46:44 +00:00
onOriginalSizeClick : function ( item ) {
if ( this . api ) {
var imgsize = this . api . asc _getOriginalImageSize ( ) ;
var w = imgsize . asc _getImageWidth ( ) ;
var h = imgsize . asc _getImageHeight ( ) ;
var properties = new Asc . asc _CImgProperty ( ) ;
properties . asc _putWidth ( w ) ;
properties . asc _putHeight ( h ) ;
2019-04-11 10:09:28 +00:00
properties . put _ResetCrop ( true ) ;
2018-04-11 13:46:44 +00:00
this . api . asc _setGraphicObjectProps ( properties ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Set Image Original Size' ) ;
}
} ,
onImgReplace : function ( menu , item ) {
var me = this ;
if ( this . api ) {
if ( item . value == 'file' ) {
setTimeout ( function ( ) {
if ( me . api ) me . api . asc _changeImageFromFile ( ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , me . documentHolder ) ;
} , 10 ) ;
2020-05-13 14:43:45 +00:00
} else if ( item . value == 'storage' ) {
Common . NotificationCenter . trigger ( 'storage:image-load' , 'change' ) ;
2018-04-11 13:46:44 +00:00
} else {
( new Common . Views . ImageFromUrlDialog ( {
handler : function ( result , value ) {
if ( result == 'ok' ) {
if ( me . api ) {
var checkUrl = value . replace ( / /g , '' ) ;
if ( ! _ . isEmpty ( checkUrl ) ) {
var props = new Asc . asc _CImgProperty ( ) ;
props . asc _putImageUrl ( checkUrl ) ;
me . api . asc _setGraphicObjectProps ( props ) ;
}
}
}
Common . NotificationCenter . trigger ( 'edit:complete' , me . documentHolder ) ;
}
} ) ) . show ( ) ;
}
}
} ,
2018-04-13 13:29:31 +00:00
onNumberFormatSelect : function ( menu , item ) {
if ( item . value !== undefined && item . value !== 'advanced' ) {
if ( this . api )
this . api . asc _setCellFormat ( item . options . format ) ;
}
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
} ,
onCustomNumberFormat : function ( item ) {
var me = this ,
value = me . api . asc _getLocale ( ) ;
( ! value ) && ( value = ( ( me . permissions . lang ) ? parseInt ( Common . util . LanguageInfo . getLocalLanguageCode ( me . permissions . lang ) ) : 0x0409 ) ) ;
( new SSE . Views . FormatSettingsDialog ( {
api : me . api ,
handler : function ( result , settings ) {
if ( settings ) {
me . api . asc _setCellFormat ( settings . format ) ;
}
Common . NotificationCenter . trigger ( 'edit:complete' , me . documentHolder ) ;
} ,
props : { format : item . options . numformat , formatInfo : item . options . numformatinfo , langId : value }
} ) ) . show ( ) ;
Common . NotificationCenter . trigger ( 'edit:complete' , this . documentHolder ) ;
} ,
onNumberFormatOpenAfter : function ( menu ) {
if ( this . api ) {
var me = this ,
value = me . api . asc _getLocale ( ) ;
( ! value ) && ( value = ( ( me . permissions . lang ) ? parseInt ( Common . util . LanguageInfo . getLocalLanguageCode ( me . permissions . lang ) ) : 0x0409 ) ) ;
if ( this . _state . langId !== value ) {
this . _state . langId = value ;
var info = new Asc . asc _CFormatCellsInfo ( ) ;
info . asc _setType ( Asc . c _oAscNumFormatType . None ) ;
info . asc _setSymbol ( this . _state . langId ) ;
var arr = this . api . asc _getFormatCells ( info ) ; // all formats
for ( var i = 0 ; i < menu . items . length - 2 ; i ++ ) {
menu . items [ i ] . options . format = arr [ i ] ;
}
}
var val = menu . options . numformatinfo ;
val = ( val ) ? val . asc _getType ( ) : - 1 ;
for ( var i = 0 ; i < menu . items . length - 2 ; i ++ ) {
var mnu = menu . items [ i ] ;
mnu . options . exampleval = me . api . asc _getLocaleExample ( mnu . options . format ) ;
$ ( mnu . el ) . find ( 'label' ) . text ( mnu . options . exampleval ) ;
mnu . setChecked ( val == mnu . value ) ;
}
}
} ,
2017-11-22 08:41:47 +00:00
SetDisabled : function ( state , canProtect ) {
2017-11-10 07:50:01 +00:00
this . _isDisabled = state ;
2017-11-22 08:41:47 +00:00
this . _canProtect = canProtect ;
2017-11-10 07:50:01 +00:00
} ,
2017-06-06 08:04:04 +00:00
guestText : 'Guest' ,
2019-04-02 14:17:30 +00:00
textCtrlClick : 'Click the link to open it or click and hold the mouse button to select the cell.' ,
2016-03-11 00:48:53 +00:00
txtHeight : 'Height' ,
txtWidth : 'Width' ,
tipIsLocked : 'This element is being edited by another user.' ,
textChangeColumnWidth : 'Column Width {0} symbols ({1} pixels)' ,
textChangeRowHeight : 'Row Height {0} points ({1} pixels)' ,
textInsertLeft : 'Insert Left' ,
2016-04-06 13:38:54 +00:00
textInsertTop : 'Insert Top' ,
2016-08-05 11:40:47 +00:00
textSym : 'sym' ,
notcriticalErrorTitle : 'Warning' ,
2016-10-24 11:56:11 +00:00
errorInvalidLink : 'The link reference does not exist. Please correct the link or delete it.' ,
txtRemoveAccentChar : 'Remove accent character' ,
txtBorderProps : 'Borders property' ,
txtHideTop : 'Hide top border' ,
txtHideBottom : 'Hide bottom border' ,
txtHideLeft : 'Hide left border' ,
txtHideRight : 'Hide right border' ,
txtHideHor : 'Hide horizontal line' ,
txtHideVer : 'Hide vertical line' ,
txtHideLT : 'Hide left top line' ,
txtHideLB : 'Hide left bottom line' ,
txtAddTop : 'Add top border' ,
txtAddBottom : 'Add bottom border' ,
txtAddLeft : 'Add left border' ,
txtAddRight : 'Add right border' ,
txtAddHor : 'Add horizontal line' ,
txtAddVer : 'Add vertical line' ,
txtAddLT : 'Add left top line' ,
txtAddLB : 'Add left bottom line' ,
txtRemoveBar : 'Remove bar' ,
txtOverbar : 'Bar over text' ,
txtUnderbar : 'Bar under text' ,
txtRemScripts : 'Remove scripts' ,
txtRemSubscript : 'Remove subscript' ,
txtRemSuperscript : 'Remove superscript' ,
txtScriptsAfter : 'Scripts after text' ,
txtScriptsBefore : 'Scripts before text' ,
txtFractionStacked : 'Change to stacked fraction' ,
txtFractionSkewed : 'Change to skewed fraction' ,
txtFractionLinear : 'Change to linear fraction' ,
txtRemFractionBar : 'Remove fraction bar' ,
txtAddFractionBar : 'Add fraction bar' ,
txtRemLimit : 'Remove limit' ,
txtLimitOver : 'Limit over text' ,
txtLimitUnder : 'Limit under text' ,
txtHidePlaceholder : 'Hide placeholder' ,
txtShowPlaceholder : 'Show placeholder' ,
txtMatrixAlign : 'Matrix alignment' ,
txtColumnAlign : 'Column alignment' ,
txtTop : 'Top' ,
txtBottom : 'Bottom' ,
txtInsertEqBefore : 'Insert equation before' ,
txtInsertEqAfter : 'Insert equation after' ,
txtDeleteEq : 'Delete equation' ,
txtLimitChange : 'Change limits location' ,
txtHideTopLimit : 'Hide top limit' ,
txtShowTopLimit : 'Show top limit' ,
txtHideBottomLimit : 'Hide bottom limit' ,
txtShowBottomLimit : 'Show bottom limit' ,
txtInsertArgBefore : 'Insert argument before' ,
txtInsertArgAfter : 'Insert argument after' ,
txtDeleteArg : 'Delete argument' ,
txtHideOpenBracket : 'Hide opening bracket' ,
txtShowOpenBracket : 'Show opening bracket' ,
txtHideCloseBracket : 'Hide closing bracket' ,
txtShowCloseBracket : 'Show closing bracket' ,
txtStretchBrackets : 'Stretch brackets' ,
txtMatchBrackets : 'Match brackets to argument height' ,
txtGroupCharOver : 'Char over text' ,
txtGroupCharUnder : 'Char under text' ,
txtDeleteGroupChar : 'Delete char' ,
txtHideDegree : 'Hide degree' ,
txtShowDegree : 'Show degree' ,
txtIncreaseArg : 'Increase argument size' ,
txtDecreaseArg : 'Decrease argument size' ,
txtInsertBreak : 'Insert manual break' ,
txtDeleteBreak : 'Delete manual break' ,
txtAlignToChar : 'Align to character' ,
txtDeleteRadical : 'Delete radical' ,
txtDeleteChars : 'Delete enclosing characters' ,
2016-10-26 13:20:51 +00:00
txtDeleteCharsAndSeparators : 'Delete enclosing characters and separators' ,
insertText : 'Insert' ,
alignmentText : 'Alignment' ,
leftText : 'Left' ,
rightText : 'Right' ,
centerText : 'Center' ,
insertRowAboveText : 'Row Above' ,
insertRowBelowText : 'Row Below' ,
insertColumnLeftText : 'Column Left' ,
insertColumnRightText : 'Column Right' ,
deleteText : 'Delete' ,
deleteRowText : 'Delete Row' ,
2016-11-11 13:22:35 +00:00
deleteColumnText : 'Delete Column' ,
2017-02-06 14:12:59 +00:00
txtNoChoices : 'There are no choices for filling the cell.<br>Only text values from the column can be selected for replacement.' ,
txtExpandSort : 'The data next to the selection will not be sorted. Do you want to expand the selection to include the adjacent data or continue with sorting the currently selected cells only?' ,
txtExpand : 'Expand and sort' ,
txtSorting : 'Sorting' ,
2017-04-11 11:05:56 +00:00
txtSortSelected : 'Sort selected' ,
txtPaste : 'Paste' ,
2020-02-28 13:30:58 +00:00
txtPasteFormulas : 'Formulas' ,
txtPasteFormulaNumFormat : 'Formulas & number formats' ,
txtPasteKeepSourceFormat : 'Formulas & formatting' ,
txtPasteBorders : 'All except borders' ,
txtPasteColWidths : 'Formulas & column widths' ,
2017-04-11 11:05:56 +00:00
txtPasteMerge : 'Merge conditional formatting' ,
txtPasteTranspose : 'Transpose' ,
2020-02-28 13:30:58 +00:00
txtPasteValues : 'Values' ,
txtPasteValNumFormat : 'Values & number formats' ,
txtPasteValFormat : 'Values & formatting' ,
2017-04-11 11:05:56 +00:00
txtPasteFormat : 'Paste only formatting' ,
txtPasteLink : 'Paste Link' ,
txtPastePicture : 'Picture' ,
txtPasteLinkPicture : 'Linked Picture' ,
txtPasteSourceFormat : 'Source formatting' ,
2017-11-28 10:22:25 +00:00
txtPasteDestFormat : 'Destination formatting' ,
2019-04-16 12:28:07 +00:00
txtKeepTextOnly : 'Keep text only' ,
txtUseTextImport : 'Use text import wizard' ,
2017-11-28 10:22:25 +00:00
txtUndoExpansion : 'Undo table autoexpansion' ,
2018-05-31 07:27:38 +00:00
txtRedoExpansion : 'Redo table autoexpansion' ,
txtAnd : 'and' ,
txtOr : 'or' ,
txtEquals : "Equals" ,
txtNotEquals : "Does not equal" ,
txtGreater : "Greater than" ,
txtGreaterEquals : "Greater than or equal to" ,
txtLess : "Less than" ,
txtLessEquals : "Less than or equal to" ,
txtAboveAve : 'Above average' ,
txtBelowAve : 'Below average' ,
txtBegins : "Begins with" ,
txtNotBegins : "Does not begin with" ,
txtEnds : "Ends with" ,
txtNotEnds : "Does not end with" ,
txtContains : "Contains" ,
txtNotContains : "Does not contain" ,
txtFilterTop : 'Top' ,
txtFilterBottom : 'Bottom' ,
txtItems : 'items' ,
txtPercent : 'percent' ,
txtEqualsToCellColor : 'Equals to cell color' ,
txtEqualsToFontColor : 'Equals to font color' ,
txtAll : '(All)' ,
2018-07-26 14:03:47 +00:00
txtBlanks : '(Blanks)' ,
2019-04-17 09:01:20 +00:00
txtColumn : 'Column' ,
2020-02-28 13:30:58 +00:00
txtImportWizard : 'Text Import Wizard' ,
textPasteSpecial : 'Paste special'
2016-03-11 00:48:53 +00:00
} , SSE . Controllers . DocumentHolder || { } ) ) ;
} ) ;