Skip to content

Commit 332c9c0

Browse files
author
EC2 Default User
committed
Fullscreen Mode
1 parent 8539e29 commit 332c9c0

File tree

8 files changed

+166
-85
lines changed

8 files changed

+166
-85
lines changed

index.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ <h3>
3232
</h3>
3333
</button>
3434
<div class="top-menu-buttons">
35+
<div class="btn" id="btn_fullscreen">
36+
<div class="wrapper">
37+
<i class="fa fa-arrows-alt"></i> Fullscreen
38+
</div>
39+
</div>
3540
<div class="btn" id="btn_share">
3641
<div class="wrapper">
3742
<i class="fa fa-share" aria-hidden="true"></i> Share <input type="text" class="collapse" id="shared">

js/dom/enable_fullscreen.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
'use strict';
2+
3+
module.exports = () => {
4+
let $func = 'requestFullScreen',
5+
vendorPrefixes = ['webkit', 'moz', 'ms', 'o'],
6+
db = document.body;
7+
8+
for (let p of vendorPrefixes) {
9+
let fName = p + $func [0].toUpperCase () + $func.slice (1);
10+
if (db [fName]) {
11+
$func = fName;
12+
break;
13+
}
14+
}
15+
16+
$('#btn_fullscreen').click (function () {
17+
console.log ('callinggggg', $func);
18+
db [$func] ();
19+
});
20+
};

js/dom/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const showRequestedAlgorithm = require('./show_requested_algorithm');
99
const showWiki = require('./show_wiki');
1010
const enableSearch = require('./enable_search');
1111
const resizeWorkspace = require('./resize_workspace');
12+
const enableFullScreen = require('./enable_fullscreen');
1213

1314
module.exports = {
1415
showAlgorithm,
@@ -19,5 +20,6 @@ module.exports = {
1920
showRequestedAlgorithm,
2021
showWiki,
2122
enableSearch,
22-
resizeWorkspace
23-
};
23+
resizeWorkspace,
24+
enableFullScreen
25+
};

js/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ $(() => {
4747

4848
//enable search feature
4949
DOM.enableSearch ();
50+
//enable fullscreen feature
51+
DOM.enableFullScreen ();
5052

5153
// determine if the app is loading a pre-existing scratch-pad
5254
// or the home page
@@ -85,4 +87,4 @@ $(() => {
8587
window.location.href = window.location.protocol + '//' + window.location.host + window.location.pathname + '#path=scratch/' + vLoadedScratch;
8688
}
8789

88-
});
90+
});

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy