|
|
@ -19,14 +19,27 @@ Object.defineProperty(exports, "__esModule", { |
|
|
|
}); |
|
|
|
}); |
|
|
|
exports.PDFPresentationMode = undefined; |
|
|
|
exports.PDFPresentationMode = undefined; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); |
|
|
|
|
|
|
|
|
|
|
|
var _ui_utils = require('./ui_utils'); |
|
|
|
var _ui_utils = require('./ui_utils'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
|
|
|
|
|
|
|
|
|
|
|
var DELAY_BEFORE_RESETTING_SWITCH_IN_PROGRESS = 1500; |
|
|
|
var DELAY_BEFORE_RESETTING_SWITCH_IN_PROGRESS = 1500; |
|
|
|
var DELAY_BEFORE_HIDING_CONTROLS = 3000; |
|
|
|
var DELAY_BEFORE_HIDING_CONTROLS = 3000; |
|
|
|
var ACTIVE_SELECTOR = 'pdfPresentationMode'; |
|
|
|
var ACTIVE_SELECTOR = 'pdfPresentationMode'; |
|
|
|
var CONTROLS_SELECTOR = 'pdfPresentationModeControls'; |
|
|
|
var CONTROLS_SELECTOR = 'pdfPresentationModeControls'; |
|
|
|
var PDFPresentationMode = function PDFPresentationModeClosure() { |
|
|
|
var MOUSE_SCROLL_COOLDOWN_TIME = 50; |
|
|
|
|
|
|
|
var PAGE_SWITCH_THRESHOLD = 0.1; |
|
|
|
|
|
|
|
var SWIPE_MIN_DISTANCE_THRESHOLD = 50; |
|
|
|
|
|
|
|
var SWIPE_ANGLE_THRESHOLD = Math.PI / 6; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var PDFPresentationMode = function () { |
|
|
|
function PDFPresentationMode(options) { |
|
|
|
function PDFPresentationMode(options) { |
|
|
|
|
|
|
|
var _this = this; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_classCallCheck(this, PDFPresentationMode); |
|
|
|
|
|
|
|
|
|
|
|
this.container = options.container; |
|
|
|
this.container = options.container; |
|
|
|
this.viewer = options.viewer || options.container.firstElementChild; |
|
|
|
this.viewer = options.viewer || options.container.firstElementChild; |
|
|
|
this.pdfViewer = options.pdfViewer; |
|
|
|
this.pdfViewer = options.pdfViewer; |
|
|
@ -39,26 +52,28 @@ var PDFPresentationMode = function PDFPresentationModeClosure() { |
|
|
|
this.mouseScrollDelta = 0; |
|
|
|
this.mouseScrollDelta = 0; |
|
|
|
this.touchSwipeState = null; |
|
|
|
this.touchSwipeState = null; |
|
|
|
if (contextMenuItems) { |
|
|
|
if (contextMenuItems) { |
|
|
|
contextMenuItems.contextFirstPage.addEventListener('click', function PDFPresentationMode_contextFirstPageClick(e) { |
|
|
|
contextMenuItems.contextFirstPage.addEventListener('click', function () { |
|
|
|
this.contextMenuOpen = false; |
|
|
|
_this.contextMenuOpen = false; |
|
|
|
this.eventBus.dispatch('firstpage'); |
|
|
|
_this.eventBus.dispatch('firstpage'); |
|
|
|
}.bind(this)); |
|
|
|
}); |
|
|
|
contextMenuItems.contextLastPage.addEventListener('click', function PDFPresentationMode_contextLastPageClick(e) { |
|
|
|
contextMenuItems.contextLastPage.addEventListener('click', function () { |
|
|
|
this.contextMenuOpen = false; |
|
|
|
_this.contextMenuOpen = false; |
|
|
|
this.eventBus.dispatch('lastpage'); |
|
|
|
_this.eventBus.dispatch('lastpage'); |
|
|
|
}.bind(this)); |
|
|
|
}); |
|
|
|
contextMenuItems.contextPageRotateCw.addEventListener('click', function PDFPresentationMode_contextPageRotateCwClick(e) { |
|
|
|
contextMenuItems.contextPageRotateCw.addEventListener('click', function () { |
|
|
|
this.contextMenuOpen = false; |
|
|
|
_this.contextMenuOpen = false; |
|
|
|
this.eventBus.dispatch('rotatecw'); |
|
|
|
_this.eventBus.dispatch('rotatecw'); |
|
|
|
}.bind(this)); |
|
|
|
}); |
|
|
|
contextMenuItems.contextPageRotateCcw.addEventListener('click', function PDFPresentationMode_contextPageRotateCcwClick(e) { |
|
|
|
contextMenuItems.contextPageRotateCcw.addEventListener('click', function () { |
|
|
|
this.contextMenuOpen = false; |
|
|
|
_this.contextMenuOpen = false; |
|
|
|
this.eventBus.dispatch('rotateccw'); |
|
|
|
_this.eventBus.dispatch('rotateccw'); |
|
|
|
}.bind(this)); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
PDFPresentationMode.prototype = { |
|
|
|
|
|
|
|
request: function PDFPresentationMode_request() { |
|
|
|
_createClass(PDFPresentationMode, [{ |
|
|
|
|
|
|
|
key: 'request', |
|
|
|
|
|
|
|
value: function request() { |
|
|
|
if (this.switchInProgress || this.active || !this.viewer.hasChildNodes()) { |
|
|
|
if (this.switchInProgress || this.active || !this.viewer.hasChildNodes()) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
@ -81,15 +96,15 @@ var PDFPresentationMode = function PDFPresentationModeClosure() { |
|
|
|
previousScale: this.pdfViewer.currentScaleValue |
|
|
|
previousScale: this.pdfViewer.currentScaleValue |
|
|
|
}; |
|
|
|
}; |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
}, |
|
|
|
} |
|
|
|
_mouseWheel: function PDFPresentationMode_mouseWheel(evt) { |
|
|
|
}, { |
|
|
|
|
|
|
|
key: '_mouseWheel', |
|
|
|
|
|
|
|
value: function _mouseWheel(evt) { |
|
|
|
if (!this.active) { |
|
|
|
if (!this.active) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
evt.preventDefault(); |
|
|
|
evt.preventDefault(); |
|
|
|
var delta = (0, _ui_utils.normalizeWheelEventDelta)(evt); |
|
|
|
var delta = (0, _ui_utils.normalizeWheelEventDelta)(evt); |
|
|
|
var MOUSE_SCROLL_COOLDOWN_TIME = 50; |
|
|
|
|
|
|
|
var PAGE_SWITCH_THRESHOLD = 0.1; |
|
|
|
|
|
|
|
var currentTime = new Date().getTime(); |
|
|
|
var currentTime = new Date().getTime(); |
|
|
|
var storedTime = this.mouseScrollTimeStamp; |
|
|
|
var storedTime = this.mouseScrollTimeStamp; |
|
|
|
if (currentTime > storedTime && currentTime - storedTime < MOUSE_SCROLL_COOLDOWN_TIME) { |
|
|
|
if (currentTime > storedTime && currentTime - storedTime < MOUSE_SCROLL_COOLDOWN_TIME) { |
|
|
@ -107,82 +122,101 @@ var PDFPresentationMode = function PDFPresentationModeClosure() { |
|
|
|
this.mouseScrollTimeStamp = currentTime; |
|
|
|
this.mouseScrollTimeStamp = currentTime; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
get isFullscreen() { |
|
|
|
}, { |
|
|
|
return !!(document.fullscreenElement || document.mozFullScreen || document.webkitIsFullScreen || document.msFullscreenElement); |
|
|
|
key: '_goToPreviousPage', |
|
|
|
}, |
|
|
|
value: function _goToPreviousPage() { |
|
|
|
_goToPreviousPage: function PDFPresentationMode_goToPreviousPage() { |
|
|
|
|
|
|
|
var page = this.pdfViewer.currentPageNumber; |
|
|
|
var page = this.pdfViewer.currentPageNumber; |
|
|
|
if (page <= 1) { |
|
|
|
if (page <= 1) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
this.pdfViewer.currentPageNumber = page - 1; |
|
|
|
this.pdfViewer.currentPageNumber = page - 1; |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
}, |
|
|
|
} |
|
|
|
_goToNextPage: function PDFPresentationMode_goToNextPage() { |
|
|
|
}, { |
|
|
|
|
|
|
|
key: '_goToNextPage', |
|
|
|
|
|
|
|
value: function _goToNextPage() { |
|
|
|
var page = this.pdfViewer.currentPageNumber; |
|
|
|
var page = this.pdfViewer.currentPageNumber; |
|
|
|
if (page >= this.pdfViewer.pagesCount) { |
|
|
|
if (page >= this.pdfViewer.pagesCount) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
this.pdfViewer.currentPageNumber = page + 1; |
|
|
|
this.pdfViewer.currentPageNumber = page + 1; |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
}, |
|
|
|
} |
|
|
|
_notifyStateChange: function PDFPresentationMode_notifyStateChange() { |
|
|
|
}, { |
|
|
|
|
|
|
|
key: '_notifyStateChange', |
|
|
|
|
|
|
|
value: function _notifyStateChange() { |
|
|
|
this.eventBus.dispatch('presentationmodechanged', { |
|
|
|
this.eventBus.dispatch('presentationmodechanged', { |
|
|
|
source: this, |
|
|
|
source: this, |
|
|
|
active: this.active, |
|
|
|
active: this.active, |
|
|
|
switchInProgress: !!this.switchInProgress |
|
|
|
switchInProgress: !!this.switchInProgress |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
} |
|
|
|
_setSwitchInProgress: function PDFPresentationMode_setSwitchInProgress() { |
|
|
|
}, { |
|
|
|
|
|
|
|
key: '_setSwitchInProgress', |
|
|
|
|
|
|
|
value: function _setSwitchInProgress() { |
|
|
|
|
|
|
|
var _this2 = this; |
|
|
|
|
|
|
|
|
|
|
|
if (this.switchInProgress) { |
|
|
|
if (this.switchInProgress) { |
|
|
|
clearTimeout(this.switchInProgress); |
|
|
|
clearTimeout(this.switchInProgress); |
|
|
|
} |
|
|
|
} |
|
|
|
this.switchInProgress = setTimeout(function switchInProgressTimeout() { |
|
|
|
this.switchInProgress = setTimeout(function () { |
|
|
|
this._removeFullscreenChangeListeners(); |
|
|
|
_this2._removeFullscreenChangeListeners(); |
|
|
|
delete this.switchInProgress; |
|
|
|
delete _this2.switchInProgress; |
|
|
|
this._notifyStateChange(); |
|
|
|
_this2._notifyStateChange(); |
|
|
|
}.bind(this), DELAY_BEFORE_RESETTING_SWITCH_IN_PROGRESS); |
|
|
|
}, DELAY_BEFORE_RESETTING_SWITCH_IN_PROGRESS); |
|
|
|
}, |
|
|
|
} |
|
|
|
_resetSwitchInProgress: function PDFPresentationMode_resetSwitchInProgress() { |
|
|
|
}, { |
|
|
|
|
|
|
|
key: '_resetSwitchInProgress', |
|
|
|
|
|
|
|
value: function _resetSwitchInProgress() { |
|
|
|
if (this.switchInProgress) { |
|
|
|
if (this.switchInProgress) { |
|
|
|
clearTimeout(this.switchInProgress); |
|
|
|
clearTimeout(this.switchInProgress); |
|
|
|
delete this.switchInProgress; |
|
|
|
delete this.switchInProgress; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
_enter: function PDFPresentationMode_enter() { |
|
|
|
}, { |
|
|
|
|
|
|
|
key: '_enter', |
|
|
|
|
|
|
|
value: function _enter() { |
|
|
|
|
|
|
|
var _this3 = this; |
|
|
|
|
|
|
|
|
|
|
|
this.active = true; |
|
|
|
this.active = true; |
|
|
|
this._resetSwitchInProgress(); |
|
|
|
this._resetSwitchInProgress(); |
|
|
|
this._notifyStateChange(); |
|
|
|
this._notifyStateChange(); |
|
|
|
this.container.classList.add(ACTIVE_SELECTOR); |
|
|
|
this.container.classList.add(ACTIVE_SELECTOR); |
|
|
|
setTimeout(function enterPresentationModeTimeout() { |
|
|
|
setTimeout(function () { |
|
|
|
this.pdfViewer.currentPageNumber = this.args.page; |
|
|
|
_this3.pdfViewer.currentPageNumber = _this3.args.page; |
|
|
|
this.pdfViewer.currentScaleValue = 'page-fit'; |
|
|
|
_this3.pdfViewer.currentScaleValue = 'page-fit'; |
|
|
|
}.bind(this), 0); |
|
|
|
}, 0); |
|
|
|
this._addWindowListeners(); |
|
|
|
this._addWindowListeners(); |
|
|
|
this._showControls(); |
|
|
|
this._showControls(); |
|
|
|
this.contextMenuOpen = false; |
|
|
|
this.contextMenuOpen = false; |
|
|
|
this.container.setAttribute('contextmenu', 'viewerContextMenu'); |
|
|
|
this.container.setAttribute('contextmenu', 'viewerContextMenu'); |
|
|
|
window.getSelection().removeAllRanges(); |
|
|
|
window.getSelection().removeAllRanges(); |
|
|
|
}, |
|
|
|
} |
|
|
|
_exit: function PDFPresentationMode_exit() { |
|
|
|
}, { |
|
|
|
|
|
|
|
key: '_exit', |
|
|
|
|
|
|
|
value: function _exit() { |
|
|
|
|
|
|
|
var _this4 = this; |
|
|
|
|
|
|
|
|
|
|
|
var page = this.pdfViewer.currentPageNumber; |
|
|
|
var page = this.pdfViewer.currentPageNumber; |
|
|
|
this.container.classList.remove(ACTIVE_SELECTOR); |
|
|
|
this.container.classList.remove(ACTIVE_SELECTOR); |
|
|
|
setTimeout(function exitPresentationModeTimeout() { |
|
|
|
setTimeout(function () { |
|
|
|
this.active = false; |
|
|
|
_this4.active = false; |
|
|
|
this._removeFullscreenChangeListeners(); |
|
|
|
_this4._removeFullscreenChangeListeners(); |
|
|
|
this._notifyStateChange(); |
|
|
|
_this4._notifyStateChange(); |
|
|
|
this.pdfViewer.currentScaleValue = this.args.previousScale; |
|
|
|
_this4.pdfViewer.currentScaleValue = _this4.args.previousScale; |
|
|
|
this.pdfViewer.currentPageNumber = page; |
|
|
|
_this4.pdfViewer.currentPageNumber = page; |
|
|
|
this.args = null; |
|
|
|
_this4.args = null; |
|
|
|
}.bind(this), 0); |
|
|
|
}, 0); |
|
|
|
this._removeWindowListeners(); |
|
|
|
this._removeWindowListeners(); |
|
|
|
this._hideControls(); |
|
|
|
this._hideControls(); |
|
|
|
this._resetMouseScrollState(); |
|
|
|
this._resetMouseScrollState(); |
|
|
|
this.container.removeAttribute('contextmenu'); |
|
|
|
this.container.removeAttribute('contextmenu'); |
|
|
|
this.contextMenuOpen = false; |
|
|
|
this.contextMenuOpen = false; |
|
|
|
}, |
|
|
|
} |
|
|
|
_mouseDown: function PDFPresentationMode_mouseDown(evt) { |
|
|
|
}, { |
|
|
|
|
|
|
|
key: '_mouseDown', |
|
|
|
|
|
|
|
value: function _mouseDown(evt) { |
|
|
|
if (this.contextMenuOpen) { |
|
|
|
if (this.contextMenuOpen) { |
|
|
|
this.contextMenuOpen = false; |
|
|
|
this.contextMenuOpen = false; |
|
|
|
evt.preventDefault(); |
|
|
|
evt.preventDefault(); |
|
|
@ -195,39 +229,49 @@ var PDFPresentationMode = function PDFPresentationModeClosure() { |
|
|
|
this.pdfViewer.currentPageNumber += evt.shiftKey ? -1 : 1; |
|
|
|
this.pdfViewer.currentPageNumber += evt.shiftKey ? -1 : 1; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
_contextMenu: function PDFPresentationMode_contextMenu() { |
|
|
|
}, { |
|
|
|
|
|
|
|
key: '_contextMenu', |
|
|
|
|
|
|
|
value: function _contextMenu() { |
|
|
|
this.contextMenuOpen = true; |
|
|
|
this.contextMenuOpen = true; |
|
|
|
}, |
|
|
|
} |
|
|
|
_showControls: function PDFPresentationMode_showControls() { |
|
|
|
}, { |
|
|
|
|
|
|
|
key: '_showControls', |
|
|
|
|
|
|
|
value: function _showControls() { |
|
|
|
|
|
|
|
var _this5 = this; |
|
|
|
|
|
|
|
|
|
|
|
if (this.controlsTimeout) { |
|
|
|
if (this.controlsTimeout) { |
|
|
|
clearTimeout(this.controlsTimeout); |
|
|
|
clearTimeout(this.controlsTimeout); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.container.classList.add(CONTROLS_SELECTOR); |
|
|
|
this.container.classList.add(CONTROLS_SELECTOR); |
|
|
|
} |
|
|
|
} |
|
|
|
this.controlsTimeout = setTimeout(function showControlsTimeout() { |
|
|
|
this.controlsTimeout = setTimeout(function () { |
|
|
|
this.container.classList.remove(CONTROLS_SELECTOR); |
|
|
|
_this5.container.classList.remove(CONTROLS_SELECTOR); |
|
|
|
delete this.controlsTimeout; |
|
|
|
delete _this5.controlsTimeout; |
|
|
|
}.bind(this), DELAY_BEFORE_HIDING_CONTROLS); |
|
|
|
}, DELAY_BEFORE_HIDING_CONTROLS); |
|
|
|
}, |
|
|
|
} |
|
|
|
_hideControls: function PDFPresentationMode_hideControls() { |
|
|
|
}, { |
|
|
|
|
|
|
|
key: '_hideControls', |
|
|
|
|
|
|
|
value: function _hideControls() { |
|
|
|
if (!this.controlsTimeout) { |
|
|
|
if (!this.controlsTimeout) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
clearTimeout(this.controlsTimeout); |
|
|
|
clearTimeout(this.controlsTimeout); |
|
|
|
this.container.classList.remove(CONTROLS_SELECTOR); |
|
|
|
this.container.classList.remove(CONTROLS_SELECTOR); |
|
|
|
delete this.controlsTimeout; |
|
|
|
delete this.controlsTimeout; |
|
|
|
}, |
|
|
|
} |
|
|
|
_resetMouseScrollState: function PDFPresentationMode_resetMouseScrollState() { |
|
|
|
}, { |
|
|
|
|
|
|
|
key: '_resetMouseScrollState', |
|
|
|
|
|
|
|
value: function _resetMouseScrollState() { |
|
|
|
this.mouseScrollTimeStamp = 0; |
|
|
|
this.mouseScrollTimeStamp = 0; |
|
|
|
this.mouseScrollDelta = 0; |
|
|
|
this.mouseScrollDelta = 0; |
|
|
|
}, |
|
|
|
} |
|
|
|
_touchSwipe: function PDFPresentationMode_touchSwipe(evt) { |
|
|
|
}, { |
|
|
|
|
|
|
|
key: '_touchSwipe', |
|
|
|
|
|
|
|
value: function _touchSwipe(evt) { |
|
|
|
if (!this.active) { |
|
|
|
if (!this.active) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
var SWIPE_MIN_DISTANCE_THRESHOLD = 50; |
|
|
|
|
|
|
|
var SWIPE_ANGLE_THRESHOLD = Math.PI / 6; |
|
|
|
|
|
|
|
if (evt.touches.length > 1) { |
|
|
|
if (evt.touches.length > 1) { |
|
|
|
this.touchSwipeState = null; |
|
|
|
this.touchSwipeState = null; |
|
|
|
return; |
|
|
|
return; |
|
|
@ -269,8 +313,10 @@ var PDFPresentationMode = function PDFPresentationModeClosure() { |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
_addWindowListeners: function PDFPresentationMode_addWindowListeners() { |
|
|
|
}, { |
|
|
|
|
|
|
|
key: '_addWindowListeners', |
|
|
|
|
|
|
|
value: function _addWindowListeners() { |
|
|
|
this.showControlsBind = this._showControls.bind(this); |
|
|
|
this.showControlsBind = this._showControls.bind(this); |
|
|
|
this.mouseDownBind = this._mouseDown.bind(this); |
|
|
|
this.mouseDownBind = this._mouseDown.bind(this); |
|
|
|
this.mouseWheelBind = this._mouseWheel.bind(this); |
|
|
|
this.mouseWheelBind = this._mouseWheel.bind(this); |
|
|
@ -285,8 +331,10 @@ var PDFPresentationMode = function PDFPresentationModeClosure() { |
|
|
|
window.addEventListener('touchstart', this.touchSwipeBind); |
|
|
|
window.addEventListener('touchstart', this.touchSwipeBind); |
|
|
|
window.addEventListener('touchmove', this.touchSwipeBind); |
|
|
|
window.addEventListener('touchmove', this.touchSwipeBind); |
|
|
|
window.addEventListener('touchend', this.touchSwipeBind); |
|
|
|
window.addEventListener('touchend', this.touchSwipeBind); |
|
|
|
}, |
|
|
|
} |
|
|
|
_removeWindowListeners: function PDFPresentationMode_removeWindowListeners() { |
|
|
|
}, { |
|
|
|
|
|
|
|
key: '_removeWindowListeners', |
|
|
|
|
|
|
|
value: function _removeWindowListeners() { |
|
|
|
window.removeEventListener('mousemove', this.showControlsBind); |
|
|
|
window.removeEventListener('mousemove', this.showControlsBind); |
|
|
|
window.removeEventListener('mousedown', this.mouseDownBind); |
|
|
|
window.removeEventListener('mousedown', this.mouseDownBind); |
|
|
|
window.removeEventListener('wheel', this.mouseWheelBind); |
|
|
|
window.removeEventListener('wheel', this.mouseWheelBind); |
|
|
@ -301,29 +349,42 @@ var PDFPresentationMode = function PDFPresentationModeClosure() { |
|
|
|
delete this.resetMouseScrollStateBind; |
|
|
|
delete this.resetMouseScrollStateBind; |
|
|
|
delete this.contextMenuBind; |
|
|
|
delete this.contextMenuBind; |
|
|
|
delete this.touchSwipeBind; |
|
|
|
delete this.touchSwipeBind; |
|
|
|
}, |
|
|
|
} |
|
|
|
_fullscreenChange: function PDFPresentationMode_fullscreenChange() { |
|
|
|
}, { |
|
|
|
|
|
|
|
key: '_fullscreenChange', |
|
|
|
|
|
|
|
value: function _fullscreenChange() { |
|
|
|
if (this.isFullscreen) { |
|
|
|
if (this.isFullscreen) { |
|
|
|
this._enter(); |
|
|
|
this._enter(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this._exit(); |
|
|
|
this._exit(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
_addFullscreenChangeListeners: function PDFPresentationMode_addFullscreenChangeListeners() { |
|
|
|
}, { |
|
|
|
|
|
|
|
key: '_addFullscreenChangeListeners', |
|
|
|
|
|
|
|
value: function _addFullscreenChangeListeners() { |
|
|
|
this.fullscreenChangeBind = this._fullscreenChange.bind(this); |
|
|
|
this.fullscreenChangeBind = this._fullscreenChange.bind(this); |
|
|
|
window.addEventListener('fullscreenchange', this.fullscreenChangeBind); |
|
|
|
window.addEventListener('fullscreenchange', this.fullscreenChangeBind); |
|
|
|
window.addEventListener('mozfullscreenchange', this.fullscreenChangeBind); |
|
|
|
window.addEventListener('mozfullscreenchange', this.fullscreenChangeBind); |
|
|
|
window.addEventListener('webkitfullscreenchange', this.fullscreenChangeBind); |
|
|
|
window.addEventListener('webkitfullscreenchange', this.fullscreenChangeBind); |
|
|
|
window.addEventListener('MSFullscreenChange', this.fullscreenChangeBind); |
|
|
|
window.addEventListener('MSFullscreenChange', this.fullscreenChangeBind); |
|
|
|
}, |
|
|
|
} |
|
|
|
_removeFullscreenChangeListeners: function PDFPresentationMode_removeFullscreenChangeListeners() { |
|
|
|
}, { |
|
|
|
|
|
|
|
key: '_removeFullscreenChangeListeners', |
|
|
|
|
|
|
|
value: function _removeFullscreenChangeListeners() { |
|
|
|
window.removeEventListener('fullscreenchange', this.fullscreenChangeBind); |
|
|
|
window.removeEventListener('fullscreenchange', this.fullscreenChangeBind); |
|
|
|
window.removeEventListener('mozfullscreenchange', this.fullscreenChangeBind); |
|
|
|
window.removeEventListener('mozfullscreenchange', this.fullscreenChangeBind); |
|
|
|
window.removeEventListener('webkitfullscreenchange', this.fullscreenChangeBind); |
|
|
|
window.removeEventListener('webkitfullscreenchange', this.fullscreenChangeBind); |
|
|
|
window.removeEventListener('MSFullscreenChange', this.fullscreenChangeBind); |
|
|
|
window.removeEventListener('MSFullscreenChange', this.fullscreenChangeBind); |
|
|
|
delete this.fullscreenChangeBind; |
|
|
|
delete this.fullscreenChangeBind; |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}, { |
|
|
|
|
|
|
|
key: 'isFullscreen', |
|
|
|
|
|
|
|
get: function get() { |
|
|
|
|
|
|
|
return !!(document.fullscreenElement || document.mozFullScreen || document.webkitIsFullScreen || document.msFullscreenElement); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}]); |
|
|
|
|
|
|
|
|
|
|
|
return PDFPresentationMode; |
|
|
|
return PDFPresentationMode; |
|
|
|
}(); |
|
|
|
}(); |
|
|
|
|
|
|
|
|
|
|
|
exports.PDFPresentationMode = PDFPresentationMode; |
|
|
|
exports.PDFPresentationMode = PDFPresentationMode; |