[Pkg-javascript-commits] [pdf.js] 82/119: Preface all "fullscreen" CSS rules with a |pdfPresentationMode| class, and add it to the |viewerContainer| while Presentation Mode is active

David Prévot taffit at moszumanska.debian.org
Wed May 13 21:27:44 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 601bd4a930c5e89ed272acb5752d06b42731e4a3
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Wed Feb 4 14:10:45 2015 +0100

    Preface all "fullscreen" CSS rules with a |pdfPresentationMode| class, and add it to the |viewerContainer| while Presentation Mode is active
---
 web/pdf_presentation_mode.js | 11 +++++++----
 web/pdf_viewer.css           |  8 ++++----
 web/viewer.css               | 32 ++++++++++++++++++--------------
 3 files changed, 29 insertions(+), 22 deletions(-)

diff --git a/web/pdf_presentation_mode.js b/web/pdf_presentation_mode.js
index 467d7e2..3dd0285 100644
--- a/web/pdf_presentation_mode.js
+++ b/web/pdf_presentation_mode.js
@@ -20,7 +20,8 @@
 
 var DELAY_BEFORE_RESETTING_SWITCH_IN_PROGRESS = 1500; // in ms
 var DELAY_BEFORE_HIDING_CONTROLS = 3000; // in ms
-var SELECTOR = 'presentationControls';
+var ACTIVE_SELECTOR = 'pdfPresentationMode';
+var CONTROLS_SELECTOR = 'pdfPresentationModeControls';
 
 /**
  * @typedef {Object} PDFPresentationModeOptions
@@ -201,6 +202,7 @@ var PDFPresentationMode = (function PDFPresentationModeClosure() {
       this.active = true;
       this._resetSwitchInProgress();
       this._notifyStateChange();
+      this.container.classList.add(ACTIVE_SELECTOR);
 
       // Ensure that the correct page is scrolled into view when entering
       // Presentation Mode, by waiting until fullscreen mode in enabled.
@@ -225,6 +227,7 @@ var PDFPresentationMode = (function PDFPresentationModeClosure() {
      */
     _exit: function PDFPresentationMode_exit() {
       var page = PDFViewerApplication.page;
+      this.container.classList.remove(ACTIVE_SELECTOR);
 
       // Ensure that the correct page is scrolled into view when exiting
       // Presentation Mode, by waiting until fullscreen mode is disabled.
@@ -285,10 +288,10 @@ var PDFPresentationMode = (function PDFPresentationModeClosure() {
       if (this.controlsTimeout) {
         clearTimeout(this.controlsTimeout);
       } else {
-        this.container.classList.add(SELECTOR);
+        this.container.classList.add(CONTROLS_SELECTOR);
       }
       this.controlsTimeout = setTimeout(function showControlsTimeout() {
-        this.container.classList.remove(SELECTOR);
+        this.container.classList.remove(CONTROLS_SELECTOR);
         delete this.controlsTimeout;
       }.bind(this), DELAY_BEFORE_HIDING_CONTROLS);
     },
@@ -301,7 +304,7 @@ var PDFPresentationMode = (function PDFPresentationModeClosure() {
         return;
       }
       clearTimeout(this.controlsTimeout);
-      this.container.classList.remove(SELECTOR);
+      this.container.classList.remove(CONTROLS_SELECTOR);
       delete this.controlsTimeout;
     },
 
diff --git a/web/pdf_viewer.css b/web/pdf_viewer.css
index d1e59ab..47f2450 100644
--- a/web/pdf_viewer.css
+++ b/web/pdf_viewer.css
@@ -57,22 +57,22 @@
   box-shadow: 0px 2px 10px #ff0;
 }
 
-:-webkit-full-screen .pdfViewer .page {
+.pdfPresentationMode:-webkit-full-screen .pdfViewer .page {
   margin-bottom: 100%;
   border: 0;
 }
 
-:-moz-full-screen .pdfViewer .page {
+.pdfPresentationMode:-moz-full-screen .pdfViewer .page {
   margin-bottom: 100%;
   border: 0;
 }
 
-:-ms-fullscreen .pdfViewer .page {
+.pdfPresentationMode:-ms-fullscreen .pdfViewer .page {
   margin-bottom: 100% !important;
   border: 0;
 }
 
-:fullscreen .pdfViewer .page {
+.pdfPresentationMode:fullscreen .pdfViewer .page {
   margin-bottom: 100%;
   border: 0;
 }
diff --git a/web/viewer.css b/web/viewer.css
index 4432b30..c248633 100644
--- a/web/viewer.css
+++ b/web/viewer.css
@@ -47,7 +47,7 @@ select {
   display: none !important;
 }
 
-#viewerContainer:-webkit-full-screen {
+#viewerContainer.pdfPresentationMode:-webkit-full-screen {
   top: 0px;
   border-top: 2px solid transparent;
   background-color: #000;
@@ -58,7 +58,7 @@ select {
   -webkit-user-select: none;
 }
 
-#viewerContainer:-moz-full-screen {
+#viewerContainer.pdfPresentationMode:-moz-full-screen {
   top: 0px;
   border-top: 2px solid transparent;
   background-color: #000;
@@ -69,7 +69,7 @@ select {
   -moz-user-select: none;
 }
 
-#viewerContainer:-ms-fullscreen {
+#viewerContainer.pdfPresentationMode:-ms-fullscreen {
   top: 0px !important;
   border-top: 2px solid transparent;
   width: 100%;
@@ -79,11 +79,11 @@ select {
   -ms-user-select: none;
 }
 
-#viewerContainer:-ms-fullscreen::-ms-backdrop {
+#viewerContainer.pdfPresentationMode:-ms-fullscreen::-ms-backdrop {
   background-color: #000;
 }
 
-#viewerContainer:fullscreen {
+#viewerContainer.pdfPresentationMode:fullscreen {
   top: 0px;
   border-top: 2px solid transparent;
   background-color: #000;
@@ -96,36 +96,40 @@ select {
   -ms-user-select: none;
 }
 
-:-webkit-full-screen a:not(.internalLink) {
+.pdfPresentationMode:-webkit-full-screen a:not(.internalLink) {
   display: none;
 }
 
-:-moz-full-screen a:not(.internalLink) {
+.pdfPresentationMode:-moz-full-screen a:not(.internalLink) {
   display: none;
 }
 
-:-ms-fullscreen a:not(.internalLink) {
+.pdfPresentationMode:-ms-fullscreen a:not(.internalLink) {
   display: none !important;
 }
 
-:fullscreen a:not(.internalLink) {
+.pdfPresentationMode:fullscreen a:not(.internalLink) {
   display: none;
 }
 
-:-webkit-full-screen .textLayer > div {
+.pdfPresentationMode:-webkit-full-screen .textLayer > div {
   cursor: none;
 }
 
-:-moz-full-screen .textLayer > div {
+.pdfPresentationMode:-moz-full-screen .textLayer > div {
   cursor: none;
 }
 
-:fullscreen .textLayer > div {
+.pdfPresentationMode:-ms-fullscreen .textLayer > div {
   cursor: none;
 }
 
-#viewerContainer.presentationControls,
-#viewerContainer.presentationControls .textLayer > div {
+.pdfPresentationMode:fullscreen .textLayer > div {
+  cursor: none;
+}
+
+.pdfPresentationMode.pdfPresentationModeControls > *,
+.pdfPresentationMode.pdfPresentationModeControls .textLayer > div {
   cursor: default;
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list