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

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

parent 3f8f42ac
...@@ -49,7 +49,8 @@ define([ ...@@ -49,7 +49,8 @@ define([
'common/main/lib/view/InsertTableDialog', 'common/main/lib/view/InsertTableDialog',
'presentationeditor/main/app/view/Toolbar', 'presentationeditor/main/app/view/Toolbar',
'presentationeditor/main/app/view/HyperlinkSettingsDialog', 'presentationeditor/main/app/view/HyperlinkSettingsDialog',
'presentationeditor/main/app/view/SlideSizeSettings' 'presentationeditor/main/app/view/SlideSizeSettings',
'presentationeditor/main/app/view/SlideshowSettings'
], function () { 'use strict'; ], function () { 'use strict';
PE.Controllers.Toolbar = Backbone.Controller.extend(_.extend({ PE.Controllers.Toolbar = Backbone.Controller.extend(_.extend({
...@@ -184,7 +185,8 @@ define([ ...@@ -184,7 +185,8 @@ define([
toolbar.mnuAddSlidePicker.on('item:click', _.bind(this.onAddSlide, this)); toolbar.mnuAddSlidePicker.on('item:click', _.bind(this.onAddSlide, this));
if (toolbar.mnuChangeSlidePicker) if (toolbar.mnuChangeSlidePicker)
toolbar.mnuChangeSlidePicker.on('item:click', _.bind(this.onChangeSlide, this)); 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.btnPrint.on('click', _.bind(this.onPrint, this));
toolbar.btnSave.on('click', _.bind(this.onSave, this)); toolbar.btnSave.on('click', _.bind(this.onSave, this));
toolbar.btnUndo.on('click', _.bind(this.onUndo, this)); toolbar.btnUndo.on('click', _.bind(this.onUndo, this));
...@@ -746,17 +748,14 @@ define([ ...@@ -746,17 +748,14 @@ define([
} }
}, },
onPreview: function(btn, e) { onPreview: function(slidenum) {
var previewPanel = PE.getController('Viewport').getView('DocumentPreview'), var previewPanel = PE.getController('Viewport').getView('DocumentPreview'),
me = this; me = this;
if (previewPanel && me.api) { if (previewPanel && me.api) {
previewPanel.show(); previewPanel.show();
var onWindowResize = function() { var onWindowResize = function() {
Common.NotificationCenter.off('window:resize', onWindowResize); Common.NotificationCenter.off('window:resize', onWindowResize);
me.api.StartDemonstration('presentation-preview', _.isNumber(slidenum) ? slidenum : 0);
var current = me.api.getCurrentPage();
me.api.StartDemonstration('presentation-preview', _.isNumber(current) ? current : 0);
Common.component.Analytics.trackEvent('ToolBar', 'Preview'); Common.component.Analytics.trackEvent('ToolBar', 'Preview');
}; };
if (!me.toolbar.mode.isDesktopApp) { if (!me.toolbar.mode.isDesktopApp) {
...@@ -781,6 +780,57 @@ define([ ...@@ -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) { onPrint: function(e) {
if (this.api) 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 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 @@ ...@@ -6,7 +6,7 @@
<div class="toolbar-group"> <div class="toolbar-group">
<div class="toolbar-row"> <div class="toolbar-row">
<span class="btn-placeholder split" id="id-toolbar-short-placeholder-btn-addslide"></span> <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> </div>
<div class="separator short"></div> <div class="separator short"></div>
......
...@@ -2036,7 +2036,7 @@ define([ ...@@ -2036,7 +2036,7 @@ define([
txtDeleteSlide : 'Delete Slide', txtDeleteSlide : 'Delete Slide',
txtBackground : 'Background', txtBackground : 'Background',
txtChangeLayout : 'Change Layout', txtChangeLayout : 'Change Layout',
txtPreview : 'Preview', txtPreview : 'Start slideshow',
textShapeAlignLeft : 'Align Left', textShapeAlignLeft : 'Align Left',
textShapeAlignRight : 'Align Right', textShapeAlignRight : 'Align Right',
textShapeAlignCenter : 'Align Center', textShapeAlignCenter : 'Align Center',
......
...@@ -356,7 +356,7 @@ define([ ...@@ -356,7 +356,7 @@ define([
txtPrev: 'Previous Slide', txtPrev: 'Previous Slide',
txtNext: 'Next Slide', txtNext: 'Next Slide',
txtClose: 'Close Preview', txtClose: 'Close Slideshow',
goToSlideText : 'Go to Slide', goToSlideText : 'Go to Slide',
slideIndexText : 'Slide {0} of {1}', slideIndexText : 'Slide {0} of {1}',
txtPlay: 'Start Presentation', txtPlay: 'Start Presentation',
......
...@@ -375,7 +375,7 @@ define([ ...@@ -375,7 +375,7 @@ define([
tipZoomOut : 'Zoom Out', tipZoomOut : 'Zoom Out',
tipZoomFactor : 'Magnification', tipZoomFactor : 'Magnification',
txtPageNumInvalid: 'Slide number invalid', txtPageNumInvalid: 'Slide number invalid',
tipPreview : 'Start Preview', tipPreview : 'Start Slideshow',
tipAccessRights : 'Manage document access rights', tipAccessRights : 'Manage document access rights',
tipViewUsers : 'View users and manage document access rights', tipViewUsers : 'View users and manage document access rights',
txAccessRights : 'Change access rights' txAccessRights : 'Change access rights'
......
...@@ -221,7 +221,20 @@ define([ ...@@ -221,7 +221,20 @@ define([
cls : 'btn-toolbar', cls : 'btn-toolbar',
iconCls : 'btn-preview', iconCls : 'btn-preview',
lock : [_set.menuFileOpen, _set.slideDeleted, _set.noSlides, _set.disableOnStart], 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); me.slideOnlyControls.push(me.btnPreview);
...@@ -1078,7 +1091,7 @@ define([ ...@@ -1078,7 +1091,7 @@ define([
this.btnNumbers, this.btnDecLeftOffset, this.btnIncLeftOffset, this.btnLineSpace, this.btnHorizontalAlign, this.btnNumbers, this.btnDecLeftOffset, this.btnIncLeftOffset, this.btnLineSpace, this.btnHorizontalAlign,
this.btnVerticalAlign, this.btnShapeArrange, this.btnShapeAlign, this.btnInsertTable, this.btnInsertImage, this.btnVerticalAlign, this.btnShapeArrange, this.btnShapeAlign, this.btnInsertTable, this.btnInsertImage,
this.btnInsertChart, this.btnInsertText, 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 // Disable all components before load document
...@@ -1555,7 +1568,7 @@ define([ ...@@ -1555,7 +1568,7 @@ define([
tipInsertHyperlink: 'Add Hyperlink', tipInsertHyperlink: 'Add Hyperlink',
tipInsertText: 'Insert Text', tipInsertText: 'Insert Text',
tipInsertShape: 'Insert Autoshape', tipInsertShape: 'Insert Autoshape',
tipPreview: 'Start Preview', tipPreview: 'Start Slideshow',
tipAddSlide: 'Add Slide', tipAddSlide: 'Add Slide',
tipNewDocument: 'New Document', tipNewDocument: 'New Document',
tipOpenDocument: 'Open Document', tipOpenDocument: 'Open Document',
...@@ -1628,6 +1641,9 @@ define([ ...@@ -1628,6 +1641,9 @@ define([
tipSlideTheme: 'Slide Theme', tipSlideTheme: 'Slide Theme',
tipSaveCoauth: 'Save your changes for the other users to see them.', tipSaveCoauth: 'Save your changes for the other users to see them.',
textInsText: 'Insert text box', 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 || {})); }, PE.Views.Toolbar || {}));
}); });
\ No newline at end of file
...@@ -303,14 +303,14 @@ ...@@ -303,14 +303,14 @@
"PE.Views.DocumentHolder.txtGroup": "Group", "PE.Views.DocumentHolder.txtGroup": "Group",
"PE.Views.DocumentHolder.txtNewSlide": "New Slide", "PE.Views.DocumentHolder.txtNewSlide": "New Slide",
"PE.Views.DocumentHolder.txtPressLink": "Press CTRL and click link", "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.txtSelectAll": "Select All",
"PE.Views.DocumentHolder.txtSlide": "Slide", "PE.Views.DocumentHolder.txtSlide": "Slide",
"PE.Views.DocumentHolder.txtUngroup": "Ungroup", "PE.Views.DocumentHolder.txtUngroup": "Ungroup",
"PE.Views.DocumentHolder.vertAlignText": "Vertical Alignment", "PE.Views.DocumentHolder.vertAlignText": "Vertical Alignment",
"PE.Views.DocumentPreview.goToSlideText": "Go to Slide", "PE.Views.DocumentPreview.goToSlideText": "Go to Slide",
"PE.Views.DocumentPreview.slideIndexText": "Slide {0} of {1}", "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.txtExitFullScreen": "Exit Full Screen",
"PE.Views.DocumentPreview.txtFinalMessage": "The end of slide preview. Click to exit.", "PE.Views.DocumentPreview.txtFinalMessage": "The end of slide preview. Click to exit.",
"PE.Views.DocumentPreview.txtFullScreen": "Full Screen", "PE.Views.DocumentPreview.txtFullScreen": "Full Screen",
...@@ -609,6 +609,10 @@ ...@@ -609,6 +609,10 @@
"PE.Views.SlideSettings.txtLeather": "Leather", "PE.Views.SlideSettings.txtLeather": "Leather",
"PE.Views.SlideSettings.txtPapyrus": "Papyrus", "PE.Views.SlideSettings.txtPapyrus": "Papyrus",
"PE.Views.SlideSettings.txtWood": "Wood", "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.cancelButtonText": "Cancel",
"PE.Views.SlideSizeSettings.okButtonText": "OK", "PE.Views.SlideSizeSettings.okButtonText": "OK",
"PE.Views.SlideSizeSettings.strPortrait": "Portrait", "PE.Views.SlideSizeSettings.strPortrait": "Portrait",
...@@ -637,7 +641,7 @@ ...@@ -637,7 +641,7 @@
"PE.Views.Statusbar.tipFitPage": "Fit Slide", "PE.Views.Statusbar.tipFitPage": "Fit Slide",
"PE.Views.Statusbar.tipFitWidth": "Fit Width", "PE.Views.Statusbar.tipFitWidth": "Fit Width",
"PE.Views.Statusbar.tipMoreUsers": "and %1 users.", "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.tipShowUsers": "To see all users click the icon below.",
"PE.Views.Statusbar.tipUsers": "Document is currently being edited by several users.", "PE.Views.Statusbar.tipUsers": "Document is currently being edited by several users.",
"PE.Views.Statusbar.tipViewUsers": "View users and manage document access rights", "PE.Views.Statusbar.tipViewUsers": "View users and manage document access rights",
...@@ -821,7 +825,7 @@ ...@@ -821,7 +825,7 @@
"PE.Views.Toolbar.tipNumbers": "Numbering", "PE.Views.Toolbar.tipNumbers": "Numbering",
"PE.Views.Toolbar.tipOpenDocument": "Open Presentation", "PE.Views.Toolbar.tipOpenDocument": "Open Presentation",
"PE.Views.Toolbar.tipPaste": "Paste", "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.tipPrint": "Print",
"PE.Views.Toolbar.tipRedo": "Redo", "PE.Views.Toolbar.tipRedo": "Redo",
"PE.Views.Toolbar.tipSave": "Save", "PE.Views.Toolbar.tipSave": "Save",
...@@ -857,5 +861,8 @@ ...@@ -857,5 +861,8 @@
"PE.Views.Toolbar.txtScheme7": "Equity", "PE.Views.Toolbar.txtScheme7": "Equity",
"PE.Views.Toolbar.txtScheme8": "Flow", "PE.Views.Toolbar.txtScheme8": "Flow",
"PE.Views.Toolbar.txtScheme9": "Foundry", "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