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 . usertips = [ ] ;
me . _TtHeight = 20 ;
me . slidesCount = 0 ;
me . fastcoauthtips = [ ] ;
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 ;
2016-03-11 00:48:53 +00:00
/** coauthoring begin **/
var usersStore = PE . getCollection ( 'Common.Collections.Users' ) ;
/** coauthoring end **/
var showPopupMenu = function ( menu , value , event , docElement , eOpts ) {
if ( ! _ . isUndefined ( menu ) && menu !== null ) {
Common . UI . Menu . Manager . hideAll ( ) ;
var showPoint = [ event . get _X ( ) , event . get _Y ( ) ] ,
menuContainer = $ ( me . el ) . find ( Common . Utils . String . format ( '#menu-container-{0}' , menu . id ) ) ;
2016-04-05 11:52:34 +00:00
if ( event . get _Type ( ) == Asc . c _oAscContextMenuTypes . Thumbnails ) {
2016-03-11 00:48:53 +00:00
showPoint [ 0 ] -= 3 ;
showPoint [ 1 ] -= 3 ;
}
if ( ! menu . rendered ) {
// Prepare menu container
if ( menuContainer . length < 1 ) {
menuContainer = $ ( Common . Utils . String . format ( '<div id="menu-container-{0}" style="position: absolute; z-index: 10000;"><div class="dropdown-toggle" data-toggle="dropdown"></div></div>' , menu . id ) ) ;
$ ( me . el ) . append ( menuContainer ) ;
}
menu . render ( menuContainer ) ;
menu . cmpEl . attr ( { tabindex : "-1" } ) ;
}
menuContainer . css ( {
left : showPoint [ 0 ] ,
top : showPoint [ 1 ]
} ) ;
menu . show ( ) ;
if ( _ . isFunction ( menu . options . initMenu ) ) {
menu . options . initMenu ( value ) ;
menu . alignPosition ( ) ;
}
_ . delay ( function ( ) {
menu . cmpEl . focus ( ) ;
} , 10 ) ;
me . currentMenu = menu ;
}
} ;
var fillMenuProps = function ( selectedElements ) {
if ( ! selectedElements || ! _ . isArray ( selectedElements ) ) return ;
var menu _props = { } ,
menu _to _show = null ;
_ . each ( selectedElements , function ( element , index ) {
var elType = element . get _ObjectType ( ) ,
elValue = element . get _ObjectValue ( ) ;
2016-04-05 11:52:34 +00:00
if ( Asc . c _oAscTypeSelectElement . Image == elType ) {
2016-03-11 00:48:53 +00:00
menu _to _show = me . pictureMenu ;
menu _props . imgProps = { } ;
menu _props . imgProps . value = elValue ;
menu _props . imgProps . locked = ( elValue ) ? elValue . get _Locked ( ) : false ;
2016-04-05 11:52:34 +00:00
} else if ( Asc . c _oAscTypeSelectElement . Table == elType )
2016-03-11 00:48:53 +00:00
{
menu _to _show = me . tableMenu ;
menu _props . tableProps = { } ;
menu _props . tableProps . value = elValue ;
menu _props . tableProps . locked = ( elValue ) ? elValue . get _Locked ( ) : false ;
2016-04-05 11:52:34 +00:00
} else if ( Asc . c _oAscTypeSelectElement . Hyperlink == elType ) {
2016-03-11 00:48:53 +00:00
menu _props . hyperProps = { } ;
menu _props . hyperProps . value = elValue ;
2016-04-05 11:52:34 +00:00
} else if ( Asc . c _oAscTypeSelectElement . Shape == elType ) { // shape
2016-03-11 00:48:53 +00:00
menu _to _show = me . pictureMenu ;
menu _props . shapeProps = { } ;
menu _props . shapeProps . value = elValue ;
menu _props . shapeProps . locked = ( elValue ) ? elValue . get _Locked ( ) : false ;
if ( elValue . get _FromChart ( ) )
menu _props . shapeProps . isChart = true ;
}
2016-04-05 11:52:34 +00:00
else if ( Asc . c _oAscTypeSelectElement . Chart == elType ) {
2016-03-11 00:48:53 +00:00
menu _to _show = me . pictureMenu ;
menu _props . chartProps = { } ;
menu _props . chartProps . value = elValue ;
menu _props . chartProps . locked = ( elValue ) ? elValue . get _Locked ( ) : false ;
}
2016-04-05 11:52:34 +00:00
else if ( Asc . c _oAscTypeSelectElement . Slide == elType ) {
2016-03-11 00:48:53 +00:00
menu _props . slideProps = { } ;
menu _props . slideProps . value = elValue ;
menu _props . slideProps . locked = ( elValue ) ? elValue . get _LockDelete ( ) : false ;
2016-04-05 11:52:34 +00:00
} else if ( Asc . c _oAscTypeSelectElement . Paragraph == elType ) {
2016-03-11 00:48:53 +00:00
menu _props . paraProps = { } ;
menu _props . paraProps . value = elValue ;
menu _props . paraProps . locked = ( elValue ) ? elValue . get _Locked ( ) : false ;
if ( ( menu _props . shapeProps && menu _props . shapeProps . value || menu _props . chartProps && menu _props . chartProps . value ) && // text in shape, need to show paragraph menu with vertical align
_ . isUndefined ( menu _props . tableProps ) )
menu _to _show = me . textMenu ;
2017-04-26 09:26:02 +00:00
} else if ( Asc . c _oAscTypeSelectElement . SpellCheck == elType ) {
menu _props . spellProps = { } ;
menu _props . spellProps . value = elValue ;
me . _currentSpellObj = elValue ;
2016-10-25 10:48:31 +00:00
} else if ( Asc . c _oAscTypeSelectElement . Math == elType ) {
menu _props . mathProps = { } ;
menu _props . mathProps . value = elValue ;
me . _currentMathObj = elValue ;
2016-03-11 00:48:53 +00:00
}
} ) ;
if ( menu _to _show === null ) {
if ( ! _ . isUndefined ( menu _props . paraProps ) )
menu _to _show = me . textMenu ;
else if ( ! _ . isUndefined ( menu _props . slideProps ) ) {
menu _to _show = me . slideMenu ;
}
}
return { menu _to _show : menu _to _show , menu _props : menu _props } ;
} ;
2017-06-06 08:04:04 +00:00
var fillViewMenuProps = function ( selectedElements ) {
if ( ! selectedElements || ! _ . isArray ( selectedElements ) ) return ;
2017-11-10 08:59:05 +00:00
if ( ! me . viewModeMenu )
me . createDelayedElementsViewer ( ) ;
2017-06-06 08:04:04 +00:00
var menu _props = { } ,
menu _to _show = null ;
_ . each ( selectedElements , function ( element , index ) {
var elType = element . get _ObjectType ( ) ,
elValue = element . get _ObjectValue ( ) ;
if ( Asc . c _oAscTypeSelectElement . Image == elType || Asc . c _oAscTypeSelectElement . Table == elType || Asc . c _oAscTypeSelectElement . Shape == elType ||
Asc . c _oAscTypeSelectElement . Chart == elType || Asc . c _oAscTypeSelectElement . Paragraph == elType ) {
menu _to _show = me . viewModeMenu ;
menu _props . locked = menu _props . locked || ( ( elValue ) ? elValue . get _Locked ( ) : false ) ;
if ( Asc . c _oAscTypeSelectElement . Chart == elType )
menu _props . isChart = true ;
}
else if ( Asc . c _oAscTypeSelectElement . Slide == elType ) {
menu _props . locked = menu _props . locked || ( ( elValue ) ? elValue . get _LockDelete ( ) : false ) ;
}
} ) ;
return ( menu _to _show ) ? { menu _to _show : menu _to _show , menu _props : menu _props } : null ;
} ;
2016-03-11 00:48:53 +00:00
var showObjectMenu = function ( event , docElement , eOpts ) {
2017-06-06 08:04:04 +00:00
if ( me . api ) {
2017-11-10 08:59:05 +00:00
var obj = ( me . mode . isEdit && ! me . _isDisabled ) ? fillMenuProps ( me . api . getSelectedElements ( ) ) : fillViewMenuProps ( me . api . getSelectedElements ( ) ) ;
2016-03-11 00:48:53 +00:00
if ( obj ) showPopupMenu ( obj . menu _to _show , obj . menu _props , event , docElement , eOpts ) ;
}
} ;
var onContextMenu = function ( event ) {
_ . delay ( function ( ) {
2016-04-05 11:52:34 +00:00
if ( event . get _Type ( ) == Asc . c _oAscContextMenuTypes . Thumbnails ) {
2017-11-10 08:59:05 +00:00
! me . _isDisabled && showPopupMenu . call ( me , me . slideMenu , { isSlideSelect : event . get _IsSlideSelect ( ) , isSlideHidden : event . get _IsSlideHidden ( ) , fromThumbs : true } , event ) ;
2016-03-11 00:48:53 +00:00
} else {
showObjectMenu . call ( me , event ) ;
}
} , 10 ) ;
} ;
var onFocusObject = function ( selectedElements ) {
2017-06-06 08:04:04 +00:00
if ( me . currentMenu && me . currentMenu . isVisible ( ) ) {
2016-08-30 08:34:27 +00:00
if ( me . api . asc _getCurrentFocusObject ( ) === 0 ) { // thumbnails
2017-11-10 08:59:05 +00:00
if ( me . slideMenu === me . currentMenu && ! me . _isDisabled ) {
2017-07-20 10:37:26 +00:00
var isHidden = false ;
_ . each ( selectedElements , function ( element , index ) {
if ( Asc . c _oAscTypeSelectElement . Slide == element . get _ObjectType ( ) ) {
isHidden = element . get _ObjectValue ( ) . get _IsHidden ( ) ;
}
} ) ;
me . currentMenu . options . initMenu ( { isSlideSelect : me . slideMenu . items [ 2 ] . isVisible ( ) , isSlideHidden : isHidden , fromThumbs : true } ) ;
2016-03-11 00:48:53 +00:00
me . currentMenu . alignPosition ( ) ;
}
2016-08-30 08:34:27 +00:00
} else {
2017-11-10 08:59:05 +00:00
var obj = ( me . mode . isEdit && ! me . _isDisabled ) ? fillMenuProps ( selectedElements ) : fillViewMenuProps ( selectedElements ) ;
2016-08-30 08:34:27 +00:00
if ( obj ) {
if ( obj . menu _to _show === me . currentMenu ) {
me . currentMenu . options . initMenu ( obj . menu _props ) ;
me . currentMenu . alignPosition ( ) ;
}
}
2016-03-11 00:48:53 +00:00
}
}
} ;
var handleDocumentWheel = function ( event ) {
if ( me . api ) {
var delta = ( _ . isUndefined ( event . originalEvent ) ) ? event . wheelDelta : event . originalEvent . wheelDelta ;
if ( _ . isUndefined ( delta ) ) {
delta = event . deltaY ;
}
if ( ( event . ctrlKey || event . metaKey ) && ! event . altKey ) {
if ( delta < 0 )
me . api . zoomOut ( ) ;
else if ( delta > 0 )
me . api . zoomIn ( ) ;
event . preventDefault ( ) ;
event . stopPropagation ( ) ;
}
}
} ;
var handleDocumentKeyDown = function ( event ) {
if ( me . api ) {
var key = event . keyCode ;
if ( ( event . ctrlKey || event . metaKey ) && ! event . shiftKey && ! event . altKey ) {
2017-09-19 14:26:09 +00:00
if ( key === Common . UI . Keys . NUM _PLUS || key === Common . UI . Keys . EQUALITY || ( Common . Utils . isGecko && key === Common . UI . Keys . EQUALITY _FF ) || ( Common . Utils . isOpera && key == 43 ) ) {
2016-03-11 00:48:53 +00:00
me . api . zoomIn ( ) ;
event . preventDefault ( ) ;
event . stopPropagation ( ) ;
return false ;
}
2017-09-19 14:26:09 +00:00
else if ( key === Common . UI . Keys . NUM _MINUS || key === Common . UI . Keys . MINUS || ( Common . Utils . isGecko && key === Common . UI . Keys . MINUS _FF ) || ( Common . Utils . isOpera && key == 45 ) ) {
2016-03-11 00:48:53 +00:00
me . api . zoomOut ( ) ;
event . preventDefault ( ) ;
event . stopPropagation ( ) ;
return false ;
}
}
if ( me . currentMenu && me . currentMenu . isVisible ( ) ) {
if ( key == Common . UI . Keys . UP ||
key == Common . UI . Keys . DOWN ) {
$ ( 'ul.dropdown-menu' , me . currentMenu . el ) . focus ( ) ;
}
}
2017-10-24 11:56:49 +00:00
if ( key == Common . UI . Keys . ESC ) {
Common . UI . Menu . Manager . hideAll ( ) ;
Common . NotificationCenter . trigger ( 'leftmenu:change' , 'hide' ) ;
}
2016-03-11 00:48:53 +00:00
}
} ;
var onDocumentHolderResize = function ( ) {
me . _Height = me . cmpEl . height ( ) ;
me . _Width = me . cmpEl . width ( ) ;
me . _BodyWidth = $ ( 'body' ) . width ( ) ;
2017-10-23 13:28:06 +00:00
me . _XY = undefined ;
2016-03-11 00:48:53 +00:00
if ( me . slideNumDiv ) {
me . slideNumDiv . remove ( ) ;
me . slideNumDiv = undefined ;
}
} ;
var onAfterRender = function ( ct ) {
var meEl = me . cmpEl ;
if ( meEl ) {
meEl . on ( 'contextmenu' , function ( e ) {
e . preventDefault ( ) ;
e . stopPropagation ( ) ;
return false ;
} ) ;
meEl . on ( 'click' , function ( e ) {
if ( e . target . localName == 'canvas' ) {
2019-11-19 07:00:44 +00:00
if ( me . _preventClick )
me . _preventClick = false ;
else
meEl . focus ( ) ;
2016-03-11 00:48:53 +00:00
}
} ) ;
meEl . on ( 'mousedown' , function ( e ) {
if ( e . target . localName == 'canvas' )
Common . UI . Menu . Manager . hideAll ( ) ;
} ) ;
//NOTE: set mouse wheel handler
var addEvent = function ( elem , type , fn ) {
elem . addEventListener ? elem . addEventListener ( type , fn , false ) : elem . attachEvent ( "on" + type , fn ) ;
} ;
var eventname = ( /Firefox/i . test ( navigator . userAgent ) ) ? 'DOMMouseScroll' : 'mousewheel' ;
addEvent ( me . el , eventname , handleDocumentWheel ) ;
}
$ ( document ) . on ( 'mousewheel' , handleDocumentWheel ) ;
$ ( document ) . on ( 'keydown' , handleDocumentKeyDown ) ;
$ ( window ) . on ( 'resize' , onDocumentHolderResize ) ;
var viewport = PE . getController ( 'Viewport' ) . getView ( 'Viewport' ) ;
viewport . hlayout . on ( 'layout:resizedrag' , onDocumentHolderResize ) ;
} ;
/** coauthoring begin **/
var getUserName = function ( id ) {
if ( usersStore ) {
var rec = usersStore . findUser ( id ) ;
if ( rec )
return rec . get ( 'username' ) ;
}
return me . guestText ;
} ;
/** coauthoring end **/
var screenTip = {
toolTip : new Common . UI . Tooltip ( {
owner : this ,
html : true ,
title : '<br><b>Press Ctrl and click link</b>'
// style: 'word-wrap: break-word;'
} ) ,
strTip : '' ,
isHidden : true ,
isVisible : false
} ;
/** coauthoring begin **/
var userTooltip = true ;
var userTipMousover = function ( evt , el , opt ) {
if ( userTooltip === true ) {
userTooltip = new Common . UI . Tooltip ( {
owner : evt . currentTarget ,
title : me . tipIsLocked
} ) ;
userTooltip . show ( ) ;
}
} ;
var userTipHide = function ( ) {
if ( typeof userTooltip == 'object' ) {
userTooltip . hide ( ) ;
userTooltip = undefined ;
for ( var i = 0 ; i < me . usertips . length ; i ++ ) {
me . usertips [ i ] . off ( 'mouseover' , userTipMousover ) ;
me . usertips [ i ] . off ( 'mouseout' , userTipMousout ) ;
}
}
} ;
var userTipMousout = function ( evt , el , opt ) {
if ( typeof userTooltip == 'object' ) {
if ( userTooltip . $element && evt . currentTarget === userTooltip . $element [ 0 ] ) {
userTipHide ( ) ;
}
}
} ;
/** coauthoring end **/
Common . NotificationCenter . on ( {
'window:show' : function ( e ) {
screenTip . toolTip . hide ( ) ;
screenTip . isVisible = false ;
/** coauthoring begin **/
userTipHide ( ) ;
/** coauthoring end **/
} ,
'modal:show' : function ( e ) {
me . hideTips ( ) ;
} ,
'layout:changed' : function ( e ) {
screenTip . toolTip . hide ( ) ;
screenTip . isVisible = false ;
/** coauthoring begin **/
userTipHide ( ) ;
/** coauthoring end **/
me . hideTips ( ) ;
onDocumentHolderResize ( ) ;
}
} ) ;
var onHyperlinkClick = function ( url ) {
if ( url && me . api . asc _getUrlType ( url ) > 0 ) {
window . open ( url ) ;
}
} ;
var onMouseMoveStart = function ( ) {
screenTip . isHidden = true ;
/** coauthoring begin **/
if ( me . usertips . length > 0 ) {
if ( typeof userTooltip == 'object' ) {
userTooltip . hide ( ) ;
userTooltip = true ;
}
_ . each ( me . usertips , function ( item ) {
item . remove ( ) ;
} ) ;
}
me . usertips = [ ] ;
me . usertipcount = 0 ;
/** coauthoring end **/
} ;
var onMouseMoveEnd = function ( ) {
if ( screenTip . isHidden && screenTip . isVisible ) {
screenTip . isVisible = false ;
screenTip . toolTip . hide ( ) ;
}
} ;
var onMouseMove = function ( moveData ) {
if ( _ . isUndefined ( me . _XY ) ) {
me . _XY = [
me . cmpEl . offset ( ) . left - $ ( window ) . scrollLeft ( ) ,
me . cmpEl . offset ( ) . top - $ ( window ) . scrollTop ( )
] ;
me . _Width = me . cmpEl . width ( ) ;
me . _Height = me . cmpEl . height ( ) ;
me . _BodyWidth = $ ( 'body' ) . width ( ) ;
}
if ( moveData ) {
var showPoint , ToolTip ;
if ( moveData . get _Type ( ) == 1 ) { // 1 - hyperlink
var hyperProps = moveData . get _Hyperlink ( ) ;
var recalc = false ;
if ( hyperProps ) {
screenTip . isHidden = false ;
ToolTip = ( _ . isEmpty ( hyperProps . get _ToolTip ( ) ) ) ? hyperProps . get _Value ( ) : hyperProps . get _ToolTip ( ) ;
ToolTip = Common . Utils . String . htmlEncode ( ToolTip ) ;
if ( screenTip . tipLength !== ToolTip . length || screenTip . strTip . indexOf ( ToolTip ) < 0 ) {
screenTip . toolTip . setTitle ( ToolTip + '<br><b>' + me . txtPressLink + '</b>' ) ;
screenTip . tipLength = ToolTip . length ;
screenTip . strTip = ToolTip ;
recalc = true ;
}
showPoint = [ moveData . get _X ( ) , moveData . get _Y ( ) ] ;
showPoint [ 1 ] += ( me . _XY [ 1 ] - 15 ) ;
showPoint [ 0 ] += ( me . _XY [ 0 ] + 5 ) ;
if ( ! screenTip . isVisible || recalc ) {
screenTip . isVisible = true ;
screenTip . toolTip . show ( [ - 10000 , - 10000 ] ) ;
}
if ( recalc ) {
screenTip . tipHeight = screenTip . toolTip . getBSTip ( ) . $tip . height ( ) ;
screenTip . tipWidth = screenTip . toolTip . getBSTip ( ) . $tip . width ( ) ;
}
showPoint [ 1 ] -= screenTip . tipHeight ;
if ( showPoint [ 0 ] + screenTip . tipWidth > me . _BodyWidth )
showPoint [ 0 ] = me . _BodyWidth - screenTip . tipWidth ;
screenTip . toolTip . getBSTip ( ) . $tip . css ( { top : showPoint [ 1 ] + 'px' , left : showPoint [ 0 ] + 'px' } ) ;
}
}
/** coauthoring begin **/
else if ( moveData . get _Type ( ) == 2 && me . mode . isEdit ) { // 2 - locked object
var src ;
if ( me . usertipcount >= me . usertips . length ) {
src = $ ( document . createElement ( "div" ) ) ;
src . addClass ( 'username-tip' ) ;
src . css ( { height : me . _TtHeight + 'px' , position : 'absolute' , zIndex : '900' , visibility : 'visible' } ) ;
$ ( document . body ) . append ( src ) ;
if ( userTooltip ) {
src . on ( 'mouseover' , userTipMousover ) ;
src . on ( 'mouseout' , userTipMousout ) ;
}
me . usertips . push ( src ) ;
}
src = me . usertips [ me . usertipcount ] ;
me . usertipcount ++ ;
ToolTip = getUserName ( moveData . get _UserId ( ) ) ;
showPoint = [ moveData . get _X ( ) + me . _XY [ 0 ] , moveData . get _Y ( ) + me . _XY [ 1 ] ] ;
2018-04-04 13:40:23 +00:00
var maxwidth = showPoint [ 0 ] ;
2016-03-11 00:48:53 +00:00
showPoint [ 0 ] = me . _BodyWidth - showPoint [ 0 ] ;
showPoint [ 1 ] -= ( ( moveData . get _LockedObjectType ( ) == 2 ) ? me . _TtHeight : 0 ) ;
if ( showPoint [ 1 ] > me . _XY [ 1 ] && showPoint [ 1 ] + me . _TtHeight < me . _XY [ 1 ] + me . _Height ) {
src . text ( ToolTip ) ;
2018-04-04 13:40:23 +00:00
src . css ( { visibility : 'visible' , top : showPoint [ 1 ] + 'px' , right : showPoint [ 0 ] + 'px' , 'max-width' : maxwidth + 'px' } ) ;
2016-03-11 00:48:53 +00:00
}
}
/** coauthoring end **/
}
} ;
var onShowForeignCursorLabel = function ( UserId , X , Y , color ) {
/** coauthoring begin **/
var src ;
for ( var i = 0 ; i < me . fastcoauthtips . length ; i ++ ) {
if ( me . fastcoauthtips [ i ] . attr ( 'userid' ) == UserId ) {
src = me . fastcoauthtips [ i ] ;
break ;
}
}
if ( ! src ) {
src = $ ( document . createElement ( "div" ) ) ;
src . addClass ( 'username-tip' ) ;
src . attr ( 'userid' , UserId ) ;
src . css ( { height : me . _TtHeight + 'px' , position : 'absolute' , zIndex : '900' , display : 'none' , 'pointer-events' : 'none' ,
'background-color' : '#' + Common . Utils . ThemeColor . getHexColor ( color . get _r ( ) , color . get _g ( ) , color . get _b ( ) ) } ) ;
src . text ( getUserName ( UserId ) ) ;
2018-02-27 14:20:20 +00:00
$ ( '#id_main_parent' ) . append ( src ) ;
2016-03-11 00:48:53 +00:00
me . fastcoauthtips . push ( src ) ;
src . fadeIn ( 150 ) ;
}
src . css ( { top : ( Y - me . _TtHeight ) + 'px' , left : X + 'px' } ) ;
/** coauthoring end **/
} ;
var onHideForeignCursorLabel = function ( UserId ) {
/** coauthoring begin **/
for ( var i = 0 ; i < me . fastcoauthtips . length ; i ++ ) {
if ( me . fastcoauthtips [ i ] . attr ( 'userid' ) == UserId ) {
var src = me . fastcoauthtips [ i ] ;
me . fastcoauthtips [ i ] . fadeOut ( 150 , function ( ) { src . remove ( ) } ) ;
me . fastcoauthtips . splice ( i , 1 ) ;
break ;
}
}
/** coauthoring end **/
} ;
var onDialogAddHyperlink = function ( ) {
var win , props , text ;
2018-08-28 11:24:09 +00:00
if ( me . api && me . mode . isEdit && ! me . _isDisabled && ! PE . getController ( 'LeftMenu' ) . leftMenu . menuFile . isVisible ( ) ) {
2016-03-11 00:48:53 +00:00
var handlerDlg = function ( dlg , result ) {
if ( result == 'ok' ) {
props = dlg . getSettings ( ) ;
( text !== false )
? me . api . add _Hyperlink ( props )
: me . api . change _Hyperlink ( props ) ;
}
me . fireEvent ( 'editcomplete' , me ) ;
} ;
text = me . api . can _AddHyperlink ( ) ;
var _arr = [ ] ;
for ( var i = 0 ; i < me . api . getCountPages ( ) ; i ++ ) {
_arr . push ( {
displayValue : i + 1 ,
value : i
} ) ;
}
if ( text !== false ) {
win = new PE . Views . HyperlinkSettingsDialog ( {
api : me . api ,
handler : handlerDlg ,
slides : _arr
} ) ;
2016-04-05 12:57:51 +00:00
props = new Asc . CHyperlinkProperty ( ) ;
2016-03-11 00:48:53 +00:00
props . put _Text ( text ) ;
win . show ( ) ;
win . setSettings ( props ) ;
} else {
var selectedElements = me . api . getSelectedElements ( ) ;
if ( selectedElements && _ . isArray ( selectedElements ) ) {
_ . each ( selectedElements , function ( el , i ) {
2016-04-05 11:52:34 +00:00
if ( selectedElements [ i ] . get _ObjectType ( ) == Asc . c _oAscTypeSelectElement . Hyperlink )
2016-03-11 00:48:53 +00:00
props = selectedElements [ i ] . get _ObjectValue ( ) ;
} ) ;
}
if ( props ) {
win = new PE . Views . HyperlinkSettingsDialog ( {
api : me . api ,
handler : handlerDlg ,
slides : _arr
} ) ;
win . show ( ) ;
win . setSettings ( props ) ;
}
}
}
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Add Hyperlink' ) ;
} ;
var onPaintSlideNum = function ( slideNum ) {
if ( _ . isUndefined ( me . _XY ) ) {
me . _XY = [
me . cmpEl . offset ( ) . left - $ ( window ) . scrollLeft ( ) ,
me . cmpEl . offset ( ) . top - $ ( window ) . scrollTop ( )
] ;
me . _Width = me . cmpEl . width ( ) ;
me . _Height = me . cmpEl . height ( ) ;
me . _BodyWidth = $ ( 'body' ) . width ( ) ;
}
if ( _ . isUndefined ( me . slideNumDiv ) ) {
me . slideNumDiv = $ ( document . createElement ( "div" ) ) ;
me . slideNumDiv . addClass ( 'slidenum-div' ) ;
me . slideNumDiv . css ( {
position : 'absolute' ,
display : 'block' ,
zIndex : '900' ,
top : me . _XY [ 1 ] + me . _Height / 2 + 'px' ,
right : ( me . _BodyWidth - me . _XY [ 0 ] - me . _Width + 22 ) + 'px'
} ) ;
$ ( document . body ) . append ( me . slideNumDiv ) ;
}
me . slideNumDiv . html ( me . txtSlide + ' ' + ( slideNum + 1 ) ) ;
me . slideNumDiv . show ( ) ;
} ;
var onEndPaintSlideNum = function ( ) {
if ( me . slideNumDiv )
me . slideNumDiv . hide ( ) ;
} ;
var onCoAuthoringDisconnect = function ( ) {
me . mode . isEdit = false ;
} ;
2017-04-26 09:26:02 +00:00
var onTextLanguage = function ( langid ) {
me . _currLang . id = langid ;
} ;
this . changeLanguageMenu = function ( menu ) {
if ( me . _currLang . id === null || me . _currLang . id === undefined ) {
2019-08-10 14:40:57 +00:00
menu . clearAll ( ) ;
2017-04-26 09:26:02 +00:00
} else {
2019-08-10 14:40:57 +00:00
var index = _ . findIndex ( menu . items , { langid : me . _currLang . id } ) ;
( index > - 1 ) && ! menu . items [ index ] . checked && menu . setChecked ( index , true ) ;
2017-04-26 09:26:02 +00:00
}
} ;
var onSpellCheckVariantsFound = function ( ) {
var selectedElements = me . api . getSelectedElements ( true ) ;
var props ;
if ( selectedElements && _ . isArray ( selectedElements ) ) {
for ( var i = 0 ; i < selectedElements . length ; i ++ ) {
if ( selectedElements [ i ] . get _ObjectType ( ) == Asc . c _oAscTypeSelectElement . SpellCheck ) {
props = selectedElements [ i ] . get _ObjectValue ( ) ;
me . _currentSpellObj = props ;
break ;
}
}
}
if ( props && props . get _Checked ( ) === false && props . get _Variants ( ) !== null && props . get _Variants ( ) !== undefined ) {
me . addWordVariants ( ) ;
2018-11-08 12:08:55 +00:00
if ( me . textMenu && me . textMenu . isVisible ( ) ) {
2017-04-26 09:26:02 +00:00
me . textMenu . alignPosition ( ) ;
}
}
} ;
this . addWordVariants = function ( isParagraph ) {
2019-07-11 11:35:24 +00:00
if ( ! me . textMenu || ! me . textMenu . isVisible ( ) && ! me . tableMenu . isVisible ( ) ) return ;
2018-11-08 12:08:55 +00:00
2017-04-26 09:26:02 +00:00
if ( _ . isUndefined ( isParagraph ) ) {
isParagraph = me . textMenu . isVisible ( ) ;
}
me . clearWordVariants ( isParagraph ) ;
var moreMenu = ( isParagraph ) ? me . menuSpellMorePara : me . menuSpellMoreTable ;
var spellMenu = ( isParagraph ) ? me . menuSpellPara : me . menuSpellTable ;
var arr = [ ] ,
arrMore = [ ] ;
var variants = me . _currentSpellObj . get _Variants ( ) ;
if ( variants . length > 0 ) {
moreMenu . setVisible ( variants . length > 3 ) ;
moreMenu . setDisabled ( me . _currentParaObjDisabled ) ;
_ . 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 ) ;
}
} ) ;
( index < 3 ) ? arr . push ( mnu ) : arrMore . push ( mnu ) ;
} ) ;
if ( arr . length > 0 ) {
if ( isParagraph ) {
2019-06-25 13:13:50 +00:00
_ . each ( arr , function ( variant , index ) {
me . textMenu . insertItem ( index , variant ) ;
2017-04-26 09:26:02 +00:00
} )
} else {
2019-06-25 13:13:50 +00:00
_ . each ( arr , function ( variant , index ) {
me . menuSpellCheckTable . menu . insertItem ( index , variant ) ;
2017-04-26 09:26:02 +00:00
} )
}
}
if ( arrMore . length > 0 ) {
2019-06-25 13:13:50 +00:00
_ . each ( arrMore , function ( variant , index ) {
moreMenu . menu . addItem ( variant ) ;
2017-04-26 09:26:02 +00:00
} ) ;
}
spellMenu . setVisible ( false ) ;
} else {
moreMenu . setVisible ( false ) ;
spellMenu . setVisible ( true ) ;
spellMenu . setCaption ( me . noSpellVariantsText , true ) ;
}
} ;
this . clearWordVariants = function ( isParagraph ) {
var spellMenu = ( isParagraph ) ? me . textMenu : me . menuSpellCheckTable . menu ;
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 ;
}
spellMenu . removeItem ( spellMenu . items [ i ] ) ;
i -- ;
}
}
( isParagraph ) ? me . menuSpellMorePara . menu . removeAll ( ) : me . menuSpellMoreTable . menu . removeAll ( ) ;
me . menuSpellMorePara . menu . checkeditem = undefined ;
me . menuSpellMorePara . menu . activeItem = undefined ;
me . menuSpellMoreTable . menu . checkeditem = undefined ;
me . menuSpellMoreTable . menu . activeItem = undefined ;
} ;
2016-10-25 10:48:31 +00:00
this . initEquationMenu = function ( ) {
if ( ! me . _currentMathObj ) return ;
var type = me . _currentMathObj . get _Type ( ) ,
value = me . _currentMathObj ,
mnu , arr = [ ] ;
switch ( type ) {
case Asc . c _oAscMathInterfaceType . Accent :
mnu = new Common . UI . MenuItem ( {
caption : me . txtRemoveAccentChar ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'remove_AccentCharacter' }
} ) ;
arr . push ( mnu ) ;
break ;
case Asc . c _oAscMathInterfaceType . BorderBox :
mnu = new Common . UI . MenuItem ( {
caption : me . txtBorderProps ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
menu : new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
{
caption : value . get _HideTop ( ) ? me . txtAddTop : me . txtHideTop ,
equationProps : { type : type , callback : 'put_HideTop' , value : ! value . get _HideTop ( ) }
} ,
{
caption : value . get _HideBottom ( ) ? me . txtAddBottom : me . txtHideBottom ,
equationProps : { type : type , callback : 'put_HideBottom' , value : ! value . get _HideBottom ( ) }
} ,
{
caption : value . get _HideLeft ( ) ? me . txtAddLeft : me . txtHideLeft ,
equationProps : { type : type , callback : 'put_HideLeft' , value : ! value . get _HideLeft ( ) }
} ,
{
caption : value . get _HideRight ( ) ? me . txtAddRight : me . txtHideRight ,
equationProps : { type : type , callback : 'put_HideRight' , value : ! value . get _HideRight ( ) }
} ,
{
caption : value . get _HideHor ( ) ? me . txtAddHor : me . txtHideHor ,
equationProps : { type : type , callback : 'put_HideHor' , value : ! value . get _HideHor ( ) }
} ,
{
caption : value . get _HideVer ( ) ? me . txtAddVer : me . txtHideVer ,
equationProps : { type : type , callback : 'put_HideVer' , value : ! value . get _HideVer ( ) }
} ,
{
caption : value . get _HideTopLTR ( ) ? me . txtAddLT : me . txtHideLT ,
equationProps : { type : type , callback : 'put_HideTopLTR' , value : ! value . get _HideTopLTR ( ) }
} ,
{
caption : value . get _HideTopRTL ( ) ? me . txtAddLB : me . txtHideLB ,
equationProps : { type : type , callback : 'put_HideTopRTL' , value : ! value . get _HideTopRTL ( ) }
}
]
} )
} ) ;
arr . push ( mnu ) ;
break ;
case Asc . c _oAscMathInterfaceType . Bar :
mnu = new Common . UI . MenuItem ( {
caption : me . txtRemoveBar ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'remove_Bar' }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : ( value . get _Pos ( ) == Asc . c _oAscMathInterfaceBarPos . Top ) ? me . txtUnderbar : me . txtOverbar ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_Pos' , value : ( value . get _Pos ( ) == Asc . c _oAscMathInterfaceBarPos . Top ) ? Asc . c _oAscMathInterfaceBarPos . Bottom : Asc . c _oAscMathInterfaceBarPos . Top }
} ) ;
arr . push ( mnu ) ;
break ;
case Asc . c _oAscMathInterfaceType . Script :
var scripttype = value . get _ScriptType ( ) ;
if ( scripttype == Asc . c _oAscMathInterfaceScript . PreSubSup ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtScriptsAfter ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_ScriptType' , value : Asc . c _oAscMathInterfaceScript . SubSup }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . txtRemScripts ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_ScriptType' , value : Asc . c _oAscMathInterfaceScript . None }
} ) ;
arr . push ( mnu ) ;
} else {
if ( scripttype == Asc . c _oAscMathInterfaceScript . SubSup ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtScriptsBefore ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_ScriptType' , value : Asc . c _oAscMathInterfaceScript . PreSubSup }
} ) ;
arr . push ( mnu ) ;
}
if ( scripttype == Asc . c _oAscMathInterfaceScript . SubSup || scripttype == Asc . c _oAscMathInterfaceScript . Sub ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtRemSubscript ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_ScriptType' , value : ( scripttype == Asc . c _oAscMathInterfaceScript . SubSup ) ? Asc . c _oAscMathInterfaceScript . Sup : Asc . c _oAscMathInterfaceScript . None }
} ) ;
arr . push ( mnu ) ;
}
if ( scripttype == Asc . c _oAscMathInterfaceScript . SubSup || scripttype == Asc . c _oAscMathInterfaceScript . Sup ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtRemSuperscript ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_ScriptType' , value : ( scripttype == Asc . c _oAscMathInterfaceScript . SubSup ) ? Asc . c _oAscMathInterfaceScript . Sub : Asc . c _oAscMathInterfaceScript . None }
} ) ;
arr . push ( mnu ) ;
}
}
break ;
case Asc . c _oAscMathInterfaceType . Fraction :
var fraction = value . get _FractionType ( ) ;
if ( fraction == Asc . c _oAscMathInterfaceFraction . Skewed || fraction == Asc . c _oAscMathInterfaceFraction . Linear ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtFractionStacked ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_FractionType' , value : Asc . c _oAscMathInterfaceFraction . Bar }
} ) ;
arr . push ( mnu ) ;
}
if ( fraction == Asc . c _oAscMathInterfaceFraction . Bar || fraction == Asc . c _oAscMathInterfaceFraction . Linear ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtFractionSkewed ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_FractionType' , value : Asc . c _oAscMathInterfaceFraction . Skewed }
} ) ;
arr . push ( mnu ) ;
}
if ( fraction == Asc . c _oAscMathInterfaceFraction . Bar || fraction == Asc . c _oAscMathInterfaceFraction . Skewed ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtFractionLinear ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_FractionType' , value : Asc . c _oAscMathInterfaceFraction . Linear }
} ) ;
arr . push ( mnu ) ;
}
if ( fraction == Asc . c _oAscMathInterfaceFraction . Bar || fraction == Asc . c _oAscMathInterfaceFraction . NoBar ) {
mnu = new Common . UI . MenuItem ( {
caption : ( fraction == Asc . c _oAscMathInterfaceFraction . Bar ) ? me . txtRemFractionBar : me . txtAddFractionBar ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_FractionType' , value : ( fraction == Asc . c _oAscMathInterfaceFraction . Bar ) ? Asc . c _oAscMathInterfaceFraction . NoBar : Asc . c _oAscMathInterfaceFraction . Bar }
} ) ;
arr . push ( mnu ) ;
}
break ;
case Asc . c _oAscMathInterfaceType . Limit :
mnu = new Common . UI . MenuItem ( {
caption : ( value . get _Pos ( ) == Asc . c _oAscMathInterfaceLimitPos . Top ) ? me . txtLimitUnder : me . txtLimitOver ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_Pos' , value : ( value . get _Pos ( ) == Asc . c _oAscMathInterfaceLimitPos . Top ) ? Asc . c _oAscMathInterfaceLimitPos . Bottom : Asc . c _oAscMathInterfaceLimitPos . Top }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . txtRemLimit ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_Pos' , value : Asc . c _oAscMathInterfaceLimitPos . None }
} ) ;
arr . push ( mnu ) ;
break ;
case Asc . c _oAscMathInterfaceType . Matrix :
mnu = new Common . UI . MenuItem ( {
caption : value . get _HidePlaceholder ( ) ? me . txtShowPlaceholder : me . txtHidePlaceholder ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_HidePlaceholder' , value : ! value . get _HidePlaceholder ( ) }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . insertText ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
menu : new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
{
caption : me . insertRowAboveText ,
equationProps : { type : type , callback : 'insert_MatrixRow' , value : true }
} ,
{
caption : me . insertRowBelowText ,
equationProps : { type : type , callback : 'insert_MatrixRow' , value : false }
} ,
{
caption : me . insertColumnLeftText ,
equationProps : { type : type , callback : 'insert_MatrixColumn' , value : true }
} ,
{
caption : me . insertColumnRightText ,
equationProps : { type : type , callback : 'insert_MatrixColumn' , value : false }
}
]
} )
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . deleteText ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
menu : new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
{
caption : me . deleteRowText ,
equationProps : { type : type , callback : 'delete_MatrixRow' }
} ,
{
caption : me . deleteColumnText ,
equationProps : { type : type , callback : 'delete_MatrixColumn' }
}
]
} )
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . txtMatrixAlign ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
menu : new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
{
caption : me . txtTop ,
checkable : true ,
checked : ( value . get _MatrixAlign ( ) == Asc . c _oAscMathInterfaceMatrixMatrixAlign . Top ) ,
equationProps : { type : type , callback : 'put_MatrixAlign' , value : Asc . c _oAscMathInterfaceMatrixMatrixAlign . Top }
} ,
{
caption : me . centerText ,
checkable : true ,
checked : ( value . get _MatrixAlign ( ) == Asc . c _oAscMathInterfaceMatrixMatrixAlign . Center ) ,
equationProps : { type : type , callback : 'put_MatrixAlign' , value : Asc . c _oAscMathInterfaceMatrixMatrixAlign . Center }
} ,
{
caption : me . txtBottom ,
checkable : true ,
checked : ( value . get _MatrixAlign ( ) == Asc . c _oAscMathInterfaceMatrixMatrixAlign . Bottom ) ,
equationProps : { type : type , callback : 'put_MatrixAlign' , value : Asc . c _oAscMathInterfaceMatrixMatrixAlign . Bottom }
}
]
} )
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . txtColumnAlign ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
menu : new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
{
caption : me . leftText ,
checkable : true ,
checked : ( value . get _ColumnAlign ( ) == Asc . c _oAscMathInterfaceMatrixColumnAlign . Left ) ,
equationProps : { type : type , callback : 'put_ColumnAlign' , value : Asc . c _oAscMathInterfaceMatrixColumnAlign . Left }
} ,
{
caption : me . centerText ,
checkable : true ,
checked : ( value . get _ColumnAlign ( ) == Asc . c _oAscMathInterfaceMatrixColumnAlign . Center ) ,
equationProps : { type : type , callback : 'put_ColumnAlign' , value : Asc . c _oAscMathInterfaceMatrixColumnAlign . Center }
} ,
{
caption : me . rightText ,
checkable : true ,
checked : ( value . get _ColumnAlign ( ) == Asc . c _oAscMathInterfaceMatrixColumnAlign . Right ) ,
equationProps : { type : type , callback : 'put_ColumnAlign' , value : Asc . c _oAscMathInterfaceMatrixColumnAlign . Right }
}
]
} )
} ) ;
arr . push ( mnu ) ;
break ;
case Asc . c _oAscMathInterfaceType . EqArray :
mnu = new Common . UI . MenuItem ( {
caption : me . txtInsertEqBefore ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'insert_Equation' , value : true }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . txtInsertEqAfter ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'insert_Equation' , value : false }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . txtDeleteEq ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'delete_Equation' }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . alignmentText ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
menu : new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
{
caption : me . txtTop ,
checkable : true ,
checked : ( value . get _Align ( ) == Asc . c _oAscMathInterfaceEqArrayAlign . Top ) ,
equationProps : { type : type , callback : 'put_Align' , value : Asc . c _oAscMathInterfaceEqArrayAlign . Top }
} ,
{
caption : me . centerText ,
checkable : true ,
checked : ( value . get _Align ( ) == Asc . c _oAscMathInterfaceEqArrayAlign . Center ) ,
equationProps : { type : type , callback : 'put_Align' , value : Asc . c _oAscMathInterfaceEqArrayAlign . Center }
} ,
{
caption : me . txtBottom ,
checkable : true ,
checked : ( value . get _Align ( ) == Asc . c _oAscMathInterfaceEqArrayAlign . Bottom ) ,
equationProps : { type : type , callback : 'put_Align' , value : Asc . c _oAscMathInterfaceEqArrayAlign . Bottom }
}
]
} )
} ) ;
arr . push ( mnu ) ;
break ;
case Asc . c _oAscMathInterfaceType . LargeOperator :
mnu = new Common . UI . MenuItem ( {
caption : me . txtLimitChange ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_LimitLocation' , value : ( value . get _LimitLocation ( ) == Asc . c _oAscMathInterfaceNaryLimitLocation . UndOvr ) ? Asc . c _oAscMathInterfaceNaryLimitLocation . SubSup : Asc . c _oAscMathInterfaceNaryLimitLocation . UndOvr }
} ) ;
arr . push ( mnu ) ;
if ( value . get _HideUpper ( ) !== undefined ) {
mnu = new Common . UI . MenuItem ( {
caption : value . get _HideUpper ( ) ? me . txtShowTopLimit : me . txtHideTopLimit ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_HideUpper' , value : ! value . get _HideUpper ( ) }
} ) ;
arr . push ( mnu ) ;
}
if ( value . get _HideLower ( ) !== undefined ) {
mnu = new Common . UI . MenuItem ( {
caption : value . get _HideLower ( ) ? me . txtShowBottomLimit : me . txtHideBottomLimit ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_HideLower' , value : ! value . get _HideLower ( ) }
} ) ;
arr . push ( mnu ) ;
}
break ;
case Asc . c _oAscMathInterfaceType . Delimiter :
mnu = new Common . UI . MenuItem ( {
caption : me . txtInsertArgBefore ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'insert_DelimiterArgument' , value : true }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . txtInsertArgAfter ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'insert_DelimiterArgument' , value : false }
} ) ;
arr . push ( mnu ) ;
if ( value . can _DeleteArgument ( ) ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtDeleteArg ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'delete_DelimiterArgument' }
} ) ;
arr . push ( mnu ) ;
}
mnu = new Common . UI . MenuItem ( {
caption : value . has _Separators ( ) ? me . txtDeleteCharsAndSeparators : me . txtDeleteChars ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'remove_DelimiterCharacters' }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : value . get _HideOpeningBracket ( ) ? me . txtShowOpenBracket : me . txtHideOpenBracket ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_HideOpeningBracket' , value : ! value . get _HideOpeningBracket ( ) }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : value . get _HideClosingBracket ( ) ? me . txtShowCloseBracket : me . txtHideCloseBracket ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_HideClosingBracket' , value : ! value . get _HideClosingBracket ( ) }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . txtStretchBrackets ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
checkable : true ,
checked : value . get _StretchBrackets ( ) ,
equationProps : { type : type , callback : 'put_StretchBrackets' , value : ! value . get _StretchBrackets ( ) }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . txtMatchBrackets ,
equation : true ,
disabled : ( ! value . get _StretchBrackets ( ) || me . _currentParaObjDisabled ) ,
checkable : true ,
checked : value . get _StretchBrackets ( ) && value . get _MatchBrackets ( ) ,
equationProps : { type : type , callback : 'put_MatchBrackets' , value : ! value . get _MatchBrackets ( ) }
} ) ;
arr . push ( mnu ) ;
break ;
case Asc . c _oAscMathInterfaceType . GroupChar :
if ( value . can _ChangePos ( ) ) {
mnu = new Common . UI . MenuItem ( {
caption : ( value . get _Pos ( ) == Asc . c _oAscMathInterfaceGroupCharPos . Top ) ? me . txtGroupCharUnder : me . txtGroupCharOver ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_Pos' , value : ( value . get _Pos ( ) == Asc . c _oAscMathInterfaceGroupCharPos . Top ) ? Asc . c _oAscMathInterfaceGroupCharPos . Bottom : Asc . c _oAscMathInterfaceGroupCharPos . Top }
} ) ;
arr . push ( mnu ) ;
mnu = new Common . UI . MenuItem ( {
caption : me . txtDeleteGroupChar ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_Pos' , value : Asc . c _oAscMathInterfaceGroupCharPos . None }
} ) ;
arr . push ( mnu ) ;
}
break ;
case Asc . c _oAscMathInterfaceType . Radical :
if ( value . get _HideDegree ( ) !== undefined ) {
mnu = new Common . UI . MenuItem ( {
caption : value . get _HideDegree ( ) ? me . txtShowDegree : me . txtHideDegree ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'put_HideDegree' , value : ! value . get _HideDegree ( ) }
} ) ;
arr . push ( mnu ) ;
}
mnu = new Common . UI . MenuItem ( {
caption : me . txtDeleteRadical ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'remove_Radical' }
} ) ;
arr . push ( mnu ) ;
break ;
}
if ( value . can _IncreaseArgumentSize ( ) ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtIncreaseArg ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'increase_ArgumentSize' }
} ) ;
arr . push ( mnu ) ;
}
if ( value . can _DecreaseArgumentSize ( ) ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtDecreaseArg ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'decrease_ArgumentSize' }
} ) ;
arr . push ( mnu ) ;
}
if ( value . can _InsertManualBreak ( ) ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtInsertBreak ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'insert_ManualBreak' }
} ) ;
arr . push ( mnu ) ;
}
if ( value . can _DeleteManualBreak ( ) ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtDeleteBreak ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'delete_ManualBreak' }
} ) ;
arr . push ( mnu ) ;
}
if ( value . can _AlignToCharacter ( ) ) {
mnu = new Common . UI . MenuItem ( {
caption : me . txtAlignToChar ,
equation : true ,
disabled : me . _currentParaObjDisabled ,
equationProps : { type : type , callback : 'align_ToCharacter' }
} ) ;
arr . push ( mnu ) ;
}
return arr ;
} ;
this . addEquationMenu = function ( isParagraph , insertIdx ) {
if ( _ . isUndefined ( isParagraph ) ) {
isParagraph = me . textMenu . isVisible ( ) ;
}
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 ++ ;
} ) ;
}
return menuItems . length ;
} ;
this . clearEquationMenu = function ( isParagraph , insertIdx ) {
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 ;
}
} ;
this . equationCallback = function ( eqProps ) {
if ( eqProps ) {
var eqObj ;
switch ( eqProps . type ) {
case Asc . c _oAscMathInterfaceType . Accent :
eqObj = new CMathMenuAccent ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . BorderBox :
eqObj = new CMathMenuBorderBox ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . Box :
eqObj = new CMathMenuBox ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . Bar :
eqObj = new CMathMenuBar ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . Script :
eqObj = new CMathMenuScript ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . Fraction :
eqObj = new CMathMenuFraction ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . Limit :
eqObj = new CMathMenuLimit ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . Matrix :
eqObj = new CMathMenuMatrix ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . EqArray :
eqObj = new CMathMenuEqArray ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . LargeOperator :
eqObj = new CMathMenuNary ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . Delimiter :
eqObj = new CMathMenuDelimiter ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . GroupChar :
eqObj = new CMathMenuGroupCharacter ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . Radical :
eqObj = new CMathMenuRadical ( ) ;
break ;
case Asc . c _oAscMathInterfaceType . Common :
eqObj = new CMathMenuBase ( ) ;
break ;
}
if ( eqObj ) {
eqObj [ eqProps . callback ] ( eqProps . value ) ;
me . api . asc _SetMathProps ( eqObj ) ;
}
}
me . fireEvent ( 'editcomplete' , me ) ;
} ;
2016-03-11 00:48:53 +00:00
this . changePosition = function ( ) {
me . _XY = [
me . cmpEl . offset ( ) . left - $ ( window ) . scrollLeft ( ) ,
me . cmpEl . offset ( ) . top - $ ( window ) . scrollTop ( )
] ;
onMouseMoveStart ( ) ;
} ;
this . hideTips = function ( ) {
/** coauthoring begin **/
if ( typeof userTooltip == 'object' ) {
userTooltip . hide ( ) ;
userTooltip = true ;
}
_ . each ( me . usertips , function ( item ) {
item . remove ( ) ;
} ) ;
me . usertips = [ ] ;
me . usertipcount = 0 ;
/** coauthoring end **/
} ;
/** coauthoring begin **/
// Hotkeys
// ---------------------
var keymap = { } ;
var hkComments = 'alt+h' ;
keymap [ hkComments ] = function ( ) {
if ( me . api . can _AddQuotedComment ( ) !== false && me . slidesCount > 0 ) {
me . addComment ( ) ;
}
} ;
var hkPreview = 'command+f5,ctrl+f5' ;
keymap [ hkPreview ] = function ( e ) {
2016-11-24 09:42:43 +00:00
var isResized = false ;
2016-03-11 00:48:53 +00:00
e . preventDefault ( ) ;
e . stopPropagation ( ) ;
if ( me . slidesCount > 0 ) {
2017-07-20 13:46:45 +00:00
Common . NotificationCenter . trigger ( 'preview:start' , 0 ) ;
2016-03-11 00:48:53 +00:00
}
} ;
Common . util . Shortcuts . delegateShortcuts ( { shortcuts : keymap } ) ;
2018-01-12 07:16:30 +00:00
var onApiStartDemonstration = function ( ) {
if ( me . slidesCount > 0 ) {
Common . NotificationCenter . trigger ( 'preview:start' , 0 ) ;
}
} ;
2016-03-11 00:48:53 +00:00
/** coauthoring end **/
var onApiCountPages = function ( count ) {
me . slidesCount = count ;
} ;
2016-08-19 06:18:45 +00:00
var onApiCurrentPages = function ( number ) {
2016-12-01 14:31:16 +00:00
if ( me . currentMenu && me . currentMenu . isVisible ( ) && me . _isFromSlideMenu !== true && me . _isFromSlideMenu !== number )
me . currentMenu . hide ( ) ;
me . _isFromSlideMenu = number ;
2016-08-19 06:18:45 +00:00
} ;
2017-08-07 14:20:17 +00:00
var onApiUpdateThemeIndex = function ( v ) {
me . _state . themeId = v ;
} ;
var onApiLockDocumentTheme = function ( ) {
me . _state . themeLock = true ;
} ;
var onApiUnLockDocumentTheme = function ( ) {
me . _state . themeLock = false ;
} ;
2017-09-19 08:17:54 +00:00
var onShowSpecialPasteOptions = function ( specialPasteShowOptions ) {
var coord = specialPasteShowOptions . asc _getCellCoord ( ) ,
pasteContainer = me . cmpEl . find ( '#special-paste-container' ) ,
pasteItems = specialPasteShowOptions . asc _getOptions ( ) ;
2018-11-13 15:06:00 +00:00
if ( ! pasteItems ) return ;
2017-09-19 08:17:54 +00:00
// Prepare menu container
if ( pasteContainer . length < 1 ) {
me . _arrSpecialPaste = [ ] ;
2017-10-30 12:05:09 +00:00
me . _arrSpecialPaste [ Asc . c _oSpecialPasteProps . paste ] = me . textPaste ;
2017-09-19 08:17:54 +00:00
me . _arrSpecialPaste [ Asc . c _oSpecialPasteProps . keepTextOnly ] = me . txtKeepTextOnly ;
2017-11-02 14:09:02 +00:00
me . _arrSpecialPaste [ Asc . c _oSpecialPasteProps . picture ] = me . txtPastePicture ;
2017-11-17 11:51:17 +00:00
me . _arrSpecialPaste [ Asc . c _oSpecialPasteProps . sourceformatting ] = me . txtPasteSourceFormat ;
me . _arrSpecialPaste [ Asc . c _oSpecialPasteProps . destinationFormatting ] = me . txtPasteDestFormat ;
2017-09-19 08:17:54 +00:00
pasteContainer = $ ( '<div id="special-paste-container" style="position: absolute;"><div id="id-document-holder-btn-special-paste"></div></div>' ) ;
me . cmpEl . append ( pasteContainer ) ;
me . btnSpecialPaste = new Common . UI . Button ( {
cls : 'btn-toolbar' ,
iconCls : 'btn-paste' ,
menu : new Common . UI . Menu ( { items : [ ] } )
} ) ;
me . btnSpecialPaste . render ( $ ( '#id-document-holder-btn-special-paste' ) ) ;
}
if ( pasteItems . length > 0 ) {
var menu = me . btnSpecialPaste . menu ;
for ( var i = 0 ; i < menu . items . length ; i ++ ) {
menu . removeItem ( menu . items [ i ] ) ;
i -- ;
}
var group _prev = - 1 ;
_ . each ( pasteItems , function ( menuItem , index ) {
var mnu = new Common . UI . MenuItem ( {
caption : me . _arrSpecialPaste [ menuItem ] ,
value : menuItem ,
checkable : true ,
toggleGroup : 'specialPasteGroup'
} ) . on ( 'click' , function ( item , e ) {
me . api . asc _SpecialPaste ( item . value ) ;
setTimeout ( function ( ) { menu . hide ( ) ; } , 100 ) ;
} ) ;
menu . addItem ( mnu ) ;
} ) ;
( menu . items . length > 0 ) && menu . items [ 0 ] . setChecked ( true , true ) ;
}
if ( coord . asc _getX ( ) < 0 || coord . asc _getY ( ) < 0 ) {
if ( pasteContainer . is ( ':visible' ) ) pasteContainer . hide ( ) ;
} else {
var showPoint = [ coord . asc _getX ( ) + coord . asc _getWidth ( ) + 3 , coord . asc _getY ( ) + coord . asc _getHeight ( ) + 3 ] ;
pasteContainer . css ( { left : showPoint [ 0 ] , top : showPoint [ 1 ] } ) ;
pasteContainer . show ( ) ;
}
} ;
var onHideSpecialPasteOptions = function ( ) {
var pasteContainer = me . cmpEl . find ( '#special-paste-container' ) ;
if ( pasteContainer . is ( ':visible' ) )
pasteContainer . hide ( ) ;
} ;
2019-04-09 11:29:51 +00:00
var onChangeCropState = function ( state ) {
this . menuImgCrop . menu . items [ 0 ] . setChecked ( state , true ) ;
} ;
2016-03-11 00:48:53 +00:00
this . setApi = function ( o ) {
me . api = o ;
if ( me . api ) {
me . api . asc _registerCallback ( 'asc_onContextMenu' , _ . bind ( onContextMenu , me ) ) ;
me . api . asc _registerCallback ( 'asc_onMouseMoveStart' , _ . bind ( onMouseMoveStart , me ) ) ;
me . api . asc _registerCallback ( 'asc_onMouseMoveEnd' , _ . bind ( onMouseMoveEnd , me ) ) ;
me . api . asc _registerCallback ( 'asc_onPaintSlideNum' , _ . bind ( onPaintSlideNum , me ) ) ;
me . api . asc _registerCallback ( 'asc_onEndPaintSlideNum' , _ . bind ( onEndPaintSlideNum , me ) ) ;
me . api . asc _registerCallback ( 'asc_onCountPages' , _ . bind ( onApiCountPages , me ) ) ;
2016-08-19 06:18:45 +00:00
me . api . asc _registerCallback ( 'asc_onCurrentPage' , _ . bind ( onApiCurrentPages , me ) ) ;
2016-03-11 00:48:53 +00:00
me . slidesCount = me . api . getCountPages ( ) ;
//hyperlink
me . api . asc _registerCallback ( 'asc_onHyperlinkClick' , _ . bind ( onHyperlinkClick , me ) ) ;
me . api . asc _registerCallback ( 'asc_onMouseMove' , _ . bind ( onMouseMove , me ) ) ;
if ( me . mode . isEdit === true ) {
me . api . asc _registerCallback ( 'asc_onDialogAddHyperlink' , _ . bind ( onDialogAddHyperlink , me ) ) ;
2019-11-19 07:00:44 +00:00
me . api . asc _registerCallback ( 'asc_doubleClickOnChart' , _ . bind ( me . editChartClick , me ) ) ;
2017-04-26 09:26:02 +00:00
me . api . asc _registerCallback ( 'asc_onSpellCheckVariantsFound' , _ . bind ( onSpellCheckVariantsFound , me ) ) ;
2017-09-19 08:17:54 +00:00
me . api . asc _registerCallback ( 'asc_onShowSpecialPasteOptions' , _ . bind ( onShowSpecialPasteOptions , me ) ) ;
me . api . asc _registerCallback ( 'asc_onHideSpecialPasteOptions' , _ . bind ( onHideSpecialPasteOptions , me ) ) ;
2019-04-09 11:29:51 +00:00
me . api . asc _registerCallback ( 'asc_ChangeCropState' , _ . bind ( onChangeCropState , me ) ) ;
2019-11-19 07:00:44 +00:00
me . api . asc _registerCallback ( 'asc_onHidePlaceholderActions' , _ . bind ( me . onHidePlaceholderActions , me ) ) ;
2019-11-18 12:14:14 +00:00
me . api . asc _registerPlaceholderCallback ( AscCommon . PlaceholderButtonType . Image , _ . bind ( me . onInsertImage , me , true ) ) ;
me . api . asc _registerPlaceholderCallback ( AscCommon . PlaceholderButtonType . ImageUrl , _ . bind ( me . onInsertImageUrl , me , true ) ) ;
2019-11-19 07:00:44 +00:00
me . api . asc _registerPlaceholderCallback ( AscCommon . PlaceholderButtonType . Chart , _ . bind ( me . onClickPlaceholderChart , me ) ) ;
2019-11-19 09:02:00 +00:00
me . api . asc _registerPlaceholderCallback ( AscCommon . PlaceholderButtonType . Table , _ . bind ( me . onClickPlaceholderTable , me ) ) ;
2019-11-19 07:00:44 +00:00
me . api . asc _registerPlaceholderCallback ( AscCommon . PlaceholderButtonType . Video , _ . bind ( me . onClickPlaceholder , me , AscCommon . PlaceholderButtonType . Video ) ) ;
me . api . asc _registerPlaceholderCallback ( AscCommon . PlaceholderButtonType . Audio , _ . bind ( me . onClickPlaceholder , me , AscCommon . PlaceholderButtonType . Audio ) ) ;
2016-03-11 00:48:53 +00:00
}
me . api . asc _registerCallback ( 'asc_onCoAuthoringDisconnect' , _ . bind ( onCoAuthoringDisconnect , me ) ) ;
Common . NotificationCenter . on ( 'api:disconnect' , _ . bind ( onCoAuthoringDisconnect , me ) ) ;
2017-04-26 09:26:02 +00:00
me . api . asc _registerCallback ( 'asc_onTextLanguage' , _ . bind ( onTextLanguage , me ) ) ;
2016-03-11 00:48:53 +00:00
me . api . asc _registerCallback ( 'asc_onShowForeignCursorLabel' , _ . bind ( onShowForeignCursorLabel , me ) ) ;
me . api . asc _registerCallback ( 'asc_onHideForeignCursorLabel' , _ . bind ( onHideForeignCursorLabel , me ) ) ;
me . api . asc _registerCallback ( 'asc_onFocusObject' , _ . bind ( onFocusObject , me ) ) ;
2017-08-07 14:20:17 +00:00
me . api . asc _registerCallback ( 'asc_onUpdateThemeIndex' , _ . bind ( onApiUpdateThemeIndex , me ) ) ;
me . api . asc _registerCallback ( 'asc_onLockDocumentTheme' , _ . bind ( onApiLockDocumentTheme , me ) ) ;
me . api . asc _registerCallback ( 'asc_onUnLockDocumentTheme' , _ . bind ( onApiUnLockDocumentTheme , me ) ) ;
2018-01-12 07:16:30 +00:00
me . api . asc _registerCallback ( 'asc_onStartDemonstration' , _ . bind ( onApiStartDemonstration ) ) ;
2016-03-11 00:48:53 +00:00
}
return me ;
} ;
this . mode = { } ;
this . setMode = function ( mode ) {
me . mode = mode ;
/** coauthoring begin **/
2017-06-14 11:53:29 +00:00
! ( me . mode . canCoAuthoring && me . mode . canComments )
2016-03-11 00:48:53 +00:00
? Common . util . Shortcuts . suspendEvents ( hkComments )
: Common . util . Shortcuts . resumeEvents ( hkComments ) ;
/** coauthoring end **/
me . editorConfig = { user : mode . user } ;
} ;
me . on ( 'render:after' , onAfterRender , me ) ;
} ,
render : function ( ) {
this . fireEvent ( 'render:before' , this ) ;
this . cmpEl = $ ( this . el ) ;
this . fireEvent ( 'render:after' , this ) ;
return this ;
} ,
focus : function ( ) {
var me = this ;
_ . defer ( function ( ) { me . cmpEl . focus ( ) ; } , 50 ) ;
} ,
addHyperlink : function ( item ) {
var win , me = this ;
if ( me . api ) {
var _arr = [ ] ;
for ( var i = 0 ; i < me . api . getCountPages ( ) ; i ++ ) {
_arr . push ( {
displayValue : i + 1 ,
value : i
} ) ;
}
win = new PE . Views . HyperlinkSettingsDialog ( {
api : me . api ,
handler : function ( dlg , result ) {
if ( result == 'ok' ) {
me . api . add _Hyperlink ( dlg . getSettings ( ) ) ;
}
me . fireEvent ( 'editcomplete' , me ) ;
} ,
slides : _arr
} ) ;
win . show ( ) ;
win . setSettings ( item . hyperProps . value ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Add Hyperlink' ) ;
}
} ,
editHyperlink : function ( item , e ) {
var win , me = this ;
if ( me . api ) {
var _arr = [ ] ;
for ( var i = 0 ; i < me . api . getCountPages ( ) ; i ++ ) {
_arr . push ( {
displayValue : i + 1 ,
value : i
} ) ;
}
win = new PE . Views . HyperlinkSettingsDialog ( {
api : me . api ,
handler : function ( dlg , result ) {
if ( result == 'ok' ) {
me . api . change _Hyperlink ( win . getSettings ( ) ) ;
}
me . fireEvent ( 'editcomplete' , me ) ;
} ,
slides : _arr
} ) ;
win . show ( ) ;
win . setSettings ( item . hyperProps . value ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Edit Hyperlink' ) ;
}
} ,
/** coauthoring begin **/
addComment : function ( item , e , eOpt ) {
2017-06-14 11:53:29 +00:00
if ( this . api && this . mode . canCoAuthoring && this . mode . canComments ) {
2016-03-11 00:48:53 +00:00
this . suppressEditComplete = true ;
var controller = PE . getController ( 'Common.Controllers.Comments' ) ;
if ( controller ) {
controller . addDummyComment ( ) ;
}
}
} ,
/** coauthoring end **/
2019-11-26 10:54:37 +00:00
editChartClick : function ( chart , placeholder ) {
2019-11-19 07:00:44 +00:00
if ( this . mode . isEdit && ! this . _isDisabled ) {
var diagramEditor = PE . getController ( 'Common.Controllers.ExternalDiagramEditor' ) . getView ( 'Common.Views.ExternalDiagramEditor' ) ;
if ( diagramEditor ) {
diagramEditor . setEditMode ( chart === undefined || typeof chart == 'object' ) ; //edit from doubleclick or context menu
diagramEditor . show ( ) ;
if ( typeof chart !== 'object' )
2019-11-27 09:00:40 +00:00
chart = this . api . asc _getChartObject ( chart , placeholder ) ;
2016-03-11 00:48:53 +00:00
diagramEditor . setChartData ( new Asc . asc _CChartBinary ( chart ) ) ;
2019-11-26 10:54:37 +00:00
diagramEditor . setPlaceholder ( placeholder ) ;
2016-03-11 00:48:53 +00:00
}
}
} ,
onCutCopyPaste : function ( item , e ) {
var me = this ;
if ( me . api ) {
2016-07-26 14:46:42 +00:00
var res = ( item . value == 'cut' ) ? me . api . Cut ( ) : ( ( item . value == 'copy' ) ? me . api . Copy ( ) : me . api . Paste ( ) ) ;
if ( ! res ) {
2017-04-21 09:56:11 +00:00
if ( ! Common . localStorage . getBool ( "pe-hide-copywarning" ) ) {
2016-03-11 00:48:53 +00:00
( new Common . Views . CopyWarningDialog ( {
handler : function ( dontshow ) {
if ( dontshow ) Common . localStorage . setItem ( "pe-hide-copywarning" , 1 ) ;
me . fireEvent ( 'editcomplete' , me ) ;
}
} ) ) . show ( ) ;
}
}
}
2016-07-26 14:46:42 +00:00
me . fireEvent ( 'editcomplete' , me ) ;
2016-03-11 00:48:53 +00:00
} ,
onSlidePickerShowAfter : function ( picker ) {
if ( ! picker . _needRecalcSlideLayout ) return ;
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 ;
}
} ,
2019-10-30 07:17:33 +00:00
addToLayout : function ( ) {
if ( this . api )
this . api . asc _AddToLayout ( ) ;
} ,
2017-06-06 08:04:04 +00:00
createDelayedElementsViewer : function ( ) {
var me = this ;
var menuViewCopy = new Common . UI . MenuItem ( {
caption : me . textCopy ,
value : 'copy'
} ) . on ( 'click' , _ . bind ( me . onCutCopyPaste , me ) ) ;
var menuViewUndo = new Common . UI . MenuItem ( {
caption : me . textUndo
} ) . on ( 'click' , function ( ) {
me . api . Undo ( ) ;
} ) ;
var menuViewCopySeparator = new Common . UI . MenuItem ( {
caption : '--'
} ) ;
var menuViewAddComment = new Common . UI . MenuItem ( {
caption : me . addCommentText
} ) . on ( 'click' , _ . bind ( me . addComment , me ) ) ;
this . viewModeMenu = new Common . UI . Menu ( {
initMenu : function ( value ) {
2017-11-10 08:59:05 +00:00
menuViewUndo . setVisible ( me . mode . canCoAuthoring && me . mode . canComments && ! me . _isDisabled ) ;
menuViewUndo . setDisabled ( ! me . api . asc _getCanUndo ( ) && ! me . _isDisabled ) ;
menuViewCopySeparator . setVisible ( ! value . isChart && me . api . can _AddQuotedComment ( ) !== false && me . mode . canCoAuthoring && me . mode . canComments && ! me . _isDisabled ) ;
menuViewAddComment . setVisible ( ! value . isChart && me . api . can _AddQuotedComment ( ) !== false && me . mode . canCoAuthoring && me . mode . canComments && ! me . _isDisabled ) ;
2017-06-06 08:04:04 +00:00
menuViewAddComment . setDisabled ( value . locked ) ;
} ,
items : [
menuViewCopy ,
menuViewUndo ,
menuViewCopySeparator ,
menuViewAddComment
]
} ) . on ( 'hide:after' , function ( menu , e , isFromInputControl ) {
if ( me . suppressEditComplete ) {
me . suppressEditComplete = false ;
return ;
}
if ( ! isFromInputControl ) me . fireEvent ( 'editcomplete' , me ) ;
me . currentMenu = null ;
} ) ;
} ,
2016-03-11 00:48:53 +00:00
createDelayedElements : function ( ) {
var me = this ;
var mnuDeleteSlide = new Common . UI . MenuItem ( {
caption : me . txtDeleteSlide
2016-08-30 11:48:49 +00:00
} ) . on ( 'click' , function ( item ) {
2016-03-11 00:48:53 +00:00
if ( me . api ) {
2016-08-30 08:31:31 +00:00
me . _isFromSlideMenu = true ;
2016-03-11 00:48:53 +00:00
me . api . DeleteSlide ( ) ;
2016-08-30 11:48:49 +00:00
me . fireEvent ( 'editcomplete' , me ) ;
2016-03-11 00:48:53 +00:00
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Delete Slide' ) ;
}
2016-08-30 11:48:49 +00:00
} ) ;
2016-03-11 00:48:53 +00:00
var mnuChangeSlide = new Common . UI . MenuItem ( {
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>' ) }
]
} )
} ) ;
2019-10-30 08:33:55 +00:00
var mnuResetSlide = new Common . UI . MenuItem ( {
caption : me . txtResetLayout
} ) . on ( 'click' , function ( item ) {
if ( me . api ) {
me . api . ResetSlide ( ) ;
me . fireEvent ( 'editcomplete' , me ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Reset Slide' ) ;
}
} ) ;
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 : [
{ template : _ . template ( '<div id="id-docholder-menu-changetheme" style="width: 280px; margin: 0 4px;"></div>' ) }
]
} )
} ) ;
2016-03-11 00:48:53 +00:00
var mnuPreview = new Common . UI . MenuItem ( {
caption : me . txtPreview
} ) . on ( 'click' , function ( item ) {
2017-08-14 09:01:13 +00:00
var current = me . api . getCurrentPage ( ) ;
2017-07-20 13:46:45 +00:00
Common . NotificationCenter . trigger ( 'preview:start' , _ . isNumber ( current ) ? current : 0 ) ;
2016-03-11 00:48:53 +00:00
} ) ;
var mnuSelectAll = new Common . UI . MenuItem ( {
caption : me . txtSelectAll
} ) . on ( 'click' , function ( item ) {
if ( me . api ) {
me . api . SelectAllSlides ( ) ;
me . fireEvent ( 'editcomplete' , me ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Select All Slides' ) ;
}
} ) ;
2019-08-07 07:38:03 +00:00
var mnuPrintSelection = new Common . UI . MenuItem ( {
caption : me . txtPrintSelection
} ) . on ( 'click' , function ( item ) {
if ( me . api ) {
var printopt = new Asc . asc _CAdjustPrint ( ) ;
printopt . asc _setPrintType ( Asc . c _oAscPrintType . Selection ) ;
var opts = new Asc . asc _CDownloadOptions ( null , Common . Utils . isChrome || Common . Utils . isSafari || Common . Utils . isOpera ) ; // if isChrome or isSafari or isOpera == true use asc_onPrintUrl event
opts . asc _setAdvancedOptions ( printopt ) ;
me . api . asc _Print ( opts ) ;
me . fireEvent ( 'editcomplete' , me ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Print Selection' ) ;
}
} ) ;
2016-03-11 00:48:53 +00:00
var menuSlidePaste = new Common . UI . MenuItem ( {
caption : me . textPaste ,
value : 'paste'
} ) . on ( 'click' , _ . bind ( me . onCutCopyPaste , me ) ) ;
var menuSlideSettings = new Common . UI . MenuItem ( {
caption : me . textSlideSettings ,
value : null
} ) . on ( 'click' , function ( item ) {
PE . getController ( 'RightMenu' ) . onDoubleClickOnObject ( item . options . value ) ;
} ) ;
2017-07-20 10:37:26 +00:00
var mnuSlideHide = new Common . UI . MenuItem ( {
caption : me . txtSlideHide ,
checkable : true ,
checked : false
} ) . on ( 'click' , function ( item ) {
if ( me . api ) {
me . api . asc _HideSlides ( item . checked ) ;
me . fireEvent ( 'editcomplete' , me ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Hide Slides' ) ;
}
} ) ;
2016-03-11 00:48:53 +00:00
me . slideMenu = new Common . UI . Menu ( {
initMenu : function ( value ) {
menuSlidePaste . setVisible ( value . fromThumbs !== true ) ;
me . slideMenu . items [ 1 ] . setVisible ( value . fromThumbs === true ) ; // New Slide
me . slideMenu . items [ 2 ] . setVisible ( value . isSlideSelect === true ) ; // Duplicate Slide
mnuDeleteSlide . setVisible ( value . isSlideSelect === true ) ;
2017-07-20 10:37:26 +00:00
mnuSlideHide . setVisible ( value . isSlideSelect === true ) ;
mnuSlideHide . setChecked ( value . isSlideHidden === true ) ;
me . slideMenu . items [ 5 ] . setVisible ( value . isSlideSelect === true || value . fromThumbs !== true ) ;
2016-03-11 00:48:53 +00:00
mnuChangeSlide . setVisible ( value . isSlideSelect === true || value . fromThumbs !== true ) ;
2019-10-30 08:33:55 +00:00
mnuResetSlide . setVisible ( value . isSlideSelect === true || value . fromThumbs !== true ) ;
2017-08-07 14:20:17 +00:00
mnuChangeTheme . setVisible ( value . isSlideSelect === true || value . fromThumbs !== true ) ;
2019-02-04 13:38:04 +00:00
menuSlideSettings . setVisible ( value . isSlideSelect === true || value . fromThumbs !== true ) ;
2016-03-11 00:48:53 +00:00
menuSlideSettings . options . value = null ;
2019-10-30 08:33:55 +00:00
for ( var i = 10 ; i < 15 ; i ++ ) {
2016-03-11 00:48:53 +00:00
me . slideMenu . items [ i ] . setVisible ( value . fromThumbs === true ) ;
}
2019-08-07 08:25:39 +00:00
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 ( ) ;
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 ) ;
}
mnuPreview . setDisabled ( me . slidesCount < 1 ) ;
mnuSelectAll . setDisabled ( locked || me . slidesCount < 2 ) ;
mnuDeleteSlide . setDisabled ( lockedDeleted || locked ) ;
mnuChangeSlide . setDisabled ( lockedLayout || locked ) ;
2019-10-30 08:33:55 +00:00
mnuResetSlide . setDisabled ( lockedLayout || locked ) ;
2017-08-07 14:20:17 +00:00
mnuChangeTheme . setDisabled ( me . _state . themeLock || locked ) ;
2017-07-20 10:37:26 +00:00
mnuSlideHide . setDisabled ( lockedLayout || locked ) ;
2019-08-07 07:38:03 +00:00
mnuPrintSelection . setDisabled ( me . slidesCount < 1 ) ;
2016-03-11 00:48:53 +00:00
} ,
items : [
menuSlidePaste ,
new Common . UI . MenuItem ( {
caption : me . txtNewSlide
} ) . on ( 'click' , function ( item ) {
if ( me . api ) {
2016-08-30 08:31:31 +00:00
me . _isFromSlideMenu = true ;
2016-03-11 00:48:53 +00:00
me . api . AddSlide ( ) ;
2016-08-30 11:48:49 +00:00
me . fireEvent ( 'editcomplete' , me ) ;
2016-03-11 00:48:53 +00:00
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Add Slide' ) ;
}
} ) ,
new Common . UI . MenuItem ( {
caption : me . txtDuplicateSlide
} ) . on ( 'click' , function ( item ) {
if ( me . api ) {
2016-08-30 08:31:31 +00:00
me . _isFromSlideMenu = true ;
2016-03-11 00:48:53 +00:00
me . api . DublicateSlide ( ) ;
2016-08-30 11:48:49 +00:00
me . fireEvent ( 'editcomplete' , me ) ;
2016-03-11 00:48:53 +00:00
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Dublicate Hyperlink' ) ;
}
} ) ,
mnuDeleteSlide ,
2017-07-20 10:37:26 +00:00
mnuSlideHide ,
2016-03-11 00:48:53 +00:00
{ caption : '--' } ,
mnuChangeSlide ,
2019-10-30 08:33:55 +00:00
mnuResetSlide ,
2017-08-07 14:20:17 +00:00
mnuChangeTheme ,
2016-03-11 00:48:53 +00:00
menuSlideSettings ,
{ caption : '--' } ,
mnuSelectAll ,
2019-08-07 07:38:03 +00:00
mnuPrintSelection ,
2016-03-11 00:48:53 +00:00
{ caption : '--' } ,
mnuPreview
]
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' ) ,
parentMenu : mnuChangeSlide . menu ,
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;">' ,
'<div style="background-image: url(<%= imageUrl %>); width: <%= itemWidth %>px; height: <%= itemHeight %>px;"/>' ,
'<div class="title"><%= title %></div> ' ,
'</div>'
] . join ( '' ) )
} ) . on ( 'item:click' , function ( picker , item , record , e ) {
if ( me . api ) {
me . api . ChangeLayout ( record . get ( 'data' ) . idx ) ;
if ( e . type !== 'click' )
me . slideMenu . hide ( ) ;
me . fireEvent ( 'editcomplete' , me ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Change Layout' ) ;
}
} ) ;
if ( me . slideMenu ) {
mnuChangeSlide . menu . on ( 'show:after' , function ( menu ) {
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 %>"">' ,
'<div class="item-theme" style="' + '<% if (typeof imageUrl !== "undefined") { %>' + 'background-image: url(<%= imageUrl %>);' + '<% } %> background-position: 0 -<%= offsety %>px;"/>' ,
2017-08-07 14:20:17 +00:00
'</div>'
] . join ( '' ) )
} ) . on ( 'item:click' , function ( picker , item , record , e ) {
if ( me . api ) {
me . api . ChangeTheme ( record . get ( 'themeId' ) , true ) ;
if ( e . type !== 'click' )
me . slideMenu . hide ( ) ;
me . fireEvent ( 'editcomplete' , me ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Change Theme' ) ;
}
} ) ;
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
} ) ;
var mnuTableMerge = new Common . UI . MenuItem ( {
caption : me . mergeCellsText
} ) . on ( 'click' , function ( item ) {
if ( me . api )
me . api . MergeCells ( ) ;
} ) ;
var mnuTableSplit = new Common . UI . MenuItem ( {
caption : me . splitCellsText
} ) . on ( 'click' , function ( item ) {
if ( me . api ) {
( new Common . Views . InsertTableDialog ( {
2017-08-07 09:23:03 +00:00
split : true ,
2016-03-11 00:48:53 +00:00
handler : function ( result , value ) {
if ( result == 'ok' ) {
if ( me . api ) {
me . api . SplitCell ( value . columns , value . rows ) ;
}
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Table Split' ) ;
}
2017-08-23 08:02:04 +00:00
me . fireEvent ( 'editcomplete' , me ) ;
2016-03-11 00:48:53 +00:00
}
} ) ) . show ( ) ;
}
} ) ;
var menuTableCellAlign = new Common . UI . MenuItem ( {
caption : me . cellAlignText ,
menu : ( function ( ) {
function onItemClick ( item , e ) {
if ( me . api ) {
2016-04-05 12:57:51 +00:00
var properties = new Asc . CTableProp ( ) ;
2016-03-11 00:48:53 +00:00
properties . put _CellsVAlign ( item . value ) ;
me . api . tblApply ( properties ) ;
}
me . fireEvent ( 'editcomplete' , me ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Table Cell Align' ) ;
}
return new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
me . menuTableCellTop = new Common . UI . MenuItem ( {
2017-06-06 08:29:30 +00:00
caption : me . textShapeAlignTop ,
2016-03-11 00:48:53 +00:00
checkable : true ,
toggleGroup : 'popuptablecellalign' ,
2016-04-05 11:52:34 +00:00
value : Asc . c _oAscVertAlignJc . Top
2016-03-11 00:48:53 +00:00
} ) . on ( 'click' , _ . bind ( onItemClick , me ) ) ,
me . menuTableCellCenter = new Common . UI . MenuItem ( {
2017-06-06 08:29:30 +00:00
caption : me . textShapeAlignMiddle ,
2016-03-11 00:48:53 +00:00
checkable : true ,
toggleGroup : 'popuptablecellalign' ,
2016-04-05 11:52:34 +00:00
value : Asc . c _oAscVertAlignJc . Center
2016-03-11 00:48:53 +00:00
} ) . on ( 'click' , _ . bind ( onItemClick , me ) ) ,
me . menuTableCellBottom = new Common . UI . MenuItem ( {
2017-06-06 08:29:30 +00:00
caption : me . textShapeAlignBottom ,
2016-03-11 00:48:53 +00:00
checkable : true ,
toggleGroup : 'popuptablecellalign' ,
2016-04-05 11:52:34 +00:00
value : Asc . c _oAscVertAlignJc . Bottom
2016-03-11 00:48:53 +00:00
} ) . on ( 'click' , _ . bind ( onItemClick , me ) )
]
} )
} ) ( )
} ) ;
2018-02-06 12:06:01 +00:00
var menuTableDistRows = new Common . UI . MenuItem ( {
caption : me . textDistributeRows
} ) . on ( 'click' , _ . bind ( function ( ) {
if ( me . api )
me . api . asc _DistributeTableCells ( false ) ;
me . fireEvent ( 'editcomplete' , me ) ;
} , me ) ) ;
var menuTableDistCols = new Common . UI . MenuItem ( {
caption : me . textDistributeCols
} ) . on ( 'click' , _ . bind ( function ( ) {
if ( me . api )
me . api . asc _DistributeTableCells ( true ) ;
me . fireEvent ( 'editcomplete' , me ) ;
} , me ) ) ;
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 ( {
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 <% } %>">' ,
'<i class="icon <% if (spellcheck) { %> img-toolbarmenu spellcheck-lang <% } %>"></i>' ,
'<%= caption %>' ,
'</a>'
] . join ( '' ) ) ;
2017-04-26 09:26:02 +00:00
me . langTableMenu = new Common . UI . MenuItem ( {
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
} )
} ) ;
var menuIgnoreSpellTable = new Common . UI . MenuItem ( {
caption : me . ignoreSpellText
} ) . on ( 'click' , function ( item ) {
if ( me . api ) {
me . api . asc _ignoreMisspelledWord ( me . _currentSpellObj , false ) ;
me . fireEvent ( 'editcomplete' , me ) ;
}
} ) ;
var menuIgnoreAllSpellTable = new Common . UI . MenuItem ( {
caption : me . ignoreAllSpellText
} ) . on ( 'click' , function ( menu ) {
if ( me . api ) {
me . api . asc _ignoreMisspelledWord ( me . _currentSpellObj , true ) ;
me . fireEvent ( 'editcomplete' , me ) ;
}
} ) ;
2019-08-05 08:59:52 +00:00
var menuToDictionaryTable = new Common . UI . MenuItem ( {
caption : me . toDictionaryText
} ) . on ( 'click' , function ( item , e ) {
2019-08-06 11:32:12 +00:00
me . api . asc _spellCheckAddToDictionary ( me . _currentSpellObj ) ;
2019-08-05 08:59:52 +00:00
me . fireEvent ( 'editcomplete' , me ) ;
} ) ;
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 ( {
caption : me . spellcheckText ,
menu : new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
me . menuSpellTable ,
me . menuSpellMoreTable ,
menuIgnoreSpellTableSeparator ,
menuIgnoreSpellTable ,
menuIgnoreAllSpellTable ,
2019-08-05 08:59:52 +00:00
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 ( {
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 ( {
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
} )
} ) ;
var menuIgnoreSpellPara = new Common . UI . MenuItem ( {
caption : me . ignoreSpellText
} ) . on ( 'click' , function ( item , e ) {
me . api . asc _ignoreMisspelledWord ( me . _currentSpellObj , false ) ;
me . fireEvent ( 'editcomplete' , me ) ;
} ) ;
var menuIgnoreAllSpellPara = new Common . UI . MenuItem ( {
caption : me . ignoreAllSpellText
} ) . on ( 'click' , function ( item , e ) {
me . api . asc _ignoreMisspelledWord ( me . _currentSpellObj , true ) ;
me . fireEvent ( 'editcomplete' , me ) ;
} ) ;
2019-08-05 08:59:52 +00:00
var menuToDictionaryPara = new Common . UI . MenuItem ( {
caption : me . toDictionaryText
} ) . on ( 'click' , function ( item , e ) {
2019-08-06 11:32:12 +00:00
me . api . asc _spellCheckAddToDictionary ( me . _currentSpellObj ) ;
2019-08-05 08:59:52 +00:00
me . fireEvent ( 'editcomplete' , me ) ;
} ) ;
2017-04-26 09:26:02 +00:00
var menuIgnoreSpellParaSeparator = new Common . UI . MenuItem ( {
caption : '--'
} ) ;
var menuSpellcheckParaSeparator = new Common . UI . MenuItem ( {
caption : '--'
} ) ;
2016-03-11 00:48:53 +00:00
var menuTableAdvanced = new Common . UI . MenuItem ( {
caption : me . advancedTableText
} ) . on ( 'click' , function ( item ) {
if ( me . api ) {
var selectedElements = me . api . getSelectedElements ( ) ;
if ( selectedElements && selectedElements . length > 0 ) {
var elType , elValue ;
for ( var i = selectedElements . length - 1 ; i >= 0 ; i -- ) {
elType = selectedElements [ i ] . get _ObjectType ( ) ;
elValue = selectedElements [ i ] . get _ObjectValue ( ) ;
2016-04-05 11:52:34 +00:00
if ( Asc . c _oAscTypeSelectElement . Table == elType ) {
2016-03-11 00:48:53 +00:00
( new PE . Views . TableSettingsAdvanced (
{
tableProps : elValue ,
handler : function ( result , value ) {
if ( result == 'ok' ) {
if ( me . api ) {
me . api . tblApply ( value . tableProps ) ;
}
}
me . fireEvent ( 'editcomplete' , me ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Table Settings Advanced' ) ;
}
} ) ) . show ( ) ;
break ;
}
}
}
}
} ) ;
var menuImageAdvanced = new Common . UI . MenuItem ( {
caption : me . advancedImageText
} ) . on ( 'click' , function ( item ) {
if ( me . api ) {
var selectedElements = me . api . getSelectedElements ( ) ;
if ( selectedElements && selectedElements . length > 0 ) {
var elType , elValue ;
for ( var i = selectedElements . length - 1 ; i >= 0 ; i -- ) {
elType = selectedElements [ i ] . get _ObjectType ( ) ;
elValue = selectedElements [ i ] . get _ObjectValue ( ) ;
2016-04-05 11:52:34 +00:00
if ( Asc . c _oAscTypeSelectElement . Image == elType ) {
2016-03-11 00:48:53 +00:00
var imgsizeOriginal ;
if ( ! menuImgOriginalSize . isDisabled ( ) ) {
imgsizeOriginal = me . api . get _OriginalSizeImage ( ) ;
if ( imgsizeOriginal )
imgsizeOriginal = { width : imgsizeOriginal . get _ImageWidth ( ) , height : imgsizeOriginal . get _ImageHeight ( ) } ;
}
( new PE . Views . ImageSettingsAdvanced (
{
imageProps : elValue ,
sizeOriginal : imgsizeOriginal ,
handler : function ( result , value ) {
if ( result == 'ok' ) {
if ( me . api ) {
me . api . ImgApply ( value . imageProps ) ;
}
}
me . fireEvent ( 'editcomplete' , me ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Image Settings Advanced' ) ;
}
} ) ) . show ( ) ;
break ;
}
}
}
}
} ) ;
var menuShapeAdvanced = new Common . UI . MenuItem ( {
caption : me . advancedShapeText
} ) . on ( 'click' , function ( item ) {
if ( me . api ) {
var selectedElements = me . api . getSelectedElements ( ) ;
if ( selectedElements && selectedElements . length > 0 ) {
var elType , elValue ;
for ( var i = selectedElements . length - 1 ; i >= 0 ; i -- ) {
elType = selectedElements [ i ] . get _ObjectType ( ) ;
elValue = selectedElements [ i ] . get _ObjectValue ( ) ;
2016-04-05 11:52:34 +00:00
if ( Asc . c _oAscTypeSelectElement . Shape == elType ) {
2016-03-11 00:48:53 +00:00
( new PE . Views . ShapeSettingsAdvanced (
{
shapeProps : elValue ,
handler : function ( result , value ) {
if ( result == 'ok' ) {
if ( me . api ) {
me . api . ShapeApply ( value . shapeProps ) ;
}
}
me . fireEvent ( 'editcomplete' , me ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Image Shape Advanced' ) ;
}
} ) ) . show ( ) ;
break ;
}
}
}
}
} ) ;
var menuParagraphAdvanced = new Common . UI . MenuItem ( {
caption : me . advancedParagraphText
} ) . on ( 'click' , function ( item ) {
if ( me . api ) {
var selectedElements = me . api . getSelectedElements ( ) ;
if ( selectedElements && selectedElements . length > 0 ) {
var elType , elValue ;
for ( var i = selectedElements . length - 1 ; i >= 0 ; i -- ) {
elType = selectedElements [ i ] . get _ObjectType ( ) ;
elValue = selectedElements [ i ] . get _ObjectValue ( ) ;
2016-04-05 11:52:34 +00:00
if ( Asc . c _oAscTypeSelectElement . Paragraph == elType ) {
2016-03-11 00:48:53 +00:00
( new PE . Views . ParagraphSettingsAdvanced (
{
paragraphProps : elValue ,
api : me . api ,
handler : function ( result , value ) {
if ( result == 'ok' ) {
if ( me . api ) {
me . api . paraApply ( value . paragraphProps ) ;
}
}
me . fireEvent ( 'editcomplete' , me ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Image Paragraph Advanced' ) ;
}
} ) ) . show ( ) ;
break ;
}
}
}
}
} ) ;
var menuCommentParaSeparator = new Common . UI . MenuItem ( {
caption : '--'
} ) ;
var menuAddHyperlinkPara = new Common . UI . MenuItem ( {
caption : me . hyperlinkText
} ) . on ( 'click' , _ . bind ( me . addHyperlink , me ) ) ;
var menuEditHyperlinkPara = new Common . UI . MenuItem ( {
caption : me . editHyperlinkText
} ) . on ( 'click' , _ . bind ( me . editHyperlink , me ) ) ;
var menuRemoveHyperlinkPara = new Common . UI . MenuItem ( {
caption : me . removeHyperlinkText
} ) . on ( 'click' , function ( item ) {
if ( me . api ) {
me . api . remove _Hyperlink ( ) ;
}
me . fireEvent ( 'editcomplete' , me ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Remove Hyperlink' ) ;
} ) ;
var menuHyperlinkPara = new Common . UI . MenuItem ( {
caption : me . hyperlinkText ,
menu : new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
menuEditHyperlinkPara ,
menuRemoveHyperlinkPara
]
} )
} ) ;
var menuAddHyperlinkTable = new Common . UI . MenuItem ( {
caption : me . hyperlinkText
} ) . on ( 'click' , _ . bind ( me . addHyperlink , me ) ) ;
var menuEditHyperlinkTable = new Common . UI . MenuItem ( {
caption : me . editHyperlinkText
} ) . on ( 'click' , _ . bind ( me . editHyperlink , me ) ) ;
var menuRemoveHyperlinkTable = new Common . UI . MenuItem ( {
caption : me . removeHyperlinkText
} ) . on ( 'click' , function ( item ) {
if ( me . api ) {
me . api . remove _Hyperlink ( ) ;
}
me . fireEvent ( 'editcomplete' , me ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Remove Hyperlink Table' ) ;
} ) ;
var menuHyperlinkTable = new Common . UI . MenuItem ( {
caption : me . hyperlinkText ,
menu : new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
menuEditHyperlinkTable ,
menuRemoveHyperlinkTable
]
} )
} ) ;
var menuHyperlinkSeparator = new Common . UI . MenuItem ( {
caption : '--'
} ) ;
var mnuGroupImg = new Common . UI . MenuItem ( {
caption : this . txtGroup ,
iconCls : 'mnu-group'
} ) . on ( 'click' , function ( item ) {
if ( me . api ) {
me . api . groupShapes ( ) ;
}
me . fireEvent ( 'editcomplete' , this ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Group Image' ) ;
} ) ;
var mnuUnGroupImg = new Common . UI . MenuItem ( {
caption : this . txtUngroup ,
iconCls : 'mnu-ungroup'
} ) . on ( 'click' , function ( item ) {
if ( me . api ) {
me . api . unGroupShapes ( ) ;
}
me . fireEvent ( 'editcomplete' , this ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Ungroup Image' ) ;
} ) ;
var menuImgShapeArrange = new Common . UI . MenuItem ( {
caption : me . txtArrange ,
menu : new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
new Common . UI . MenuItem ( {
caption : this . textArrangeFront ,
iconCls : 'mnu-arrange-front'
} ) . on ( 'click' , function ( item ) {
if ( me . api ) {
me . api . shapes _bringToFront ( ) ;
}
me . fireEvent ( 'editcomplete' , me ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Bring To Front' ) ;
} ) ,
new Common . UI . MenuItem ( {
caption : this . textArrangeBack ,
iconCls : 'mnu-arrange-back'
} ) . on ( 'click' , function ( item ) {
if ( me . api ) {
me . api . shapes _bringToBack ( ) ;
}
me . fireEvent ( 'editcomplete' , me ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Bring To Back' ) ;
} ) ,
new Common . UI . MenuItem ( {
caption : this . textArrangeForward ,
iconCls : 'mnu-arrange-forward'
} ) . on ( 'click' , function ( item ) {
if ( me . api ) {
me . api . shapes _bringForward ( ) ;
}
me . fireEvent ( 'editcomplete' , me ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Send Forward' ) ;
} ) ,
new Common . UI . MenuItem ( {
caption : this . textArrangeBackward ,
iconCls : 'mnu-arrange-backward'
} ) . on ( 'click' , function ( item ) {
if ( me . api ) {
me . api . shapes _bringBackward ( ) ;
}
me . fireEvent ( 'editcomplete' , me ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Send Backward' ) ;
} ) ,
{ caption : '--' } ,
mnuGroupImg ,
mnuUnGroupImg
]
} )
} ) ;
var menuImgShapeAlign = new Common . UI . MenuItem ( {
caption : me . txtAlign ,
menu : ( function ( ) {
function onItemClick ( item ) {
if ( me . api ) {
2019-02-12 07:25:43 +00:00
var value = me . api . asc _getSelectedDrawingObjectsCount ( ) < 2 || Common . Utils . InternalSettings . get ( "pe-align-to-slide" ) ;
value = value ? Asc . c _oAscObjectsAlignType . Slide : Asc . c _oAscObjectsAlignType . Selected ;
if ( item . value < 6 ) {
me . api . put _ShapesAlign ( item . value , value ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Shape Align' ) ;
} else if ( item . value == 6 ) {
me . api . DistributeHorizontally ( value ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Distribute Horizontally' ) ;
} else if ( item . value == 7 ) {
me . api . DistributeVertically ( value ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Distribute Vertically' ) ;
}
2016-03-11 00:48:53 +00:00
}
me . fireEvent ( 'editcomplete' , me ) ;
}
return new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
new Common . UI . MenuItem ( {
caption : me . textShapeAlignLeft ,
iconCls : 'mnu-shape-align-left' ,
2016-04-05 11:52:34 +00:00
value : Asc . c _oAscAlignShapeType . ALIGN _LEFT
2016-03-11 00:48:53 +00:00
} ) . on ( 'click' , _ . bind ( onItemClick , me ) ) ,
new Common . UI . MenuItem ( {
caption : me . textShapeAlignCenter ,
iconCls : 'mnu-shape-align-center' ,
2016-04-05 11:52:34 +00:00
value : Asc . c _oAscAlignShapeType . ALIGN _CENTER
2016-03-11 00:48:53 +00:00
} ) . on ( 'click' , _ . bind ( onItemClick , me ) ) ,
new Common . UI . MenuItem ( {
caption : me . textShapeAlignRight ,
iconCls : 'mnu-shape-align-right' ,
2016-04-05 11:52:34 +00:00
value : Asc . c _oAscAlignShapeType . ALIGN _RIGHT
2016-03-11 00:48:53 +00:00
} ) . on ( 'click' , _ . bind ( onItemClick , me ) ) ,
new Common . UI . MenuItem ( {
caption : me . textShapeAlignTop ,
iconCls : 'mnu-shape-align-top' ,
2016-04-05 11:52:34 +00:00
value : Asc . c _oAscAlignShapeType . ALIGN _TOP
2016-03-11 00:48:53 +00:00
} ) . on ( 'click' , _ . bind ( onItemClick , me ) ) ,
new Common . UI . MenuItem ( {
caption : me . textShapeAlignMiddle ,
iconCls : 'mnu-shape-align-middle' ,
2016-04-05 11:52:34 +00:00
value : Asc . c _oAscAlignShapeType . ALIGN _MIDDLE
2016-03-11 00:48:53 +00:00
} ) . on ( 'click' , _ . bind ( onItemClick , me ) ) ,
new Common . UI . MenuItem ( {
caption : me . textShapeAlignBottom ,
iconCls : 'mnu-shape-align-bottom' ,
2016-04-05 11:52:34 +00:00
value : Asc . c _oAscAlignShapeType . ALIGN _BOTTOM
2016-03-11 00:48:53 +00:00
} ) . on ( 'click' , _ . bind ( onItemClick , me ) ) ,
{ caption : '--' } ,
new Common . UI . MenuItem ( {
caption : me . txtDistribHor ,
2019-02-12 07:25:43 +00:00
iconCls : 'mnu-distrib-hor' ,
value : 6
} ) . on ( 'click' , _ . bind ( onItemClick , me ) ) ,
2016-03-11 00:48:53 +00:00
new Common . UI . MenuItem ( {
caption : me . txtDistribVert ,
2019-02-12 07:25:43 +00:00
iconCls : 'mnu-distrib-vert' ,
value : 7
} ) . on ( 'click' , _ . bind ( onItemClick , me ) )
2016-03-11 00:48:53 +00:00
]
} )
} ) ( )
} ) ;
var menuChartEdit = new Common . UI . MenuItem ( {
caption : me . editChartText
2019-11-19 07:00:44 +00:00
} ) . on ( 'click' , _ . bind ( me . editChartClick , me , undefined ) ) ;
2016-03-11 00:48:53 +00:00
var menuParagraphVAlign = new Common . UI . MenuItem ( {
caption : me . vertAlignText ,
menu : ( function ( ) {
function onItemClick ( item ) {
if ( me . api ) {
2016-04-18 12:21:15 +00:00
var properties = new Asc . asc _CShapeProperty ( ) ;
2016-03-11 00:48:53 +00:00
properties . put _VerticalTextAlign ( item . value ) ;
me . api . ShapeApply ( properties ) ;
}
me . fireEvent ( 'editcomplete' , me ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Text Vertical Align' ) ;
}
return new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
me . menuParagraphTop = new Common . UI . MenuItem ( {
2017-06-06 08:29:30 +00:00
caption : me . textShapeAlignTop ,
2016-03-11 00:48:53 +00:00
checkable : true ,
toggleGroup : 'popupparagraphvalign' ,
2016-11-10 11:24:18 +00:00
value : Asc . c _oAscVAlign . Top
2016-03-11 00:48:53 +00:00
} ) . on ( 'click' , _ . bind ( onItemClick , me ) ) ,
me . menuParagraphCenter = new Common . UI . MenuItem ( {
2017-06-06 08:29:30 +00:00
caption : me . textShapeAlignMiddle ,
2016-03-11 00:48:53 +00:00
checkable : true ,
toggleGroup : 'popupparagraphvalign' ,
2016-11-10 11:24:18 +00:00
value : Asc . c _oAscVAlign . Center
2016-03-11 00:48:53 +00:00
} ) . on ( 'click' , _ . bind ( onItemClick , me ) ) ,
me . menuParagraphBottom = new Common . UI . MenuItem ( {
2017-06-06 08:29:30 +00:00
caption : me . textShapeAlignBottom ,
2016-03-11 00:48:53 +00:00
checkable : true ,
toggleGroup : 'popupparagraphvalign' ,
2016-11-10 11:24:18 +00:00
value : Asc . c _oAscVAlign . Bottom
2016-03-11 00:48:53 +00:00
} ) . on ( 'click' , _ . bind ( onItemClick , me ) )
]
} )
} ) ( )
} ) ;
var paragraphDirection = function ( item , e ) {
if ( me . api ) {
2016-04-18 12:21:15 +00:00
var properties = new Asc . asc _CShapeProperty ( ) ;
2016-03-11 00:48:53 +00:00
properties . put _Vert ( item . options . direction ) ;
me . api . ShapeApply ( properties ) ;
}
me . fireEvent ( 'editcomplete' , me ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Text Direction' ) ;
} ;
var menuParagraphDirection = new Common . UI . MenuItem ( {
caption : me . directionText ,
menu : new Common . UI . Menu ( {
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
2016-03-11 00:48:53 +00:00
} ) . on ( 'click' , _ . bind ( paragraphDirection , me ) ) ,
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
2016-03-11 00:48:53 +00:00
} ) . on ( 'click' , _ . bind ( paragraphDirection , me ) ) ,
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
2016-03-11 00:48:53 +00:00
} ) . on ( 'click' , _ . bind ( paragraphDirection , me ) )
]
} )
} ) ;
var menuImgShapeSeparator = new Common . UI . MenuItem ( {
caption : '--'
} ) ;
var menuImgOriginalSize = new Common . UI . MenuItem ( {
caption : me . originalSizeText
} ) . on ( 'click' , function ( item ) {
if ( me . api ) {
var originalImageSize = me . api . get _OriginalSizeImage ( ) ;
if ( originalImageSize ) {
2016-04-18 12:21:15 +00:00
var properties = new Asc . asc _CImgProperty ( ) ;
2016-03-11 00:48:53 +00:00
properties . put _Width ( originalImageSize . get _ImageWidth ( ) ) ;
properties . put _Height ( originalImageSize . get _ImageHeight ( ) ) ;
2019-04-11 10:09:28 +00:00
properties . put _ResetCrop ( true ) ;
2016-03-11 00:48:53 +00:00
me . api . ImgApply ( properties ) ;
}
me . fireEvent ( 'editcomplete' , me ) ;
Common . component . Analytics . trackEvent ( 'DocumentHolder' , 'Set Image Original Size' ) ;
}
} ) ;
2018-04-11 13:46:44 +00:00
var menuImgReplace = new Common . UI . MenuItem ( {
caption : me . textReplace ,
menu : new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
new Common . UI . MenuItem ( {
caption : this . textFromFile
} ) . on ( 'click' , function ( item ) {
setTimeout ( function ( ) {
2019-11-18 12:14:14 +00:00
me . onInsertImage ( ) ;
2018-04-11 13:46:44 +00:00
} , 10 ) ;
} ) ,
new Common . UI . MenuItem ( {
caption : this . textFromUrl
2019-11-18 12:14:14 +00:00
} ) . on ( 'click' , _ . bind ( me . onInsertImageUrl , me , false ) )
2018-04-11 13:46:44 +00:00
]
} )
} ) ;
2019-02-26 16:36:02 +00:00
var onImgRotate = function ( item ) {
var properties = new Asc . asc _CShapeProperty ( ) ;
properties . asc _putRotAdd ( ( item . value == 1 ? 90 : 270 ) * 3.14159265358979 / 180 ) ;
me . api . ShapeApply ( properties ) ;
me . fireEvent ( 'editcomplete' , me ) ;
} ;
var onImgFlip = function ( item ) {
var properties = new Asc . asc _CShapeProperty ( ) ;
if ( item . value == 1 )
properties . asc _putFlipHInvert ( true ) ;
else
properties . asc _putFlipVInvert ( true ) ;
me . api . ShapeApply ( properties ) ;
me . fireEvent ( 'editcomplete' , me ) ;
} ;
var menuImgShapeRotate = new Common . UI . MenuItem ( {
caption : me . textRotate ,
menu : new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
new Common . UI . MenuItem ( {
caption : me . textRotate90 ,
value : 1
} ) . on ( 'click' , _ . bind ( onImgRotate , me ) ) ,
2019-02-27 10:11:28 +00:00
new Common . UI . MenuItem ( {
caption : me . textRotate270 ,
value : 0
} ) . on ( 'click' , _ . bind ( onImgRotate , me ) ) ,
2019-02-27 11:51:52 +00:00
{ caption : '--' } ,
2019-02-26 16:36:02 +00:00
new Common . UI . MenuItem ( {
caption : me . textFlipH ,
value : 1
} ) . on ( 'click' , _ . bind ( onImgFlip , me ) ) ,
new Common . UI . MenuItem ( {
caption : me . textFlipV ,
value : 0
} ) . on ( 'click' , _ . bind ( onImgFlip , me ) )
]
} )
} ) ;
2019-04-09 11:29:51 +00:00
var onImgCrop = function ( item ) {
if ( item . value == 1 ) {
me . api . asc _cropFill ( ) ;
} else if ( item . value == 2 ) {
me . api . asc _cropFit ( ) ;
} else {
item . checked ? me . api . asc _startEditCrop ( ) : me . api . asc _endEditCrop ( ) ;
}
me . fireEvent ( 'editcomplete' , me ) ;
} ;
me . menuImgCrop = new Common . UI . MenuItem ( {
caption : me . textCrop ,
menu : new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
new Common . UI . MenuItem ( {
caption : me . textCrop ,
checkable : true ,
allowDepress : true ,
value : 0
} ) . on ( 'click' , _ . bind ( onImgCrop , me ) ) ,
new Common . UI . MenuItem ( {
caption : me . textCropFill ,
value : 1
} ) . on ( 'click' , _ . bind ( onImgCrop , me ) ) ,
new Common . UI . MenuItem ( {
caption : me . textCropFit ,
value : 2
} ) . on ( 'click' , _ . bind ( onImgCrop , me ) )
]
} )
} ) ;
2016-03-11 00:48:53 +00:00
/** coauthoring begin **/
var menuAddCommentPara = new Common . UI . MenuItem ( {
caption : me . addCommentText
} ) . on ( 'click' , _ . bind ( me . addComment , me ) ) ;
menuAddCommentPara . hide ( ) ;
var menuAddCommentTable = new Common . UI . MenuItem ( {
caption : me . addCommentText
} ) . on ( 'click' , _ . bind ( me . addComment , me ) ) ;
menuAddCommentTable . hide ( ) ;
var menuCommentSeparatorImg = new Common . UI . MenuItem ( {
caption : '--'
} ) ;
menuCommentSeparatorImg . hide ( ) ;
var menuAddCommentImg = new Common . UI . MenuItem ( {
caption : me . addCommentText
} ) . on ( 'click' , _ . bind ( me . addComment , me ) ) ;
menuAddCommentImg . hide ( ) ;
/** coauthoring end **/
2019-10-30 07:17:33 +00:00
var menuAddToLayoutImg = new Common . UI . MenuItem ( {
caption : me . addToLayoutText
} ) . on ( 'click' , _ . bind ( me . addToLayout , me ) ) ;
2016-03-11 00:48:53 +00:00
var menuParaCopy = new Common . UI . MenuItem ( {
caption : me . textCopy ,
value : 'copy'
} ) . on ( 'click' , _ . bind ( me . onCutCopyPaste , me ) ) ;
var menuParaPaste = new Common . UI . MenuItem ( {
caption : me . textPaste ,
value : 'paste'
} ) . on ( 'click' , _ . bind ( me . onCutCopyPaste , me ) ) ;
var menuParaCut = new Common . UI . MenuItem ( {
caption : me . textCut ,
value : 'cut'
} ) . on ( 'click' , _ . bind ( me . onCutCopyPaste , me ) ) ;
var menuImgCopy = new Common . UI . MenuItem ( {
caption : me . textCopy ,
value : 'copy'
} ) . on ( 'click' , _ . bind ( me . onCutCopyPaste , me ) ) ;
var menuImgPaste = new Common . UI . MenuItem ( {
caption : me . textPaste ,
value : 'paste'
} ) . on ( 'click' , _ . bind ( me . onCutCopyPaste , me ) ) ;
var menuImgCut = new Common . UI . MenuItem ( {
caption : me . textCut ,
value : 'cut'
} ) . on ( 'click' , _ . bind ( me . onCutCopyPaste , me ) ) ;
var menuTableCopy = new Common . UI . MenuItem ( {
caption : me . textCopy ,
value : 'copy'
} ) . on ( 'click' , _ . bind ( me . onCutCopyPaste , me ) ) ;
var menuTablePaste = new Common . UI . MenuItem ( {
caption : me . textPaste ,
value : 'paste'
} ) . on ( 'click' , _ . bind ( me . onCutCopyPaste , me ) ) ;
var menuTableCut = new Common . UI . MenuItem ( {
caption : me . textCut ,
value : 'cut'
} ) . on ( 'click' , _ . bind ( me . onCutCopyPaste , me ) ) ;
2016-10-25 10:48:31 +00:00
var menuEquationSeparator = new Common . UI . MenuItem ( {
caption : '--'
} ) ;
var menuEquationSeparatorInTable = new Common . UI . MenuItem ( {
caption : '--'
} ) ;
2019-10-30 07:17:33 +00:00
var menuAddToLayoutTable = new Common . UI . MenuItem ( {
caption : me . addToLayoutText
} ) . on ( 'click' , _ . bind ( me . addToLayout , me ) ) ;
2016-03-11 00:48:53 +00:00
me . textMenu = new Common . UI . Menu ( {
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
2016-10-25 10:48:31 +00:00
menuParagraphVAlign . setVisible ( isInShape && ! isInChart && ! isEquation ) ; // после того, как заголовок можно будет растягивать по вертикали, вернуть "|| isInChart" !!
menuParagraphDirection . setVisible ( isInShape && ! isInChart && ! isEquation ) ; // после того, как заголовок можно будет растягивать по вертикали, вернуть "|| isInChart" !!
2016-03-11 00:48:53 +00:00
if ( isInShape || isInChart ) {
var align = value . shapeProps . value . get _VerticalTextAlign ( ) ;
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 ( ) ;
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 ) ;
2016-03-11 00:48:53 +00:00
}
menuParagraphVAlign . setDisabled ( disabled ) ;
menuParagraphDirection . setDisabled ( disabled ) ;
var text = null ;
if ( me . api ) {
text = me . api . can _AddHyperlink ( ) ;
}
menuAddHyperlinkPara . setVisible ( value . hyperProps === undefined && text !== false ) ;
menuHyperlinkPara . setVisible ( value . hyperProps !== undefined ) ;
menuEditHyperlinkPara . hyperProps = value . hyperProps ;
if ( text !== false ) {
menuAddHyperlinkPara . hyperProps = { } ;
2016-04-05 12:57:51 +00:00
menuAddHyperlinkPara . hyperProps . value = new Asc . CHyperlinkProperty ( ) ;
2016-03-11 00:48:53 +00:00
menuAddHyperlinkPara . hyperProps . value . put _Text ( text ) ;
}
/** coauthoring begin **/
2017-08-02 09:03:16 +00:00
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 **/
menuCommentParaSeparator . setVisible ( /** coauthoring begin **/ menuAddCommentPara . isVisible ( ) || /** coauthoring end **/ menuAddHyperlinkPara . isVisible ( ) || menuHyperlinkPara . isVisible ( ) ) ;
menuAddHyperlinkPara . setDisabled ( disabled ) ;
menuHyperlinkPara . setDisabled ( disabled ) ;
/** coauthoring begin **/
menuAddCommentPara . setDisabled ( disabled ) ;
/** coauthoring end **/
menuParagraphAdvanced . setDisabled ( disabled ) ;
menuParaCut . setDisabled ( disabled ) ;
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 ) ;
menuIgnoreSpellPara . setVisible ( spell ) ;
menuIgnoreAllSpellPara . setVisible ( spell ) ;
2019-08-05 15:30:42 +00:00
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 ,
menuIgnoreSpellPara ,
menuIgnoreAllSpellPara ,
2019-08-05 08:59:52 +00:00
menuToDictionaryPara ,
2017-04-26 09:26:02 +00:00
me . langParaMenu ,
menuIgnoreSpellParaSeparator ,
2016-03-11 00:48:53 +00:00
menuParaCut ,
menuParaCopy ,
menuParaPaste ,
2016-10-25 10:48:31 +00:00
menuEquationSeparator ,
2016-03-11 00:48:53 +00:00
{ caption : '--' } ,
menuParagraphVAlign ,
menuParagraphDirection ,
menuParagraphAdvanced ,
menuCommentParaSeparator ,
/** coauthoring begin **/
menuAddCommentPara ,
/** coauthoring end **/
menuAddHyperlinkPara ,
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 ( {
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 ) ;
2016-04-05 11:52:34 +00:00
me . menuTableCellTop . setChecked ( value . tableProps . value . get _CellsVAlign ( ) == Asc . c _oAscVertAlignJc . Top ) ;
me . menuTableCellCenter . setChecked ( value . tableProps . value . get _CellsVAlign ( ) == Asc . c _oAscVertAlignJc . Center ) ;
me . menuTableCellBottom . setChecked ( value . tableProps . value . get _CellsVAlign ( ) == Asc . c _oAscVertAlignJc . Bottom ) ;
2016-03-11 00:48:53 +00:00
if ( me . api ) {
mnuTableMerge . setDisabled ( value . tableProps . locked || disabled || ! me . api . CheckBeforeMergeCells ( ) ) ;
mnuTableSplit . setDisabled ( value . tableProps . locked || disabled || ! me . api . CheckBeforeSplitCells ( ) ) ;
}
2018-02-06 12:06:01 +00:00
menuTableDistRows . setDisabled ( value . tableProps . locked || disabled ) ;
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
menuTableCellAlign . setDisabled ( value . tableProps . locked || disabled ) ;
menuTableAdvanced . setDisabled ( value . tableProps . locked || disabled ) ;
menuTableCut . setDisabled ( value . tableProps . locked || disabled ) ;
menuTablePaste . setDisabled ( value . tableProps . locked || disabled ) ;
// hyperlink properties
var text = null ;
if ( me . api ) {
text = me . api . can _AddHyperlink ( ) ;
}
menuAddHyperlinkTable . setVisible ( ! _ . isUndefined ( value . paraProps ) && _ . isUndefined ( value . hyperProps ) && text !== false ) ;
menuHyperlinkTable . setVisible ( ! _ . isUndefined ( value . paraProps ) && ! _ . isUndefined ( value . hyperProps ) ) ;
menuEditHyperlinkTable . hyperProps = value . hyperProps ;
if ( text !== false ) {
menuAddHyperlinkTable . hyperProps = { } ;
2016-04-05 12:57:51 +00:00
menuAddHyperlinkTable . hyperProps . value = new Asc . CHyperlinkProperty ( ) ;
2016-03-11 00:48:53 +00:00
menuAddHyperlinkTable . hyperProps . value . put _Text ( text ) ;
}
if ( ! _ . isUndefined ( value . paraProps ) ) {
menuAddHyperlinkTable . setDisabled ( value . paraProps . locked || disabled ) ;
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 **/
menuAddCommentTable . setVisible ( me . api . can _AddQuotedComment ( ) !== false && me . mode . canCoAuthoring && me . mode . canComments ) ;
menuAddCommentTable . setDisabled ( ! _ . isUndefined ( value . paraProps ) && value . paraProps . locked || disabled ) ;
/** coauthoring end **/
menuHyperlinkSeparator . setVisible ( menuAddHyperlinkTable . isVisible ( ) || menuHyperlinkTable . isVisible ( ) /** coauthoring begin **/ || 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 ) ;
2019-08-05 15:30:42 +00:00
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 ,
2016-03-11 00:48:53 +00:00
menuTableCut ,
menuTableCopy ,
menuTablePaste ,
{ caption : '--' } ,
new Common . UI . MenuItem ( {
caption : me . selectText ,
menu : new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
new Common . UI . MenuItem ( {
caption : me . rowText
} ) . on ( 'click' , function ( ) { if ( me . api ) me . api . selectRow ( ) } ) ,
new Common . UI . MenuItem ( {
caption : me . columnText
} ) . on ( 'click' , function ( ) { if ( me . api ) me . api . selectColumn ( ) } ) ,
new Common . UI . MenuItem ( {
caption : me . cellText
} ) . on ( 'click' , function ( ) { if ( me . api ) me . api . selectCell ( ) } ) ,
new Common . UI . MenuItem ( {
caption : me . tableText
} ) . on ( 'click' , function ( ) { if ( me . api ) me . api . selectTable ( ) } )
]
} )
} ) ,
{
caption : me . insertText ,
menu : new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
style : 'width: 100px' ,
items : [
new Common . UI . MenuItem ( {
caption : me . insertColumnLeftText
} ) . on ( 'click' , function ( item ) {
if ( me . api )
me . api . addColumnLeft ( ) ;
} ) ,
new Common . UI . MenuItem ( {
caption : me . insertColumnRightText
} ) . on ( 'click' , function ( item ) {
if ( me . api )
me . api . addColumnRight ( ) ;
} ) ,
new Common . UI . MenuItem ( {
caption : me . insertRowAboveText
} ) . on ( 'click' , function ( item ) {
if ( me . api )
me . api . addRowAbove ( ) ;
} ) ,
new Common . UI . MenuItem ( {
caption : me . insertRowBelowText
} ) . on ( 'click' , function ( item ) {
if ( me . api )
me . api . addRowBelow ( ) ;
} )
]
} )
} ,
new Common . UI . MenuItem ( {
caption : me . deleteText ,
menu : new Common . UI . Menu ( {
menuAlign : 'tl-tr' ,
items : [
new Common . UI . MenuItem ( {
caption : me . rowText
} ) . on ( 'click' , function ( ) { if ( me . api ) me . api . remRow ( ) } ) ,
new Common . UI . MenuItem ( {
caption : me . columnText
} ) . on ( 'click' , function ( ) { if ( me . api ) me . api . remColumn ( ) } ) ,
new Common . UI . MenuItem ( {
caption : me . tableText
} ) . on ( 'click' , function ( ) { if ( me . api ) me . api . remTable ( ) } )
]
} )
} ) ,
{ caption : '--' } ,
mnuTableMerge ,
mnuTableSplit ,
{ caption : '--' } ,
2018-02-06 12:06:01 +00:00
menuTableDistRows ,
menuTableDistCols ,
{ caption : '--' } ,
2016-03-11 00:48:53 +00:00
menuTableCellAlign ,
{ caption : '--' } ,
menuTableAdvanced ,
menuHyperlinkSeparator ,
/** coauthoring begin **/
menuAddCommentTable ,
/** coauthoring end **/
menuAddHyperlinkTable ,
2019-10-30 07:17:33 +00:00
menuHyperlinkTable ,
{ caption : '--' } ,
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 ( {
initMenu : function ( value ) {
if ( me . api ) {
mnuUnGroupImg . setDisabled ( ! me . api . canUnGroup ( ) ) ;
mnuGroupImg . setDisabled ( ! me . api . canGroup ( ) ) ;
}
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 ) ,
pluginGuid = ( value . imgProps ) ? value . imgProps . value . asc _getPluginGuid ( ) : null ;
2016-03-11 00:48:53 +00:00
2019-02-26 16:36:02 +00:00
menuImgShapeRotate . setVisible ( _ . isUndefined ( value . chartProps ) && ( pluginGuid === null || pluginGuid === undefined ) ) ;
if ( menuImgShapeRotate . isVisible ( ) )
menuImgShapeRotate . setDisabled ( disabled ) ;
2016-03-11 00:48:53 +00:00
// image properties
2018-04-11 13:46:44 +00:00
menuImgOriginalSize . setVisible ( isimage ) ;
2016-03-11 00:48:53 +00:00
if ( menuImgOriginalSize . isVisible ( ) )
menuImgOriginalSize . setDisabled ( disabled || _ . isNull ( value . imgProps . value . get _ImageUrl ( ) ) || _ . isUndefined ( value . imgProps . value . get _ImageUrl ( ) ) ) ;
2018-04-11 13:46:44 +00:00
menuImgReplace . setVisible ( isimage && ( pluginGuid === null || pluginGuid === undefined ) ) ;
if ( menuImgReplace . isVisible ( ) )
menuImgReplace . setDisabled ( disabled || pluginGuid === null ) ;
2019-04-09 11:29:51 +00:00
me . menuImgCrop . setVisible ( me . api . asc _canEditCrop ( ) ) ;
if ( me . menuImgCrop . isVisible ( ) )
me . menuImgCrop . setDisabled ( disabled ) ;
2018-04-11 13:46:44 +00:00
menuImageAdvanced . setVisible ( isimage ) ;
2016-03-11 00:48:53 +00:00
menuShapeAdvanced . setVisible ( _ . isUndefined ( value . imgProps ) && _ . isUndefined ( value . chartProps ) ) ;
menuChartEdit . setVisible ( _ . isUndefined ( value . imgProps ) && ! _ . isUndefined ( value . chartProps ) && ( _ . isUndefined ( value . shapeProps ) || value . shapeProps . isChart ) ) ;
menuImgShapeSeparator . setVisible ( menuImageAdvanced . isVisible ( ) || menuShapeAdvanced . isVisible ( ) || menuChartEdit . isVisible ( ) ) ;
/** coauthoring begin **/
menuAddCommentImg . setVisible ( me . api . can _AddQuotedComment ( ) !== false && me . mode . canCoAuthoring && me . mode . canComments ) ;
menuCommentSeparatorImg . setVisible ( menuAddCommentImg . isVisible ( ) ) ;
menuAddCommentImg . setDisabled ( disabled ) ;
/** coauthoring end **/
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 ;
menuImgShapeAlign . menu . items [ 7 ] . setDisabled ( objcount == 2 && ! slide _checked ) ;
menuImgShapeAlign . menu . items [ 8 ] . setDisabled ( objcount == 2 && ! slide _checked ) ;
}
2016-03-11 00:48:53 +00:00
menuImageAdvanced . setDisabled ( disabled ) ;
menuShapeAdvanced . setDisabled ( disabled ) ;
if ( menuChartEdit . isVisible ( ) )
menuChartEdit . setDisabled ( disabled ) ;
menuImgCut . setDisabled ( disabled ) ;
menuImgPaste . setDisabled ( disabled ) ;
} ,
items : [
menuImgCut ,
menuImgCopy ,
menuImgPaste ,
{ caption : '--' } ,
menuImgShapeArrange ,
menuImgShapeAlign ,
2019-02-26 16:36:02 +00:00
menuImgShapeRotate ,
2016-03-11 00:48:53 +00:00
menuImgShapeSeparator ,
2019-04-09 11:29:51 +00:00
me . menuImgCrop ,
2016-03-11 00:48:53 +00:00
menuImgOriginalSize ,
2018-04-11 13:46:44 +00:00
menuImgReplace ,
2016-03-11 00:48:53 +00:00
menuImageAdvanced ,
menuShapeAdvanced
, menuChartEdit
/** coauthoring begin **/
, menuCommentSeparatorImg ,
2019-10-30 07:17:33 +00:00
menuAddCommentImg ,
2016-03-11 00:48:53 +00:00
/** coauthoring end **/
2019-10-30 07:17:33 +00:00
{ caption : '--' } ,
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'
} ) ;
} ,
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
2019-08-10 14:40:57 +00:00
me . langParaMenu . menu . on ( 'item:click' , function ( menu , item ) {
if ( me . api ) {
if ( ! _ . isUndefined ( item . langid ) )
me . api . put _TextPrLang ( item . langid ) ;
2017-04-26 09:26:02 +00:00
2019-08-10 14:40:57 +00:00
me . _currLang . paraid = item . langid ;
me . fireEvent ( 'editcomplete' , me ) ;
}
} ) ;
2017-04-26 09:26:02 +00:00
2019-08-10 14:40:57 +00:00
me . langTableMenu . menu . on ( 'item:click' , function ( menu , item , e ) {
if ( me . api ) {
if ( ! _ . isUndefined ( item . langid ) )
me . api . put _TextPrLang ( item . langid ) ;
me . _currLang . tableid = item . langid ;
me . fireEvent ( 'editcomplete' , me ) ;
}
2017-04-26 09:26:02 +00:00
} ) ;
}
} ,
2017-11-10 08:59:05 +00:00
SetDisabled : function ( state ) {
this . _isDisabled = state ;
} ,
2019-11-18 12:14:14 +00:00
onInsertImage : function ( placeholder , obj , x , y ) {
if ( this . api )
2019-11-27 08:52:48 +00:00
( placeholder ) ? this . api . asc _addImage ( obj ) : this . api . ChangeImageFromFile ( ) ;
2019-11-18 12:14:14 +00:00
this . fireEvent ( 'editcomplete' , this ) ;
} ,
onInsertImageUrl : function ( placeholder , obj , x , y ) {
var me = this ;
( new Common . Views . ImageFromUrlDialog ( {
handler : function ( result , value ) {
if ( result == 'ok' ) {
if ( me . api ) {
var checkUrl = value . replace ( / /g , '' ) ;
if ( ! _ . isEmpty ( checkUrl ) ) {
if ( placeholder )
2019-11-27 08:52:48 +00:00
me . api . AddImageUrl ( checkUrl , undefined , undefined , obj ) ;
2019-11-18 12:14:14 +00:00
else {
var props = new Asc . asc _CImgProperty ( ) ;
props . put _ImageUrl ( checkUrl ) ;
2019-11-26 10:54:37 +00:00
me . api . ImgApply ( props , obj ) ;
2019-11-18 12:14:14 +00:00
}
}
}
}
me . fireEvent ( 'editcomplete' , me ) ;
}
} ) ) . show ( ) ;
} ,
2019-11-19 07:00:44 +00:00
onClickPlaceholderChart : function ( obj , x , y ) {
if ( ! this . api ) return ;
2019-11-28 08:25:32 +00:00
this . _state . placeholderObj = obj ;
2019-11-19 07:00:44 +00:00
var menu = this . placeholderMenuChart ,
menuContainer = menu ? this . cmpEl . find ( Common . Utils . String . format ( '#menu-container-{0}' , menu . id ) ) : null ,
me = this ;
this . _fromShowPlaceholder = true ;
Common . UI . Menu . Manager . hideAll ( ) ;
if ( ! menu ) {
this . placeholderMenuChart = menu = new Common . UI . Menu ( {
style : 'width: 435px;' ,
items : [
{ template : _ . template ( '<div id="id-placeholder-menu-chart" class="menu-insertchart" style="margin: 5px 5px 5px 10px;"></div>' ) }
]
} ) ;
// Prepare menu container
menuContainer = $ ( Common . Utils . String . format ( '<div id="menu-container-{0}" style="position: absolute; z-index: 10000;"><div class="dropdown-toggle" data-toggle="dropdown"></div></div>' , menu . id ) ) ;
this . cmpEl . append ( menuContainer ) ;
menu . render ( menuContainer ) ;
menu . cmpEl . attr ( { tabindex : "-1" } ) ;
menu . on ( 'hide:after' , function ( ) {
if ( ! me . _fromShowPlaceholder )
me . api . asc _uncheckPlaceholders ( ) ;
} ) ;
var picker = new Common . UI . DataView ( {
el : $ ( '#id-placeholder-menu-chart' ) ,
parentMenu : menu ,
showLast : false ,
// restoreHeight: 421,
groups : new Common . UI . DataViewGroupStore ( Common . define . chartData . getChartGroupData ( ) ) ,
store : new Common . UI . DataViewStore ( Common . define . chartData . getChartData ( ) ) ,
itemTemplate : _ . template ( '<div id="<%= id %>" class="item-chartlist <%= iconCls %>"></div>' )
} ) ;
picker . on ( 'item:click' , function ( picker , item , record , e ) {
2019-11-28 08:25:32 +00:00
me . editChartClick ( record . get ( 'type' ) , me . _state . placeholderObj ) ;
2019-11-19 07:00:44 +00:00
} ) ;
}
menuContainer . css ( { left : x , top : y } ) ;
menuContainer . attr ( 'data-value' , 'prevent-canvas-click' ) ;
this . _preventClick = true ;
menu . show ( ) ;
menu . alignPosition ( ) ;
_ . delay ( function ( ) {
menu . cmpEl . focus ( ) ;
} , 10 ) ;
this . _fromShowPlaceholder = false ;
} ,
2019-11-19 09:02:00 +00:00
onClickPlaceholderTable : function ( obj , x , y ) {
if ( ! this . api ) return ;
2019-11-28 08:25:32 +00:00
this . _state . placeholderObj = obj ;
2019-11-19 09:02:00 +00:00
var menu = this . placeholderMenuTable ,
menuContainer = menu ? this . cmpEl . find ( Common . Utils . String . format ( '#menu-container-{0}' , menu . id ) ) : null ,
me = this ;
this . _fromShowPlaceholder = true ;
Common . UI . Menu . Manager . hideAll ( ) ;
if ( ! menu ) {
this . placeholderMenuTable = menu = new Common . UI . Menu ( {
items : [
{ template : _ . template ( '<div id="id-placeholder-menu-tablepicker" class="dimension-picker" style="margin: 5px 10px;"></div>' ) } ,
{ caption : me . mniCustomTable , value : 'custom' }
]
} ) ;
// Prepare menu container
menuContainer = $ ( Common . Utils . String . format ( '<div id="menu-container-{0}" style="position: absolute; z-index: 10000;"><div class="dropdown-toggle" data-toggle="dropdown"></div></div>' , menu . id ) ) ;
this . cmpEl . append ( menuContainer ) ;
menu . render ( menuContainer ) ;
menu . cmpEl . attr ( { tabindex : "-1" } ) ;
menu . on ( 'hide:after' , function ( ) {
if ( ! me . _fromShowPlaceholder )
me . api . asc _uncheckPlaceholders ( ) ;
} ) ;
var picker = new Common . UI . DimensionPicker ( {
el : $ ( '#id-placeholder-menu-tablepicker' ) ,
minRows : 8 ,
minColumns : 10 ,
maxRows : 8 ,
maxColumns : 10
} ) ;
picker . on ( 'select' , function ( picker , columns , rows ) {
2019-11-28 08:25:32 +00:00
me . api . put _Table ( columns , rows , me . _state . placeholderObj ) ;
2019-11-19 09:02:00 +00:00
me . fireEvent ( 'editcomplete' , me ) ;
} ) ;
menu . on ( 'item:click' , function ( menu , item , e ) {
if ( item . value === 'custom' ) {
( new Common . Views . InsertTableDialog ( {
handler : function ( result , value ) {
if ( result == 'ok' )
2019-11-28 08:25:32 +00:00
me . api . put _Table ( value . columns , value . rows , me . _state . placeholderObj ) ;
2019-11-19 09:02:00 +00:00
me . fireEvent ( 'editcomplete' , me ) ;
}
} ) ) . show ( ) ;
}
} ) ;
}
menuContainer . css ( { left : x , top : y } ) ;
menuContainer . attr ( 'data-value' , 'prevent-canvas-click' ) ;
this . _preventClick = true ;
menu . show ( ) ;
menu . alignPosition ( ) ;
_ . delay ( function ( ) {
menu . cmpEl . focus ( ) ;
} , 10 ) ;
this . _fromShowPlaceholder = false ;
} ,
2019-11-19 07:00:44 +00:00
onHidePlaceholderActions : function ( ) {
this . placeholderMenuChart && this . placeholderMenuChart . hide ( ) ;
2019-11-28 08:25:32 +00:00
this . placeholderMenuTable && this . placeholderMenuTable . hide ( ) ;
2019-11-19 07:00:44 +00:00
} ,
onClickPlaceholder : function ( type , obj , x , y ) {
if ( ! this . api ) return ;
2019-11-19 09:02:00 +00:00
if ( type == AscCommon . PlaceholderButtonType . Video ) {
2019-11-26 10:54:37 +00:00
// this.api.addVideo(obj);
2019-11-19 09:02:00 +00:00
} else if ( type == AscCommon . PlaceholderButtonType . Audio ) {
2019-11-26 10:54:37 +00:00
// this.api.addAudio(obj);
2019-11-19 07:00:44 +00:00
}
2019-11-19 09:02:00 +00:00
this . fireEvent ( 'editcomplete' , this ) ;
2019-11-19 07:00:44 +00:00
} ,
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' ,
txtPressLink : 'Press CTRL and click link' ,
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' ,
2019-12-02 10:32:56 +00:00
mniCustomTable : 'Insert Custom Table'
2016-03-11 00:48:53 +00:00
} , PE . Views . DocumentHolder || { } ) ) ;
} ) ;