This commit is contained in:
MathuraMG 2016-08-12 00:39:59 -04:00
parent c14eae56c8
commit 8f68b3aa58
3 changed files with 18792 additions and 10 deletions

View File

@ -29,6 +29,8 @@ class EditorAccessibility extends React.Component {
<p> Current line <p> Current line
<span className="editor-linenumber" aria-live="polite" aria-atomic="true" id="current-line"> {this.props.lineNo} </span> <span className="editor-linenumber" aria-live="polite" aria-atomic="true" id="current-line"> {this.props.lineNo} </span>
</p> </p>
<div id="canvas-sub">
</div>
</div> </div>
); );
} }

View File

@ -51,7 +51,8 @@ const hijackConsoleScript = `<script>
return false; return false;
}; };
}); });
</script>`; </script>
<div id="canvas-sub"> </div>`;
class PreviewFrame extends React.Component { class PreviewFrame extends React.Component {
@ -131,8 +132,10 @@ class PreviewFrame extends React.Component {
const headRegex = new RegExp('head', 'i'); const headRegex = new RegExp('head', 'i');
let htmlHeadContents = htmlHead[0].split(headRegex)[1]; let htmlHeadContents = htmlHead[0].split(headRegex)[1];
htmlHeadContents = htmlHeadContents.slice(1, htmlHeadContents.length - 2); htmlHeadContents = htmlHeadContents.slice(1, htmlHeadContents.length - 2);
htmlHeadContents += '<script src="/data.js"></script>\n';
htmlHeadContents += '<script src="/interceptor-functions.js"></script>\n'; htmlHeadContents += '<script src="/interceptor-functions.js"></script>\n';
htmlHeadContents += '<script src="/intercept-p5.js"></script>\n'; htmlHeadContents += '<script src="/intercept-p5.js"></script>\n';
htmlHeadContents += `<script type="text/javascript" src="http://chir.ag/projects/ntc/ntc.js"></script>`;
htmlFile = htmlFile.replace(/(?:<head.*?>)([\s\S]*?)(?:<\/head>)/gmi, `<head>\n${htmlHeadContents}\n</head>`); htmlFile = htmlFile.replace(/(?:<head.*?>)([\s\S]*?)(?:<\/head>)/gmi, `<head>\n${htmlHeadContents}\n</head>`);
// const htmlHead = htmlFile.match(/(?:<head.*?>)([\s\S]*?)(?:<\/head>)/gmi); // const htmlHead = htmlFile.match(/(?:<head.*?>)([\s\S]*?)(?:<\/head>)/gmi);
@ -167,15 +170,15 @@ class PreviewFrame extends React.Component {
render() { render() {
return ( return (
<iframe <iframe
className="preview-frame" className="preview-frame"
aria-label="sketch output" aria-label="sketch output"
role="main" role="main"
tabIndex="0" tabIndex="0"
frameBorder="0" frameBorder="0"
title="sketch output" title="sketch output"
sandbox="allow-scripts allow-pointer-lock allow-same-origin allow-popups allow-modals allow-forms" sandbox="allow-scripts allow-pointer-lock allow-same-origin allow-popups allow-modals allow-forms"
/> />
); );
} }
} }

18777
static/data.js Normal file

File diff suppressed because it is too large Load Diff