-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added the option to specify a title when the enable function is called #124
Open
MaRossetti
wants to merge
1
commit into
richtr:master
Choose a base branch
from
MaRossetti:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,36 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>NoSleep.js - Simple Test Page</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
</head> | ||
<body> | ||
<h1>NoSleep Test Page</h1> | ||
<script src="../dist/NoSleep.min.js"></script> | ||
<head> | ||
<title>NoSleep.js - Simple Test Page</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
</head> | ||
<body> | ||
<h1>NoSleep Test Page</h1> | ||
<script src="../dist/NoSleep.min.js"></script> | ||
Comment on lines
-3
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This diff seems to originate due to the use of different format settings from the repo's owner. I suggest reverting those changes because the owner may not like them |
||
|
||
<input type="button" id="toggle" value="Wake Lock is disabled" /> | ||
<input type="button" id="toggle" value="Wake Lock is disabled" /> | ||
|
||
<script> | ||
var noSleep = new NoSleep(); | ||
<script> | ||
var noSleep = new NoSleep(); | ||
|
||
var wakeLockEnabled = false; | ||
var toggleEl = document.querySelector("#toggle"); | ||
toggleEl.addEventListener('click', function() { | ||
if (!wakeLockEnabled) { | ||
noSleep.enable(); // keep the screen on! | ||
wakeLockEnabled = true; | ||
toggleEl.value = "Wake Lock is enabled"; | ||
document.body.style.backgroundColor = "green"; | ||
} else { | ||
noSleep.disable(); // let the screen turn off. | ||
wakeLockEnabled = false; | ||
toggleEl.value = "Wake Lock is disabled"; | ||
document.body.style.backgroundColor = ""; | ||
} | ||
}, false); | ||
</script> | ||
var wakeLockEnabled = false; | ||
var toggleEl = document.querySelector("#toggle"); | ||
toggleEl.addEventListener('click', function() { | ||
if (!wakeLockEnabled) { | ||
noSleep.enable(); // keep the screen on! If specified set the title of the video | ||
wakeLockEnabled = true; | ||
toggleEl.value = "Wake Lock is enabled"; | ||
document.body.style.backgroundColor = "green"; | ||
} else { | ||
noSleep.disable(); // let the screen turn off. | ||
wakeLockEnabled = false; | ||
toggleEl.value = "Wake Lock is disabled"; | ||
document.body.style.backgroundColor = ""; | ||
} | ||
}, false); | ||
</script> | ||
|
||
<!-- Github Ribbon --> | ||
<a href="https://github.com/richtr/NoSleep.js"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"></a> | ||
</body> | ||
<!-- Github Ribbon --> | ||
<a href="https://github.com/richtr/NoSleep.js"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"></a> | ||
</body> | ||
</html> |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use capital S here to keep the default value as-is (i.e.
No Sleep
)