[PE] Add slide master mode

This commit is contained in:
Julia.Svinareva
2024-04-22 21:09:06 +03:00
parent f2d757daf5
commit 73cb10bf9e
5 changed files with 122 additions and 6 deletions

View File

@ -91,6 +91,8 @@ define([
});
this.addListeners({
'ViewTab': {
'mode:normal': _.bind(this.onChangePresentationViewMode, this, 'normal'),
'mode:master': _.bind(this.onChangePresentationViewMode, this, 'master'),
'zoom:selected': _.bind(this.onSelectedZoomValue, this),
'zoom:changedbefore': _.bind(this.onZoomChanged, this),
'zoom:changedafter': _.bind(this.onZoomChanged, this),
@ -390,7 +392,21 @@ define([
unitsChanged: function(m) {
this._state.unitsChanged = true;
}
},
onChangePresentationViewMode: function (m, state) {
var mode;
if (m === 'master') {
mode = Asc.c_oAscPresentationViewMode.masterSlide;
this.view.btnSlideMaster.toggle(state, true);
this.view.btnNormal.toggle(!state, true);
} else {
mode = Asc.c_oAscPresentationViewMode.normal;
this.view.btnSlideMaster.toggle(!state, true);
this.view.btnNormal.toggle(state, true);
} // Asc.c_oAscPresentationViewMode.sorter;
this.api.asc_changePresentationViewMode(mode);
},
}, PE.Controllers.ViewTab || {}));
});

View File

@ -120,7 +120,23 @@
</div>
</section>
<section class="panel" data-tab="ins">
<div class="group">
<div class="group master-slide">
<span class="btn-slot text x-huge" id="slot-btn-insslidemaster"></span>
<span class="btn-slot text x-huge" id="slot-btn-inslayout"></span>
</div>
<div class="separator long master-slide"></div>
<div class="group master-slide">
<span class="btn-slot text x-huge" id="slot-btn-insplaceholder"></span>
</div>
<div class="group master-slide">
<div class="elset">
<span class="btn-slot text x-huge" id="slot-chk-title"></span>
</div>
<div class="elset">
<span class="btn-slot text x-huge" id="slot-chk-footers"></span>
</div>
</div>
<div class="group normal-slide">
<span class="btn-slot text x-huge slot-addslide"></span>
</div>
<div class="group" style="display:none;"></div>

View File

@ -749,6 +749,30 @@ define([
});
me.paragraphControls.push(me.btnColumns);
me.btnInsertSlideMaster = new Common.UI.Button({
id: 'tlbtn-insertslidemaster',
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-add-slide-master',
caption: me.capAddSlideMaster,
lock: [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart],
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
me.slideOnlyControls.push(me.btnInsertSlideMaster);
me.btnInsertLayout = new Common.UI.Button({
id: 'tlbtn-insertlayout',
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-add-layout',
caption: me.capAddLayout,
lock: [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart],
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
me.slideOnlyControls.push(me.btnInsertLayout);
me.btnInsertTable = new Common.UI.Button({
id: 'tlbtn-inserttable',
cls: 'btn-toolbar x-huge icon-top',
@ -1492,6 +1516,8 @@ define([
this.btnIncLeftOffset.updateHint(this.tipIncPrLeft);
this.btnLineSpace.updateHint(this.tipLineSpace);
this.btnColumns.updateHint(this.tipColumns);
this.btnInsertSlideMaster.updateHint(this.tipAddSlideMaster);
this.btnInsertLayout.updateHint(this.tipAddLayout);
this.btnInsertTable.updateHint(this.tipInsertTable);
this.btnInsertChart.updateHint(this.tipInsertChart);
this.btnInsertSmartArt.updateHint(this.tipInsertSmartArt);
@ -2396,7 +2422,11 @@ define([
capBtnInsHeaderFooter: 'Header & Footer',
tipEditHeaderFooter: 'Edit header or footer',
tipReplace: 'Replace',
textLineSpaceOptions: 'Line spacing options'
textLineSpaceOptions: 'Line spacing options',
capAddSlideMaster: 'Add Slide Master',
capAddLayout: 'Add Layout',
tipAddSlideMaster: 'Add slide master',
tipAddLayout: 'Add layout'
}
}()), PE.Views.Toolbar || {}));
});

View File

@ -47,6 +47,11 @@ define([
PE.Views.ViewTab = Common.UI.BaseView.extend(_.extend((function(){
var template =
'<section class="panel" data-tab="view">' +
'<div class="group small">' +
'<span class="btn-slot text x-huge" id="slot-btn-normal"></span>' +
'<span class="btn-slot text x-huge" id="slot-btn-slide-master"></span>' +
'</div>' +
'<div class="separator long"></div>' +
'<div class="group small">' +
'<div class="elset" style="display: flex;">' +
'<span class="btn-slot" id="slot-field-zoom" style="flex-grow: 1;"></span>' +
@ -103,6 +108,12 @@ define([
setEvents: function () {
var me = this;
me.btnNormal.on('toggle', _.bind(function(btn, state) {
me.fireEvent('mode:normal', [state]);
}, me));
me.btnSlideMaster.on('toggle', _.bind(function(btn, state) {
me.fireEvent('mode:master', [state]);
}, me));
me.btnFitToSlide && me.btnFitToSlide.on('click', function () {
me.fireEvent('zoom:toslide', [me.btnFitToSlide]);
});
@ -184,6 +195,34 @@ define([
var me = this;
this.btnNormal = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-normal',
caption: this.textNormal,
lock: [_set.disableOnStart],
enableToggle: true,
allowDepress: true,
pressed: true,
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
this.lockedControls.push(this.btnNormal);
this.btnSlideMaster = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-slide-master',
caption: this.textSlideMaster,
lock: [_set.disableOnStart],
enableToggle: true,
allowDepress: true,
pressed: false,
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'small'
});
this.lockedControls.push(this.btnSlideMaster);
this.cmbZoom = new Common.UI.ComboBox({
cls: 'input-group-nr',
menuStyle: 'min-width: 55px;',
@ -349,6 +388,8 @@ define([
this.$el = $(_.template(template)( {} ));
var $host = this.$el;
this.btnNormal.render($host.find('#slot-btn-normal'));
this.btnSlideMaster.render($host.find('#slot-btn-slide-master'));
this.cmbZoom.render($host.find('#slot-field-zoom'));
$host.find('#slot-lbl-zoom').text(this.textZoom);
this.btnFitToSlide.render($host.find('#slot-btn-fts'));
@ -370,6 +411,8 @@ define([
(new Promise(function (accept, reject) {
accept();
})).then(function () {
me.btnNormal.updateHint(me.tipNormal);
me.btnSlideMaster.updateHint(me.tipSlideMaster);
me.btnFitToSlide.updateHint(me.tipFitToSlide);
me.btnFitToWidth.updateHint(me.tipFitToWidth);
me.btnInterfaceTheme.updateHint(me.tipInterfaceTheme);
@ -531,8 +574,11 @@ define([
textCm: 'cm',
textCustom: 'Custom',
textLeftMenu: 'Left panel',
textRightMenu: 'Right panel'
textRightMenu: 'Right panel',
textNormal: 'Normal',
textSlideMaster: 'Slide Master',
tipNormal: 'Normal',
tipSlideMaster: 'Slide master'
}
}()), PE.Views.ViewTab || {}));
});

View File

@ -2739,6 +2739,10 @@
"PE.Views.Toolbar.txtSlideAlign": "Align to Slide",
"PE.Views.Toolbar.txtUngroup": "Ungroup",
"PE.Views.Toolbar.textLineSpaceOptions": "Line spacing options",
"PE.Views.Toolbar.capAddSlideMaster": "Add Slide Master",
"PE.Views.Toolbar.capAddLayout": "Add Layout",
"PE.Views.Toolbar.tipAddSlideMaster": "Add slide master",
"PE.Views.Toolbar.tipAddLayout": "Add layout",
"PE.Views.Transitions.strDelay": "Delay",
"PE.Views.Transitions.strDuration": "Duration",
"PE.Views.Transitions.strStartOnClick": "Start On Click",
@ -2804,5 +2808,9 @@
"PE.Views.ViewTab.tipFitToWidth": "Fit to width",
"PE.Views.ViewTab.tipGridlines": "Show gridlines",
"PE.Views.ViewTab.tipGuides": "Show guides",
"PE.Views.ViewTab.tipInterfaceTheme": "Interface theme"
"PE.Views.ViewTab.tipInterfaceTheme": "Interface theme",
"PE.Views.ViewTab.textNormal": "Normal",
"PE.Views.ViewTab.textSlideMaster": "Slide Master",
"PE.Views.ViewTab.tipNormal": "Normal",
"PE.Views.ViewTab.tipSlideMaster": "Slide master"
}