diff --git a/openslides/core/static/css/projector.css b/openslides/core/static/css/projector.css index 4460cace3..080a0e6f1 100644 --- a/openslides/core/static/css/projector.css +++ b/openslides/core/static/css/projector.css @@ -85,6 +85,20 @@ body{ transition-property: margin, font-size; transition-duration: 1s; } +.fullscreen { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 1000; + background-color: black; +} +.fullscreen canvas { + margin: auto; + display: block !important; +} + h1, h2, h3, h4, h5, h6 { font-family: "Roboto Condensed",Helvetica,Arial,sans-serif; font-weight: normal; @@ -213,6 +227,19 @@ hr { z-index: 301; } +/*** PDF presentation ***/ +.rotate0 { + transform: rotate(0deg); +} +.rotate90 { + transform: rotate(90deg); +} +.rotate180 { + transform: rotate(180deg); +} +.rotate270 { + transform: rotate(270deg); +} /*** Table style ***/ .table { diff --git a/openslides/mediafiles/static/js/mediafiles/base.js b/openslides/mediafiles/static/js/mediafiles/base.js index 2608e9ce9..b9c2abc95 100644 --- a/openslides/mediafiles/static/js/mediafiles/base.js +++ b/openslides/mediafiles/static/js/mediafiles/base.js @@ -11,6 +11,12 @@ angular.module('OpenSlidesApp.mediafiles', []) var name = 'mediafiles/mediafile'; return DS.defineResource({ name: name, + useClass: jsDataModel, + methods: { + getResourceName: function () { + return name; + } + }, computed: { is_presentable: ['filetype', function (filetype) { var PRESENTABLE_FILE_TYPES = ['application/pdf']; diff --git a/openslides/mediafiles/static/js/mediafiles/projector.js b/openslides/mediafiles/static/js/mediafiles/projector.js index 06110e3c1..e40fe83f9 100644 --- a/openslides/mediafiles/static/js/mediafiles/projector.js +++ b/openslides/mediafiles/static/js/mediafiles/projector.js @@ -23,35 +23,6 @@ angular.module('OpenSlidesApp.mediafiles.projector', ['OpenSlidesApp.mediafiles' $scope.pdfName = mediafile.title; $scope.pdfUrl = mediafile.mediafileUrl; }) - // get page from projector - $scope.page = $scope.element.page; - $scope.scroll = 0; - - function updateScale() { - if($scope.element.pageFit) { - $scope.scale = 'page-fit'; - } else { - $scope.scale = $scope.element.scale; - } - } - - $scope.$watch(function() { - return $scope.element.scale; - }, updateScale); - - updateScale(); - - $scope.getNavStyle = function(scroll) { - if (scroll > 100) { - return 'pdf-controls fixed'; - } else { - return 'pdf-controls'; - } - }; - - $scope.onLoad = function() { - $scope.loading = ''; - }; } ]); diff --git a/openslides/mediafiles/static/js/mediafiles/site.js b/openslides/mediafiles/static/js/mediafiles/site.js index e50ccabd9..717e062d2 100644 --- a/openslides/mediafiles/static/js/mediafiles/site.js +++ b/openslides/mediafiles/static/js/mediafiles/site.js @@ -66,6 +66,11 @@ angular.module('OpenSlidesApp.mediafiles.site', ['ngFileUpload', 'OpenSlidesApp. $scope.presentedMediafiles = _.filter(projectorElements, function (element) { return element.name === 'mediafiles/mediafile'; }); + if ($scope.presentedMediafiles.length) { + $scope.isMeta = false; + } else { + $scope.isMeta = true; + } } $scope.$watch(function() { @@ -141,8 +146,8 @@ angular.module('OpenSlidesApp.mediafiles.site', ['ngFileUpload', 'OpenSlidesApp. id: mediafile.id, numPages: mediafile.mediafile.pages, page: 1, - pageFit: true, scale: 1, + rotate: 0, visible: true }; } else { @@ -151,10 +156,10 @@ angular.module('OpenSlidesApp.mediafiles.site', ['ngFileUpload', 'OpenSlidesApp. name: 'mediafiles/mediafile', id: mediafile.id, numPages: mediafile.mediafile.pages, - visible: true, - pageFit: true, + page: 1, scale: 1, - page: 1 + rotate: 0, + visible: true }]; } $http.post(postUrl, data); @@ -173,38 +178,32 @@ angular.module('OpenSlidesApp.mediafiles.site', ['ngFileUpload', 'OpenSlidesApp. return $scope.presentedMediafiles[0]; } - $scope.mediafileGoPrevious = function () { - var mediafileElement = getCurrentlyPresentedMediafile(); - if (mediafileElement.page > 1) { - sendMediafileCommand({ - page: parseInt(mediafileElement.page) - 1 - }); - } + $scope.getTitle = function (presentedMediafile) { + return Mediafile.get(presentedMediafile.id).title; }; - $scope.mediafileGoNext = function () { + + $scope.mediafileGoToPage = function (page) { var mediafileElement = getCurrentlyPresentedMediafile(); - if (mediafileElement.page < mediafileElement.numPages) { + if (parseInt(page) > 0) { sendMediafileCommand({ - page: parseInt(mediafileElement.page) + 1 + page: parseInt(page) }); } }; $scope.mediafileZoomIn = function () { var mediafileElement = getCurrentlyPresentedMediafile(); sendMediafileCommand({ - pageFit: false, scale: parseFloat(mediafileElement.scale) + 0.2 }); }; $scope.mediafileFit = function () { sendMediafileCommand({ - pageFit: true + scale: 1 }); }; $scope.mediafileZoomOut = function () { var mediafileElement = getCurrentlyPresentedMediafile(); sendMediafileCommand({ - pageFit: false, scale: parseFloat(mediafileElement.scale) - 0.2 }); }; @@ -214,15 +213,15 @@ angular.module('OpenSlidesApp.mediafiles.site', ['ngFileUpload', 'OpenSlidesApp. }); }; $scope.mediafileRotate = function () { - var rotation; - var currentRotation = $scope.mediafile.rotation; - if (currentRotation === 270) { + var mediafileElement = getCurrentlyPresentedMediafile(); + var rotation = mediafileElement.rotate; + if (rotation === 270) { rotation = 0; } else { - rotation = currentRotation + 90; + rotation = rotation + 90; } sendMediafileCommand({ - rotation: rotation + rotate: rotation }); }; } diff --git a/openslides/mediafiles/static/templates/mediafiles/mediafile-list.html b/openslides/mediafiles/static/templates/mediafiles/mediafile-list.html index ac093d1dd..d50c3289a 100644 --- a/openslides/mediafiles/static/templates/mediafiles/mediafile-list.html +++ b/openslides/mediafiles/static/templates/mediafiles/mediafile-list.html @@ -10,6 +10,65 @@ +
+