From 6ecb15ad1d4ea76b3f6d42fba86e8f4325c12197 Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Fri, 11 Jul 2014 18:17:44 +0200 Subject: [PATCH 1/4] Don't show controls bar automatically. --- static/js/directives/presentation.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/static/js/directives/presentation.js b/static/js/directives/presentation.js index 4f5e101e..2a75a4c9 100644 --- a/static/js/directives/presentation.js +++ b/static/js/directives/presentation.js @@ -70,9 +70,8 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($, } }; - $scope.resetProperties = function(keepControlsBar) { + $scope.resetProperties = function() { $scope.isPresenter = false; - $scope.hideControlsBar = !keepControlsBar; $scope.currentFileInfo = null; $scope.currentPage = null; $scope.receivedPage = null; @@ -80,7 +79,6 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($, $scope.$on("pdfLoaded", function(event, source, doc) { $scope.downloading = false; - $scope.hideControlsBar = !$scope.isPresenter; $scope.currentPageNumber = -1; if ($scope.isPresenter) { $scope.$emit("showPdfPage", 1); From cf62a359e5b5a986768205027bf3a3570ec37a5d Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Fri, 11 Jul 2014 18:26:11 +0200 Subject: [PATCH 2/4] Make sure control overlay always has a fixed height. --- src/styles/components/_presentation.scss | 4 ++++ static/partials/presentation.html | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/styles/components/_presentation.scss b/src/styles/components/_presentation.scss index f40b2158..50208297 100644 --- a/src/styles/components/_presentation.scss +++ b/src/styles/components/_presentation.scss @@ -99,6 +99,10 @@ line-height: 28px; } +.overlaybar-content .pagecontrol { + height: 30px; +} + .presentation .overlaybar a.btn-prev { left: 40px; } diff --git a/static/partials/presentation.html b/static/partials/presentation.html index 061e1e61..6a119126 100644 --- a/static/partials/presentation.html +++ b/static/partials/presentation.html @@ -20,10 +20,12 @@
-
- -
/ {{ maxPageNumber }}
- +
+
+ +
/ {{ maxPageNumber }}
+ +
From 7672fd60e7095c42620a54f61f6dd94e2beef12f Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Fri, 11 Jul 2014 18:34:20 +0200 Subject: [PATCH 3/4] Show status while presentation is loading. --- static/js/directives/presentation.js | 12 ++++++++---- static/partials/presentation.html | 8 ++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/static/js/directives/presentation.js b/static/js/directives/presentation.js index 2a75a4c9..abaee087 100644 --- a/static/js/directives/presentation.js +++ b/static/js/directives/presentation.js @@ -36,7 +36,7 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($, $scope.currentFileInfo = null; $scope.currentPage = null; $scope.receivedPage = null; - $scope.downloading = false; + $scope.loading = false; $scope.downloadSize = 0; $scope.downloadProgress = 0; $scope.sharedFilesCache = {}; @@ -78,7 +78,6 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($, }; $scope.$on("pdfLoaded", function(event, source, doc) { - $scope.downloading = false; $scope.currentPageNumber = -1; if ($scope.isPresenter) { $scope.$emit("showPdfPage", 1); @@ -92,7 +91,7 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($, }); $scope.$on("pdfLoadError", function(event, source, errorMessage, moreInfo) { - $scope.downloading = false; + $scope.loading = false; alertify.dialog.alert(errorMessage); }); @@ -131,6 +130,7 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($, downloadScope.$on("writeComplete", function(event, url, fileInfo) { event.stopPropagation(); + $scope.downloadSize = 0; // need to store for internal file it and received token // to allow cleanup and prevent duplicate download fileInfo.url = url; @@ -153,6 +153,7 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($, $scope.presentationLoaded = false; $scope.pendingPageRequest = null; + $scope.loading = true; var token = fileInfo.id; var existing = $scope.sharedFilesCache[token]; @@ -165,7 +166,6 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($, downloadProgressBar.style.width = '0%'; $scope.downloadProgress = 0; $scope.downloadSize = fileInfo.size; - $scope.downloading = true; downloadScope.info = fileInfo; downloadScope.handler = mediaStream.tokens.on(token, function(event, currenttoken, to, data, type, to2, from, xfer) { @@ -317,6 +317,7 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($, }; $scope.$on("pdfPageLoading", function(event, page) { + $scope.loading = false; $scope.currentPageNumber = page; if ($scope.receivedPage === page) { // we received this page request, don't publish to others @@ -334,10 +335,12 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($, }); $scope.$on("pdfPageLoadError", function(event, page, errorMessage) { + $scope.loading = false; alertify.dialog.alert(errorMessage); }); $scope.$on("pdfPageRenderError", function(event, pageNumber, maxPageNumber, errorMessage) { + $scope.loading = false; alertify.dialog.alert(errorMessage); }); @@ -355,6 +358,7 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($, $scope.isPresenter = true; $scope.currentFileInfo = fileInfo; $scope.receivedPage = null; + $scope.loading = true; $scope.$emit("openPdf", file); addVisibleSharedFile(file); $scope.sharedFilesCache[fileInfo.id] = file; diff --git a/static/partials/presentation.html b/static/partials/presentation.html index 6a119126..11458196 100644 --- a/static/partials/presentation.html +++ b/static/partials/presentation.html @@ -1,13 +1,13 @@
-
+

{{_('Loading presentation ...')}}

-
+
{{downloadSize|humanizeFilesize}} / {{downloadProgress}}%
-
+

{{_('Please upload a PDF document')}}

{{_('Documents are shared with everyone in this call.')}}

@@ -15,7 +15,7 @@

{{_('You can drag files here too.')}}

- +
From 72386d98f2598f261acdeb2cc572c5a65f59e5f6 Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Fri, 11 Jul 2014 18:52:05 +0200 Subject: [PATCH 4/4] Added "Upload" button in control bar. --- src/styles/components/_presentation.scss | 5 +++++ static/js/directives/presentation.js | 9 +++++++++ static/partials/presentation.html | 6 ++++++ 3 files changed, 20 insertions(+) diff --git a/src/styles/components/_presentation.scss b/src/styles/components/_presentation.scss index 50208297..a69bc298 100644 --- a/src/styles/components/_presentation.scss +++ b/src/styles/components/_presentation.scss @@ -122,13 +122,16 @@ color: #333; margin-top: 20px; width: 160px; + height: 122px; display: inline-block; margin-left: 20px; cursor: pointer; position: relative; + vertical-align: middle; } .presentation .thumbnail:first-child { + cursor: default; margin-left: 0; } @@ -149,6 +152,8 @@ position: absolute; left: 0; right: 0; + top: 0; + bottom: 0; text-align: center; } diff --git a/static/js/directives/presentation.js b/static/js/directives/presentation.js index abaee087..6f0d372d 100644 --- a/static/js/directives/presentation.js +++ b/static/js/directives/presentation.js @@ -403,6 +403,15 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($, return namespace + "_" + $scope.myid; }; + var uploadBinder = fileUpload.bindClick(namespace, $element.find('.thumbnail button')[0], function(files) { + console.log("Files selected", files); + filesSelected(files); + }); + uploadBinder.namespace = function() { + // Inject own id into namespace. + return namespace + "_" + $scope.myid; + }; + $scope.showPresentation = function() { console.log("Presentation active"); $scope.layout.presentation = true; diff --git a/static/partials/presentation.html b/static/partials/presentation.html index 11458196..10d49107 100644 --- a/static/partials/presentation.html +++ b/static/partials/presentation.html @@ -28,6 +28,12 @@
+
+
+
+ +
+