PageSourceSearch

https://presentations.dragonia.org.pl/warsawjs-81/vendors/shower-warsawjs/scripts/fullscreen.js

js dragonia.org.pl collected 2026-10-05 06:50:33 UTC 1,800 bytes, 46 lines download raw bytes

1(function (root) {
2    'use strict';
3
4    // Alias for `window.document`.
5    var document = root.document;
6
7    // Catch reference to button.
8    var link = document.querySelector('.fullscreen');
9
10    // Link must be available in DOM.
11    if (!link) return;
12
13    /**
14     * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API|MDN}
15     */
16    function toggleFullscreen() {
17        if (!document.fullscreenElement &&    // alternative standard method
18            !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement) {  // current working methods
19            if (document.documentElement.requestFullscreen) {
20                document.documentElement.requestFullscreen();
21            } else if (document.documentElement.msRequestFullscreen) {
22                document.documentElement.msRequestFullscreen();
23            } else if (document.documentElement.mozRequestFullScreen) {
24                document.documentElement.mozRequestFullScreen();
25            } else if (document.documentElement.webkitRequestFullscreen) {
26                document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
27            }
28        } else {
29            if (document.exitFullscreen) {
30                document.exitFullscreen();
31            } else if (document.msExitFullscreen) {
32                document.msExitFullscreen();
33            } else if (document.mozCancelFullScreen) {
34                document.mozCancelFullScreen();
35            } else if (document.webkitExitFullscreen) {
36                document.webkitExitFullscreen();
37            }
38        }
39    }
40
41    // Add listener for 'click'.
42    link.addEventListener('click', function (evt) {
43        evt.preventDefault();
44        toggleFullscreen();
45    });
46}(this));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.