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
define ( [
'jquery' ,
'underscore' ,
'backbone' ,
'gateway' ,
'common/main/lib/util/utils' ,
'common/main/lib/component/Menu' ,
'common/main/lib/view/CopyWarningDialog' ,
'presentationeditor/main/app/view/HyperlinkSettingsDialog' ,
// 'common/main/lib/view/InsertTableDialog',
'presentationeditor/main/app/view/ParagraphSettingsAdvanced' ,
'presentationeditor/main/app/view/ShapeSettingsAdvanced' ,
'presentationeditor/main/app/view/TableSettingsAdvanced'
] , function ( $ , _ , Backbone , gateway ) { 'use strict' ;
PE . Views . DocumentHolder = Backbone . View . extend ( _ . extend ( {
el : '#editor_sdk' ,
// Compile our stats template
template : null ,
// Delegated events for creating new items, and clearing completed ones.
events : {
} ,
initialize : function ( ) {
var me = this ;
me . slidesCount = 0 ;
2016-10-25 10:48:31 +00:00
me . _currentMathObj = undefined ;
me . _currentParaObjDisabled = false ;
2017-04-26 09:26:02 +00:00
me . _currentSpellObj = undefined ;
me . _currLang = { } ;
2017-08-07 14:20:17 +00:00
me . _state = { } ;
2017-11-10 08:59:05 +00:00
me . _isDisabled = false ;
2022-05-17 12:29:01 +00:00
} ,
2017-11-10 08:59:05 +00:00
2022-05-17 12:29:01 +00:00
render : function ( ) {
this . fireEvent ( 'render:before' , this ) ;
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
this . cmpEl = $ ( this . el ) ;
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
this . fireEvent ( 'render:after' , this ) ;
return this ;
} ,
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
setApi : function ( o ) {
this . api = o ;
return this ;
} ,
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
setMode : function ( m ) {
this . mode = m ;
return this ;
} ,
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
focus : function ( ) {
var me = this ;
_ . defer ( function ( ) { me . cmpEl . focus ( ) ; } , 50 ) ;
} ,
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
changeLanguageMenu : function ( menu ) {
var me = this ;
if ( me . _currLang . id === null || me . _currLang . id === undefined ) {
menu . clearAll ( ) ;
} else {
var index = _ . findIndex ( menu . items , { langid : me . _currLang . id } ) ;
( index > - 1 ) && ! menu . items [ index ] . checked && menu . setChecked ( index , true ) ;
}
} ,
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
addWordVariants : function ( isParagraph ) {
var me = this ;
if ( ! me . textMenu || ! me . textMenu . isVisible ( ) && ! me . tableMenu . isVisible ( ) ) return ;
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
if ( _ . isUndefined ( isParagraph ) ) {
isParagraph = me . textMenu . isVisible ( ) ;
}
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
me . clearWordVariants ( isParagraph ) ;
2017-06-06 08:04:04 +00:00
2022-05-17 12:29:01 +00:00
var moreMenu = ( isParagraph ) ? me . menuSpellMorePara : me . menuSpellMoreTable ;
var spellMenu = ( isParagraph ) ? me . menuSpellPara : me . menuSpellTable ;
var arr = [ ] ,
arrMore = [ ] ;
var variants = me . _currentSpellObj . get _Variants ( ) ;
2017-06-06 08:04:04 +00:00
2022-05-17 12:29:01 +00:00
if ( variants . length > 0 ) {
moreMenu . setVisible ( variants . length > 3 ) ;
moreMenu . setDisabled ( me . _currentParaObjDisabled ) ;
2017-11-10 08:59:05 +00:00
2022-05-17 12:29:01 +00:00
_ . each ( variants , function ( variant , index ) {
var mnu = new Common . UI . MenuItem ( {
caption : variant ,
spellword : true ,
disabled : me . _currentParaObjDisabled
} ) . on ( 'click' , function ( item , e ) {
if ( me . api ) {
me . api . asc _replaceMisspelledWord ( item . caption , me . _currentSpellObj ) ;
me . fireEvent ( 'editcomplete' , me ) ;
}
} ) ;
2017-06-06 08:04:04 +00:00
2022-05-17 12:29:01 +00:00
( index < 3 ) ? arr . push ( mnu ) : arrMore . push ( mnu ) ;
2017-06-06 08:04:04 +00:00
} ) ;
2022-05-17 12:29:01 +00:00
if ( arr . length > 0 ) {
if ( isParagraph ) {
_ . each ( arr , function ( variant , index ) {
me . textMenu . insertItem ( index , variant ) ;
} )
2016-08-30 08:34:27 +00:00
} else {
2022-05-17 12:29:01 +00:00
_ . each ( arr , function ( variant , index ) {
me . menuSpellCheckTable . menu . insertItem ( index , variant ) ;
} )
2017-10-24 11:56:49 +00:00
}
2016-03-11 00:48:53 +00:00
}
2022-05-17 12:29:01 +00:00
if ( arrMore . length > 0 ) {
_ . each ( arrMore , function ( variant , index ) {
moreMenu . menu . addItem ( variant ) ;
2016-03-11 00:48:53 +00:00
} ) ;
}
2022-05-17 12:29:01 +00:00
spellMenu . setVisible ( false ) ;
} else {
moreMenu . setVisible ( false ) ;
spellMenu . setVisible ( true ) ;
spellMenu . setCaption ( me . noSpellVariantsText , true ) ;
}
} ,
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
clearWordVariants : function ( isParagraph ) {
var me = this ;
var spellMenu = ( isParagraph ) ? me . textMenu : me . menuSpellCheckTable . menu ;
2021-11-08 22:01:49 +00:00
2022-05-17 12:29:01 +00:00
for ( var i = 0 ; i < spellMenu . items . length ; i ++ ) {
if ( spellMenu . items [ i ] . options . spellword ) {
if ( spellMenu . checkeditem == spellMenu . items [ i ] ) {
spellMenu . checkeditem = undefined ;
spellMenu . activeItem = undefined ;
2016-03-11 00:48:53 +00:00
}
2022-05-17 12:29:01 +00:00
spellMenu . removeItem ( spellMenu . items [ i ] ) ;
i -- ;
2016-03-11 00:48:53 +00:00
}
2022-05-17 12:29:01 +00:00
}
( isParagraph ) ? me . menuSpellMorePara . menu . removeAll ( ) : me . menuSpellMoreTable . menu . removeAll ( ) ;
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
me . menuSpellMorePara . menu . checkeditem = undefined ;
me . menuSpellMorePara . menu . activeItem = undefined ;
me . menuSpellMoreTable . menu . checkeditem = undefined ;
me . menuSpellMoreTable . menu . activeItem = undefined ;
} ,
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
initEquationMenu : function ( ) {
var me = this ;
if ( ! me . _currentMathObj ) return ;
var type = me . _currentMathObj . get _Type ( ) ,
value = me . _currentMathObj ,
mnu , arr = [ ] ;
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
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' }
2016-03-11 00:48:53 +00:00
} ) ;
2022-05-17 12:29:01 +00:00
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 ( {
cls : 'shifted-right' ,
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 ( ) }
}
]
} )
2017-04-26 09:26:02 +00:00
} ) ;
2022-05-17 12:29:01 +00:00
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 ) {
2016-10-25 10:48:31 +00:00
mnu = new Common . UI . MenuItem ( {
2022-05-17 12:29:01 +00:00
caption : me . txtScriptsAfter ,
2016-10-25 10:48:31 +00:00
equation : true ,
disabled : me . _currentParaObjDisabled ,
2022-05-17 12:29:01 +00:00
equationProps : { type : type , callback : 'put_ScriptType' , value : Asc . c _oAscMathInterfaceScript . SubSup }
2016-10-25 10:48:31 +00:00
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
2022-05-17 12:29:01 +00:00
caption : me . txtRemScripts ,
2016-10-25 10:48:31 +00:00
equation : true ,
disabled : me . _currentParaObjDisabled ,
2022-05-17 12:29:01 +00:00
equationProps : { type : type , callback : 'put_ScriptType' , value : Asc . c _oAscMathInterfaceScript . None }
2016-10-25 10:48:31 +00:00
} ) ;
arr . push ( mnu ) ;
2022-05-17 12:29:01 +00:00
} else {
if ( scripttype == Asc . c _oAscMathInterfaceScript . SubSup ) {
2016-10-25 10:48:31 +00:00
mnu = new Common . UI . MenuItem ( {
2022-05-17 12:29:01 +00:00
caption : me . txtScriptsBefore ,
2016-10-25 10:48:31 +00:00
equation : true ,
disabled : me . _currentParaObjDisabled ,
2022-05-17 12:29:01 +00:00
equationProps : { type : type , callback : 'put_ScriptType' , value : Asc . c _oAscMathInterfaceScript . PreSubSup }
2016-10-25 10:48:31 +00:00
} ) ;
arr . push ( mnu ) ;
}
2022-05-17 12:29:01 +00:00
if ( scripttype == Asc . c _oAscMathInterfaceScript . SubSup || scripttype == Asc . c _oAscMathInterfaceScript . Sub ) {
2016-10-25 10:48:31 +00:00
mnu = new Common . UI . MenuItem ( {
2022-05-17 12:29:01 +00:00
caption : me . txtRemSubscript ,
2016-10-25 10:48:31 +00:00
equation : true ,
disabled : me . _currentParaObjDisabled ,
2022-05-17 12:29:01 +00:00
equationProps : { type : type , callback : 'put_ScriptType' , value : ( scripttype == Asc . c _oAscMathInterfaceScript . SubSup ) ? Asc . c _oAscMathInterfaceScript . Sup : Asc . c _oAscMathInterfaceScript . None }
2016-10-25 10:48:31 +00:00
} ) ;
arr . push ( mnu ) ;
}
2022-05-17 12:29:01 +00:00
if ( scripttype == Asc . c _oAscMathInterfaceScript . SubSup || scripttype == Asc . c _oAscMathInterfaceScript . Sup ) {
2016-10-25 10:48:31 +00:00
mnu = new Common . UI . MenuItem ( {
2022-05-17 12:29:01 +00:00
caption : me . txtRemSuperscript ,
2016-10-25 10:48:31 +00:00
equation : true ,
disabled : me . _currentParaObjDisabled ,
2022-05-17 12:29:01 +00:00
equationProps : { type : type , callback : 'put_ScriptType' , value : ( scripttype == Asc . c _oAscMathInterfaceScript . SubSup ) ? Asc . c _oAscMathInterfaceScript . Sub : Asc . c _oAscMathInterfaceScript . None }
2016-10-25 10:48:31 +00:00
} ) ;
arr . push ( mnu ) ;
}
2022-05-17 12:29:01 +00:00
}
break ;
case Asc . c _oAscMathInterfaceType . Fraction :
var fraction = value . get _FractionType ( ) ;
if ( fraction == Asc . c _oAscMathInterfaceFraction . Skewed || fraction == Asc . c _oAscMathInterfaceFraction . Linear ) {
2016-10-25 10:48:31 +00:00
mnu = new Common . UI . MenuItem ( {
2022-05-17 12:29:01 +00:00
caption : me . txtFractionStacked ,
2016-10-25 10:48:31 +00:00
equation : true ,
disabled : me . _currentParaObjDisabled ,
2022-05-17 12:29:01 +00:00
equationProps : { type : type , callback : 'put_FractionType' , value : Asc . c _oAscMathInterfaceFraction . Bar }
2016-10-25 10:48:31 +00:00
} ) ;
arr . push ( mnu ) ;
2022-05-17 12:29:01 +00:00
}
if ( fraction == Asc . c _oAscMathInterfaceFraction . Bar || fraction == Asc . c _oAscMathInterfaceFraction . Linear ) {
2016-10-25 10:48:31 +00:00
mnu = new Common . UI . MenuItem ( {
2022-05-17 12:29:01 +00:00
caption : me . txtFractionSkewed ,
2016-10-25 10:48:31 +00:00
equation : true ,
disabled : me . _currentParaObjDisabled ,
2022-05-17 12:29:01 +00:00
equationProps : { type : type , callback : 'put_FractionType' , value : Asc . c _oAscMathInterfaceFraction . Skewed }
2016-10-25 10:48:31 +00:00
} ) ;
arr . push ( mnu ) ;
2022-05-17 12:29:01 +00:00
}
if ( fraction == Asc . c _oAscMathInterfaceFraction . Bar || fraction == Asc . c _oAscMathInterfaceFraction . Skewed ) {
2016-10-25 10:48:31 +00:00
mnu = new Common . UI . MenuItem ( {
2022-05-17 12:29:01 +00:00
caption : me . txtFractionLinear ,
2016-10-25 10:48:31 +00:00
equation : true ,
disabled : me . _currentParaObjDisabled ,
2022-05-17 12:29:01 +00:00
equationProps : { type : type , callback : 'put_FractionType' , value : Asc . c _oAscMathInterfaceFraction . Linear }
2016-10-25 10:48:31 +00:00
} ) ;
arr . push ( mnu ) ;
2022-05-17 12:29:01 +00:00
}
if ( fraction == Asc . c _oAscMathInterfaceFraction . Bar || fraction == Asc . c _oAscMathInterfaceFraction . NoBar ) {
2016-10-25 10:48:31 +00:00
mnu = new Common . UI . MenuItem ( {
2022-05-17 12:29:01 +00:00
caption : ( fraction == Asc . c _oAscMathInterfaceFraction . Bar ) ? me . txtRemFractionBar : me . txtAddFractionBar ,
2016-10-25 10:48:31 +00:00
equation : true ,
disabled : me . _currentParaObjDisabled ,
2022-05-17 12:29:01 +00:00
equationProps : { type : type , callback : 'put_FractionType' , value : ( fraction == Asc . c _oAscMathInterfaceFraction . Bar ) ? Asc . c _oAscMathInterfaceFraction . NoBar : Asc . c _oAscMathInterfaceFraction . Bar }
2016-10-25 10:48:31 +00:00
} ) ;
arr . push ( mnu ) ;
2022-05-17 12:29:01 +00:00
}
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 ( {
cls : 'shifted-right' ,
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 ( {
cls : 'shifted-right' ,
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 ( {
cls : 'shifted-right' ,
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 ( {
cls : 'shifted-right' ,
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 ( {
cls : 'shifted-right' ,
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 ) {
2016-10-25 10:48:31 +00:00
mnu = new Common . UI . MenuItem ( {
2022-05-17 12:29:01 +00:00
caption : value . get _HideUpper ( ) ? me . txtShowTopLimit : me . txtHideTopLimit ,
2016-10-25 10:48:31 +00:00
equation : true ,
disabled : me . _currentParaObjDisabled ,
2022-05-17 12:29:01 +00:00
equationProps : { type : type , callback : 'put_HideUpper' , value : ! value . get _HideUpper ( ) }
2016-10-25 10:48:31 +00:00
} ) ;
arr . push ( mnu ) ;
2022-05-17 12:29:01 +00:00
}
if ( value . get _HideLower ( ) !== undefined ) {
2016-10-25 10:48:31 +00:00
mnu = new Common . UI . MenuItem ( {
2022-05-17 12:29:01 +00:00
caption : value . get _HideLower ( ) ? me . txtShowBottomLimit : me . txtHideBottomLimit ,
2016-10-25 10:48:31 +00:00
equation : true ,
disabled : me . _currentParaObjDisabled ,
2022-05-17 12:29:01 +00:00
equationProps : { type : type , callback : 'put_HideLower' , value : ! value . get _HideLower ( ) }
2016-10-25 10:48:31 +00:00
} ) ;
arr . push ( mnu ) ;
2022-05-17 12:29:01 +00:00
}
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 ( ) ) {
2016-10-25 10:48:31 +00:00
mnu = new Common . UI . MenuItem ( {
2022-05-17 12:29:01 +00:00
caption : me . txtDeleteArg ,
2016-10-25 10:48:31 +00:00
equation : true ,
disabled : me . _currentParaObjDisabled ,
2022-05-17 12:29:01 +00:00
equationProps : { type : type , callback : 'delete_DelimiterArgument' }
2016-10-25 10:48:31 +00:00
} ) ;
arr . push ( mnu ) ;
2022-05-17 12:29:01 +00:00
}
2016-10-25 10:48:31 +00:00
mnu = new Common . UI . MenuItem ( {
2022-05-17 12:29:01 +00:00
caption : value . has _Separators ( ) ? me . txtDeleteCharsAndSeparators : me . txtDeleteChars ,
2016-10-25 10:48:31 +00:00
equation : true ,
disabled : me . _currentParaObjDisabled ,
2022-05-17 12:29:01 +00:00
equationProps : { type : type , callback : 'remove_DelimiterCharacters' }
2016-10-25 10:48:31 +00:00
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
2022-05-17 12:29:01 +00:00
caption : value . get _HideOpeningBracket ( ) ? me . txtShowOpenBracket : me . txtHideOpenBracket ,
2016-10-25 10:48:31 +00:00
equation : true ,
disabled : me . _currentParaObjDisabled ,
2022-05-17 12:29:01 +00:00
equationProps : { type : type , callback : 'put_HideOpeningBracket' , value : ! value . get _HideOpeningBracket ( ) }
2016-10-25 10:48:31 +00:00
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
2022-05-17 12:29:01 +00:00
caption : value . get _HideClosingBracket ( ) ? me . txtShowCloseBracket : me . txtHideCloseBracket ,
2016-10-25 10:48:31 +00:00
equation : true ,
disabled : me . _currentParaObjDisabled ,
2022-05-17 12:29:01 +00:00
equationProps : { type : type , callback : 'put_HideClosingBracket' , value : ! value . get _HideClosingBracket ( ) }
2016-10-25 10:48:31 +00:00
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
2022-05-17 12:29:01 +00:00
caption : me . txtStretchBrackets ,
2016-10-25 10:48:31 +00:00
equation : true ,
disabled : me . _currentParaObjDisabled ,
2022-05-17 12:29:01 +00:00
checkable : true ,
checked : value . get _StretchBrackets ( ) ,
equationProps : { type : type , callback : 'put_StretchBrackets' , value : ! value . get _StretchBrackets ( ) }
2016-10-25 10:48:31 +00:00
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
2022-05-17 12:29:01 +00:00
caption : me . txtMatchBrackets ,
2016-10-25 10:48:31 +00:00
equation : true ,
2022-05-17 12:29:01 +00:00
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 ( ) }
2016-10-25 10:48:31 +00:00
} ) ;
arr . push ( mnu ) ;
2022-05-17 12:29:01 +00:00
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 ) ;
2017-09-19 08:17:54 +00:00
}
2022-05-17 12:29:01 +00:00
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 ( ) }
2017-09-19 08:17:54 +00:00
} ) ;
2022-05-17 12:29:01 +00:00
arr . push ( mnu ) ;
2016-03-11 00:48:53 +00:00
}
2022-05-17 12:29:01 +00:00
mnu = new Common . UI . MenuItem ( {
caption : me . txtDeleteRadical ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'remove_Radical' }
2016-03-11 00:48:53 +00:00
} ) ;
2022-05-17 12:29:01 +00:00
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' }
2016-03-11 00:48:53 +00:00
} ) ;
2022-05-17 12:29:01 +00:00
arr . push ( mnu ) ;
2016-03-11 00:48:53 +00:00
}
2022-05-17 12:29:01 +00:00
if ( value . can _DecreaseArgumentSize ( ) ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtDecreaseArg ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'decrease_ArgumentSize' }
2016-03-11 00:48:53 +00:00
} ) ;
2022-05-17 12:29:01 +00:00
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 ) ;
2016-03-11 00:48:53 +00:00
}
2022-05-17 12:29:01 +00:00
return arr ;
2016-03-11 00:48:53 +00:00
} ,
2022-05-17 12:29:01 +00:00
addEquationMenu : function ( isParagraph , insertIdx ) {
var me = this ;
if ( _ . isUndefined ( isParagraph ) ) {
isParagraph = me . textMenu . isVisible ( ) ;
2016-03-11 00:48:53 +00:00
}
2022-05-17 12:29:01 +00:00
me . clearEquationMenu ( isParagraph , insertIdx ) ;
var equationMenu = ( isParagraph ) ? me . textMenu : me . tableMenu ,
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 ++ ;
} ) ;
2016-03-11 00:48:53 +00:00
}
2022-05-17 12:29:01 +00:00
return menuItems . length ;
2016-03-11 00:48:53 +00:00
} ,
2022-05-17 12:29:01 +00:00
equationCallback : function ( eqProps ) {
this . fireEvent ( 'equation:callback' , [ eqProps ] ) ;
2022-03-11 14:20:24 +00:00
} ,
2022-05-17 12:29:01 +00:00
clearEquationMenu : function ( isParagraph , insertIdx ) {
2016-03-11 00:48:53 +00:00
var me = this ;
2022-05-17 12:29:01 +00:00
var equationMenu = ( isParagraph ) ? me . textMenu : me . tableMenu ;
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 ;
2016-03-11 00:48:53 +00:00
}
} ,
onSlidePickerShowAfter : function ( picker ) {
if ( ! picker . _needRecalcSlideLayout ) return ;
2022-05-17 12:29:01 +00:00
2016-03-11 00:48:53 +00:00
if ( picker . cmpEl && picker . dataViewItems . length > 0 ) {
var dataViewItems = picker . dataViewItems ,
el = $ ( dataViewItems [ 0 ] . el ) ,
itemW = el . outerWidth ( ) + parseInt ( el . css ( 'margin-left' ) ) + parseInt ( el . css ( 'margin-right' ) ) ,
2019-06-04 08:38:44 +00:00
columnCount = Math . floor ( picker . options . restoreWidth / itemW + 0.5 ) || 1 , // try to use restore width
2016-03-11 00:48:53 +00:00
col = 0 , maxHeight = 0 ;
2019-06-04 08:38:44 +00:00
picker . cmpEl . width ( itemW * columnCount + 11 ) ;
2016-03-11 00:48:53 +00:00
for ( var i = 0 ; i < dataViewItems . length ; i ++ ) {
var div = $ ( dataViewItems [ i ] . el ) . find ( '.title' ) ,
height = div . height ( ) ;
if ( height > maxHeight )
maxHeight = height ;
else
div . css ( { 'height' : maxHeight } ) ;
col ++ ;
if ( col > columnCount - 1 ) { col = 0 ; maxHeight = 0 ; }
}
picker . _needRecalcSlideLayout = false ;
}
} ,
2017-06-06 08:04:04 +00:00
createDelayedElementsViewer : function ( ) {
var me = this ;
2022-05-17 12:29:01 +00:00
me . menuViewCopy = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-copy' ,
2017-06-06 08:04:04 +00:00
caption : me . textCopy ,
value : 'copy'
2022-05-17 12:29:01 +00:00
} ) ;
2017-06-06 08:04:04 +00:00
2022-05-17 21:25:25 +00:00
me . menuViewUndo = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-undo' ,
2017-06-06 08:04:04 +00:00
caption : me . textUndo
} ) ;
var menuViewCopySeparator = new Common . UI . MenuItem ( {
caption : '--'
} ) ;
2022-05-17 12:29:01 +00:00
me . menuViewAddComment = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-menu-comments' ,
2017-06-06 08:04:04 +00:00
caption : me . addCommentText
2022-05-17 12:29:01 +00:00
} ) ;
2017-06-06 08:04:04 +00:00
this . viewModeMenu = new Common . UI . Menu ( {
2020-08-20 13:55:06 +00:00
cls : 'shifted-right' ,
2017-06-06 08:04:04 +00:00
initMenu : function ( value ) {
2022-05-17 21:25:25 +00:00
me . menuViewUndo . setVisible ( me . mode . canCoAuthoring && me . mode . canComments && ! me . _isDisabled ) ;
me . menuViewUndo . setDisabled ( ! me . api . asc _getCanUndo ( ) ) ;
2017-11-10 08:59:05 +00:00
menuViewCopySeparator . setVisible ( ! value . isChart && me . api . can _AddQuotedComment ( ) !== false && me . mode . canCoAuthoring && me . mode . canComments && ! me . _isDisabled ) ;
2022-05-17 12:29:01 +00:00
me . menuViewAddComment . setVisible ( ! value . isChart && me . api . can _AddQuotedComment ( ) !== false && me . mode . canCoAuthoring && me . mode . canComments && ! me . _isDisabled ) ;
me . menuViewAddComment . setDisabled ( value . locked ) ;
2022-08-10 19:29:53 +00:00
var cancopy = me . api && me . api . can _CopyCut ( ) ;
me . menuViewCopy . setDisabled ( ! cancopy ) ;
2017-06-06 08:04:04 +00:00
} ,
items : [
2022-05-17 12:29:01 +00:00
me . menuViewCopy ,
2022-05-17 21:25:25 +00:00
me . menuViewUndo ,
2017-06-06 08:04:04 +00:00
menuViewCopySeparator ,
2022-05-17 12:29:01 +00:00
me . menuViewAddComment
2017-06-06 08:04:04 +00:00
]
} ) . on ( 'hide:after' , function ( menu , e , isFromInputControl ) {
if ( me . suppressEditComplete ) {
me . suppressEditComplete = false ;
return ;
}
if ( ! isFromInputControl ) me . fireEvent ( 'editcomplete' , me ) ;
me . currentMenu = null ;
} ) ;
2022-05-17 21:25:25 +00:00
me . mnuPreview = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-preview' ,
2020-02-12 13:09:07 +00:00
caption : me . txtPreview
} ) ;
2022-05-17 21:25:25 +00:00
me . mnuSelectAll = new Common . UI . MenuItem ( {
2020-02-12 13:09:07 +00:00
caption : me . txtSelectAll
} ) ;
2022-05-17 21:25:25 +00:00
me . mnuPrintSelection = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-print' ,
2020-02-12 13:09:07 +00:00
caption : me . txtPrintSelection
} ) ;
this . viewModeMenuSlide = new Common . UI . Menu ( {
2020-08-20 13:55:06 +00:00
cls : 'shifted-right' ,
2020-02-12 13:09:07 +00:00
initMenu : function ( value ) {
2022-05-17 21:25:25 +00:00
me . mnuSelectAll . setDisabled ( me . slidesCount < 2 ) ;
me . mnuPrintSelection . setVisible ( me . mode . canPrint && value . fromThumbs === true ) ;
me . mnuPrintSelection . setDisabled ( me . slidesCount < 1 ) ;
me . mnuPreview . setDisabled ( me . slidesCount < 1 ) ;
2020-02-12 13:09:07 +00:00
} ,
items : [
2022-05-17 21:25:25 +00:00
me . mnuSelectAll ,
me . mnuPrintSelection ,
2020-02-12 13:09:07 +00:00
{ caption : '--' } ,
2022-05-17 21:25:25 +00:00
me . mnuPreview
2020-02-12 13:09:07 +00:00
]
} ) . on ( 'hide:after' , function ( menu , e , isFromInputControl ) {
if ( me . suppressEditComplete ) {
me . suppressEditComplete = false ;
return ;
}
if ( ! isFromInputControl ) me . fireEvent ( 'editcomplete' , me ) ;
me . currentMenu = null ;
} ) ;
2022-05-17 12:29:01 +00:00
this . fireEvent ( 'createdelayedelements' , [ this , 'view' ] ) ;
2017-06-06 08:04:04 +00:00
} ,
2016-03-11 00:48:53 +00:00
createDelayedElements : function ( ) {
var me = this ;
2022-05-17 21:25:25 +00:00
me . mnuDeleteSlide = new Common . UI . MenuItem ( {
2016-03-11 00:48:53 +00:00
caption : me . txtDeleteSlide
2016-08-30 11:48:49 +00:00
} ) ;
2016-03-11 00:48:53 +00:00
2022-05-17 21:25:25 +00:00
me . mnuChangeSlide = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-changeslide' ,
2016-03-11 00:48:53 +00:00
caption : me . txtChangeLayout ,
menu : new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
{ template : _ . template ( '<div id="id-docholder-menu-changeslide" class="menu-layouts" style="width: 302px; margin: 0 4px;"></div>' ) }
]
} )
} ) ;
2022-05-17 21:25:25 +00:00
me . mnuResetSlide = new Common . UI . MenuItem ( {
2019-10-30 08:33:55 +00:00
caption : me . txtResetLayout
2022-05-17 21:25:25 +00:00
} ) ;
2019-10-30 08:33:55 +00:00
2022-05-17 21:25:25 +00:00
me . mnuNewSlide = new Common . UI . MenuItem ( {
caption : me . txtNewSlide
} ) ;
me . mnuDuplicateSlide = new Common . UI . MenuItem ( {
caption : me . txtDuplicateSlide
2019-10-30 08:33:55 +00:00
} ) ;
2017-08-07 14:20:17 +00:00
var mnuChangeTheme = new Common . UI . MenuItem ( {
caption : me . txtChangeTheme ,
menu : new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
2021-03-30 10:26:05 +00:00
{ template : _ . template ( '<div id="id-docholder-menu-changetheme" style="width: 289px; margin: 0 4px;"></div>' ) }
2017-08-07 14:20:17 +00:00
]
} )
} ) ;
2022-05-17 21:25:25 +00:00
me . mnuPreview = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-preview' ,
2016-03-11 00:48:53 +00:00
caption : me . txtPreview
} ) ;
2022-05-17 21:25:25 +00:00
me . mnuSelectAll = new Common . UI . MenuItem ( {
2016-03-11 00:48:53 +00:00
caption : me . txtSelectAll
} ) ;
2022-05-17 21:25:25 +00:00
me . mnuPrintSelection = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-print' ,
2019-08-07 07:38:03 +00:00
caption : me . txtPrintSelection
} ) ;
2022-05-17 21:25:25 +00:00
me . mnuMoveSlideToStart = new Common . UI . MenuItem ( {
2021-10-23 23:15:18 +00:00
caption : me . txtMoveSlidesToStart
} ) ;
2022-05-17 21:25:25 +00:00
me . mnuMoveSlideToEnd = new Common . UI . MenuItem ( {
2021-10-23 23:15:18 +00:00
caption : me . txtMoveSlidesToEnd
} ) ;
2022-05-17 12:29:01 +00:00
me . menuSlidePaste = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-paste' ,
2016-03-11 00:48:53 +00:00
caption : me . textPaste ,
value : 'paste'
2022-05-17 12:29:01 +00:00
} ) ;
2016-03-11 00:48:53 +00:00
2022-05-17 21:25:25 +00:00
me . menuSlideSettings = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-menu-slide' ,
2016-03-11 00:48:53 +00:00
caption : me . textSlideSettings ,
value : null
} ) ;
2022-05-17 21:25:25 +00:00
me . mnuSlideHide = new Common . UI . MenuItem ( {
2017-07-20 10:37:26 +00:00
caption : me . txtSlideHide ,
checkable : true ,
checked : false
} ) ;
2016-03-11 00:48:53 +00:00
me . slideMenu = new Common . UI . Menu ( {
2020-08-20 13:55:06 +00:00
cls : 'shifted-right' ,
2022-02-09 19:51:43 +00:00
restoreHeightAndTop : true ,
2016-03-11 00:48:53 +00:00
initMenu : function ( value ) {
2021-10-25 09:17:32 +00:00
var selectedLast = me . api . asc _IsLastSlideSelected ( ) ,
selectedFirst = me . api . asc _IsFirstSlideSelected ( ) ;
2022-05-17 12:29:01 +00:00
me . menuSlidePaste . setVisible ( value . fromThumbs !== true ) ;
2016-03-11 00:48:53 +00:00
me . slideMenu . items [ 1 ] . setVisible ( value . fromThumbs === true ) ; // New Slide
me . slideMenu . items [ 2 ] . setVisible ( value . isSlideSelect === true ) ; // Duplicate Slide
2022-05-17 21:25:25 +00:00
me . mnuDeleteSlide . setVisible ( value . isSlideSelect === true ) ;
me . mnuSlideHide . setVisible ( value . isSlideSelect === true ) ;
me . mnuSlideHide . setChecked ( value . isSlideHidden === true ) ;
2017-07-20 10:37:26 +00:00
me . slideMenu . items [ 5 ] . setVisible ( value . isSlideSelect === true || value . fromThumbs !== true ) ;
2022-05-17 21:25:25 +00:00
me . mnuChangeSlide . setVisible ( value . isSlideSelect === true || value . fromThumbs !== true ) ;
me . mnuResetSlide . setVisible ( value . isSlideSelect === true || value . fromThumbs !== true ) ;
2017-08-07 14:20:17 +00:00
mnuChangeTheme . setVisible ( value . isSlideSelect === true || value . fromThumbs !== true ) ;
2022-05-17 21:25:25 +00:00
me . menuSlideSettings . setVisible ( value . isSlideSelect === true || value . fromThumbs !== true ) ;
me . menuSlideSettings . options . value = null ;
2021-10-25 09:17:32 +00:00
me . slideMenu . items [ 13 ] . setVisible ( ( ! selectedLast || ! selectedFirst ) && value . isSlideSelect === true ) ;
2022-05-17 21:25:25 +00:00
me . mnuMoveSlideToEnd . setVisible ( ! selectedLast && value . isSlideSelect === true ) ;
me . mnuMoveSlideToStart . setVisible ( ! selectedFirst && value . isSlideSelect === true ) ;
2021-10-23 23:15:18 +00:00
me . slideMenu . items [ 16 ] . setVisible ( value . fromThumbs === true ) ;
me . slideMenu . items [ 17 ] . setVisible ( value . fromThumbs === true ) ;
2021-10-25 09:17:32 +00:00
2021-10-23 23:15:18 +00:00
for ( var i = 10 ; i < 13 ; i ++ ) {
2016-03-11 00:48:53 +00:00
me . slideMenu . items [ i ] . setVisible ( value . fromThumbs === true ) ;
}
2021-10-23 23:15:18 +00:00
2022-05-17 21:25:25 +00:00
me . mnuPrintSelection . setVisible ( me . mode . canPrint && value . fromThumbs === true ) ;
2016-03-11 00:48:53 +00:00
var selectedElements = me . api . getSelectedElements ( ) ,
locked = false ,
lockedDeleted = false ,
lockedLayout = false ;
if ( selectedElements && _ . isArray ( selectedElements ) ) {
_ . each ( selectedElements , function ( element , index ) {
2016-04-05 11:52:34 +00:00
if ( Asc . c _oAscTypeSelectElement . Slide == element . get _ObjectType ( ) ) {
2016-03-11 00:48:53 +00:00
var elValue = element . get _ObjectValue ( ) ;
locked = elValue . get _LockDelete ( ) ;
lockedDeleted = elValue . get _LockRemove ( ) ;
lockedLayout = elValue . get _LockLayout ( ) ;
2022-05-17 21:25:25 +00:00
me . menuSlideSettings . options . value = element ;
2018-01-09 13:59:20 +00:00
me . slideLayoutMenu . options . layout _index = elValue . get _LayoutIndex ( ) ;
2016-03-11 00:48:53 +00:00
return false ;
}
} ) ;
}
for ( var i = 0 ; i < 3 ; i ++ ) {
me . slideMenu . items [ i ] . setDisabled ( locked ) ;
}
2022-05-17 21:25:25 +00:00
me . mnuPreview . setDisabled ( me . slidesCount < 1 ) ;
me . mnuSelectAll . setDisabled ( me . slidesCount < 2 ) ;
me . mnuDeleteSlide . setDisabled ( lockedDeleted || locked ) ;
me . mnuChangeSlide . setDisabled ( lockedLayout || locked ) ;
me . mnuResetSlide . setDisabled ( lockedLayout || locked ) ;
2017-08-07 14:20:17 +00:00
mnuChangeTheme . setDisabled ( me . _state . themeLock || locked ) ;
2022-05-17 21:25:25 +00:00
me . mnuSlideHide . setDisabled ( lockedLayout || locked ) ;
me . mnuPrintSelection . setDisabled ( me . slidesCount < 1 ) ;
2016-03-11 00:48:53 +00:00
} ,
items : [
2022-05-17 12:29:01 +00:00
me . menuSlidePaste ,
2022-05-17 21:25:25 +00:00
me . mnuNewSlide ,
me . mnuDuplicateSlide ,
me . mnuDeleteSlide ,
me . mnuSlideHide ,
2016-03-11 00:48:53 +00:00
{ caption : '--' } ,
2022-05-17 21:25:25 +00:00
me . mnuChangeSlide ,
me . mnuResetSlide ,
2017-08-07 14:20:17 +00:00
mnuChangeTheme ,
2022-05-17 21:25:25 +00:00
me . menuSlideSettings ,
2016-03-11 00:48:53 +00:00
{ caption : '--' } ,
2022-05-17 21:25:25 +00:00
me . mnuSelectAll ,
me . mnuPrintSelection ,
2016-03-11 00:48:53 +00:00
{ caption : '--' } ,
2022-05-17 21:25:25 +00:00
me . mnuMoveSlideToStart ,
me . mnuMoveSlideToEnd ,
2021-10-23 23:15:18 +00:00
{ caption : '--' } ,
2022-05-17 21:25:25 +00:00
me . mnuPreview
2016-03-11 00:48:53 +00:00
]
2017-04-11 11:05:56 +00:00
} ) . on ( 'hide:after' , function ( menu , e , isFromInputControl ) {
2016-03-11 00:48:53 +00:00
if ( me . suppressEditComplete ) {
me . suppressEditComplete = false ;
return ;
}
2017-04-11 11:05:56 +00:00
if ( ! isFromInputControl ) me . fireEvent ( 'editcomplete' , me ) ;
2016-03-11 00:48:53 +00:00
me . currentMenu = null ;
} ) . on ( 'render:after' , function ( cmp ) {
me . slideLayoutMenu = new Common . UI . DataView ( {
el : $ ( '#id-docholder-menu-changeslide' ) ,
2022-05-17 21:25:25 +00:00
parentMenu : me . mnuChangeSlide . menu ,
2016-03-11 00:48:53 +00:00
style : 'max-height: 300px;' ,
2019-06-04 08:38:44 +00:00
restoreWidth : 302 ,
2016-03-11 00:48:53 +00:00
store : PE . getCollection ( 'SlideLayouts' ) ,
itemTemplate : _ . template ( [
'<div class="layout" id="<%= id %>" style="width: <%= itemWidth %>px;">' ,
2021-04-15 12:46:28 +00:00
'<div style="background-image: url(<%= imageUrl %>); width: <%= itemWidth %>px; height: <%= itemHeight %>px;background-size: contain;"></div>' ,
2016-03-11 00:48:53 +00:00
'<div class="title"><%= title %></div> ' ,
'</div>'
] . join ( '' ) )
} ) . on ( 'item:click' , function ( picker , item , record , e ) {
2022-05-17 21:25:25 +00:00
if ( e . type !== 'click' )
me . slideMenu . hide ( ) ;
me . fireEvent ( 'layout:change' , [ record ] ) ;
2016-03-11 00:48:53 +00:00
} ) ;
if ( me . slideMenu ) {
2022-05-17 21:25:25 +00:00
me . mnuChangeSlide . menu . on ( 'show:after' , function ( menu ) {
2016-03-11 00:48:53 +00:00
me . onSlidePickerShowAfter ( me . slideLayoutMenu ) ;
me . slideLayoutMenu . scroller . update ( { alwaysVisibleY : true } ) ;
2018-01-09 13:59:20 +00:00
var record = me . slideLayoutMenu . store . findLayoutByIndex ( me . slideLayoutMenu . options . layout _index ) ;
if ( record ) {
me . slideLayoutMenu . selectRecord ( record , true ) ;
me . slideLayoutMenu . scrollToRecord ( record ) ;
}
2016-03-11 00:48:53 +00:00
} ) ;
}
me . slideLayoutMenu . _needRecalcSlideLayout = true ;
me . listenTo ( PE . getCollection ( 'SlideLayouts' ) , 'reset' , function ( ) {
me . slideLayoutMenu . _needRecalcSlideLayout = true ;
} ) ;
2017-08-07 14:20:17 +00:00
me . slideThemeMenu = new Common . UI . DataView ( {
el : $ ( '#id-docholder-menu-changetheme' ) ,
parentMenu : mnuChangeTheme . menu ,
2017-09-15 10:31:59 +00:00
// restoreHeight: 300,
2017-08-07 14:20:17 +00:00
style : 'max-height: 300px;' ,
store : PE . getCollection ( 'SlideThemes' ) ,
itemTemplate : _ . template ( [
2019-07-23 09:58:51 +00:00
'<div class="style" id="<%= id %>"">' ,
2020-06-05 13:10:48 +00:00
'<div class="item-theme" style="' + '<% if (typeof imageUrl !== "undefined") { %>' + 'background-image: url(<%= imageUrl %>);' + '<% } %> background-position: 0 -<%= offsety %>px;"></div>' ,
2017-08-07 14:20:17 +00:00
'</div>'
] . join ( '' ) )
} ) . on ( 'item:click' , function ( picker , item , record , e ) {
2022-05-17 21:25:25 +00:00
if ( e . type !== 'click' )
me . slideMenu . hide ( ) ;
me . fireEvent ( 'theme:change' , [ record ] ) ;
2017-08-07 14:20:17 +00:00
} ) ;
if ( me . slideMenu ) {
mnuChangeTheme . menu . on ( 'show:after' , function ( menu ) {
var record = me . slideThemeMenu . store . findWhere ( { themeId : me . _state . themeId } ) ;
me . slideThemeMenu . selectRecord ( record , true ) ;
me . slideThemeMenu . scroller . update ( { alwaysVisibleY : true } ) ;
me . slideThemeMenu . scroller . scrollTop ( 0 ) ;
} ) ;
}
2016-03-11 00:48:53 +00:00
} ) ;
2022-05-17 21:25:25 +00:00
me . mnuTableMerge = new Common . UI . MenuItem ( {
2021-04-01 21:02:05 +00:00
iconCls : 'menu__icon btn-merge-cells' ,
2016-03-11 00:48:53 +00:00
caption : me . mergeCellsText
} ) ;
2022-05-17 21:25:25 +00:00
me . mnuTableSplit = new Common . UI . MenuItem ( {
2016-03-11 00:48:53 +00:00
caption : me . splitCellsText
} ) ;
2022-05-17 21:25:25 +00:00
me . menuTableCellAlign = new Common . UI . MenuItem ( {
2020-08-20 18:03:07 +00:00
iconCls : 'menu__icon btn-align-top' ,
2022-05-17 21:25:25 +00:00
caption : me . cellAlignText ,
menu : new Common . UI . Menu ( {
cls : 'shifted-right' ,
menuAlign : 'tl-tr' ,
items : [
me . menuTableCellTop = new Common . UI . MenuItem ( {
iconCls : 'menu__icon btn-align-top' ,
caption : me . textShapeAlignTop ,
checkable : true ,
checkmark : false ,
toggleGroup : 'popuptablecellalign' ,
value : Asc . c _oAscVertAlignJc . Top
} ) ,
me . menuTableCellCenter = new Common . UI . MenuItem ( {
iconCls : 'menu__icon btn-align-middle' ,
caption : me . textShapeAlignMiddle ,
checkable : true ,
checkmark : false ,
toggleGroup : 'popuptablecellalign' ,
value : Asc . c _oAscVertAlignJc . Center
} ) ,
me . menuTableCellBottom = new Common . UI . MenuItem ( {
iconCls : 'menu__icon btn-align-bottom' ,
caption : me . textShapeAlignBottom ,
checkable : true ,
checkmark : false ,
toggleGroup : 'popuptablecellalign' ,
value : Asc . c _oAscVertAlignJc . Bottom
} )
]
} )
} ) ;
2016-03-11 00:48:53 +00:00
2022-05-17 21:25:25 +00:00
me . menuTableDistRows = new Common . UI . MenuItem ( {
2018-02-06 12:06:01 +00:00
caption : me . textDistributeRows
2022-05-17 21:25:25 +00:00
} ) ;
2018-02-06 12:06:01 +00:00
2022-05-17 21:25:25 +00:00
me . menuTableDistCols = new Common . UI . MenuItem ( {
2018-02-06 12:06:01 +00:00
caption : me . textDistributeCols
2022-05-17 21:25:25 +00:00
} ) ;
2018-02-06 12:06:01 +00:00
2022-05-17 21:53:02 +00:00
me . menuTableSelectText = new Common . UI . MenuItem ( {
caption : me . selectText ,
menu : new Common . UI . Menu ( {
cls : 'shifted-right' ,
menuAlign : 'tl-tr' ,
items : [
new Common . UI . MenuItem ( {
caption : me . rowText ,
value : 0
} ) ,
new Common . UI . MenuItem ( {
caption : me . columnText ,
value : 1
} ) ,
new Common . UI . MenuItem ( {
caption : me . cellText ,
value : 2
} ) ,
new Common . UI . MenuItem ( {
caption : me . tableText ,
value : 3
} )
]
} )
} ) ;
me . menuTableInsertText = new Common . UI . MenuItem ( {
iconCls : 'menu__icon btn-addcell' ,
caption : me . insertText ,
menu : new Common . UI . Menu ( {
cls : 'shifted-right' ,
menuAlign : 'tl-tr' ,
style : 'width: 100px' ,
items : [
new Common . UI . MenuItem ( {
caption : me . insertColumnLeftText ,
value : 0
} ) ,
new Common . UI . MenuItem ( {
caption : me . insertColumnRightText ,
value : 1
} ) ,
new Common . UI . MenuItem ( {
caption : me . insertRowAboveText ,
value : 2
} ) ,
new Common . UI . MenuItem ( {
caption : me . insertRowBelowText ,
value : 3
} )
]
} )
} ) ;
me . menuTableDeleteText = new Common . UI . MenuItem ( {
iconCls : 'menu__icon btn-delcell' ,
caption : me . deleteText ,
menu : new Common . UI . Menu ( {
cls : 'shifted-right' ,
menuAlign : 'tl-tr' ,
items : [
new Common . UI . MenuItem ( {
caption : me . rowText ,
value : 0
} ) ,
new Common . UI . MenuItem ( {
caption : me . columnText ,
value : 1
} ) ,
new Common . UI . MenuItem ( {
caption : me . tableText ,
value : 2
} )
]
} )
} ) ;
2017-04-26 09:26:02 +00:00
me . menuSpellTable = new Common . UI . MenuItem ( {
caption : me . loadSpellText ,
disabled : true
} ) ;
me . menuSpellMoreTable = new Common . UI . MenuItem ( {
caption : me . moreText ,
menu : new Common . UI . Menu ( {
2020-08-20 13:55:06 +00:00
cls : 'shifted-right' ,
2017-04-26 09:26:02 +00:00
menuAlign : 'tl-tr' ,
2019-06-21 07:46:00 +00:00
restoreHeight : true ,
2019-07-11 11:35:24 +00:00
items : [ ]
2017-04-26 09:26:02 +00:00
} )
} ) ;
2019-08-10 14:40:57 +00:00
var langTemplate = _ . template ( [
'<a id="<%= id %>" tabindex="-1" type="menuitem" style="padding-left: 28px !important;" langval="<%= value %>" class="<% if (checked) { %> checked <% } %>">' ,
2019-12-10 13:49:35 +00:00
'<i class="icon <% if (spellcheck) { %> toolbar__icon btn-ic-docspell spellcheck-lang <% } %>"></i>' ,
2019-08-10 14:40:57 +00:00
'<%= caption %>' ,
'</a>'
] . join ( '' ) ) ;
2017-04-26 09:26:02 +00:00
me . langTableMenu = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-ic-doclang' ,
2017-04-26 09:26:02 +00:00
caption : me . langText ,
2019-08-10 14:40:57 +00:00
menu : new Common . UI . MenuSimple ( {
2019-01-28 13:51:07 +00:00
cls : 'lang-menu' ,
2017-04-26 09:26:02 +00:00
menuAlign : 'tl-tr' ,
2019-08-07 10:06:36 +00:00
restoreHeight : 285 ,
2019-07-11 11:35:24 +00:00
items : [ ] ,
2019-08-10 14:40:57 +00:00
itemTemplate : langTemplate ,
2019-07-11 11:35:24 +00:00
search : true
2017-04-26 09:26:02 +00:00
} )
} ) ;
2022-05-17 21:25:25 +00:00
me . menuIgnoreSpellTable = new Common . UI . MenuItem ( {
caption : me . ignoreSpellText ,
value : false
2017-04-26 09:26:02 +00:00
} ) ;
2022-05-17 21:25:25 +00:00
me . menuIgnoreAllSpellTable = new Common . UI . MenuItem ( {
caption : me . ignoreAllSpellText ,
value : true
2017-04-26 09:26:02 +00:00
} ) ;
2022-05-17 21:25:25 +00:00
me . menuToDictionaryTable = new Common . UI . MenuItem ( {
2019-08-05 08:59:52 +00:00
caption : me . toDictionaryText
} ) ;
2017-04-26 09:26:02 +00:00
var menuIgnoreSpellTableSeparator = new Common . UI . MenuItem ( {
caption : '--'
} ) ;
var menuSpellcheckTableSeparator = new Common . UI . MenuItem ( {
caption : '--'
} ) ;
me . menuSpellCheckTable = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-ic-docspell' ,
2017-04-26 09:26:02 +00:00
caption : me . spellcheckText ,
menu : new Common . UI . Menu ( {
2020-08-20 13:55:06 +00:00
cls : 'shifted-right' ,
2017-04-26 09:26:02 +00:00
menuAlign : 'tl-tr' ,
items : [
me . menuSpellTable ,
me . menuSpellMoreTable ,
menuIgnoreSpellTableSeparator ,
2022-05-17 21:25:25 +00:00
me . menuIgnoreSpellTable ,
me . menuIgnoreAllSpellTable ,
me . menuToDictionaryTable ,
2017-04-26 09:26:02 +00:00
{ caption : '--' } ,
me . langTableMenu
]
} )
} ) ;
me . menuSpellPara = new Common . UI . MenuItem ( {
caption : me . loadSpellText ,
disabled : true
} ) ;
me . menuSpellMorePara = new Common . UI . MenuItem ( {
caption : me . moreText ,
menu : new Common . UI . Menu ( {
2020-08-20 13:55:06 +00:00
cls : 'shifted-right' ,
2017-04-26 09:26:02 +00:00
menuAlign : 'tl-tr' ,
2019-06-21 07:46:00 +00:00
restoreHeight : true ,
2019-07-11 11:35:24 +00:00
items : [ ]
2017-04-26 09:26:02 +00:00
} )
} ) ;
me . langParaMenu = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-ic-doclang' ,
2017-04-26 09:26:02 +00:00
caption : me . langText ,
2019-08-10 14:40:57 +00:00
menu : new Common . UI . MenuSimple ( {
2019-01-28 13:51:07 +00:00
cls : 'lang-menu' ,
2017-04-26 09:26:02 +00:00
menuAlign : 'tl-tr' ,
2019-08-07 10:06:36 +00:00
restoreHeight : 285 ,
2019-07-11 11:35:24 +00:00
items : [ ] ,
2019-08-10 14:40:57 +00:00
itemTemplate : langTemplate ,
2019-07-11 11:35:24 +00:00
search : true
2017-04-26 09:26:02 +00:00
} )
} ) ;
2022-05-17 21:25:25 +00:00
me . menuIgnoreSpellPara = new Common . UI . MenuItem ( {
caption : me . ignoreSpellText ,
value : false
2017-04-26 09:26:02 +00:00
} ) ;
2022-05-17 21:25:25 +00:00
me . menuIgnoreAllSpellPara = new Common . UI . MenuItem ( {
caption : me . ignoreAllSpellText ,
value : true
2017-04-26 09:26:02 +00:00
} ) ;
2022-05-17 21:25:25 +00:00
me . menuToDictionaryPara = new Common . UI . MenuItem ( {
2019-08-05 08:59:52 +00:00
caption : me . toDictionaryText
} ) ;
2017-04-26 09:26:02 +00:00
var menuIgnoreSpellParaSeparator = new Common . UI . MenuItem ( {
caption : '--'
} ) ;
var menuSpellcheckParaSeparator = new Common . UI . MenuItem ( {
caption : '--'
} ) ;
2022-05-17 21:25:25 +00:00
me . menuTableAdvanced = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-menu-table' ,
2016-03-11 00:48:53 +00:00
caption : me . advancedTableText
} ) ;
2022-05-17 21:25:25 +00:00
me . menuImageAdvanced = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-menu-image' ,
2016-03-11 00:48:53 +00:00
caption : me . advancedImageText
} ) ;
2022-05-17 21:25:25 +00:00
me . menuShapeAdvanced = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-menu-shape' ,
2016-03-11 00:48:53 +00:00
caption : me . advancedShapeText
} ) ;
2022-05-17 21:25:25 +00:00
me . menuParagraphAdvanced = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-paragraph' ,
2016-03-11 00:48:53 +00:00
caption : me . advancedParagraphText
} ) ;
2022-07-21 20:18:22 +00:00
me . menuChartAdvanced = new Common . UI . MenuItem ( {
iconCls : 'menu__icon btn-menu-chart' ,
caption : me . advancedChartText
} ) ;
2016-03-11 00:48:53 +00:00
var menuCommentParaSeparator = new Common . UI . MenuItem ( {
caption : '--'
} ) ;
2022-05-17 12:29:01 +00:00
me . menuAddHyperlinkPara = new Common . UI . MenuItem ( {
2020-08-25 12:34:03 +00:00
iconCls : 'menu__icon btn-inserthyperlink' ,
2016-03-11 00:48:53 +00:00
caption : me . hyperlinkText
2022-05-17 12:29:01 +00:00
} ) ;
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
me . menuEditHyperlinkPara = new Common . UI . MenuItem ( {
2016-03-11 00:48:53 +00:00
caption : me . editHyperlinkText
2022-05-17 12:29:01 +00:00
} ) ;
2016-03-11 00:48:53 +00:00
2022-05-17 21:25:25 +00:00
me . menuRemoveHyperlinkPara = new Common . UI . MenuItem ( {
2016-03-11 00:48:53 +00:00
caption : me . removeHyperlinkText
} ) ;
var menuHyperlinkPara = new Common . UI . MenuItem ( {
2020-08-25 12:34:03 +00:00
iconCls : 'menu__icon btn-inserthyperlink' ,
2016-03-11 00:48:53 +00:00
caption : me . hyperlinkText ,
menu : new Common . UI . Menu ( {
2020-08-20 13:55:06 +00:00
cls : 'shifted-right' ,
2016-03-11 00:48:53 +00:00
menuAlign : 'tl-tr' ,
items : [
2022-05-17 12:29:01 +00:00
me . menuEditHyperlinkPara ,
2022-05-17 21:25:25 +00:00
me . menuRemoveHyperlinkPara
2016-03-11 00:48:53 +00:00
]
} )
} ) ;
2022-05-17 12:29:01 +00:00
me . menuAddHyperlinkTable = new Common . UI . MenuItem ( {
2020-08-25 12:34:03 +00:00
iconCls : 'menu__icon btn-inserthyperlink' ,
2016-03-11 00:48:53 +00:00
caption : me . hyperlinkText
2022-05-17 12:29:01 +00:00
} ) ;
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
me . menuEditHyperlinkTable = new Common . UI . MenuItem ( {
2016-03-11 00:48:53 +00:00
caption : me . editHyperlinkText
2022-05-17 12:29:01 +00:00
} ) ;
2016-03-11 00:48:53 +00:00
2022-05-17 21:25:25 +00:00
me . menuRemoveHyperlinkTable = new Common . UI . MenuItem ( {
2016-03-11 00:48:53 +00:00
caption : me . removeHyperlinkText
} ) ;
var menuHyperlinkTable = new Common . UI . MenuItem ( {
2020-08-25 12:34:03 +00:00
iconCls : 'menu__icon btn-inserthyperlink' ,
2016-03-11 00:48:53 +00:00
caption : me . hyperlinkText ,
menu : new Common . UI . Menu ( {
2020-08-20 13:55:06 +00:00
cls : 'shifted-right' ,
2016-03-11 00:48:53 +00:00
menuAlign : 'tl-tr' ,
items : [
2022-05-17 12:29:01 +00:00
me . menuEditHyperlinkTable ,
2022-05-17 21:25:25 +00:00
me . menuRemoveHyperlinkTable
2016-03-11 00:48:53 +00:00
]
} )
} ) ;
var menuHyperlinkSeparator = new Common . UI . MenuItem ( {
caption : '--'
} ) ;
2022-05-17 21:25:25 +00:00
me . mnuGroupImg = new Common . UI . MenuItem ( {
2016-03-11 00:48:53 +00:00
caption : this . txtGroup ,
2019-12-17 14:28:05 +00:00
iconCls : 'menu__icon shape-group'
2016-03-11 00:48:53 +00:00
} ) ;
2022-05-17 21:25:25 +00:00
me . mnuUnGroupImg = new Common . UI . MenuItem ( {
2016-03-11 00:48:53 +00:00
caption : this . txtUngroup ,
2019-12-17 14:28:05 +00:00
iconCls : 'menu__icon shape-ungroup'
2016-03-11 00:48:53 +00:00
} ) ;
2022-05-17 21:25:25 +00:00
me . mnuArrangeFront = new Common . UI . MenuItem ( {
2021-11-09 18:22:00 +00:00
caption : this . textArrangeFront ,
iconCls : 'menu__icon arrange-front'
} ) ;
2022-05-17 21:25:25 +00:00
me . mnuArrangeBack = new Common . UI . MenuItem ( {
2021-11-09 18:22:00 +00:00
caption : this . textArrangeBack ,
iconCls : 'menu__icon arrange-back'
} ) ;
2022-05-17 21:25:25 +00:00
me . mnuArrangeForward = new Common . UI . MenuItem ( {
2021-11-09 18:22:00 +00:00
caption : this . textArrangeForward ,
iconCls : 'menu__icon arrange-forward'
} ) ;
2022-05-17 21:25:25 +00:00
me . mnuArrangeBackward = new Common . UI . MenuItem ( {
2021-11-09 18:22:00 +00:00
caption : this . textArrangeBackward ,
iconCls : 'menu__icon arrange-backward'
} ) ;
2016-03-11 00:48:53 +00:00
var menuImgShapeArrange = new Common . UI . MenuItem ( {
caption : me . txtArrange ,
menu : new Common . UI . Menu ( {
2020-08-20 13:55:06 +00:00
cls : 'shifted-right' ,
2016-03-11 00:48:53 +00:00
menuAlign : 'tl-tr' ,
items : [
2022-05-17 21:25:25 +00:00
me . mnuArrangeFront ,
me . mnuArrangeBack ,
me . mnuArrangeForward ,
me . mnuArrangeBackward ,
2016-03-11 00:48:53 +00:00
{ caption : '--' } ,
2022-05-17 21:25:25 +00:00
me . mnuGroupImg ,
me . mnuUnGroupImg
2016-03-11 00:48:53 +00:00
]
} )
} ) ;
2022-05-17 21:25:25 +00:00
me . menuImgShapeAlign = new Common . UI . MenuItem ( {
2016-03-11 00:48:53 +00:00
caption : me . txtAlign ,
2022-05-17 21:25:25 +00:00
menu : new Common . UI . Menu ( {
cls : 'shifted-right' ,
menuAlign : 'tl-tr' ,
items : [
new Common . UI . MenuItem ( {
caption : me . textShapeAlignLeft ,
iconCls : 'menu__icon shape-align-left' ,
value : Asc . c _oAscAlignShapeType . ALIGN _LEFT
} ) ,
new Common . UI . MenuItem ( {
caption : me . textShapeAlignCenter ,
iconCls : 'menu__icon shape-align-center' ,
value : Asc . c _oAscAlignShapeType . ALIGN _CENTER
} ) ,
new Common . UI . MenuItem ( {
caption : me . textShapeAlignRight ,
iconCls : 'menu__icon shape-align-right' ,
value : Asc . c _oAscAlignShapeType . ALIGN _RIGHT
} ) ,
new Common . UI . MenuItem ( {
caption : me . textShapeAlignTop ,
iconCls : 'menu__icon shape-align-top' ,
value : Asc . c _oAscAlignShapeType . ALIGN _TOP
} ) ,
new Common . UI . MenuItem ( {
caption : me . textShapeAlignMiddle ,
iconCls : 'menu__icon shape-align-middle' ,
value : Asc . c _oAscAlignShapeType . ALIGN _MIDDLE
} ) ,
new Common . UI . MenuItem ( {
caption : me . textShapeAlignBottom ,
iconCls : 'menu__icon shape-align-bottom' ,
value : Asc . c _oAscAlignShapeType . ALIGN _BOTTOM
} ) ,
{ caption : '--' } ,
new Common . UI . MenuItem ( {
caption : me . txtDistribHor ,
iconCls : 'menu__icon shape-distribute-hor' ,
value : 6
} ) ,
new Common . UI . MenuItem ( {
caption : me . txtDistribVert ,
iconCls : 'menu__icon shape-distribute-vert' ,
value : 7
} )
]
} )
2016-03-11 00:48:53 +00:00
} ) ;
2022-05-17 12:29:01 +00:00
me . menuChartEdit = new Common . UI . MenuItem ( {
2016-03-11 00:48:53 +00:00
caption : me . editChartText
2022-05-17 12:29:01 +00:00
} ) ;
2016-03-11 00:48:53 +00:00
2022-05-17 21:25:25 +00:00
me . menuParagraphVAlign = new Common . UI . MenuItem ( {
2020-08-20 18:03:07 +00:00
iconCls : 'menu__icon btn-align-top' ,
2016-03-11 00:48:53 +00:00
caption : me . vertAlignText ,
2022-05-17 21:25:25 +00:00
menu : new Common . UI . Menu ( {
cls : 'shifted-right' ,
menuAlign : 'tl-tr' ,
items : [
me . menuParagraphTop = new Common . UI . MenuItem ( {
iconCls : 'menu__icon btn-align-top' ,
caption : me . textShapeAlignTop ,
checkable : true ,
checkmark : false ,
toggleGroup : 'popupparagraphvalign' ,
value : Asc . c _oAscVAlign . Top
} ) ,
me . menuParagraphCenter = new Common . UI . MenuItem ( {
iconCls : 'menu__icon btn-align-middle' ,
caption : me . textShapeAlignMiddle ,
checkable : true ,
checkmark : false ,
toggleGroup : 'popupparagraphvalign' ,
value : Asc . c _oAscVAlign . Center
} ) ,
me . menuParagraphBottom = new Common . UI . MenuItem ( {
iconCls : 'menu__icon btn-align-bottom' ,
caption : me . textShapeAlignBottom ,
checkable : true ,
checkmark : false ,
toggleGroup : 'popupparagraphvalign' ,
value : Asc . c _oAscVAlign . Bottom
} )
]
} )
} ) ;
2016-03-11 00:48:53 +00:00
2022-05-17 21:25:25 +00:00
me . menuParagraphDirection = new Common . UI . MenuItem ( {
2020-08-20 18:03:07 +00:00
iconCls : 'menu__icon text-orient-hor' ,
2016-03-11 00:48:53 +00:00
caption : me . directionText ,
menu : new Common . UI . Menu ( {
2020-08-20 13:55:06 +00:00
cls : 'shifted-right' ,
2016-03-11 00:48:53 +00:00
menuAlign : 'tl-tr' ,
items : [
me . menuParagraphDirectH = new Common . UI . MenuItem ( {
caption : me . directHText ,
2019-11-21 16:10:02 +00:00
iconCls : 'menu__icon text-orient-hor' ,
2016-03-11 00:48:53 +00:00
checkable : true ,
2019-11-21 16:10:02 +00:00
checkmark : false ,
2016-03-11 00:48:53 +00:00
checked : false ,
toggleGroup : 'popupparagraphdirect' ,
2016-04-05 11:52:34 +00:00
direction : Asc . c _oAscVertDrawingText . normal
2022-05-17 21:25:25 +00:00
} ) ,
2016-03-11 00:48:53 +00:00
me . menuParagraphDirect90 = new Common . UI . MenuItem ( {
caption : me . direct90Text ,
2019-11-21 16:10:02 +00:00
iconCls : 'menu__icon text-orient-rdown' ,
2016-03-11 00:48:53 +00:00
checkable : true ,
2019-11-21 16:10:02 +00:00
checkmark : false ,
2016-03-11 00:48:53 +00:00
checked : false ,
toggleGroup : 'popupparagraphdirect' ,
2016-04-05 11:52:34 +00:00
direction : Asc . c _oAscVertDrawingText . vert
2022-05-17 21:25:25 +00:00
} ) ,
2016-03-11 00:48:53 +00:00
me . menuParagraphDirect270 = new Common . UI . MenuItem ( {
caption : me . direct270Text ,
2019-11-21 16:10:02 +00:00
iconCls : 'menu__icon text-orient-rup' ,
2016-03-11 00:48:53 +00:00
checkable : true ,
2019-11-21 16:10:02 +00:00
checkmark : false ,
2016-03-11 00:48:53 +00:00
checked : false ,
toggleGroup : 'popupparagraphdirect' ,
2016-04-05 11:52:34 +00:00
direction : Asc . c _oAscVertDrawingText . vert270
2022-05-17 21:25:25 +00:00
} )
2016-03-11 00:48:53 +00:00
]
} )
} ) ;
var menuImgShapeSeparator = new Common . UI . MenuItem ( {
caption : '--'
} ) ;
2022-05-17 21:25:25 +00:00
me . menuImgOriginalSize = new Common . UI . MenuItem ( {
2016-03-11 00:48:53 +00:00
caption : me . originalSizeText
} ) ;
2022-05-17 12:29:01 +00:00
me . menuImgReplace = new Common . UI . MenuItem ( {
2018-04-11 13:46:44 +00:00
caption : me . textReplace ,
menu : new Common . UI . Menu ( {
2020-08-20 13:55:06 +00:00
cls : 'shifted-right' ,
2018-04-11 13:46:44 +00:00
menuAlign : 'tl-tr' ,
items : [
new Common . UI . MenuItem ( {
2022-05-17 12:29:01 +00:00
caption : this . textFromFile ,
value : 0
2018-04-11 13:46:44 +00:00
} ) ,
new Common . UI . MenuItem ( {
2022-05-17 12:29:01 +00:00
caption : this . textFromUrl ,
value : 1
} ) ,
2020-05-13 14:43:45 +00:00
new Common . UI . MenuItem ( {
2022-05-17 12:29:01 +00:00
caption : this . textFromStorage ,
value : 2
2020-05-13 14:43:45 +00:00
} )
2018-04-11 13:46:44 +00:00
]
} )
} ) ;
2022-05-17 21:25:25 +00:00
me . menuImgShapeRotate = new Common . UI . MenuItem ( {
2019-02-26 16:36:02 +00:00
caption : me . textRotate ,
menu : new Common . UI . Menu ( {
2020-08-20 13:55:06 +00:00
cls : 'shifted-right' ,
2019-02-26 16:36:02 +00:00
menuAlign : 'tl-tr' ,
items : [
new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-rotate-90' ,
2019-02-26 16:36:02 +00:00
caption : me . textRotate90 ,
value : 1
2022-05-17 21:25:25 +00:00
} ) ,
2019-02-27 10:11:28 +00:00
new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-rotate-270' ,
2019-02-27 10:11:28 +00:00
caption : me . textRotate270 ,
value : 0
2022-05-17 21:25:25 +00:00
} ) ,
2019-02-27 11:51:52 +00:00
{ caption : '--' } ,
2019-02-26 16:36:02 +00:00
new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-flip-hor' ,
2019-02-26 16:36:02 +00:00
caption : me . textFlipH ,
value : 1
2022-05-17 21:25:25 +00:00
} ) ,
2019-02-26 16:36:02 +00:00
new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-flip-vert' ,
2019-02-26 16:36:02 +00:00
caption : me . textFlipV ,
value : 0
2022-05-17 21:25:25 +00:00
} )
2019-02-26 16:36:02 +00:00
]
} )
} ) ;
2019-04-09 11:29:51 +00:00
me . menuImgCrop = new Common . UI . MenuItem ( {
caption : me . textCrop ,
menu : new Common . UI . Menu ( {
2020-08-20 13:55:06 +00:00
cls : 'shifted-right' ,
2019-04-09 11:29:51 +00:00
menuAlign : 'tl-tr' ,
items : [
new Common . UI . MenuItem ( {
caption : me . textCrop ,
checkable : true ,
allowDepress : true ,
value : 0
2022-05-17 21:25:25 +00:00
} ) ,
2019-04-09 11:29:51 +00:00
new Common . UI . MenuItem ( {
caption : me . textCropFill ,
value : 1
2022-05-17 21:25:25 +00:00
} ) ,
2019-04-09 11:29:51 +00:00
new Common . UI . MenuItem ( {
caption : me . textCropFit ,
value : 2
2022-05-17 21:25:25 +00:00
} )
2019-04-09 11:29:51 +00:00
]
} )
} ) ;
2016-03-11 00:48:53 +00:00
/** coauthoring begin **/
2022-05-17 12:29:01 +00:00
me . menuAddCommentPara = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-menu-comments' ,
2016-03-11 00:48:53 +00:00
caption : me . addCommentText
2022-05-17 12:29:01 +00:00
} ) ;
me . menuAddCommentPara . hide ( ) ;
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
me . menuAddCommentTable = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-menu-comments' ,
2016-03-11 00:48:53 +00:00
caption : me . addCommentText
2022-05-17 12:29:01 +00:00
} ) ;
me . menuAddCommentTable . hide ( ) ;
2016-03-11 00:48:53 +00:00
var menuCommentSeparatorImg = new Common . UI . MenuItem ( {
caption : '--'
} ) ;
menuCommentSeparatorImg . hide ( ) ;
2022-05-17 12:29:01 +00:00
me . menuAddCommentImg = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-menu-comments' ,
2016-03-11 00:48:53 +00:00
caption : me . addCommentText
2022-05-17 12:29:01 +00:00
} ) ;
me . menuAddCommentImg . hide ( ) ;
2016-03-11 00:48:53 +00:00
/** coauthoring end **/
2022-05-17 12:29:01 +00:00
me . menuAddToLayoutImg = new Common . UI . MenuItem ( {
2019-10-30 07:17:33 +00:00
caption : me . addToLayoutText
2022-05-17 12:29:01 +00:00
} ) ;
2019-10-30 07:17:33 +00:00
2022-05-17 12:29:01 +00:00
me . menuParaCopy = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-copy' ,
2016-03-11 00:48:53 +00:00
caption : me . textCopy ,
value : 'copy'
2022-05-17 12:29:01 +00:00
} ) ;
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
me . menuParaPaste = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-paste' ,
2016-03-11 00:48:53 +00:00
caption : me . textPaste ,
value : 'paste'
2022-05-17 12:29:01 +00:00
} ) ;
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
me . menuParaCut = new Common . UI . MenuItem ( {
2020-08-25 12:34:03 +00:00
iconCls : 'menu__icon btn-cut' ,
2016-03-11 00:48:53 +00:00
caption : me . textCut ,
value : 'cut'
2022-05-17 12:29:01 +00:00
} ) ;
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
me . menuImgCopy = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-copy' ,
2016-03-11 00:48:53 +00:00
caption : me . textCopy ,
value : 'copy'
2022-05-17 12:29:01 +00:00
} ) ;
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
me . menuImgPaste = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-paste' ,
2016-03-11 00:48:53 +00:00
caption : me . textPaste ,
value : 'paste'
2022-05-17 12:29:01 +00:00
} ) ;
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
me . menuImgCut = new Common . UI . MenuItem ( {
2020-08-25 12:34:03 +00:00
iconCls : 'menu__icon btn-cut' ,
2016-03-11 00:48:53 +00:00
caption : me . textCut ,
value : 'cut'
2022-05-17 12:29:01 +00:00
} ) ;
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
me . menuTableCopy = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-copy' ,
2016-03-11 00:48:53 +00:00
caption : me . textCopy ,
value : 'copy'
2022-05-17 12:29:01 +00:00
} ) ;
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
me . menuTablePaste = new Common . UI . MenuItem ( {
2020-08-20 13:55:06 +00:00
iconCls : 'menu__icon btn-paste' ,
2016-03-11 00:48:53 +00:00
caption : me . textPaste ,
value : 'paste'
2022-05-17 12:29:01 +00:00
} ) ;
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
me . menuTableCut = new Common . UI . MenuItem ( {
2020-08-25 12:34:03 +00:00
iconCls : 'menu__icon btn-cut' ,
2016-03-11 00:48:53 +00:00
caption : me . textCut ,
value : 'cut'
2022-05-17 12:29:01 +00:00
} ) ;
2016-03-11 00:48:53 +00:00
2016-10-25 10:48:31 +00:00
var menuEquationSeparator = new Common . UI . MenuItem ( {
caption : '--'
} ) ;
var menuEquationSeparatorInTable = new Common . UI . MenuItem ( {
caption : '--'
} ) ;
2022-05-17 12:29:01 +00:00
me . menuAddToLayoutTable = new Common . UI . MenuItem ( {
2019-10-30 07:17:33 +00:00
caption : me . addToLayoutText
2022-05-17 12:29:01 +00:00
} ) ;
2019-10-30 07:17:33 +00:00
2022-05-17 21:25:25 +00:00
me . menuImgEditPoints = new Common . UI . MenuItem ( {
2021-09-21 10:34:31 +00:00
caption : me . textEditPoints
} ) ;
var menuImgEditPointsSeparator = new Common . UI . MenuItem ( {
caption : '--'
} ) ;
2016-03-11 00:48:53 +00:00
me . textMenu = new Common . UI . Menu ( {
2020-08-20 13:55:06 +00:00
cls : 'shifted-right' ,
2016-03-11 00:48:53 +00:00
initMenu : function ( value ) {
var isInShape = ( value . shapeProps && ! _ . isNull ( value . shapeProps . value ) ) ;
var isInChart = ( value . chartProps && ! _ . isNull ( value . chartProps . value ) ) ;
var disabled = ( value . paraProps !== undefined && value . paraProps . locked ) ||
( value . slideProps !== undefined && value . slideProps . locked ) ||
( isInShape && value . shapeProps . locked ) ;
2016-10-25 10:48:31 +00:00
var isEquation = ( value . mathProps && value . mathProps . value ) ;
me . _currentParaObjDisabled = disabled ;
2016-03-11 00:48:53 +00:00
2022-05-17 21:25:25 +00:00
me . menuParagraphVAlign . setVisible ( isInShape && ! isInChart && ! isEquation ) ; // после того, как заголовок можно будет растягивать по вертикали, вернуть "|| isInChart" !!
me . menuParagraphDirection . setVisible ( isInShape && ! isInChart && ! isEquation ) ; // после того, как заголовок можно будет растягивать по вертикали, вернуть "|| isInChart" !!
2016-03-11 00:48:53 +00:00
if ( isInShape || isInChart ) {
var align = value . shapeProps . value . get _VerticalTextAlign ( ) ;
2020-08-20 18:03:07 +00:00
var cls = '' ;
switch ( align ) {
case Asc . c _oAscVAlign . Top :
cls = 'menu__icon btn-align-top' ;
break ;
case Asc . c _oAscVAlign . Center :
cls = 'menu__icon btn-align-middle' ;
break ;
case Asc . c _oAscVAlign . Bottom :
cls = 'menu__icon btn-align-bottom' ;
break ;
}
2022-05-17 21:25:25 +00:00
me . menuParagraphVAlign . setIconCls ( cls ) ;
2016-11-10 11:24:18 +00:00
me . menuParagraphTop . setChecked ( align == Asc . c _oAscVAlign . Top ) ;
me . menuParagraphCenter . setChecked ( align == Asc . c _oAscVAlign . Center ) ;
me . menuParagraphBottom . setChecked ( align == Asc . c _oAscVAlign . Bottom ) ;
2016-03-11 00:48:53 +00:00
var dir = value . shapeProps . value . get _Vert ( ) ;
2020-08-20 18:03:07 +00:00
cls = '' ;
switch ( dir ) {
case Asc . c _oAscVertDrawingText . normal :
cls = 'menu__icon text-orient-hor' ;
break ;
case Asc . c _oAscVertDrawingText . vert :
cls = 'menu__icon text-orient-rdown' ;
break ;
case Asc . c _oAscVertDrawingText . vert270 :
2020-10-21 13:28:47 +00:00
cls = 'menu__icon text-orient-rup' ;
2020-08-20 18:03:07 +00:00
break ;
}
2022-05-17 21:25:25 +00:00
me . menuParagraphDirection . setIconCls ( cls ) ;
2016-04-05 11:52:34 +00:00
me . menuParagraphDirectH . setChecked ( dir == Asc . c _oAscVertDrawingText . normal ) ;
me . menuParagraphDirect90 . setChecked ( dir == Asc . c _oAscVertDrawingText . vert ) ;
me . menuParagraphDirect270 . setChecked ( dir == Asc . c _oAscVertDrawingText . vert270 ) ;
2020-08-20 18:03:07 +00:00
} else {
2022-05-17 21:25:25 +00:00
me . menuParagraphVAlign . setIconCls ( '' ) ;
me . menuParagraphDirection . setIconCls ( '' ) ;
2016-03-11 00:48:53 +00:00
}
2022-05-17 21:25:25 +00:00
me . menuParagraphVAlign . setDisabled ( disabled ) ;
me . menuParagraphDirection . setDisabled ( disabled ) ;
2016-03-11 00:48:53 +00:00
var text = null ;
if ( me . api ) {
text = me . api . can _AddHyperlink ( ) ;
}
2022-05-17 12:29:01 +00:00
me . menuAddHyperlinkPara . setVisible ( value . hyperProps === undefined && text !== false ) ;
2016-03-11 00:48:53 +00:00
menuHyperlinkPara . setVisible ( value . hyperProps !== undefined ) ;
2022-05-17 12:29:01 +00:00
me . menuEditHyperlinkPara . hyperProps = value . hyperProps ;
2016-03-11 00:48:53 +00:00
if ( text !== false ) {
2022-05-17 12:29:01 +00:00
me . menuAddHyperlinkPara . hyperProps = { } ;
me . menuAddHyperlinkPara . hyperProps . value = new Asc . CHyperlinkProperty ( ) ;
me . menuAddHyperlinkPara . hyperProps . value . put _Text ( text ) ;
2016-03-11 00:48:53 +00:00
}
/** coauthoring begin **/
2022-05-17 12:29:01 +00:00
me . menuAddCommentPara . setVisible ( ! isInChart && isInShape && me . api . can _AddQuotedComment ( ) !== false && me . mode . canCoAuthoring && me . mode . canComments ) ;
2016-03-11 00:48:53 +00:00
/** coauthoring end **/
2022-05-17 12:29:01 +00:00
menuCommentParaSeparator . setVisible ( /** coauthoring begin **/ me . menuAddCommentPara . isVisible ( ) || /** coauthoring end **/ me . menuAddHyperlinkPara . isVisible ( ) || menuHyperlinkPara . isVisible ( ) ) ;
me . menuAddHyperlinkPara . setDisabled ( disabled ) ;
2016-03-11 00:48:53 +00:00
menuHyperlinkPara . setDisabled ( disabled ) ;
/** coauthoring begin **/
2022-05-17 12:29:01 +00:00
me . menuAddCommentPara . setDisabled ( disabled ) ;
2016-03-11 00:48:53 +00:00
/** coauthoring end **/
2022-05-17 21:25:25 +00:00
me . menuParagraphAdvanced . setDisabled ( disabled ) ;
2022-08-10 19:29:53 +00:00
var cancopy = me . api && me . api . can _CopyCut ( ) ;
me . menuParaCopy . setDisabled ( ! cancopy ) ;
me . menuParaCut . setDisabled ( disabled || ! cancopy ) ;
2022-05-17 12:29:01 +00:00
me . menuParaPaste . setDisabled ( disabled ) ;
2016-10-25 10:48:31 +00:00
2017-04-26 09:26:02 +00:00
// spellCheck
2019-08-05 08:59:52 +00:00
var spell = ( value . spellProps !== undefined && value . spellProps . value . get _Checked ( ) === false ) ;
me . menuSpellPara . setVisible ( spell ) ;
menuSpellcheckParaSeparator . setVisible ( spell ) ;
2022-05-17 21:25:25 +00:00
me . menuIgnoreSpellPara . setVisible ( spell ) ;
me . menuIgnoreAllSpellPara . setVisible ( spell ) ;
me . menuToDictionaryPara . setVisible ( spell && me . mode . isDesktopApp ) ;
2019-08-05 08:59:52 +00:00
me . langParaMenu . setVisible ( spell ) ;
2017-04-26 09:26:02 +00:00
me . langParaMenu . setDisabled ( disabled ) ;
2019-08-05 08:59:52 +00:00
menuIgnoreSpellParaSeparator . setVisible ( spell ) ;
2017-04-26 09:26:02 +00:00
2019-08-05 08:59:52 +00:00
if ( spell && value . spellProps . value . get _Variants ( ) !== null && value . spellProps . value . get _Variants ( ) !== undefined ) {
2017-04-26 09:26:02 +00:00
me . addWordVariants ( true ) ;
} else {
me . menuSpellPara . setCaption ( me . loadSpellText , true ) ;
me . clearWordVariants ( true ) ;
me . menuSpellMorePara . setVisible ( false ) ;
}
if ( me . langParaMenu . isVisible ( ) && me . _currLang . id !== me . _currLang . paraid ) {
me . changeLanguageMenu ( me . langParaMenu . menu ) ;
me . _currLang . paraid = me . _currLang . id ;
}
2016-10-25 10:48:31 +00:00
//equation menu
var eqlen = 0 ;
if ( isEquation ) {
2019-08-05 08:59:52 +00:00
eqlen = me . addEquationMenu ( true , 12 ) ;
2016-10-25 10:48:31 +00:00
} else
2019-08-05 08:59:52 +00:00
me . clearEquationMenu ( true , 12 ) ;
2016-10-25 10:48:31 +00:00
menuEquationSeparator . setVisible ( isEquation && eqlen > 0 ) ;
2016-03-11 00:48:53 +00:00
} ,
items : [
2017-04-26 09:26:02 +00:00
me . menuSpellPara ,
me . menuSpellMorePara ,
menuSpellcheckParaSeparator ,
2022-05-17 21:25:25 +00:00
me . menuIgnoreSpellPara ,
me . menuIgnoreAllSpellPara ,
me . menuToDictionaryPara ,
2017-04-26 09:26:02 +00:00
me . langParaMenu ,
menuIgnoreSpellParaSeparator ,
2022-05-17 12:29:01 +00:00
me . menuParaCut ,
me . menuParaCopy ,
me . menuParaPaste ,
2016-10-25 10:48:31 +00:00
menuEquationSeparator ,
2016-03-11 00:48:53 +00:00
{ caption : '--' } ,
2022-05-17 21:25:25 +00:00
me . menuParagraphVAlign ,
me . menuParagraphDirection ,
me . menuParagraphAdvanced ,
2016-03-11 00:48:53 +00:00
menuCommentParaSeparator ,
/** coauthoring begin **/
2022-05-17 12:29:01 +00:00
me . menuAddCommentPara ,
2016-03-11 00:48:53 +00:00
/** coauthoring end **/
2022-05-17 12:29:01 +00:00
me . menuAddHyperlinkPara ,
2016-03-11 00:48:53 +00:00
menuHyperlinkPara
]
2017-04-11 11:05:56 +00:00
} ) . on ( 'hide:after' , function ( menu , e , isFromInputControl ) {
2016-03-11 00:48:53 +00:00
if ( me . suppressEditComplete ) {
me . suppressEditComplete = false ;
return ;
}
2017-04-11 11:05:56 +00:00
if ( ! isFromInputControl ) me . fireEvent ( 'editcomplete' , me ) ;
2016-03-11 00:48:53 +00:00
me . currentMenu = null ;
} ) ;
me . tableMenu = new Common . UI . Menu ( {
2020-08-20 13:55:06 +00:00
cls : 'shifted-right' ,
2022-02-09 19:51:43 +00:00
restoreHeightAndTop : true ,
2016-03-11 00:48:53 +00:00
initMenu : function ( value ) {
// table properties
if ( _ . isUndefined ( value . tableProps ) )
return ;
2016-10-25 10:48:31 +00:00
var isEquation = ( value . mathProps && value . mathProps . value ) ;
2018-02-06 12:06:01 +00:00
for ( var i = 6 ; i < 19 ; i ++ ) {
2016-10-25 10:48:31 +00:00
me . tableMenu . items [ i ] . setVisible ( ! isEquation ) ;
}
2016-03-11 00:48:53 +00:00
var disabled = ( value . slideProps !== undefined && value . slideProps . locked ) ;
2020-08-20 18:03:07 +00:00
var align = value . tableProps . value . get _CellsVAlign ( ) ;
var cls = '' ;
switch ( align ) {
case Asc . c _oAscVertAlignJc . Top :
cls = 'menu__icon btn-align-top' ;
break ;
case Asc . c _oAscVertAlignJc . Center :
cls = 'menu__icon btn-align-middle' ;
break ;
case Asc . c _oAscVertAlignJc . Bottom :
cls = 'menu__icon btn-align-bottom' ;
break ;
}
2022-05-17 21:25:25 +00:00
me . menuTableCellAlign . setIconCls ( cls ) ;
2020-08-20 18:03:07 +00:00
me . menuTableCellTop . setChecked ( align == Asc . c _oAscVertAlignJc . Top ) ;
me . menuTableCellCenter . setChecked ( align == Asc . c _oAscVertAlignJc . Center ) ;
me . menuTableCellBottom . setChecked ( align == Asc . c _oAscVertAlignJc . Bottom ) ;
2016-03-11 00:48:53 +00:00
if ( me . api ) {
2022-05-17 21:25:25 +00:00
me . mnuTableMerge . setDisabled ( value . tableProps . locked || disabled || ! me . api . CheckBeforeMergeCells ( ) ) ;
me . mnuTableSplit . setDisabled ( value . tableProps . locked || disabled || ! me . api . CheckBeforeSplitCells ( ) ) ;
2016-03-11 00:48:53 +00:00
}
2022-05-17 21:25:25 +00:00
me . menuTableDistRows . setDisabled ( value . tableProps . locked || disabled ) ;
me . menuTableDistCols . setDisabled ( value . tableProps . locked || disabled ) ;
2016-03-11 00:48:53 +00:00
2017-04-26 09:26:02 +00:00
me . tableMenu . items [ 7 ] . setDisabled ( value . tableProps . locked || disabled ) ;
me . tableMenu . items [ 8 ] . setDisabled ( value . tableProps . locked || disabled ) ;
2016-03-11 00:48:53 +00:00
2022-05-17 21:25:25 +00:00
me . menuTableCellAlign . setDisabled ( value . tableProps . locked || disabled ) ;
me . menuTableAdvanced . setDisabled ( value . tableProps . locked || disabled ) ;
2022-08-10 19:29:53 +00:00
var cancopy = me . api && me . api . can _CopyCut ( ) ;
me . menuTableCopy . setDisabled ( ! cancopy ) ;
me . menuTableCut . setDisabled ( value . tableProps . locked || disabled || ! cancopy ) ;
2022-05-17 12:29:01 +00:00
me . menuTablePaste . setDisabled ( value . tableProps . locked || disabled ) ;
2016-03-11 00:48:53 +00:00
// hyperlink properties
var text = null ;
if ( me . api ) {
text = me . api . can _AddHyperlink ( ) ;
}
2022-05-17 12:29:01 +00:00
me . menuAddHyperlinkTable . setVisible ( ! _ . isUndefined ( value . paraProps ) && _ . isUndefined ( value . hyperProps ) && text !== false ) ;
2016-03-11 00:48:53 +00:00
menuHyperlinkTable . setVisible ( ! _ . isUndefined ( value . paraProps ) && ! _ . isUndefined ( value . hyperProps ) ) ;
2022-05-17 12:29:01 +00:00
me . menuEditHyperlinkTable . hyperProps = value . hyperProps ;
2016-03-11 00:48:53 +00:00
if ( text !== false ) {
2022-05-17 12:29:01 +00:00
me . menuAddHyperlinkTable . hyperProps = { } ;
me . menuAddHyperlinkTable . hyperProps . value = new Asc . CHyperlinkProperty ( ) ;
me . menuAddHyperlinkTable . hyperProps . value . put _Text ( text ) ;
2016-03-11 00:48:53 +00:00
}
if ( ! _ . isUndefined ( value . paraProps ) ) {
2022-05-17 12:29:01 +00:00
me . menuAddHyperlinkTable . setDisabled ( value . paraProps . locked || disabled ) ;
2016-03-11 00:48:53 +00:00
menuHyperlinkTable . setDisabled ( value . paraProps . locked || disabled ) ;
2016-10-25 10:48:31 +00:00
me . _currentParaObjDisabled = value . paraProps . locked || disabled ;
2016-03-11 00:48:53 +00:00
}
/** coauthoring begin **/
2022-05-17 12:29:01 +00:00
me . menuAddCommentTable . setVisible ( me . api . can _AddQuotedComment ( ) !== false && me . mode . canCoAuthoring && me . mode . canComments ) ;
me . menuAddCommentTable . setDisabled ( ! _ . isUndefined ( value . paraProps ) && value . paraProps . locked || disabled ) ;
2016-03-11 00:48:53 +00:00
/** coauthoring end **/
2022-05-17 12:29:01 +00:00
menuHyperlinkSeparator . setVisible ( me . menuAddHyperlinkTable . isVisible ( ) || menuHyperlinkTable . isVisible ( ) /** coauthoring begin **/ || me . menuAddCommentTable . isVisible ( ) /** coauthoring end **/ ) ;
2016-10-25 10:48:31 +00:00
2017-04-26 09:26:02 +00:00
me . menuSpellCheckTable . setVisible ( value . spellProps !== undefined && value . spellProps . value . get _Checked ( ) === false ) ;
2022-05-17 21:53:02 +00:00
me . menuToDictionaryTable . setVisible ( me . mode . isDesktopApp ) ;
2017-04-26 09:26:02 +00:00
menuSpellcheckTableSeparator . setVisible ( value . spellProps !== undefined && value . spellProps . value . get _Checked ( ) === false ) ;
me . langTableMenu . setDisabled ( disabled ) ;
if ( value . spellProps !== undefined && value . spellProps . value . get _Checked ( ) === false && value . spellProps . value . get _Variants ( ) !== null && value . spellProps . value . get _Variants ( ) !== undefined ) {
me . addWordVariants ( false ) ;
} else {
me . menuSpellTable . setCaption ( me . loadSpellText , true ) ;
me . clearWordVariants ( false ) ;
me . menuSpellMoreTable . setVisible ( false ) ;
}
if ( me . menuSpellCheckTable . isVisible ( ) && me . _currLang . id !== me . _currLang . tableid ) {
me . changeLanguageMenu ( me . langTableMenu . menu ) ;
me . _currLang . tableid = me . _currLang . id ;
}
2016-10-25 10:48:31 +00:00
//equation menu
var eqlen = 0 ;
if ( isEquation ) {
2017-04-26 09:26:02 +00:00
eqlen = me . addEquationMenu ( false , 6 ) ;
2016-10-25 10:48:31 +00:00
menuHyperlinkSeparator . setVisible ( menuHyperlinkSeparator . isVisible ( ) && eqlen > 0 ) ;
} else
2017-04-26 09:26:02 +00:00
me . clearEquationMenu ( false , 6 ) ;
2016-03-11 00:48:53 +00:00
} ,
items : [
2017-04-26 09:26:02 +00:00
me . menuSpellCheckTable ,
menuSpellcheckTableSeparator ,
2022-05-17 12:29:01 +00:00
me . menuTableCut ,
me . menuTableCopy ,
me . menuTablePaste ,
2016-03-11 00:48:53 +00:00
{ caption : '--' } ,
2022-05-17 21:53:02 +00:00
me . menuTableSelectText ,
me . menuTableInsertText ,
me . menuTableDeleteText ,
2016-03-11 00:48:53 +00:00
{ caption : '--' } ,
2022-05-17 21:25:25 +00:00
me . mnuTableMerge ,
me . mnuTableSplit ,
2016-03-11 00:48:53 +00:00
{ caption : '--' } ,
2022-05-17 21:25:25 +00:00
me . menuTableDistRows ,
me . menuTableDistCols ,
2018-02-06 12:06:01 +00:00
{ caption : '--' } ,
2022-05-17 21:25:25 +00:00
me . menuTableCellAlign ,
2016-03-11 00:48:53 +00:00
{ caption : '--' } ,
2022-05-17 21:25:25 +00:00
me . menuTableAdvanced ,
2016-03-11 00:48:53 +00:00
menuHyperlinkSeparator ,
/** coauthoring begin **/
2022-05-17 12:29:01 +00:00
me . menuAddCommentTable ,
2016-03-11 00:48:53 +00:00
/** coauthoring end **/
2022-05-17 12:29:01 +00:00
me . menuAddHyperlinkTable ,
2019-10-30 07:17:33 +00:00
menuHyperlinkTable ,
{ caption : '--' } ,
2022-05-17 12:29:01 +00:00
me . menuAddToLayoutTable
2016-03-11 00:48:53 +00:00
]
2017-04-11 11:05:56 +00:00
} ) . on ( 'hide:after' , function ( menu , e , isFromInputControl ) {
2016-03-11 00:48:53 +00:00
if ( me . suppressEditComplete ) {
me . suppressEditComplete = false ;
return ;
}
2017-04-11 11:05:56 +00:00
if ( ! isFromInputControl ) me . fireEvent ( 'editcomplete' , me ) ;
2016-03-11 00:48:53 +00:00
me . currentMenu = null ;
} ) ;
me . pictureMenu = new Common . UI . Menu ( {
2020-08-20 13:55:06 +00:00
cls : 'shifted-right' ,
2022-02-09 19:51:43 +00:00
restoreHeightAndTop : true ,
2016-03-11 00:48:53 +00:00
initMenu : function ( value ) {
if ( me . api ) {
2022-05-17 21:25:25 +00:00
me . mnuUnGroupImg . setDisabled ( ! me . api . canUnGroup ( ) ) ;
me . mnuGroupImg . setDisabled ( ! me . api . canGroup ( ) ) ;
2016-03-11 00:48:53 +00:00
}
2018-04-11 13:46:44 +00:00
var isimage = ( _ . isUndefined ( value . shapeProps ) || value . shapeProps . value . get _FromImage ( ) ) && _ . isUndefined ( value . chartProps ) ,
imgdisabled = ( value . imgProps !== undefined && value . imgProps . locked ) ,
2016-03-11 00:48:53 +00:00
shapedisabled = ( value . shapeProps !== undefined && value . shapeProps . locked ) ,
chartdisabled = ( value . chartProps !== undefined && value . chartProps . locked ) ,
2018-04-11 13:46:44 +00:00
disabled = imgdisabled || shapedisabled || chartdisabled || ( value . slideProps !== undefined && value . slideProps . locked ) ,
2021-11-09 18:22:00 +00:00
pluginGuid = ( value . imgProps ) ? value . imgProps . value . asc _getPluginGuid ( ) : null ,
inSmartartInternal = value . shapeProps && value . shapeProps . value . get _FromSmartArtInternal ( ) ;
2022-05-17 21:25:25 +00:00
me . mnuArrangeFront . setDisabled ( inSmartartInternal ) ;
me . mnuArrangeBack . setDisabled ( inSmartartInternal ) ;
me . mnuArrangeForward . setDisabled ( inSmartartInternal ) ;
me . mnuArrangeBackward . setDisabled ( inSmartartInternal ) ;
2016-03-11 00:48:53 +00:00
2022-05-17 21:25:25 +00:00
me . menuImgShapeRotate . setVisible ( _ . isUndefined ( value . chartProps ) && ( pluginGuid === null || pluginGuid === undefined ) ) ;
if ( me . menuImgShapeRotate . isVisible ( ) ) {
me . menuImgShapeRotate . setDisabled ( disabled || ( value . shapeProps && value . shapeProps . value . get _FromSmartArt ( ) ) ) ;
me . menuImgShapeRotate . menu . items [ 3 ] . setDisabled ( inSmartartInternal ) ;
me . menuImgShapeRotate . menu . items [ 4 ] . setDisabled ( inSmartartInternal ) ;
2022-03-28 12:31:59 +00:00
}
2019-02-26 16:36:02 +00:00
2016-03-11 00:48:53 +00:00
// image properties
2022-05-17 21:25:25 +00:00
me . menuImgOriginalSize . setVisible ( isimage ) ;
if ( me . menuImgOriginalSize . isVisible ( ) )
me . menuImgOriginalSize . setDisabled ( disabled || _ . isNull ( value . imgProps . value . get _ImageUrl ( ) ) || _ . isUndefined ( value . imgProps . value . get _ImageUrl ( ) ) ) ;
2016-03-11 00:48:53 +00:00
2022-05-17 12:29:01 +00:00
me . menuImgReplace . setVisible ( isimage && ( pluginGuid === null || pluginGuid === undefined ) ) ;
if ( me . menuImgReplace . isVisible ( ) )
me . menuImgReplace . setDisabled ( disabled || pluginGuid === null ) ;
me . menuImgReplace . menu . items [ 2 ] . setVisible ( me . mode . canRequestInsertImage || me . mode . fileChoiceUrl && me . mode . fileChoiceUrl . indexOf ( "{documentType}" ) > - 1 ) ;
2020-05-13 14:43:45 +00:00
2019-04-09 11:29:51 +00:00
me . menuImgCrop . setVisible ( me . api . asc _canEditCrop ( ) ) ;
if ( me . menuImgCrop . isVisible ( ) )
me . menuImgCrop . setDisabled ( disabled ) ;
2021-09-21 10:34:31 +00:00
var canEditPoints = me . api && me . api . asc _canEditGeometry ( ) ;
2022-05-17 21:25:25 +00:00
me . menuImgEditPoints . setVisible ( canEditPoints ) ;
2021-09-21 10:34:31 +00:00
menuImgEditPointsSeparator . setVisible ( canEditPoints ) ;
2022-05-17 21:25:25 +00:00
canEditPoints && me . menuImgEditPoints . setDisabled ( disabled ) ;
2021-09-21 10:34:31 +00:00
2022-05-17 21:25:25 +00:00
me . menuImageAdvanced . setVisible ( isimage ) ;
me . menuShapeAdvanced . setVisible ( _ . isUndefined ( value . imgProps ) && _ . isUndefined ( value . chartProps ) ) ;
2022-05-17 12:29:01 +00:00
me . menuChartEdit . setVisible ( _ . isUndefined ( value . imgProps ) && ! _ . isUndefined ( value . chartProps ) && ( _ . isUndefined ( value . shapeProps ) || value . shapeProps . isChart ) ) ;
2022-07-21 20:18:22 +00:00
me . menuChartAdvanced . setVisible ( _ . isUndefined ( value . imgProps ) && ! _ . isUndefined ( value . chartProps ) && ( _ . isUndefined ( value . shapeProps ) || value . shapeProps . isChart ) ) ;
menuImgShapeSeparator . setVisible ( me . menuImageAdvanced . isVisible ( ) || me . menuShapeAdvanced . isVisible ( ) || me . menuChartEdit . isVisible ( ) || me . menuChartAdvanced . isVisible ( ) ) ;
2016-03-11 00:48:53 +00:00
/** coauthoring begin **/
2022-05-17 12:29:01 +00:00
me . menuAddCommentImg . setVisible ( me . api . can _AddQuotedComment ( ) !== false && me . mode . canCoAuthoring && me . mode . canComments ) ;
menuCommentSeparatorImg . setVisible ( me . menuAddCommentImg . isVisible ( ) ) ;
me . menuAddCommentImg . setDisabled ( disabled ) ;
2016-03-11 00:48:53 +00:00
/** coauthoring end **/
2022-05-17 21:25:25 +00:00
me . menuImgShapeAlign . setDisabled ( disabled ) ;
2019-02-12 07:25:43 +00:00
if ( ! disabled ) {
var objcount = me . api . asc _getSelectedDrawingObjectsCount ( ) ,
slide _checked = Common . Utils . InternalSettings . get ( "pe-align-to-slide" ) || false ;
2022-05-17 21:25:25 +00:00
me . menuImgShapeAlign . menu . items [ 7 ] . setDisabled ( objcount == 2 && ! slide _checked ) ;
me . menuImgShapeAlign . menu . items [ 8 ] . setDisabled ( objcount == 2 && ! slide _checked ) ;
2019-02-12 07:25:43 +00:00
}
2022-05-17 21:25:25 +00:00
me . menuImageAdvanced . setDisabled ( disabled ) ;
me . menuShapeAdvanced . setDisabled ( disabled ) ;
2022-07-21 20:18:22 +00:00
me . menuChartAdvanced . setDisabled ( disabled ) ;
2022-05-17 12:29:01 +00:00
if ( me . menuChartEdit . isVisible ( ) )
me . menuChartEdit . setDisabled ( disabled ) ;
2016-03-11 00:48:53 +00:00
2022-08-10 19:29:53 +00:00
var cancopy = me . api && me . api . can _CopyCut ( ) ;
me . menuImgCopy . setDisabled ( ! cancopy ) ;
me . menuImgCut . setDisabled ( disabled || ! cancopy ) ;
2022-05-17 12:29:01 +00:00
me . menuImgPaste . setDisabled ( disabled ) ;
2021-09-06 11:27:45 +00:00
menuImgShapeArrange . setDisabled ( disabled ) ;
2022-05-17 12:29:01 +00:00
me . menuAddToLayoutImg . setDisabled ( disabled ) ;
2016-03-11 00:48:53 +00:00
} ,
items : [
2022-05-17 12:29:01 +00:00
me . menuImgCut ,
me . menuImgCopy ,
me . menuImgPaste ,
2016-03-11 00:48:53 +00:00
{ caption : '--' } ,
2022-05-17 21:25:25 +00:00
me . menuImgEditPoints ,
2021-09-21 10:34:31 +00:00
menuImgEditPointsSeparator ,
2016-03-11 00:48:53 +00:00
menuImgShapeArrange ,
2022-05-17 21:25:25 +00:00
me . menuImgShapeAlign ,
me . menuImgShapeRotate ,
2016-03-11 00:48:53 +00:00
menuImgShapeSeparator ,
2019-04-09 11:29:51 +00:00
me . menuImgCrop ,
2022-05-17 21:25:25 +00:00
me . menuImgOriginalSize ,
2022-05-17 12:29:01 +00:00
me . menuImgReplace ,
2022-05-17 21:25:25 +00:00
me . menuImageAdvanced ,
me . menuShapeAdvanced
2022-05-17 12:29:01 +00:00
, me . menuChartEdit
2022-07-21 20:18:22 +00:00
, me . menuChartAdvanced
2016-03-11 00:48:53 +00:00
/** coauthoring begin **/
, menuCommentSeparatorImg ,
2022-05-17 12:29:01 +00:00
me . menuAddCommentImg ,
2016-03-11 00:48:53 +00:00
/** coauthoring end **/
2019-10-30 07:17:33 +00:00
{ caption : '--' } ,
2022-05-17 12:29:01 +00:00
me . menuAddToLayoutImg
2016-03-11 00:48:53 +00:00
]
2017-04-11 11:05:56 +00:00
} ) . on ( 'hide:after' , function ( menu , e , isFromInputControl ) {
2016-03-11 00:48:53 +00:00
if ( me . suppressEditComplete ) {
me . suppressEditComplete = false ;
return ;
}
2017-04-11 11:05:56 +00:00
if ( ! isFromInputControl ) me . fireEvent ( 'editcomplete' , me ) ;
2016-03-11 00:48:53 +00:00
me . currentMenu = null ;
} ) ;
var nextpage = $ ( '#id_buttonNextPage' ) ;
nextpage . attr ( 'data-toggle' , 'tooltip' ) ;
nextpage . tooltip ( {
title : me . textNextPage + Common . Utils . String . platformKey ( 'PgDn' ) ,
placement : 'top-right'
} ) ;
var prevpage = $ ( '#id_buttonPrevPage' ) ;
prevpage . attr ( 'data-toggle' , 'tooltip' ) ;
prevpage . tooltip ( {
title : me . textPrevPage + Common . Utils . String . platformKey ( 'PgUp' ) ,
placement : 'top-right'
} ) ;
2022-05-17 12:29:01 +00:00
this . fireEvent ( 'createdelayedelements' , [ this , 'edit' ] ) ;
2016-03-11 00:48:53 +00:00
} ,
2017-04-26 09:26:02 +00:00
setLanguages : function ( langs ) {
var me = this ;
if ( langs && langs . length > 0 && me . langParaMenu && me . langTableMenu ) {
2019-08-10 14:40:57 +00:00
var arrPara = [ ] , arrTable = [ ] ;
_ . each ( langs , function ( lang ) {
var item = {
2019-01-28 13:51:07 +00:00
caption : lang . displayValue ,
2019-02-27 14:53:21 +00:00
value : lang . value ,
2017-04-26 09:26:02 +00:00
checkable : true ,
2019-01-28 13:51:07 +00:00
langid : lang . code ,
2019-08-10 14:40:57 +00:00
spellcheck : lang . spellcheck
} ;
arrPara . push ( item ) ;
arrTable . push ( _ . clone ( item ) ) ;
} ) ;
me . langParaMenu . menu . resetItems ( arrPara ) ;
me . langTableMenu . menu . resetItems ( arrTable ) ;
2017-04-26 09:26:02 +00:00
}
} ,
2017-11-10 08:59:05 +00:00
SetDisabled : function ( state ) {
this . _isDisabled = state ;
} ,
2016-03-11 00:48:53 +00:00
insertRowAboveText : 'Row Above' ,
insertRowBelowText : 'Row Below' ,
insertColumnLeftText : 'Column Left' ,
insertColumnRightText : 'Column Right' ,
deleteText : 'Delete' ,
deleteRowText : 'Delete Row' ,
deleteColumnText : 'Delete Column' ,
deleteTableText : 'Delete Table' ,
mergeCellsText : 'Merge Cells' ,
splitCellsText : 'Split Cell...' ,
splitCellTitleText : 'Split Cell' ,
2019-11-06 08:11:30 +00:00
originalSizeText : 'Actual Size' ,
2016-03-11 00:48:53 +00:00
advancedImageText : 'Image Advanced Settings' ,
hyperlinkText : 'Hyperlink' ,
editHyperlinkText : 'Edit Hyperlink' ,
removeHyperlinkText : 'Remove Hyperlink' ,
2022-06-26 10:43:51 +00:00
txtPressLink : 'Press {0} and click link' ,
2016-03-11 00:48:53 +00:00
selectText : 'Select' ,
insertRowText : 'Insert Row' ,
insertColumnText : 'Insert Column' ,
rowText : 'Row' ,
columnText : 'Column' ,
cellText : 'Cell' ,
tableText : 'Table' ,
aboveText : 'Above' ,
belowText : 'Below' ,
advancedTableText : 'Table Advanced Settings' ,
txtSelectAll : 'Select All' ,
txtNewSlide : 'New Slide' ,
txtDuplicateSlide : 'Duplicate Slide' ,
txtDeleteSlide : 'Delete Slide' ,
txtBackground : 'Background' ,
txtChangeLayout : 'Change Layout' ,
2016-06-17 12:47:49 +00:00
txtPreview : 'Start slideshow' ,
2016-03-11 00:48:53 +00:00
textShapeAlignLeft : 'Align Left' ,
textShapeAlignRight : 'Align Right' ,
textShapeAlignCenter : 'Align Center' ,
textShapeAlignTop : 'Align Top' ,
textShapeAlignBottom : 'Align Bottom' ,
textShapeAlignMiddle : 'Align Middle' ,
textArrangeFront : 'Bring To Front' ,
textArrangeBack : 'Send To Back' ,
textArrangeForward : 'Bring Forward' ,
textArrangeBackward : 'Send Backward' ,
txtGroup : 'Group' ,
txtUngroup : 'Ungroup' ,
txtArrange : 'Arrange' ,
txtAlign : 'Align' ,
txtDistribHor : 'Distribute Horizontally' ,
txtDistribVert : 'Distribute Vertically' ,
txtSlide : 'Slide' ,
cellAlignText : 'Cell Vertical Alignment' ,
advancedShapeText : 'Shape Advanced Settings' ,
/** coauthoring begin **/
addCommentText : 'Add Comment' ,
/** coauthoring end **/
editChartText : 'Edit Data' ,
vertAlignText : 'Vertical Alignment' ,
advancedParagraphText : 'Text Advanced Settings' ,
tipIsLocked : "This element is currently being edited by another user." ,
textNextPage : 'Next Slide' ,
textPrevPage : 'Previous Slide' ,
insertText : 'Insert' ,
textCopy : 'Copy' ,
textPaste : 'Paste' ,
textCut : 'Cut' ,
textSlideSettings : 'Slide Settings' ,
directionText : 'Text Direction' ,
directHText : 'Horizontal' ,
2017-06-06 08:15:03 +00:00
direct90Text : 'Rotate Text Down' ,
direct270Text : 'Rotate Text Up' ,
2016-10-25 10:48:31 +00:00
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' ,
alignmentText : 'Alignment' ,
leftText : 'Left' ,
rightText : 'Right' ,
2017-04-26 09:26:02 +00:00
centerText : 'Center' ,
loadSpellText : 'Loading variants...' ,
ignoreAllSpellText : 'Ignore All' ,
ignoreSpellText : 'Ignore' ,
noSpellVariantsText : 'No variants' ,
moreText : 'More variants...' ,
spellcheckText : 'Spellcheck' ,
2017-06-06 08:04:04 +00:00
langText : 'Select Language' ,
2017-07-20 10:37:26 +00:00
textUndo : 'Undo' ,
2017-08-07 14:20:17 +00:00
txtSlideHide : 'Hide Slide' ,
2017-09-19 08:17:54 +00:00
txtChangeTheme : 'Change Theme' ,
txtKeepTextOnly : 'Keep text only' ,
txtPastePicture : 'Picture' ,
2017-11-17 11:51:17 +00:00
txtPasteSourceFormat : 'Keep source formatting' ,
2018-02-06 12:06:01 +00:00
txtPasteDestFormat : 'Use destination theme' ,
textDistributeRows : 'Distribute rows' ,
2018-04-11 13:46:44 +00:00
textDistributeCols : 'Distribute columns' ,
textReplace : 'Replace image' ,
textFromUrl : 'From URL' ,
2019-02-26 16:36:02 +00:00
textFromFile : 'From File' ,
2019-02-27 10:11:28 +00:00
textRotate270 : 'Rotate 90° Counterclockwise' ,
textRotate90 : 'Rotate 90° Clockwise' ,
2019-02-26 16:36:02 +00:00
textFlipV : 'Flip Vertically' ,
textFlipH : 'Flip Horizontally' ,
2019-04-09 11:29:51 +00:00
textRotate : 'Rotate' ,
textCrop : 'Crop' ,
textCropFill : 'Fill' ,
2019-08-05 08:59:52 +00:00
textCropFit : 'Fit' ,
2019-08-07 07:38:03 +00:00
toDictionaryText : 'Add to Dictionary' ,
2019-10-30 07:17:33 +00:00
txtPrintSelection : 'Print Selection' ,
2019-10-30 08:33:55 +00:00
addToLayoutText : 'Add to Layout' ,
2019-11-19 09:02:00 +00:00
txtResetLayout : 'Reset Slide' ,
2020-05-13 14:43:45 +00:00
mniCustomTable : 'Insert Custom Table' ,
2021-09-03 11:39:20 +00:00
textFromStorage : 'From Storage' ,
2021-09-21 10:34:31 +00:00
txtWarnUrl : 'Clicking this link can be harmful to your device and data.<br>Are you sure you want to continue?' ,
2021-10-12 19:21:36 +00:00
textEditPoints : 'Edit Points' ,
txtMoveSlidesToEnd : 'Move Slide to End' ,
2022-07-21 20:18:22 +00:00
txtMoveSlidesToStart : 'Move Slide to Beginning' ,
advancedChartText : 'Chart Advanced Settings'
2016-03-11 00:48:53 +00:00
} , PE . Views . DocumentHolder || { } ) ) ;
} ) ;