-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from Strilanc/dev
Dev
- Loading branch information
Showing
4 changed files
with
32 additions
and
12 deletions.
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
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
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 |
---|---|---|
|
@@ -2,12 +2,25 @@ import describe from "src/base/Describe.js" | |
|
||
let _alreadySeen = []; | ||
let showErrorDiv = (subject, body) => { | ||
let errDivStyle = document.getElementById('errorDiv').style; | ||
if (errDivStyle.opacity < 0.7) { | ||
// Partially faded away as user interacted with circuit. | ||
// Enough time to justify updating the message despite the risk of clearing the user's selection. | ||
_alreadySeen = []; | ||
} | ||
|
||
// Error just happened, so this should be showing and highlighted. | ||
errDivStyle.backgroundColor = '#FFA'; | ||
errDivStyle.opacity = 1.0; | ||
errDivStyle.display = 'block'; | ||
|
||
if (_alreadySeen.indexOf(body) !== -1) { | ||
return; | ||
} | ||
_alreadySeen.push(body); | ||
|
||
document.getElementById('errorDiv').style.display = 'block'; | ||
// Set shown error details. | ||
document.getElementById('errorMessageDiv').innerText = subject; | ||
document.getElementById('errorDescDiv').innerText = body; | ||
document.getElementById('error-mailto-anchor').innerText = 'Email the issue to [email protected]'; | ||
document.getElementById('error-mailto-anchor').href = [ | ||
|
@@ -54,10 +67,10 @@ let notifyAboutRecoveryFromUnexpectedError = (recovery, context, error) => { | |
simplifySrcUrls(location) | ||
].join('\n'); | ||
|
||
showErrorDiv(recovery, msg); | ||
showErrorDiv(recovery + ' (' + (error.message || '') + ')', msg); | ||
}; | ||
|
||
let simplifySrcUrls = textContainingUrls => textContainingUrls.replace(/http.+\/src\.min\.js/g, 'src.min.js'); | ||
let simplifySrcUrls = textContainingUrls => textContainingUrls.replace(/http.+?\/src\.min\.js/g, 'src.min.js'); | ||
|
||
let drawErrorBox = msg => { | ||
let canvas = document.getElementById("drawCanvas"); | ||
|
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