forked from BabylonJS/Babylon.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
571 additions
and
227 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<script> | ||
localStorage.setItem("language", "JS"); | ||
|
||
var parseURL = window.location.href.split("js.html"); | ||
var hash = parseURL[parseURL.length - 1]; | ||
|
||
window.location = "./" + hash; | ||
</script> |
This file was deleted.
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
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import * as React from "react"; | ||
import { GlobalState } from '../globalState'; | ||
import { Nullable } from 'babylonjs/types'; | ||
|
||
require("../scss/errorDisplay.scss"); | ||
|
||
interface IErrorDisplayComponentProps { | ||
globalState: GlobalState; | ||
} | ||
|
||
export class CompilationError { | ||
message: string; | ||
lineNumber?: number; | ||
columnNumber?: number; | ||
} | ||
|
||
export class ErrorDisplayComponent extends React.Component<IErrorDisplayComponentProps, {error: Nullable<CompilationError>}> { | ||
|
||
public constructor(props: IErrorDisplayComponentProps) { | ||
super(props); | ||
|
||
this.state = {error: null}; | ||
|
||
this.props.globalState.onErrorObservable.add((err) => { | ||
this.setState({error: err}); | ||
}); | ||
} | ||
|
||
private _onClick() { | ||
if (this.state.error && this.state.error.lineNumber && this.state.error.columnNumber) { | ||
const position = { | ||
lineNumber: this.state.error.lineNumber, | ||
column: this.state.error.columnNumber | ||
}; | ||
|
||
this.props.globalState.onNavigateRequiredObservable.notifyObservers(position); | ||
} | ||
this.setState({error: null}); | ||
} | ||
|
||
public render() { | ||
|
||
if (!this.state.error) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<div className="error-display" onClick={() => this._onClick()}> | ||
{ | ||
this.state.error.lineNumber && this.state.error.columnNumber && | ||
`Error at [${this.state.error.lineNumber}, ${this.state.error.columnNumber}]: ` | ||
} | ||
{this.state.error.message} | ||
</div> | ||
) | ||
} | ||
} |
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
Oops, something went wrong.