class App extends React.Component { constructor(props) { super(props); this.state = { JSPM_WS_Status: null, DemoIndex: 0 }; this.setDemoSample = this.setDemoSample.bind(this); } jspmWsStatusChanged(status) { this.setState({ JSPM_WS_Status: status }); } setDemoSample(index) { this.setState({ DemoIndex: index }); } componentDidMount() { JSPM.JSPrintManager.auto_reconnect = true; JSPM.JSPrintManager.start(); JSPM.JSPrintManager.MainApp = this; JSPM.JSPrintManager.WS.onOpen = function() { JSPM.JSPrintManager.MainApp.jspmWsStatusChanged( JSPM.WSStatus[JSPM.JSPrintManager.WS.status] ); }; JSPM.JSPrintManager.WS.onStatusChanged = function() { JSPM.JSPrintManager.MainApp.jspmWsStatusChanged( JSPM.WSStatus[JSPM.JSPrintManager.WS.status] ); }; JSPM.JSPrintManager.WS.onClose = function() { JSPM.JSPrintManager.MainApp.jspmWsStatusChanged( JSPM.WSStatus[JSPM.JSPrintManager.WS.status] ); }; } render() { let year = new Date().getFullYear(); let demoContent; if (this.state.JSPM_WS_Status == "Open") { if (this.state.DemoIndex == 0) { demoContent = ; } else if (this.state.DemoIndex == 1) { demoContent = ( ); } else if (this.state.DemoIndex == 2) { demoContent = ( ); } else if (this.state.DemoIndex == 3) { demoContent = ( ); } else if (this.state.DemoIndex == 4) { demoContent = ( ); } else if (this.state.DemoIndex == 5) { demoContent = ( ); } else if (this.state.DemoIndex == 6) { demoContent = ( ); } } else if (this.state.JSPM_WS_Status == "Closed") demoContent = ; else if (this.state.JSPM_WS_Status == "BlackListed") demoContent = ; else { demoContent = (

Waiting for user response....
); } return (

JSPrintManager{" "} Print RAW Commands & Known File Formats from Javascript


{demoContent}
); } } ReactDOM.render(, document.getElementById("root")); window.App = App;