mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-24 09:47:17 +08:00
[PDF] Add Edit tab
This commit is contained in:
@ -318,7 +318,7 @@ define([
|
||||
},
|
||||
'edit:complete': _.bind(me.onEditComplete, me)
|
||||
});
|
||||
|
||||
this.initNames();
|
||||
Common.util.Shortcuts.delegateShortcuts({
|
||||
shortcuts: {
|
||||
'command+s,ctrl+s,command+p,ctrl+p,command+k,ctrl+k,command+d,ctrl+d': _.bind(function (e) {
|
||||
@ -1047,6 +1047,13 @@ define([
|
||||
toolbarController.activateControls();
|
||||
if (me.needToUpdateVersion)
|
||||
toolbarController.onApiCoAuthoringDisconnect();
|
||||
|
||||
if (me.appOptions.isEdit) {
|
||||
var shapes = me.api.asc_getPropertyEditorShapes();
|
||||
if (shapes)
|
||||
me.fillAutoShapes(shapes[0], shapes[1]);
|
||||
}
|
||||
|
||||
me.api.UpdateInterfaceState();
|
||||
|
||||
Common.NotificationCenter.trigger('document:ready', 'main');
|
||||
@ -2447,6 +2454,62 @@ define([
|
||||
}
|
||||
},
|
||||
|
||||
initNames: function() {
|
||||
this.shapeGroupNames = [
|
||||
this.txtBasicShapes,
|
||||
this.txtFiguredArrows,
|
||||
this.txtMath,
|
||||
this.txtCharts,
|
||||
this.txtStarsRibbons,
|
||||
this.txtCallouts,
|
||||
this.txtButtons,
|
||||
this.txtRectangles,
|
||||
this.txtLines
|
||||
];
|
||||
},
|
||||
|
||||
fillAutoShapes: function(groupNames, shapes){
|
||||
if (_.isEmpty(shapes) || _.isEmpty(groupNames) || shapes.length != groupNames.length)
|
||||
return;
|
||||
|
||||
var me = this,
|
||||
shapegrouparray = [],
|
||||
name_arr = {};
|
||||
|
||||
_.each(groupNames, function(groupName, index){
|
||||
var store = new Backbone.Collection([], {
|
||||
model: PDFE.Models.ShapeModel
|
||||
}),
|
||||
arr = [];
|
||||
|
||||
var cols = (shapes[index].length) > 18 ? 7 : 6,
|
||||
height = Math.ceil(shapes[index].length/cols) * 35 + 3,
|
||||
width = 30 * cols;
|
||||
|
||||
_.each(shapes[index], function(shape, idx){
|
||||
var name = me['txtShape_' + shape.Type];
|
||||
arr.push({
|
||||
data : {shapeType: shape.Type},
|
||||
tip : name || (me.textShape + ' ' + (idx+1)),
|
||||
allowSelected : true,
|
||||
selected: false
|
||||
});
|
||||
if (name)
|
||||
name_arr[shape.Type] = name;
|
||||
});
|
||||
store.add(arr);
|
||||
shapegrouparray.push({
|
||||
groupName : me.shapeGroupNames[index],
|
||||
groupStore : store,
|
||||
groupWidth : width,
|
||||
groupHeight : height
|
||||
});
|
||||
});
|
||||
|
||||
this.getCollection('ShapeGroups').reset(shapegrouparray);
|
||||
this.api.asc_setShapeNames(name_arr);
|
||||
},
|
||||
|
||||
leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' then \'Save\' to save them. Click \'Leave this Page\' to discard all the unsaved changes.',
|
||||
criticalErrorTitle: 'Error',
|
||||
notcriticalErrorTitle: 'Warning',
|
||||
@ -2584,6 +2647,16 @@ define([
|
||||
errorEmailClient: 'No email client could be found',
|
||||
errorTextFormWrongFormat: 'The value entered does not match the format of the field.',
|
||||
txtArt: 'Your text here',
|
||||
txtBasicShapes: 'Basic Shapes',
|
||||
txtFiguredArrows: 'Figured Arrows',
|
||||
txtMath: 'Math',
|
||||
txtCharts: 'Charts',
|
||||
txtStarsRibbons: 'Stars & Ribbons',
|
||||
txtCallouts: 'Callouts',
|
||||
txtButtons: 'Buttons',
|
||||
txtRectangles: 'Rectangles',
|
||||
txtLines: 'Lines',
|
||||
|
||||
}
|
||||
})(), PDFE.Controllers.Main || {}))
|
||||
});
|
||||
File diff suppressed because it is too large
Load Diff
@ -118,6 +118,49 @@
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="panel" data-tab="edit">
|
||||
<div class="group">
|
||||
<span class="btn-slot text x-huge" id="slot-btn-instext"></span>
|
||||
</div>
|
||||
<div class="separator long invisible"></div>
|
||||
<div class="group small" id="slot-combo-insertshape"></div>
|
||||
<div class="separator long"></div>
|
||||
<div class="group small">
|
||||
<div class="elset" style="width:230px;">
|
||||
<span class="btn-slot float-left" id="slot-field-fontname"></span>
|
||||
<span class="btn-slot margin-left-2 float-left" id="slot-field-fontsize"></span>
|
||||
<span class="btn-slot margin-left-2" id="slot-btn-incfont"></span>
|
||||
<span class="btn-slot margin-left-2" id="slot-btn-decfont"></span>
|
||||
<span class="btn-slot margin-left-2 split" id="slot-btn-changecase"></span>
|
||||
</div>
|
||||
<div class="elset font-attr">
|
||||
<span class="btn-slot" id="slot-btn-bold"></span>
|
||||
<span class="btn-slot" id="slot-btn-italic"></span>
|
||||
<span class="btn-slot" id="slot-btn-text-underline"></span>
|
||||
<span class="btn-slot" id="slot-btn-text-strikeout"></span>
|
||||
<span class="btn-slot" id="slot-btn-superscript"></span>
|
||||
<span class="btn-slot" id="slot-btn-subscript"></span>
|
||||
<span class="btn-slot split" id="slot-btn-text-highlight"></span>
|
||||
<span class="btn-slot split" id="slot-btn-fontcolor"></span>
|
||||
<span class="btn-slot" id="slot-btn-clearstyle"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="separator long"></div>
|
||||
<div class="group small">
|
||||
<div class="elset">
|
||||
<span class="btn-slot split" id="slot-btn-markers"></span>
|
||||
<span class="btn-slot split" id="slot-btn-numbering"></span>
|
||||
<span class="btn-slot split" id="slot-btn-decoffset"></span>
|
||||
<span class="btn-slot split" id="slot-btn-incoffset"></span>
|
||||
</div>
|
||||
<div class="elset">
|
||||
<span class="btn-slot split" id="slot-btn-halign"></span>
|
||||
<span class="btn-slot split" id="slot-btn-valign"></span>
|
||||
<span class="btn-slot split" id="slot-btn-linespace"></span>
|
||||
<span class="btn-slot split" id="slot-btn-columns"></span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
</div>
|
||||
@ -57,9 +57,10 @@ define([
|
||||
'common/main/lib/component/Menu',
|
||||
'common/main/lib/component/Window',
|
||||
'common/main/lib/component/ComboBoxFonts',
|
||||
'common/main/lib/component/ComboDataView'
|
||||
,'common/main/lib/component/SynchronizeTip'
|
||||
,'common/main/lib/component/Mixtbar'
|
||||
'common/main/lib/component/ComboDataView',
|
||||
'common/main/lib/component/SynchronizeTip',
|
||||
'common/main/lib/component/Mixtbar',
|
||||
'common/main/lib/component/ComboDataViewShape'
|
||||
], function ($, _, Backbone, template, template_view) {
|
||||
'use strict';
|
||||
|
||||
@ -113,7 +114,6 @@ define([
|
||||
this._state = {
|
||||
hasCollaborativeChanges: undefined
|
||||
};
|
||||
|
||||
Common.NotificationCenter.on('app:ready', me.onAppReady.bind(this));
|
||||
return this;
|
||||
},
|
||||
@ -128,7 +128,8 @@ define([
|
||||
tabs: [
|
||||
{caption: me.textTabFile, action: 'file', extcls: 'canedit', layoutname: 'toolbar-file', haspanel:false, dataHintTitle: 'F'},
|
||||
{caption: me.textTabHome, action: 'home', extcls: 'canedit', dataHintTitle: 'H'},
|
||||
{caption: me.textTabComment, action: 'comment', extcls: 'canedit', dataHintTitle: 'C'}
|
||||
{caption: me.textTabComment, action: 'comment', extcls: 'canedit', dataHintTitle: 'C'},
|
||||
{caption: me.textTabEdit, action: 'edit', extcls: 'canedit', dataHintTitle: 'E'},
|
||||
],
|
||||
config: config
|
||||
}
|
||||
@ -198,7 +199,7 @@ define([
|
||||
penOptions: {color: '000000'},
|
||||
type: AscPDF.ANNOTATIONS_TYPES.Strikeout
|
||||
});
|
||||
this.paragraphControls.push(this.btnStrikeout);
|
||||
// this.paragraphControls.push(this.btnStrikeout);
|
||||
|
||||
this.btnUnderline = new Common.UI.ButtonColored({
|
||||
id: 'id-toolbar-btn-underline',
|
||||
@ -215,7 +216,7 @@ define([
|
||||
penOptions: {color: '000000'},
|
||||
type: AscPDF.ANNOTATIONS_TYPES.Underline
|
||||
});
|
||||
this.paragraphControls.push(this.btnUnderline);
|
||||
// this.paragraphControls.push(this.btnUnderline);
|
||||
|
||||
this.btnHighlight = new Common.UI.ButtonColored({
|
||||
id: 'id-toolbar-btn-highlight',
|
||||
@ -235,7 +236,458 @@ define([
|
||||
'249B01', 'C504D2', '0633D1', 'FFF7A0', 'FF0303', 'FFFFFF', 'D3D3D4', '969696', '606060', '000000'
|
||||
]}
|
||||
});
|
||||
this.paragraphControls.push(this.btnHighlight);
|
||||
// this.paragraphControls.push(this.btnHighlight);
|
||||
|
||||
// tab Edit
|
||||
this.cmbFontName = new Common.UI.ComboBoxFonts({
|
||||
cls: 'input-group-nr',
|
||||
menuCls: 'scrollable-menu',
|
||||
menuStyle: 'min-width: 325px;',
|
||||
hint: this.tipFontName,
|
||||
lock: [_set.paragraphLock, _set.lostConnect, _set.noTextSelected, _set.shapeLock],
|
||||
store: new Common.Collections.Fonts(),
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'top'
|
||||
});
|
||||
this.paragraphControls.push(this.cmbFontName);
|
||||
|
||||
this.cmbFontSize = new Common.UI.ComboBox({
|
||||
cls: 'input-group-nr',
|
||||
menuStyle: 'min-width: 55px;',
|
||||
hint: this.tipFontSize,
|
||||
lock: [_set.paragraphLock, _set.lostConnect, _set.noTextSelected, _set.shapeLock],
|
||||
data: [
|
||||
{value: 8, displayValue: "8"},
|
||||
{value: 9, displayValue: "9"},
|
||||
{value: 10, displayValue: "10"},
|
||||
{value: 11, displayValue: "11"},
|
||||
{value: 12, displayValue: "12"},
|
||||
{value: 14, displayValue: "14"},
|
||||
{value: 16, displayValue: "16"},
|
||||
{value: 18, displayValue: "18"},
|
||||
{value: 20, displayValue: "20"},
|
||||
{value: 22, displayValue: "22"},
|
||||
{value: 24, displayValue: "24"},
|
||||
{value: 26, displayValue: "26"},
|
||||
{value: 28, displayValue: "28"},
|
||||
{value: 36, displayValue: "36"},
|
||||
{value: 48, displayValue: "48"},
|
||||
{value: 72, displayValue: "72"},
|
||||
{value: 96, displayValue: "96"}
|
||||
],
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'top'
|
||||
});
|
||||
this.paragraphControls.push(this.cmbFontSize);
|
||||
|
||||
this.btnIncFontSize = new Common.UI.Button({
|
||||
id: 'id-toolbar-btn-incfont',
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon btn-incfont',
|
||||
lock: [_set.paragraphLock, _set.lostConnect, _set.noTextSelected, _set.shapeLock],
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'top'
|
||||
});
|
||||
this.paragraphControls.push(this.btnIncFontSize);
|
||||
|
||||
this.btnDecFontSize = new Common.UI.Button({
|
||||
id: 'id-toolbar-btn-decfont',
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon btn-decfont',
|
||||
lock: [_set.paragraphLock, _set.lostConnect, _set.noTextSelected, _set.shapeLock],
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'top'
|
||||
});
|
||||
this.paragraphControls.push(this.btnDecFontSize);
|
||||
|
||||
this.btnBold = new Common.UI.Button({
|
||||
id: 'id-toolbar-btn-bold',
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon btn-bold',
|
||||
lock: [_set.paragraphLock, _set.lostConnect, _set.noTextSelected, _set.shapeLock],
|
||||
enableToggle: true,
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom'
|
||||
});
|
||||
this.paragraphControls.push(this.btnBold);
|
||||
|
||||
this.btnItalic = new Common.UI.Button({
|
||||
id: 'id-toolbar-btn-italic',
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon btn-italic',
|
||||
lock: [_set.paragraphLock, _set.lostConnect, _set.noTextSelected, _set.shapeLock],
|
||||
enableToggle: true,
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom'
|
||||
});
|
||||
this.paragraphControls.push(this.btnItalic);
|
||||
|
||||
this.btnTextUnderline = new Common.UI.Button({
|
||||
id: 'id-toolbar-btn-underline',
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon btn-underline',
|
||||
lock: [_set.paragraphLock, _set.lostConnect, _set.noTextSelected, _set.shapeLock],
|
||||
enableToggle: true,
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom'
|
||||
});
|
||||
this.paragraphControls.push(this.btnTextUnderline);
|
||||
|
||||
this.btnTextStrikeout = new Common.UI.Button({
|
||||
id: 'id-toolbar-btn-strikeout',
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon btn-strikeout',
|
||||
lock: [_set.paragraphLock, _set.lostConnect, _set.noTextSelected, _set.shapeLock],
|
||||
enableToggle: true,
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom'
|
||||
});
|
||||
this.paragraphControls.push(this.btnTextStrikeout);
|
||||
|
||||
this.btnSuperscript = new Common.UI.Button({
|
||||
id: 'id-toolbar-btn-superscript',
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon btn-superscript',
|
||||
lock: [_set.paragraphLock, _set.lostConnect, _set.noTextSelected, _set.shapeLock],
|
||||
enableToggle: true,
|
||||
toggleGroup: 'superscriptGroup',
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom'
|
||||
});
|
||||
this.paragraphControls.push(this.btnSuperscript);
|
||||
|
||||
this.btnSubscript = new Common.UI.Button({
|
||||
id: 'id-toolbar-btn-subscript',
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon btn-subscript',
|
||||
lock: [_set.paragraphLock, _set.lostConnect, _set.noTextSelected, _set.shapeLock],
|
||||
enableToggle: true,
|
||||
toggleGroup: 'superscriptGroup',
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom'
|
||||
});
|
||||
this.paragraphControls.push(this.btnSubscript);
|
||||
|
||||
this.btnTextHighlightColor = new Common.UI.ButtonColored({
|
||||
id: 'id-toolbar-btn-highlight',
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon btn-highlight',
|
||||
enableToggle: true,
|
||||
allowDepress: true,
|
||||
split: true,
|
||||
menu: true,
|
||||
lock: [_set.paragraphLock, _set.lostConnect, _set.noTextSelected, _set.shapeLock],
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom',
|
||||
dataHintOffset: '0, -16',
|
||||
penOptions: {color: 'FFFC54', colors: [
|
||||
'FFFC54', '72F54A', '74F9FD', 'EB51F7', 'A900F9', 'EF8B3A', '7272FF', 'FF63A4', '1DFF92', '03DA18',
|
||||
'249B01', 'C504D2', '0633D1', 'FFF7A0', 'FF0303', 'FFFFFF', 'D3D3D4', '969696', '606060', '000000'
|
||||
]}
|
||||
});
|
||||
this.paragraphControls.push(this.btnTextHighlightColor);
|
||||
|
||||
this.btnFontColor = new Common.UI.ButtonColored({
|
||||
id: 'id-toolbar-btn-fontcolor',
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon btn-fontcolor',
|
||||
lock: [_set.paragraphLock, _set.lostConnect, _set.noTextSelected, _set.shapeLock],
|
||||
split: true,
|
||||
menu: true,
|
||||
eyeDropper: true,
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom',
|
||||
dataHintOffset: '0, -16',
|
||||
penOptions: {color: '000000'}
|
||||
});
|
||||
this.paragraphControls.push(this.btnFontColor);
|
||||
|
||||
this.btnChangeCase = new Common.UI.Button({
|
||||
id: 'id-toolbar-btn-case',
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon btn-change-case',
|
||||
lock: [_set.paragraphLock, _set.lostConnect, _set.noTextSelected, _set.shapeLock],
|
||||
menu: new Common.UI.Menu({
|
||||
items: [
|
||||
{caption: this.mniSentenceCase, value: Asc.c_oAscChangeTextCaseType.SentenceCase},
|
||||
{caption: this.mniLowerCase, value: Asc.c_oAscChangeTextCaseType.LowerCase},
|
||||
{caption: this.mniUpperCase, value: Asc.c_oAscChangeTextCaseType.UpperCase},
|
||||
{caption: this.mniCapitalizeWords, value: Asc.c_oAscChangeTextCaseType.CapitalizeWords},
|
||||
{caption: this.mniToggleCase, value: Asc.c_oAscChangeTextCaseType.ToggleCase}
|
||||
]
|
||||
}),
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'top',
|
||||
dataHintOffset: '0, -6'
|
||||
});
|
||||
this.paragraphControls.push(this.btnChangeCase);
|
||||
this.mnuChangeCase = this.btnChangeCase.menu;
|
||||
|
||||
this.btnClearStyle = new Common.UI.Button({
|
||||
id: 'id-toolbar-btn-clearstyle',
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon btn-clearstyle',
|
||||
lock: [ _set.paragraphLock, _set.lostConnect, _set.noParagraphSelected],
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom'
|
||||
});
|
||||
this.paragraphControls.push(this.btnClearStyle);
|
||||
|
||||
this.btnMarkers = new Common.UI.Button({
|
||||
id: 'id-toolbar-btn-markers',
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon ' + (!Common.UI.isRTL() ? 'btn-setmarkers' : 'btn-setmarkers-rtl'),
|
||||
lock: [_set.paragraphLock, _set.lostConnect, _set.noParagraphSelected, _set.inSmartart, _set.inSmartartInternal],
|
||||
enableToggle: true,
|
||||
toggleGroup: 'markersGroup',
|
||||
split: true,
|
||||
menu: true,
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'top',
|
||||
dataHintOffset: '0, -16'
|
||||
});
|
||||
this.paragraphControls.push(this.btnMarkers);
|
||||
|
||||
this.btnNumbers = new Common.UI.Button({
|
||||
id: 'id-toolbar-btn-numbering',
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon ' + (!Common.UI.isRTL() ? 'btn-numbering' : 'btn-numbering-rtl'),
|
||||
lock: [_set.paragraphLock, _set.lostConnect, _set.noParagraphSelected, _set.inSmartart, _set.inSmartartInternal],
|
||||
enableToggle: true,
|
||||
toggleGroup: 'markersGroup',
|
||||
split: true,
|
||||
menu: true,
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'top',
|
||||
dataHintOffset: '0, -16'
|
||||
});
|
||||
this.paragraphControls.push(this.btnNumbers);
|
||||
|
||||
var clone = function (source) {
|
||||
var obj = {};
|
||||
for (var prop in source)
|
||||
obj[prop] = (typeof(source[prop]) == 'object') ? clone(source[prop]) : source[prop];
|
||||
return obj;
|
||||
};
|
||||
|
||||
this.mnuMarkersPicker = {
|
||||
conf: {index: 0},
|
||||
selectByIndex: function (idx) {
|
||||
this.conf.index = idx;
|
||||
}
|
||||
};
|
||||
this.mnuNumbersPicker = clone(this.mnuMarkersPicker);
|
||||
|
||||
this.btnHorizontalAlign = new Common.UI.Button({
|
||||
id: 'id-toolbar-btn-halign',
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon btn-align-left',
|
||||
icls: 'btn-align-left',
|
||||
lock: [_set.paragraphLock, _set.lostConnect, _set.noParagraphSelected],
|
||||
menu: new Common.UI.Menu({
|
||||
items: [
|
||||
{
|
||||
caption: this.textAlignLeft + Common.Utils.String.platformKey('Ctrl+L'),
|
||||
iconCls: 'menu__icon btn-align-left',
|
||||
icls: 'btn-align-left',
|
||||
checkable: true,
|
||||
checkmark: false,
|
||||
toggleGroup: 'halignGroup',
|
||||
checked: true,
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
caption: this.textAlignCenter + Common.Utils.String.platformKey('Ctrl+E'),
|
||||
iconCls: 'menu__icon btn-align-center',
|
||||
icls: 'btn-align-center',
|
||||
checkable: true,
|
||||
checkmark: false,
|
||||
toggleGroup: 'halignGroup',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
caption: this.textAlignRight + Common.Utils.String.platformKey('Ctrl+R'),
|
||||
iconCls: 'menu__icon btn-align-right',
|
||||
icls: 'btn-align-right',
|
||||
checkable: true,
|
||||
checkmark: false,
|
||||
toggleGroup: 'halignGroup',
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
caption: this.textAlignJust + Common.Utils.String.platformKey('Ctrl+J'),
|
||||
iconCls: 'menu__icon btn-align-just',
|
||||
icls: 'btn-align-just',
|
||||
checkable: true,
|
||||
checkmark: false,
|
||||
toggleGroup: 'halignGroup',
|
||||
value: 3
|
||||
}
|
||||
]
|
||||
}),
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom',
|
||||
dataHintOffset: '0, -6'
|
||||
});
|
||||
this.paragraphControls.push(this.btnHorizontalAlign);
|
||||
|
||||
this.btnVerticalAlign = new Common.UI.Button({
|
||||
id: 'id-toolbar-btn-valign',
|
||||
cls: 'btn-toolbar',
|
||||
lock: [_set.paragraphLock, _set.lostConnect, _set.noParagraphSelected, _set.noObjectSelected],
|
||||
iconCls: 'toolbar__icon btn-align-middle',
|
||||
icls: 'btn-align-middle',
|
||||
menu: new Common.UI.Menu({
|
||||
items: [
|
||||
{
|
||||
caption: this.textAlignTop,
|
||||
iconCls: 'menu__icon btn-align-top',
|
||||
icls: 'btn-align-top',
|
||||
checkable: true,
|
||||
checkmark: false,
|
||||
toggleGroup: 'valignGroup',
|
||||
value: Asc.c_oAscVAlign.Top
|
||||
},
|
||||
{
|
||||
caption: this.textAlignMiddle,
|
||||
iconCls: 'menu__icon btn-align-middle',
|
||||
icls: 'btn-align-middle',
|
||||
checkable: true,
|
||||
checkmark: false,
|
||||
toggleGroup: 'valignGroup',
|
||||
value: Asc.c_oAscVAlign.Center,
|
||||
checked: true
|
||||
},
|
||||
{
|
||||
caption: this.textAlignBottom,
|
||||
iconCls: 'menu__icon btn-align-bottom',
|
||||
icls: 'btn-align-bottom',
|
||||
checkable: true,
|
||||
checkmark: false,
|
||||
toggleGroup: 'valignGroup',
|
||||
value: Asc.c_oAscVAlign.Bottom
|
||||
}
|
||||
]
|
||||
}),
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom',
|
||||
dataHintOffset: '0, -6'
|
||||
});
|
||||
this.paragraphControls.push(this.btnVerticalAlign);
|
||||
|
||||
this.btnDecLeftOffset = new Common.UI.Button({
|
||||
id: 'id-toolbar-btn-decoffset',
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon btn-decoffset',
|
||||
lock: [_set.decIndentLock, _set.paragraphLock, _set.lostConnect, _set.noParagraphSelected, _set.inSmartart, _set.inSmartartInternal],
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'top'
|
||||
});
|
||||
this.paragraphControls.push(this.btnDecLeftOffset);
|
||||
|
||||
this.btnIncLeftOffset = new Common.UI.Button({
|
||||
id: 'id-toolbar-btn-incoffset',
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon btn-incoffset',
|
||||
lock: [_set.incIndentLock, _set.paragraphLock, _set.lostConnect, _set.noParagraphSelected, _set.inSmartart, _set.inSmartartInternal],
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'top'
|
||||
});
|
||||
this.paragraphControls.push(this.btnIncLeftOffset);
|
||||
|
||||
this.btnLineSpace = new Common.UI.Button({
|
||||
id: 'id-toolbar-btn-linespace',
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon btn-linespace',
|
||||
lock: [_set.paragraphLock, _set.lostConnect, _set.noParagraphSelected],
|
||||
menu: new Common.UI.Menu({
|
||||
style: 'min-width: 60px;',
|
||||
items: [
|
||||
{caption: '1.0', value: 1.0, checkable: true, toggleGroup: 'linesize'},
|
||||
{caption: '1.15', value: 1.15, checkable: true, toggleGroup: 'linesize'},
|
||||
{caption: '1.5', value: 1.5, checkable: true, toggleGroup: 'linesize'},
|
||||
{caption: '2.0', value: 2.0, checkable: true, toggleGroup: 'linesize'},
|
||||
{caption: '2.5', value: 2.5, checkable: true, toggleGroup: 'linesize'},
|
||||
{caption: '3.0', value: 3.0, checkable: true, toggleGroup: 'linesize'}
|
||||
]
|
||||
}),
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom',
|
||||
dataHintOffset: '0, -6'
|
||||
});
|
||||
this.paragraphControls.push(this.btnLineSpace);
|
||||
|
||||
this.btnColumns = new Common.UI.Button({
|
||||
id: 'id-toolbar-btn-columns',
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'toolbar__icon btn-columns-two',
|
||||
lock: [_set.paragraphLock, _set.lostConnect, _set.noParagraphSelected, _set.noColumns],
|
||||
menu: new Common.UI.Menu({
|
||||
cls: 'ppm-toolbar shifted-right',
|
||||
items: [
|
||||
{
|
||||
caption: this.textColumnsOne,
|
||||
iconCls: 'menu__icon btn-columns-one',
|
||||
checkable: true,
|
||||
checkmark: false,
|
||||
toggleGroup: 'menuColumns',
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
caption: this.textColumnsTwo,
|
||||
iconCls: 'menu__icon btn-columns-two',
|
||||
checkable: true,
|
||||
checkmark: false,
|
||||
toggleGroup: 'menuColumns',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
caption: this.textColumnsThree,
|
||||
iconCls: 'menu__icon btn-columns-three',
|
||||
checkable: true,
|
||||
checkmark: false,
|
||||
toggleGroup: 'menuColumns',
|
||||
value: 2
|
||||
},
|
||||
{caption: '--'},
|
||||
{caption: this.textColumnsCustom, value: 'advanced'}
|
||||
]
|
||||
}),
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom',
|
||||
dataHintOffset: '0, -6'
|
||||
});
|
||||
this.paragraphControls.push(this.btnColumns);
|
||||
|
||||
this.cmbInsertShape = new Common.UI.ComboDataViewShape({
|
||||
cls: 'combo-styles shapes',
|
||||
itemWidth: 20,
|
||||
itemHeight: 20,
|
||||
menuMaxHeight: 652,
|
||||
menuWidth: 362,
|
||||
style: 'width: 140px;',
|
||||
enableKeyEvents: true,
|
||||
lock: [_set.lostConnect, _set.disableOnStart],
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom',
|
||||
dataHintOffset: '-16, 0'
|
||||
});
|
||||
this.toolbarControls.push(this.cmbInsertShape);
|
||||
|
||||
this.btnInsertText = new Common.UI.Button({
|
||||
id: 'tlbtn-inserttext',
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'toolbar__icon btn-big-text',
|
||||
lock: [_set.lostConnect, _set.disableOnStart],
|
||||
caption: this.capInsertText,
|
||||
enableToggle: true,
|
||||
split: true,
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom',
|
||||
dataHintOffset: 'small',
|
||||
textboxType: 'textRect'
|
||||
});
|
||||
this.toolbarControls.push(this.btnInsertText);
|
||||
|
||||
} else if ( config.isRestrictedEdit ) {
|
||||
Common.UI.Mixtbar.prototype.initialize.call(this, {
|
||||
@ -598,12 +1050,36 @@ define([
|
||||
_injectComponent('#slot-btn-form-next', this.btnNextForm);
|
||||
_injectComponent('#slot-btn-form-submit', this.btnSubmit);
|
||||
_injectComponent('#slot-btn-form-save', this.btnSaveForm);
|
||||
_injectComponent('#slot-field-fontname', this.cmbFontName);
|
||||
_injectComponent('#slot-field-fontsize', this.cmbFontSize);
|
||||
_injectComponent('#slot-btn-text-underline', this.btnTextUnderline);
|
||||
_injectComponent('#slot-btn-text-highlight', this.btnTextHighlightColor);
|
||||
_injectComponent('#slot-btn-text-strikeout', this.btnTextStrikeout);
|
||||
_injectComponent('#slot-btn-bold', this.btnBold);
|
||||
_injectComponent('#slot-btn-italic', this.btnItalic);
|
||||
_injectComponent('#slot-btn-superscript', this.btnSuperscript);
|
||||
_injectComponent('#slot-btn-subscript', this.btnSubscript);
|
||||
_injectComponent('#slot-btn-incfont', this.btnIncFontSize);
|
||||
_injectComponent('#slot-btn-decfont', this.btnDecFontSize);
|
||||
_injectComponent('#slot-btn-fontcolor', this.btnFontColor);
|
||||
_injectComponent('#slot-btn-changecase', this.btnChangeCase);
|
||||
_injectComponent('#slot-btn-clearstyle', this.btnClearStyle);
|
||||
_injectComponent('#slot-btn-markers', this.btnMarkers);
|
||||
_injectComponent('#slot-btn-numbering', this.btnNumbers);
|
||||
_injectComponent('#slot-btn-incoffset', this.btnIncLeftOffset);
|
||||
_injectComponent('#slot-btn-decoffset', this.btnDecLeftOffset);
|
||||
_injectComponent('#slot-btn-halign', this.btnHorizontalAlign);
|
||||
_injectComponent('#slot-btn-valign', this.btnVerticalAlign);
|
||||
_injectComponent('#slot-btn-linespace', this.btnLineSpace);
|
||||
_injectComponent('#slot-btn-columns', this.btnColumns);
|
||||
_injectComponent('#slot-combo-insertshape', this.cmbInsertShape);
|
||||
_injectComponent('#slot-btn-instext', this.btnInsertText);
|
||||
|
||||
this.btnPrint.menu && this.btnPrint.$el.addClass('split');
|
||||
return $host;
|
||||
},
|
||||
|
||||
createPen: function(button, id) {
|
||||
createPen: function(button, id, transparent) {
|
||||
var mnu;
|
||||
button.setMenu(new Common.UI.Menu({
|
||||
cls: 'shifted-left',
|
||||
@ -614,11 +1090,11 @@ define([
|
||||
id: 'id-toolbar-menu-' + id + '-color-new',
|
||||
template: _.template('<a tabindex="-1" type="menuitem" style="">' + button.textNewColor + '</a>')
|
||||
},
|
||||
{caption: '--', visible: false},
|
||||
{caption: '--', visible: !!transparent},
|
||||
mnu = new Common.UI.MenuItem({
|
||||
caption: this.strMenuNoFill,
|
||||
checkable: true,
|
||||
visible: false,
|
||||
visible: !!transparent,
|
||||
style: 'padding-left:20px;padding-right:20px;'
|
||||
})
|
||||
]
|
||||
@ -693,6 +1169,40 @@ define([
|
||||
me.mnuHighlightColorPicker = arr[0];
|
||||
me.mnuHighlightTransparent = arr[1];
|
||||
}
|
||||
if (me.btnTextHighlightColor && me.btnTextHighlightColor.menu) {
|
||||
var arr = me.createPen(me.btnTextHighlightColor, 'text-highlight', true);
|
||||
me.mnuTextHighlightColorPicker = arr[0];
|
||||
me.mnuTextHighlightTransparent = arr[1];
|
||||
}
|
||||
if (me.btnFontColor && me.btnFontColor.menu) {
|
||||
var arr = me.createPen(me.btnFontColor, 'font');
|
||||
me.mnuFontColorPicker = arr[0];
|
||||
me.mnuFontTransparent = arr[1];
|
||||
}
|
||||
|
||||
me.btnInsertText && me.btnInsertText.setMenu(new Common.UI.Menu({
|
||||
items: [
|
||||
{
|
||||
caption: me.tipInsertHorizontalText,
|
||||
checkable: true,
|
||||
checkmark: false,
|
||||
iconCls : 'menu__icon btn-text',
|
||||
toggleGroup: 'textbox',
|
||||
value: 'textRect',
|
||||
iconClsForMainBtn: 'btn-big-text'
|
||||
},
|
||||
{
|
||||
caption: me.tipInsertVerticalText,
|
||||
checkable: true,
|
||||
checkmark: false,
|
||||
iconCls : 'menu__icon btn-text-vertical',
|
||||
toggleGroup: 'textbox',
|
||||
value: 'textRectVertical',
|
||||
iconClsForMainBtn: 'btn-big-text-vertical'
|
||||
},
|
||||
]
|
||||
}));
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
@ -709,6 +1219,124 @@ define([
|
||||
this.btnUnderline.updateHint(this.textUnderline);
|
||||
this.btnHighlight.updateHint(this.textHighlight);
|
||||
// this.btnRotate.updateHint(this.tipRotate);
|
||||
this.btnIncFontSize.updateHint(this.tipIncFont + Common.Utils.String.platformKey('Ctrl+]'));
|
||||
this.btnDecFontSize.updateHint(this.tipDecFont + Common.Utils.String.platformKey('Ctrl+['));
|
||||
this.btnBold.updateHint(this.textBold + Common.Utils.String.platformKey('Ctrl+B'));
|
||||
this.btnItalic.updateHint(this.textItalic + Common.Utils.String.platformKey('Ctrl+I'));
|
||||
this.btnTextUnderline.updateHint(this.textUnderline + Common.Utils.String.platformKey('Ctrl+U'));
|
||||
this.btnTextStrikeout.updateHint(this.textStrikeout);
|
||||
this.btnSuperscript.updateHint(this.textSuperscript);
|
||||
this.btnSubscript.updateHint(this.textSubscript);
|
||||
this.btnFontColor.updateHint(this.tipFontColor);
|
||||
this.btnTextHighlightColor.updateHint(this.tipHighlightColor);
|
||||
this.btnChangeCase.updateHint(this.tipChangeCase);
|
||||
this.btnClearStyle.updateHint(this.tipClearStyle);
|
||||
this.btnMarkers.updateHint(this.tipMarkers);
|
||||
this.btnNumbers.updateHint(this.tipNumbers);
|
||||
this.btnHorizontalAlign.updateHint(this.tipHAligh);
|
||||
this.btnVerticalAlign.updateHint(this.tipVAligh);
|
||||
this.btnDecLeftOffset.updateHint(this.tipDecPrLeft + Common.Utils.String.platformKey('Ctrl+Shift+M'));
|
||||
this.btnIncLeftOffset.updateHint(this.tipIncPrLeft);
|
||||
this.btnLineSpace.updateHint(this.tipLineSpace);
|
||||
this.btnColumns.updateHint(this.tipColumns);
|
||||
this.btnInsertText.updateHint([this.tipInsertHorizontalText ,this.tipInsertText]);
|
||||
this.btnMarkers.setMenu(
|
||||
new Common.UI.Menu({
|
||||
cls: 'shifted-left',
|
||||
style: 'min-width: 145px',
|
||||
items: [
|
||||
{template: _.template('<div id="id-toolbar-menu-markers" class="menu-markers" style="width: 145px; margin: 0 9px;"></div>')},
|
||||
this.mnuMarkerSettings = new Common.UI.MenuItem({
|
||||
caption: this.textListSettings,
|
||||
value: 'settings'
|
||||
})
|
||||
]
|
||||
})
|
||||
);
|
||||
|
||||
this.btnNumbers.setMenu(
|
||||
new Common.UI.Menu({
|
||||
cls: 'shifted-left',
|
||||
items: [
|
||||
{template: _.template('<div id="id-toolbar-menu-numbering" class="menu-markers" style="width: 353px; margin: 0 9px;"></div>')},
|
||||
this.mnuNumberSettings = new Common.UI.MenuItem({
|
||||
caption: this.textListSettings,
|
||||
value: 'settings'
|
||||
})
|
||||
]
|
||||
})
|
||||
);
|
||||
|
||||
this._markersArr = [
|
||||
'undefined',
|
||||
'{"bulletTypeface":{"type":"bufont","typeface":"Symbol"},"bulletType":{"type":"char","char":"·","startAt":null}}',
|
||||
'{"bulletTypeface":{"type":"bufont","typeface":"Courier New"},"bulletType":{"type":"char","char":"o","startAt":null}}',
|
||||
'{"bulletTypeface":{"type":"bufont","typeface":"Wingdings"},"bulletType":{"type":"char","char":"§","startAt":null}}',
|
||||
'{"bulletTypeface":{"type":"bufont","typeface":"Wingdings"},"bulletType":{"type":"char","char":"v","startAt":null}}',
|
||||
'{"bulletTypeface":{"type":"bufont","typeface":"Wingdings"},"bulletType":{"type":"char","char":"Ø","startAt":null}}',
|
||||
'{"bulletTypeface":{"type":"bufont","typeface":"Wingdings"},"bulletType":{"type":"char","char":"ü","startAt":null}}',
|
||||
'{"bulletTypeface":{"type":"bufont","typeface":"Symbol"},"bulletType":{"type":"char","char":"¨","startAt":null}}',
|
||||
'{"bulletTypeface":{"type":"bufont","typeface":"Arial"},"bulletType":{"type":"char","char":"–","startAt":null}}'
|
||||
];
|
||||
|
||||
var _conf = this.mnuMarkersPicker.conf;
|
||||
this.mnuMarkersPicker = new Common.UI.DataView({
|
||||
el: $('#id-toolbar-menu-markers'),
|
||||
parentMenu: this.btnMarkers.menu,
|
||||
outerMenu: {menu: this.btnMarkers.menu, index: 0},
|
||||
restoreHeight: 138,
|
||||
allowScrollbar: false,
|
||||
delayRenderTips: true,
|
||||
store: new Common.UI.DataViewStore([
|
||||
{id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: -1},numberingInfo: this._markersArr[0], skipRenderOnChange: true, tip: this.tipNone},
|
||||
{id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 1}, numberingInfo: this._markersArr[1], skipRenderOnChange: true, tip: this.tipMarkersFRound},
|
||||
{id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 2}, numberingInfo: this._markersArr[2], skipRenderOnChange: true, tip: this.tipMarkersHRound},
|
||||
{id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 3}, numberingInfo: this._markersArr[3], skipRenderOnChange: true, tip: this.tipMarkersFSquare},
|
||||
{id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 4}, numberingInfo: this._markersArr[4], skipRenderOnChange: true, tip: this.tipMarkersStar},
|
||||
{id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 5}, numberingInfo: this._markersArr[5], skipRenderOnChange: true, tip: this.tipMarkersArrow},
|
||||
{id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 6}, numberingInfo: this._markersArr[6], skipRenderOnChange: true, tip: this.tipMarkersCheckmark},
|
||||
{id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 7}, numberingInfo: this._markersArr[7], skipRenderOnChange: true, tip: this.tipMarkersFRhombus},
|
||||
{id: 'id-markers-' + Common.UI.getId(), data: {type: 0, subtype: 8}, numberingInfo: this._markersArr[8], skipRenderOnChange: true, tip: this.tipMarkersDash}
|
||||
]),
|
||||
itemTemplate: _.template('<div id="<%= id %>" class="item-markerlist"></div>')
|
||||
});
|
||||
this.btnMarkers.menu.setInnerMenu([{menu: this.mnuMarkersPicker, index: 0}]);
|
||||
_conf && this.mnuMarkersPicker.selectByIndex(_conf.index, true);
|
||||
|
||||
this._numbersArr = [
|
||||
'undefined',
|
||||
'{"bulletTypeface":{"type":"bufont","typeface":"Arial"},"bulletType":{"type":"autonum","char":null,"autoNumType":"alphaUcPeriod","startAt":null}}',
|
||||
'{"bulletTypeface":{"type":"bufont","typeface":"Arial"},"bulletType":{"type":"autonum","char":null,"autoNumType":"alphaLcParenR","startAt":null}}',
|
||||
'{"bulletTypeface":{"type":"bufont","typeface":"Arial"},"bulletType":{"type":"autonum","char":null,"autoNumType":"alphaLcPeriod","startAt":null}}',
|
||||
'{"bulletTypeface":{"type":"bufont","typeface":"Arial"},"bulletType":{"type":"autonum","char":null,"autoNumType":"arabicPeriod","startAt":null}}',
|
||||
'{"bulletTypeface":{"type":"bufont","typeface":"Arial"},"bulletType":{"type":"autonum","char":null,"autoNumType":"arabicParenR","startAt":null}}',
|
||||
'{"bulletTypeface":{"type":"bufont","typeface":"Arial"},"bulletType":{"type":"autonum","char":null,"autoNumType":"romanUcPeriod","startAt":null}}',
|
||||
'{"bulletTypeface":{"type":"bufont","typeface":"Arial"},"bulletType":{"type":"autonum","char":null,"autoNumType":"romanLcPeriod","startAt":null}}'
|
||||
];
|
||||
|
||||
_conf = this.mnuNumbersPicker.conf;
|
||||
this.mnuNumbersPicker = new Common.UI.DataView({
|
||||
el: $('#id-toolbar-menu-numbering'),
|
||||
parentMenu: this.btnNumbers.menu,
|
||||
outerMenu: {menu: this.btnNumbers.menu, index: 0},
|
||||
restoreHeight: 92,
|
||||
allowScrollbar: false,
|
||||
delayRenderTips: true,
|
||||
store: new Common.UI.DataViewStore([
|
||||
{id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: -1}, numberingInfo: this._numbersArr[0], skipRenderOnChange: true, tip: this.tipNone},
|
||||
{id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 4}, numberingInfo: this._numbersArr[1], skipRenderOnChange: true, tip: this.tipNumCapitalLetters},
|
||||
{id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 5}, numberingInfo: this._numbersArr[2], skipRenderOnChange: true, tip: this.tipNumLettersParentheses},
|
||||
{id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 6}, numberingInfo: this._numbersArr[3], skipRenderOnChange: true, tip: this.tipNumLettersPoints},
|
||||
{id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 1}, numberingInfo: this._numbersArr[4], skipRenderOnChange: true, tip: this.tipNumNumbersPoint},
|
||||
{id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 2}, numberingInfo: this._numbersArr[5], skipRenderOnChange: true, tip: this.tipNumNumbersParentheses},
|
||||
{id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 3}, numberingInfo: this._numbersArr[6], skipRenderOnChange: true, tip: this.tipNumRoman},
|
||||
{id: 'id-numbers-' + Common.UI.getId(), data: {type: 1, subtype: 7}, numberingInfo: this._numbersArr[7], skipRenderOnChange: true, tip: this.tipNumRomanSmall}
|
||||
]),
|
||||
itemTemplate: _.template('<div id="<%= id %>" class="item-multilevellist"></div>')
|
||||
});
|
||||
this.btnNumbers.menu.setInnerMenu([{menu: this.mnuNumbersPicker, index: 0}]);
|
||||
_conf && this.mnuNumbersPicker.selectByIndex(_conf.index, true);
|
||||
|
||||
} else if (this.mode.isRestrictedEdit) {
|
||||
this.btnClear.updateHint(this.textClearFields);
|
||||
this.btnPrevForm.updateHint(this.tipPrevForm);
|
||||
@ -841,6 +1469,45 @@ define([
|
||||
|
||||
/** coauthoring end **/
|
||||
|
||||
updateAutoshapeMenu: function (menuShape, collection) {
|
||||
var me = this,
|
||||
index = $(menuShape.el).prop('id').slice(-1);
|
||||
|
||||
var menuitem = new Common.UI.MenuItem({
|
||||
template: _.template('<div id="id-toolbar-menu-insertshape-<%= options.index %>" class="menu-insertshape"></div>'),
|
||||
index: index
|
||||
});
|
||||
menuShape.addItem(menuitem);
|
||||
|
||||
var recents = Common.localStorage.getItem('pe-recent-shapes');
|
||||
recents = recents ? JSON.parse(recents) : null;
|
||||
|
||||
var shapePicker = new Common.UI.DataViewShape({
|
||||
el: $('#id-toolbar-menu-insertshape-'+index),
|
||||
itemTemplate: _.template('<div class="item-shape" id="<%= id %>"><svg width="20" height="20" class=\"icon uni-scale\"><use xlink:href=\"#svg-icon-<%= data.shapeType %>\"></use></svg></div>'),
|
||||
groups: collection,
|
||||
parentMenu: menuShape,
|
||||
restoreHeight: 652,
|
||||
textRecentlyUsed: me.textRecentlyUsed,
|
||||
recentShapes: recents
|
||||
});
|
||||
shapePicker.on('item:click', function(picker, item, record, e) {
|
||||
if (e.type !== 'click') Common.UI.Menu.Manager.hideAll();
|
||||
if (record) {
|
||||
me.fireEvent('insert:shape', [record.get('data').shapeType]);
|
||||
me.cmbInsertShape.updateComboView(record);
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
updateComboAutoshapeMenu: function (collection) {
|
||||
var me = this,
|
||||
recents = Common.localStorage.getItem('pdfe-recent-shapes');
|
||||
recents = recents ? JSON.parse(recents) : null;
|
||||
me.cmbInsertShape.setMenuPicker(collection, recents, me.textRecentlyUsed);
|
||||
},
|
||||
|
||||
lockToolbar: function (causes, lock, opts) {
|
||||
Common.Utils.lockControls(causes, lock, opts, this.lockControls);
|
||||
},
|
||||
@ -890,7 +1557,64 @@ define([
|
||||
capBtnSaveFormDesktop: 'Save as...',
|
||||
tipSaveForm: 'Save a file as a fillable PDF',
|
||||
capBtnDownloadForm: 'Download as pdf',
|
||||
tipDownloadForm: 'Download a file as a fillable PDF'
|
||||
tipDownloadForm: 'Download a file as a fillable PDF',
|
||||
textTabEdit: 'Edit',
|
||||
textBold: 'Bold',
|
||||
textItalic: 'Italic',
|
||||
textSuperscript: 'Superscript',
|
||||
textSubscript: 'Subscript',
|
||||
tipFontName: 'Font Name',
|
||||
tipFontSize: 'Font Size',
|
||||
tipFontColor: 'Font color',
|
||||
tipMarkers: 'Bullets',
|
||||
tipNumbers: 'Numbering',
|
||||
tipClearStyle: 'Clear Style',
|
||||
tipHAligh: 'Horizontal Align',
|
||||
tipVAligh: 'Vertical Align',
|
||||
textAlignTop: 'Align text to the top',
|
||||
textAlignMiddle: 'Align text to the middle',
|
||||
textAlignBottom: 'Align text to the bottom',
|
||||
textAlignLeft: 'Left align text',
|
||||
textAlignRight: 'Right align text',
|
||||
textAlignCenter: 'Center text',
|
||||
textAlignJust: 'Justify',
|
||||
tipDecPrLeft: 'Decrease Indent',
|
||||
tipIncPrLeft: 'Increase Indent',
|
||||
tipLineSpace: 'Line Spacing',
|
||||
tipInsertHorizontalText: 'Insert horizontal text box',
|
||||
tipInsertVerticalText: 'Insert vertical text box',
|
||||
tipInsertText: 'Insert Text',
|
||||
capInsertText: 'Text',
|
||||
tipIncFont: 'Increment font size',
|
||||
tipDecFont: 'Decrement font size',
|
||||
tipColumns: 'Insert columns',
|
||||
textColumnsOne: 'One Column',
|
||||
textColumnsTwo: 'Two Columns',
|
||||
textColumnsThree: 'Three Columns',
|
||||
textColumnsCustom: 'Custom Columns',
|
||||
tipChangeCase: 'Change case',
|
||||
mniSentenceCase: 'Sentence case.',
|
||||
mniLowerCase: 'lowercase',
|
||||
mniUpperCase: 'UPPERCASE',
|
||||
mniCapitalizeWords: 'Capitalize Each Word',
|
||||
mniToggleCase: 'tOGGLE cASE',
|
||||
tipHighlightColor: 'Highlight color',
|
||||
tipNumCapitalLetters: 'A. B. C.',
|
||||
tipNumLettersParentheses: 'a) b) c)',
|
||||
tipNumLettersPoints: 'a. b. c.',
|
||||
tipNumNumbersPoint: '1. 2. 3.',
|
||||
tipNumNumbersParentheses: '1) 2) 3)',
|
||||
tipNumRoman: 'I. II. III.',
|
||||
tipNumRomanSmall: 'i. ii. iii.',
|
||||
tipMarkersFRound: 'Filled round bullets',
|
||||
tipMarkersHRound: 'Hollow round bullets',
|
||||
tipMarkersFSquare: 'Filled square bullets',
|
||||
tipMarkersStar: 'Star bullets',
|
||||
tipMarkersArrow: 'Arrow bullets',
|
||||
tipMarkersCheckmark: 'Checkmark bullets',
|
||||
tipMarkersFRhombus: 'Filled rhombus bullets',
|
||||
tipMarkersDash: 'Dash bullets',
|
||||
tipNone: 'None'
|
||||
}
|
||||
})(), PDFE.Views.Toolbar || {}));
|
||||
});
|
||||
|
||||
@ -73,9 +73,9 @@
|
||||
}
|
||||
|
||||
#slot-field-fontname {
|
||||
width: 84px;
|
||||
width: 111px;
|
||||
}
|
||||
|
||||
#slot-field-fontsize {
|
||||
width: 45px;
|
||||
width: 40px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user