Commit 84f4f247 authored by Julia Radzhabova's avatar Julia Radzhabova

[PE] Bug 30672 - реализованы пункты a, b

parent 3f8f42ac
......@@ -49,7 +49,8 @@ define([
'common/main/lib/view/InsertTableDialog',
'presentationeditor/main/app/view/Toolbar',
'presentationeditor/main/app/view/HyperlinkSettingsDialog',
'presentationeditor/main/app/view/SlideSizeSettings'
'presentationeditor/main/app/view/SlideSizeSettings',
'presentationeditor/main/app/view/SlideshowSettings'
], function () { 'use strict';
PE.Controllers.Toolbar = Backbone.Controller.extend(_.extend({
......@@ -184,7 +185,8 @@ define([
toolbar.mnuAddSlidePicker.on('item:click', _.bind(this.onAddSlide, this));
if (toolbar.mnuChangeSlidePicker)
toolbar.mnuChangeSlidePicker.on('item:click', _.bind(this.onChangeSlide, this));
toolbar.btnPreview.on('click', _.bind(this.onPreview, this));
toolbar.btnPreview.on('click', _.bind(this.onPreviewBtnClick, this));
toolbar.btnPreview.menu.on('item:click', _.bind(this.onPreviewItemClick, this));
toolbar.btnPrint.on('click', _.bind(this.onPrint, this));
toolbar.btnSave.on('click', _.bind(this.onSave, this));
toolbar.btnUndo.on('click', _.bind(this.onUndo, this));
......@@ -746,17 +748,14 @@ define([
}
},
onPreview: function(btn, e) {
onPreview: function(slidenum) {
var previewPanel = PE.getController('Viewport').getView('DocumentPreview'),
me = this;
if (previewPanel && me.api) {
previewPanel.show();
var onWindowResize = function() {
Common.NotificationCenter.off('window:resize', onWindowResize);
var current = me.api.getCurrentPage();
me.api.StartDemonstration('presentation-preview', _.isNumber(current) ? current : 0);
me.api.StartDemonstration('presentation-preview', _.isNumber(slidenum) ? slidenum : 0);
Common.component.Analytics.trackEvent('ToolBar', 'Preview');
};
if (!me.toolbar.mode.isDesktopApp) {
......@@ -781,6 +780,57 @@ define([
}
},
onPreviewBtnClick: function(btn, e) {
this.onPreview(this.api.getCurrentPage());
},
onPreviewItemClick: function(menu, item) {
switch (item.value) {
case 0:
this.onPreview(0);
break;
case 1:
this.onPreview(this.api.getCurrentPage());
break;
case 2:
var win,
me = this,
selectedElements = me.api.getSelectedElements(),
loop = false;
if (selectedElements && _.isArray(selectedElements)){
for (var i=0; i<selectedElements.length; i++) {
if (Asc.c_oAscTypeSelectElement.Slide == selectedElements[i].get_ObjectType()) {
var elValue = selectedElements[i].get_ObjectValue(),
timing = elValue.get_timing();
if (timing)
loop = timing.get_ShowLoop();
}
}
}
var handlerDlg = function(dlg, result) {
if (result == 'ok') {
loop = dlg.getSettings();
if (me.api) {
var props = new Asc.CAscSlideProps();
var timing = new Asc.CAscSlideTiming();
timing.put_ShowLoop(loop);
props.put_timing(timing);
me.api.SetSlideProps(props);
}
}
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
};
win = new PE.Views.SlideshowSettings({
handler: handlerDlg
});
win.show();
win.setSettings(loop);
break;
}
},
onPrint: function(e) {
if (this.api)
this.api.asc_Print(Common.Utils.isChrome || Common.Utils.isSafari || Common.Utils.isOpera); // if isChrome or isSafari or isOpera == true use asc_onPrintUrl event
......
......@@ -6,7 +6,7 @@
<div class="toolbar-group">
<div class="toolbar-row">
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-addslide"></span>
<span class="btn-placeholder" id="id-toolbar-short-placeholder-btn-preview"></span>
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-preview"></span>
</div>
</div>
<div class="separator short"></div>
......
......@@ -2036,7 +2036,7 @@ define([
txtDeleteSlide : 'Delete Slide',
txtBackground : 'Background',
txtChangeLayout : 'Change Layout',
txtPreview : 'Preview',
txtPreview : 'Start slideshow',
textShapeAlignLeft : 'Align Left',
textShapeAlignRight : 'Align Right',
textShapeAlignCenter : 'Align Center',
......
......@@ -356,7 +356,7 @@ define([
txtPrev: 'Previous Slide',
txtNext: 'Next Slide',
txtClose: 'Close Preview',
txtClose: 'Close Slideshow',
goToSlideText : 'Go to Slide',
slideIndexText : 'Slide {0} of {1}',
txtPlay: 'Start Presentation',
......
......@@ -375,7 +375,7 @@ define([
tipZoomOut : 'Zoom Out',
tipZoomFactor : 'Magnification',
txtPageNumInvalid: 'Slide number invalid',
tipPreview : 'Start Preview',
tipPreview : 'Start Slideshow',
tipAccessRights : 'Manage document access rights',
tipViewUsers : 'View users and manage document access rights',
txAccessRights : 'Change access rights'
......
......@@ -221,7 +221,20 @@ define([
cls : 'btn-toolbar',
iconCls : 'btn-preview',
lock : [_set.menuFileOpen, _set.slideDeleted, _set.noSlides, _set.disableOnStart],
hint : me.tipPreview
hint : me.tipPreview,
split : true,
menu : new Common.UI.Menu({
items : [
{caption: this.textShowBegin, value: 0},
{caption: this.textShowCurrent, value: 1},
{caption: '--'},
me.mnuShowSettings = new Common.UI.MenuItem({
caption: this.textShowSettings,
value: 2,
lock: [_set.lostConnect]
})
]
})
});
me.slideOnlyControls.push(me.btnPreview);
......@@ -1078,7 +1091,7 @@ define([
this.btnNumbers, this.btnDecLeftOffset, this.btnIncLeftOffset, this.btnLineSpace, this.btnHorizontalAlign,
this.btnVerticalAlign, this.btnShapeArrange, this.btnShapeAlign, this.btnInsertTable, this.btnInsertImage,
this.btnInsertChart, this.btnInsertText,
this.btnInsertHyperlink, this.btnInsertShape, this.btnColorSchemas, this.btnSlideSize, this.listTheme
this.btnInsertHyperlink, this.btnInsertShape, this.btnColorSchemas, this.btnSlideSize, this.listTheme, this.mnuShowSettings
];
// Disable all components before load document
......@@ -1555,7 +1568,7 @@ define([
tipInsertHyperlink: 'Add Hyperlink',
tipInsertText: 'Insert Text',
tipInsertShape: 'Insert Autoshape',
tipPreview: 'Start Preview',
tipPreview: 'Start Slideshow',
tipAddSlide: 'Add Slide',
tipNewDocument: 'New Document',
tipOpenDocument: 'Open Document',
......@@ -1628,6 +1641,9 @@ define([
tipSlideTheme: 'Slide Theme',
tipSaveCoauth: 'Save your changes for the other users to see them.',
textInsText: 'Insert text box',
textInsTextArt: 'Insert Text Art'
textInsTextArt: 'Insert Text Art',
textShowBegin: 'Show from Beginning',
textShowCurrent: 'Show from Current slide',
textShowSettings: 'Show Settings'
}, PE.Views.Toolbar || {}));
});
\ No newline at end of file
......@@ -303,14 +303,14 @@
"PE.Views.DocumentHolder.txtGroup": "Group",
"PE.Views.DocumentHolder.txtNewSlide": "New Slide",
"PE.Views.DocumentHolder.txtPressLink": "Press CTRL and click link",
"PE.Views.DocumentHolder.txtPreview": "Preview",
"PE.Views.DocumentHolder.txtPreview": "Start slideshow",
"PE.Views.DocumentHolder.txtSelectAll": "Select All",
"PE.Views.DocumentHolder.txtSlide": "Slide",
"PE.Views.DocumentHolder.txtUngroup": "Ungroup",
"PE.Views.DocumentHolder.vertAlignText": "Vertical Alignment",
"PE.Views.DocumentPreview.goToSlideText": "Go to Slide",
"PE.Views.DocumentPreview.slideIndexText": "Slide {0} of {1}",
"PE.Views.DocumentPreview.txtClose": "Close Preview",
"PE.Views.DocumentPreview.txtClose": "Close Slideshow",
"PE.Views.DocumentPreview.txtExitFullScreen": "Exit Full Screen",
"PE.Views.DocumentPreview.txtFinalMessage": "The end of slide preview. Click to exit.",
"PE.Views.DocumentPreview.txtFullScreen": "Full Screen",
......@@ -609,6 +609,10 @@
"PE.Views.SlideSettings.txtLeather": "Leather",
"PE.Views.SlideSettings.txtPapyrus": "Papyrus",
"PE.Views.SlideSettings.txtWood": "Wood",
"PE.Views.SlideshowSettings.textTitle": "Show Settings",
"PE.Views.SlideshowSettings.textLoop": "Loop continuously until 'Esc' is pressed",
"PE.Views.SlideshowSettings.cancelButtonText": "Cancel",
"PE.Views.SlideshowSettings.okButtonText": "Ok",
"PE.Views.SlideSizeSettings.cancelButtonText": "Cancel",
"PE.Views.SlideSizeSettings.okButtonText": "OK",
"PE.Views.SlideSizeSettings.strPortrait": "Portrait",
......@@ -637,7 +641,7 @@
"PE.Views.Statusbar.tipFitPage": "Fit Slide",
"PE.Views.Statusbar.tipFitWidth": "Fit Width",
"PE.Views.Statusbar.tipMoreUsers": "and %1 users.",
"PE.Views.Statusbar.tipPreview": "Start Preview",
"PE.Views.Statusbar.tipPreview": "Start Slideshow",
"PE.Views.Statusbar.tipShowUsers": "To see all users click the icon below.",
"PE.Views.Statusbar.tipUsers": "Document is currently being edited by several users.",
"PE.Views.Statusbar.tipViewUsers": "View users and manage document access rights",
......@@ -821,7 +825,7 @@
"PE.Views.Toolbar.tipNumbers": "Numbering",
"PE.Views.Toolbar.tipOpenDocument": "Open Presentation",
"PE.Views.Toolbar.tipPaste": "Paste",
"PE.Views.Toolbar.tipPreview": "Start Preview",
"PE.Views.Toolbar.tipPreview": "Start Slideshow",
"PE.Views.Toolbar.tipPrint": "Print",
"PE.Views.Toolbar.tipRedo": "Redo",
"PE.Views.Toolbar.tipSave": "Save",
......@@ -857,5 +861,8 @@
"PE.Views.Toolbar.txtScheme7": "Equity",
"PE.Views.Toolbar.txtScheme8": "Flow",
"PE.Views.Toolbar.txtScheme9": "Foundry",
"PE.Views.Toolbar.txtUngroup": "Ungroup"
"PE.Views.Toolbar.txtUngroup": "Ungroup",
"PE.Views.Toolbar.textShowBegin": "Show from Beginning",
"PE.Views.Toolbar.textShowCurrent": "Show from Current slide",
"PE.Views.Toolbar.textShowSettings": "Show Settings"
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment