This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Goes into viewer.html just before ending </body> --> | |
<script> | |
let pinchZoomEnabled = false; | |
function enablePinchZoom(pdfViewer) { | |
let startX = 0, startY = 0; | |
let initialPinchDistance = 0; | |
let pinchScale = 1; | |
const viewer = document.getElementById("viewer"); | |
const container = document.getElementById("viewerContainer"); | |
const reset = () => { startX = startY = initialPinchDistance = 0; pinchScale = 1; }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AbortError extends Error { | |
name = "AbortError"; | |
message = "Aborted"; | |
} | |
class AbortSignal extends EventTarget { | |
aborted = false; | |
} | |
class AbortController { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Example of a state monad in use. This is adapted from an example on | |
* the Haskell Wiki: | |
* http://www.haskell.org/haskellwiki/State_Monad#Complete_and_Concrete_Example_1 | |
*/ | |
require(['state', 'qunit'], function(state, qunit) { | |
/* | |
* playGame() is a recursive function that given an array of moves | |
* defines an algorithm for constructing a final game score. Along |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Promise() { | |
var callbacks = [], | |
promise = { | |
resolve: resolve, | |
reject: reject, | |
then: then, | |
safe: { | |
then: function safeThen(resolve, reject) { | |
promise.then(resolve, reject); | |
} |