',
'
' + 'background-image: url(<%= imageUrl %>);' + '<% } %> background-position: 0 -<%= offsety %>px;"/>',
'
'
].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);
});
}
});
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({
split: true,
handler: function(result, value) {
if (result == 'ok') {
if (me.api) {
me.api.SplitCell(value.columns, value.rows);
}
Common.component.Analytics.trackEvent('DocumentHolder', 'Table Split');
}
me.fireEvent('editcomplete', me);
}
})).show();
}
});
var menuTableCellAlign = new Common.UI.MenuItem({
caption : me.cellAlignText,
menu : (function(){
function onItemClick(item, e) {
if (me.api) {
var properties = new Asc.CTableProp();
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({
caption : me.textShapeAlignTop,
checkable : true,
toggleGroup : 'popuptablecellalign',
value : Asc.c_oAscVertAlignJc.Top
}).on('click', _.bind(onItemClick, me)),
me.menuTableCellCenter = new Common.UI.MenuItem({
caption : me.textShapeAlignMiddle,
checkable : true,
toggleGroup : 'popuptablecellalign',
value : Asc.c_oAscVertAlignJc.Center
}).on('click', _.bind(onItemClick, me)),
me.menuTableCellBottom = new Common.UI.MenuItem({
caption : me.textShapeAlignBottom,
checkable : true,
toggleGroup : 'popuptablecellalign',
value : Asc.c_oAscVertAlignJc.Bottom
}).on('click', _.bind(onItemClick, me))
]
})
})()
});
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));
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',
restoreHeight: true,
items : []
})
});
var langTemplate = _.template([
'
',
'',
'<%= caption %>',
''
].join(''));
me.langTableMenu = new Common.UI.MenuItem({
caption : me.langText,
menu : new Common.UI.MenuSimple({
cls: 'lang-menu',
menuAlign: 'tl-tr',
restoreHeight: 285,
items : [],
itemTemplate: langTemplate,
search: true
})
});
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);
}
});
var menuToDictionaryTable = new Common.UI.MenuItem({
caption : me.toDictionaryText
}).on('click', function(item, e) {
me.api.asc_spellCheckAddToDictionary(me._currentSpellObj);
me.fireEvent('editcomplete', me);
});
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,
menuToDictionaryTable,
{ 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',
restoreHeight: true,
items: []
})
});
me.langParaMenu = new Common.UI.MenuItem({
caption : me.langText,
menu : new Common.UI.MenuSimple({
cls: 'lang-menu',
menuAlign: 'tl-tr',
restoreHeight: 285,
items : [],
itemTemplate: langTemplate,
search: true
})
});
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);
});
var menuToDictionaryPara = new Common.UI.MenuItem({
caption : me.toDictionaryText
}).on('click', function(item, e) {
me.api.asc_spellCheckAddToDictionary(me._currentSpellObj);
me.fireEvent('editcomplete', me);
});
var menuIgnoreSpellParaSeparator = new Common.UI.MenuItem({
caption : '--'
});
var menuSpellcheckParaSeparator = new Common.UI.MenuItem({
caption : '--'
});
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();
if (Asc.c_oAscTypeSelectElement.Table == elType) {
(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();
if (Asc.c_oAscTypeSelectElement.Image == elType) {
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();
if (Asc.c_oAscTypeSelectElement.Shape == elType) {
(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();
if (Asc.c_oAscTypeSelectElement.Paragraph == elType) {
(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) {
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');
}
}
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',
value : Asc.c_oAscAlignShapeType.ALIGN_LEFT
}).on('click', _.bind(onItemClick, me)),
new Common.UI.MenuItem({
caption : me.textShapeAlignCenter,
iconCls : 'mnu-shape-align-center',
value : Asc.c_oAscAlignShapeType.ALIGN_CENTER
}).on('click', _.bind(onItemClick, me)),
new Common.UI.MenuItem({
caption : me.textShapeAlignRight,
iconCls : 'mnu-shape-align-right',
value : Asc.c_oAscAlignShapeType.ALIGN_RIGHT
}).on('click', _.bind(onItemClick, me)),
new Common.UI.MenuItem({
caption : me.textShapeAlignTop,
iconCls : 'mnu-shape-align-top',
value : Asc.c_oAscAlignShapeType.ALIGN_TOP
}).on('click', _.bind(onItemClick, me)),
new Common.UI.MenuItem({
caption : me.textShapeAlignMiddle,
iconCls : 'mnu-shape-align-middle',
value : Asc.c_oAscAlignShapeType.ALIGN_MIDDLE
}).on('click', _.bind(onItemClick, me)),
new Common.UI.MenuItem({
caption : me.textShapeAlignBottom,
iconCls : 'mnu-shape-align-bottom',
value : Asc.c_oAscAlignShapeType.ALIGN_BOTTOM
}).on('click', _.bind(onItemClick, me)),
{caption : '--'},
new Common.UI.MenuItem({
caption : me.txtDistribHor,
iconCls : 'mnu-distrib-hor',
value : 6
}).on('click', _.bind(onItemClick, me)),
new Common.UI.MenuItem({
caption : me.txtDistribVert,
iconCls : 'mnu-distrib-vert',
value : 7
}).on('click', _.bind(onItemClick, me))
]
})
})()
});
var menuChartEdit = new Common.UI.MenuItem({
caption : me.editChartText
}).on('click', _.bind(me.editChartClick, me, undefined));
var menuParagraphVAlign = new Common.UI.MenuItem({
caption : me.vertAlignText,
menu : (function(){
function onItemClick(item) {
if (me.api) {
var properties = new Asc.asc_CShapeProperty();
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({
caption : me.textShapeAlignTop,
checkable : true,
toggleGroup : 'popupparagraphvalign',
value : Asc.c_oAscVAlign.Top
}).on('click', _.bind(onItemClick, me)),
me.menuParagraphCenter = new Common.UI.MenuItem({
caption : me.textShapeAlignMiddle,
checkable : true,
toggleGroup : 'popupparagraphvalign',
value : Asc.c_oAscVAlign.Center
}).on('click', _.bind(onItemClick, me)),
me.menuParagraphBottom = new Common.UI.MenuItem({
caption : me.textShapeAlignBottom,
checkable : true,
toggleGroup : 'popupparagraphvalign',
value : Asc.c_oAscVAlign.Bottom
}).on('click', _.bind(onItemClick, me))
]
})
})()
});
var paragraphDirection = function(item, e) {
if (me.api) {
var properties = new Asc.asc_CShapeProperty();
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,
iconCls : 'mnu-direct-horiz',
checkable : true,
checked : false,
toggleGroup : 'popupparagraphdirect',
direction : Asc.c_oAscVertDrawingText.normal
}).on('click', _.bind(paragraphDirection, me)),
me.menuParagraphDirect90 = new Common.UI.MenuItem({
caption : me.direct90Text,
iconCls : 'mnu-direct-rdown',
checkable : true,
checked : false,
toggleGroup : 'popupparagraphdirect',
direction : Asc.c_oAscVertDrawingText.vert
}).on('click', _.bind(paragraphDirection, me)),
me.menuParagraphDirect270 = new Common.UI.MenuItem({
caption : me.direct270Text,
iconCls : 'mnu-direct-rup',
checkable : true,
checked : false,
toggleGroup : 'popupparagraphdirect',
direction : Asc.c_oAscVertDrawingText.vert270
}).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) {
var properties = new Asc.asc_CImgProperty();
properties.put_Width(originalImageSize.get_ImageWidth());
properties.put_Height(originalImageSize.get_ImageHeight());
properties.put_ResetCrop(true);
me.api.ImgApply(properties);
}
me.fireEvent('editcomplete', me);
Common.component.Analytics.trackEvent('DocumentHolder', 'Set Image Original Size');
}
});
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(){
me.onInsertImage();
}, 10);
}),
new Common.UI.MenuItem({
caption : this.textFromUrl
}).on('click', _.bind(me.onInsertImageUrl, me, false))
]
})
});
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)),
new Common.UI.MenuItem({
caption: me.textRotate270,
value : 0
}).on('click', _.bind(onImgRotate, me)),
{ caption: '--' },
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))
]
})
});
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))
]
})
});
/** 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 **/
var menuAddToLayoutImg = new Common.UI.MenuItem({
caption : me.addToLayoutText
}).on('click', _.bind(me.addToLayout, me));
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));
var menuEquationSeparator = new Common.UI.MenuItem({
caption : '--'
});
var menuEquationSeparatorInTable = new Common.UI.MenuItem({
caption : '--'
});
var menuAddToLayoutTable = new Common.UI.MenuItem({
caption : me.addToLayoutText
}).on('click', _.bind(me.addToLayout, me));
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);
var isEquation= (value.mathProps && value.mathProps.value);
me._currentParaObjDisabled = disabled;
menuParagraphVAlign.setVisible(isInShape && !isInChart && !isEquation); // после того, как заголовок можно будет растягивать по вертикали, вернуть "|| isInChart" !!
menuParagraphDirection.setVisible(isInShape && !isInChart && !isEquation); // после того, как заголовок можно будет растягивать по вертикали, вернуть "|| isInChart" !!
if (isInShape || isInChart) {
var align = value.shapeProps.value.get_VerticalTextAlign();
me.menuParagraphTop.setChecked(align == Asc.c_oAscVAlign.Top);
me.menuParagraphCenter.setChecked(align == Asc.c_oAscVAlign.Center);
me.menuParagraphBottom.setChecked(align == Asc.c_oAscVAlign.Bottom);
var dir = value.shapeProps.value.get_Vert();
me.menuParagraphDirectH.setChecked(dir == Asc.c_oAscVertDrawingText.normal);
me.menuParagraphDirect90.setChecked(dir == Asc.c_oAscVertDrawingText.vert);
me.menuParagraphDirect270.setChecked(dir == Asc.c_oAscVertDrawingText.vert270);
}
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 = {};
menuAddHyperlinkPara.hyperProps.value = new Asc.CHyperlinkProperty();
menuAddHyperlinkPara.hyperProps.value.put_Text(text);
}
/** coauthoring begin **/
menuAddCommentPara.setVisible(!isInChart && isInShape && me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments);
/** 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);
// spellCheck
var spell = (value.spellProps!==undefined && value.spellProps.value.get_Checked()===false);
me.menuSpellPara.setVisible(spell);
menuSpellcheckParaSeparator.setVisible(spell);
menuIgnoreSpellPara.setVisible(spell);
menuIgnoreAllSpellPara.setVisible(spell);
menuToDictionaryPara.setVisible(spell && me.mode.isDesktopApp);
me.langParaMenu.setVisible(spell);
me.langParaMenu.setDisabled(disabled);
menuIgnoreSpellParaSeparator.setVisible(spell);
if (spell && value.spellProps.value.get_Variants() !== null && value.spellProps.value.get_Variants() !== undefined) {
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;
}
//equation menu
var eqlen = 0;
if (isEquation) {
eqlen = me.addEquationMenu(true, 12);
} else
me.clearEquationMenu(true, 12);
menuEquationSeparator.setVisible(isEquation && eqlen>0);
},
items: [
me.menuSpellPara,
me.menuSpellMorePara,
menuSpellcheckParaSeparator,
menuIgnoreSpellPara,
menuIgnoreAllSpellPara,
menuToDictionaryPara,
me.langParaMenu,
menuIgnoreSpellParaSeparator,
menuParaCut,
menuParaCopy,
menuParaPaste,
menuEquationSeparator,
{ caption: '--' },
menuParagraphVAlign,
menuParagraphDirection,
menuParagraphAdvanced,
menuCommentParaSeparator,
/** coauthoring begin **/
menuAddCommentPara,
/** coauthoring end **/
menuAddHyperlinkPara,
menuHyperlinkPara
]
}).on('hide:after', function(menu, e, isFromInputControl) {
if (me.suppressEditComplete) {
me.suppressEditComplete = false;
return;
}
if (!isFromInputControl) me.fireEvent('editcomplete', me);
me.currentMenu = null;
});
me.tableMenu = new Common.UI.Menu({
initMenu: function(value){
// table properties
if (_.isUndefined(value.tableProps))
return;
var isEquation= (value.mathProps && value.mathProps.value);
for (var i = 6; i < 19; i++) {
me.tableMenu.items[i].setVisible(!isEquation);
}
var disabled = (value.slideProps!==undefined && value.slideProps.locked);
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);
if (me.api) {
mnuTableMerge.setDisabled(value.tableProps.locked || disabled || !me.api.CheckBeforeMergeCells());
mnuTableSplit.setDisabled(value.tableProps.locked || disabled || !me.api.CheckBeforeSplitCells());
}
menuTableDistRows.setDisabled(value.tableProps.locked || disabled);
menuTableDistCols.setDisabled(value.tableProps.locked || disabled);
me.tableMenu.items[7].setDisabled(value.tableProps.locked || disabled);
me.tableMenu.items[8].setDisabled(value.tableProps.locked || disabled);
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 = {};
menuAddHyperlinkTable.hyperProps.value = new Asc.CHyperlinkProperty();
menuAddHyperlinkTable.hyperProps.value.put_Text(text);
}
if (!_.isUndefined(value.paraProps)) {
menuAddHyperlinkTable.setDisabled(value.paraProps.locked || disabled);
menuHyperlinkTable.setDisabled(value.paraProps.locked || disabled);
me._currentParaObjDisabled = value.paraProps.locked || disabled;
}
/** 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 **/);
me.menuSpellCheckTable.setVisible(value.spellProps!==undefined && value.spellProps.value.get_Checked()===false);
menuToDictionaryTable.setVisible(me.mode.isDesktopApp);
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;
}
//equation menu
var eqlen = 0;
if (isEquation) {
eqlen = me.addEquationMenu(false, 6);
menuHyperlinkSeparator.setVisible(menuHyperlinkSeparator.isVisible() && eqlen>0);
} else
me.clearEquationMenu(false, 6);
},
items: [
me.menuSpellCheckTable,
menuSpellcheckTableSeparator,
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: '--' },
menuTableDistRows,
menuTableDistCols,
{ caption: '--' },
menuTableCellAlign,
{ caption: '--' },
menuTableAdvanced,
menuHyperlinkSeparator,
/** coauthoring begin **/
menuAddCommentTable,
/** coauthoring end **/
menuAddHyperlinkTable,
menuHyperlinkTable,
{ caption: '--' },
menuAddToLayoutTable
]
}).on('hide:after', function(menu, e, isFromInputControl) {
if (me.suppressEditComplete) {
me.suppressEditComplete = false;
return;
}
if (!isFromInputControl) me.fireEvent('editcomplete', me);
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());
}
var isimage = (_.isUndefined(value.shapeProps) || value.shapeProps.value.get_FromImage()) && _.isUndefined(value.chartProps),
imgdisabled = (value.imgProps!==undefined && value.imgProps.locked),
shapedisabled = (value.shapeProps!==undefined && value.shapeProps.locked),
chartdisabled = (value.chartProps!==undefined && value.chartProps.locked),
disabled = imgdisabled || shapedisabled || chartdisabled || (value.slideProps!==undefined && value.slideProps.locked),
pluginGuid = (value.imgProps) ? value.imgProps.value.asc_getPluginGuid() : null;
menuImgShapeRotate.setVisible(_.isUndefined(value.chartProps) && (pluginGuid===null || pluginGuid===undefined));
if (menuImgShapeRotate.isVisible())
menuImgShapeRotate.setDisabled(disabled);
// image properties
menuImgOriginalSize.setVisible(isimage);
if (menuImgOriginalSize.isVisible())
menuImgOriginalSize.setDisabled(disabled || _.isNull(value.imgProps.value.get_ImageUrl()) || _.isUndefined(value.imgProps.value.get_ImageUrl()));
menuImgReplace.setVisible(isimage && (pluginGuid===null || pluginGuid===undefined));
if (menuImgReplace.isVisible())
menuImgReplace.setDisabled(disabled || pluginGuid===null);
me.menuImgCrop.setVisible(me.api.asc_canEditCrop());
if (me.menuImgCrop.isVisible())
me.menuImgCrop.setDisabled(disabled);
menuImageAdvanced.setVisible(isimage);
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);
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);
}
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,
menuImgShapeRotate,
menuImgShapeSeparator,
me.menuImgCrop,
menuImgOriginalSize,
menuImgReplace,
menuImageAdvanced,
menuShapeAdvanced
,menuChartEdit
/** coauthoring begin **/
,menuCommentSeparatorImg,
menuAddCommentImg,
/** coauthoring end **/
{ caption: '--' },
menuAddToLayoutImg
]
}).on('hide:after', function(menu, e, isFromInputControl) {
if (me.suppressEditComplete) {
me.suppressEditComplete = false;
return;
}
if (!isFromInputControl) me.fireEvent('editcomplete', me);
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'
});
},
setLanguages: function(langs){
var me = this;
if (langs && langs.length > 0 && me.langParaMenu && me.langTableMenu) {
var arrPara = [], arrTable = [];
_.each(langs, function(lang) {
var item = {
caption : lang.displayValue,
value : lang.value,
checkable : true,
langid : lang.code,
spellcheck : lang.spellcheck
};
arrPara.push(item);
arrTable.push(_.clone(item));
});
me.langParaMenu.menu.resetItems(arrPara);
me.langTableMenu.menu.resetItems(arrTable);
me.langParaMenu.menu.on('item:click', function(menu, item){
if (me.api){
if (!_.isUndefined(item.langid))
me.api.put_TextPrLang(item.langid);
me._currLang.paraid = item.langid;
me.fireEvent('editcomplete', me);
}
});
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);
}
});
}
},
SetDisabled: function(state) {
this._isDisabled = state;
},
onInsertImage: function(placeholder, obj, x, y) {
if (this.api)
(placeholder) ? this.api.asc_addImage(obj) : this.api.ChangeImageFromFile();
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)
me.api.AddImageUrl(checkUrl, undefined, undefined, obj);
else {
var props = new Asc.asc_CImgProperty();
props.put_ImageUrl(checkUrl);
me.api.ImgApply(props, obj);
}
}
}
}
me.fireEvent('editcomplete', me);
}
})).show();
},
onClickPlaceholderChart: function(obj, x, y) {
if (!this.api) return;
this._state.placeholderObj = obj;
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('')}
]
});
// Prepare menu container
menuContainer = $(Common.Utils.String.format('', 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('
')
});
picker.on('item:click', function (picker, item, record, e) {
me.editChartClick(record.get('type'), me._state.placeholderObj);
});
}
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;
},
onClickPlaceholderTable: function(obj, x, y) {
if (!this.api) return;
this._state.placeholderObj = obj;
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('')},
{caption: me.mniCustomTable, value: 'custom'}
]
});
// Prepare menu container
menuContainer = $(Common.Utils.String.format('', 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){
me.api.put_Table(columns, rows, me._state.placeholderObj);
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')
me.api.put_Table(value.columns, value.rows, me._state.placeholderObj);
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;
},
onHidePlaceholderActions: function() {
this.placeholderMenuChart && this.placeholderMenuChart.hide();
this.placeholderMenuTable && this.placeholderMenuTable.hide();
},
onClickPlaceholder: function(type, obj, x, y) {
if (!this.api) return;
if (type == AscCommon.PlaceholderButtonType.Video) {
// this.api.addVideo(obj);
} else if (type == AscCommon.PlaceholderButtonType.Audio) {
// this.api.addAudio(obj);
}
this.fireEvent('editcomplete', this);
},
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',
originalSizeText : 'Actual Size',
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',
txtPreview : 'Start slideshow',
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',
direct90Text: 'Rotate Text Down',
direct270Text: 'Rotate Text Up',
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',
txtDeleteCharsAndSeparators: 'Delete enclosing characters and separators',
alignmentText: 'Alignment',
leftText: 'Left',
rightText: 'Right',
centerText: 'Center',
loadSpellText: 'Loading variants...',
ignoreAllSpellText: 'Ignore All',
ignoreSpellText: 'Ignore',
noSpellVariantsText: 'No variants',
moreText: 'More variants...',
spellcheckText: 'Spellcheck',
langText: 'Select Language',
textUndo: 'Undo',
txtSlideHide: 'Hide Slide',
txtChangeTheme: 'Change Theme',
txtKeepTextOnly: 'Keep text only',
txtPastePicture: 'Picture',
txtPasteSourceFormat: 'Keep source formatting',
txtPasteDestFormat: 'Use destination theme',
textDistributeRows: 'Distribute rows',
textDistributeCols: 'Distribute columns',
textReplace: 'Replace image',
textFromUrl: 'From URL',
textFromFile: 'From File',
textRotate270: 'Rotate 90° Counterclockwise',
textRotate90: 'Rotate 90° Clockwise',
textFlipV: 'Flip Vertically',
textFlipH: 'Flip Horizontally',
textRotate: 'Rotate',
textCrop: 'Crop',
textCropFill: 'Fill',
textCropFit: 'Fit',
toDictionaryText: 'Add to Dictionary',
txtPrintSelection: 'Print Selection',
addToLayoutText: 'Add to Layout',
txtResetLayout: 'Reset Slide',
mniCustomTable: 'Insert custom table'
}, PE.Views.DocumentHolder || {}));
});