|
@@ -192,13 +192,10 @@ if (document.fullscreenEnabled || document.mozFullScreenEnabled || document.webk |
|
|
// Device orientation toggle |
|
|
// Device orientation toggle |
|
|
controls.orientation = document.createElement('div'); |
|
|
controls.orientation = document.createElement('div'); |
|
|
controls.orientation.addEventListener('click', function(e) { |
|
|
controls.orientation.addEventListener('click', function(e) { |
|
|
if (orientation) { |
|
|
|
|
|
|
|
|
if (orientation) |
|
|
stopOrientation(); |
|
|
stopOrientation(); |
|
|
} else { |
|
|
|
|
|
orientation = true; |
|
|
|
|
|
window.addEventListener('deviceorientation', orientationListener); |
|
|
|
|
|
controls.orientation.classList.add('pnlm-orientation-button-active'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
else |
|
|
|
|
|
startOrientation(); |
|
|
}); |
|
|
}); |
|
|
controls.orientation.addEventListener('mousedown', function(e) {e.stopPropagation();}); |
|
|
controls.orientation.addEventListener('mousedown', function(e) {e.stopPropagation();}); |
|
|
controls.orientation.addEventListener('touchstart', function(e) {e.stopPropagation();}); |
|
|
controls.orientation.addEventListener('touchstart', function(e) {e.stopPropagation();}); |
|
@@ -1820,6 +1817,12 @@ function processOptions() { |
|
|
controls.zoom.style.display = 'none'; |
|
|
controls.zoom.style.display = 'none'; |
|
|
controls.fullscreen.style.display = 'none'; |
|
|
controls.fullscreen.style.display = 'none'; |
|
|
} |
|
|
} |
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 'orientationOnByDefault': |
|
|
|
|
|
if (config[key]) |
|
|
|
|
|
startOrientation(); |
|
|
|
|
|
break; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@@ -2043,6 +2046,16 @@ function stopOrientation() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
|
|
|
* Start using device orientation. |
|
|
|
|
|
* @private |
|
|
|
|
|
*/ |
|
|
|
|
|
function startOrientation() { |
|
|
|
|
|
orientation = true; |
|
|
|
|
|
window.addEventListener('deviceorientation', orientationListener); |
|
|
|
|
|
controls.orientation.classList.add('pnlm-orientation-button-active'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
* Escapes HTML string (to mitigate possible DOM XSS attacks). |
|
|
* Escapes HTML string (to mitigate possible DOM XSS attacks). |
|
|
* @private |
|
|
* @private |
|
|
* @param {string} s - String to escape |
|
|
* @param {string} s - String to escape |
|
|