[Libreoffice-commits] online.git: loleaflet/src
nienzu (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jul 29 16:27:26 UTC 2020
loleaflet/src/control/Control.Menubar.js | 5 ++++-
loleaflet/src/map/handler/Map.SlideShow.js | 16 ++++++++++++++--
2 files changed, 18 insertions(+), 3 deletions(-)
New commits:
commit d660146ee3c16dfad80faf24ac8d20410a02f65f
Author: nienzu <tommy.wu at ossii.com.tw>
AuthorDate: Fri Jul 3 09:57:14 2020 +0800
Commit: Marco Cecchetti <marco.cecchetti at collabora.com>
CommitDate: Wed Jul 29 18:27:06 2020 +0200
tdf#134546 Implement presentation from current page
Change-Id: Idad5bbc33e9382148aa5fe04ca475fb4989ed75d
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97786
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Tested-by: Marco Cecchetti <marco.cecchetti at collabora.com>
Reviewed-by: Marco Cecchetti <marco.cecchetti at collabora.com>
diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index bbe8e3132..b33039bc3 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -350,7 +350,8 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:DuplicateSlide', 'presentation'), id: 'duplicatepage', type: 'action'},
{name: _UNO('.uno:DeleteSlide', 'presentation'), id: 'deletepage', type: 'action'},
{type: 'separator', id: 'fullscreen-presentation-separator'},
- {name: _('Fullscreen presentation'), id: 'fullscreen-presentation', type: 'action'}]
+ {name: _('Fullscreen presentation'), id: 'fullscreen-presentation', type: 'action'},
+ {name: _('Present current slide'), id: 'presentation-currentslide', type: 'action'}]
},
{name: _UNO('.uno:ToolsMenu', 'presentation'), id: 'tools', type: 'menu', menu: [
{uno: '.uno:SpellDialog'},
@@ -1189,6 +1190,8 @@ L.Control.Menubar = L.Control.extend({
this._map.uiManager.toggleRuler();
} else if (id === 'fullscreen-presentation' && this._map.getDocType() === 'presentation') {
this._map.fire('fullscreen');
+ } else if (id === 'presentation-currentslide' && this._map.getDocType() === 'presentation') {
+ this._map.fire('fullscreen', {startSlideNumber: this._map.getCurrentPartNumber()});
} else if (id === 'insertpage') {
this._map.insertPage();
} else if (id === 'insertshape') {
diff --git a/loleaflet/src/map/handler/Map.SlideShow.js b/loleaflet/src/map/handler/Map.SlideShow.js
index 0a1987707..f9b361a5e 100644
--- a/loleaflet/src/map/handler/Map.SlideShow.js
+++ b/loleaflet/src/map/handler/Map.SlideShow.js
@@ -9,6 +9,8 @@ L.Map.mergeOptions({
L.Map.SlideShow = L.Handler.extend({
+ _slideURL: '', // store the URL for svg
+
initialize: function (map) {
this._map = map;
},
@@ -23,7 +25,7 @@ L.Map.SlideShow = L.Handler.extend({
this._map.off('slidedownloadready', this._onSlideDownloadReady, this);
},
- _onFullScreen: function () {
+ _onFullScreen: function (e) {
if (window.ThisIsTheiOSApp || window.ThisIsTheAndroidApp) {
window.postMobileMessage('SLIDESHOW');
return;
@@ -48,6 +50,10 @@ L.Map.SlideShow = L.Handler.extend({
this._onFullScreenChange, this);
}
+ this._startSlideNumber = 0; // Default: start from page 0
+ if (e.startSlideNumber !== undefined) {
+ this._startSlideNumber = e.startSlideNumber;
+ }
this.fullscreen = true;
this._map.downloadAs('slideshow.svg', 'svg', null, 'slideshow');
},
@@ -67,7 +73,13 @@ L.Map.SlideShow = L.Handler.extend({
},
_onSlideDownloadReady: function (e) {
- this._slideShow.src = e.url;
+ this._slideURL = e.url;
+ console.debug('slide file url : ', this._slideURL);
+ this._startPlaying();
+ },
+
+ _startPlaying: function() {
+ this._slideShow.src = this._slideURL + '?StartSlideNumber=' + this._startSlideNumber;
this._slideShow.contentWindow.focus();
}
});
More information about the Libreoffice-commits
mailing list