1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-14 10:36:19 +02:00

more fixes for console

This commit is contained in:
Kushagra Gour
2017-05-08 03:12:43 +05:30
parent c2621d0adb
commit ba055a0b92
3 changed files with 5 additions and 3 deletions

View File

@ -246,7 +246,7 @@
<p> <p>
<h3>Awesome libraries used</h3> <h3>Awesome libraries used</h3>
<ul> <ul>
<li><a target="_blank" href="http://kushagragour.in/lab/hint/">Hint.css</a> - By me :)</li> <li><a target="_blank" href="https://kushagragour.in/lab/hint/">Hint.css</a> & <a target="_blank" href="https://github.com/chinchang/screenlog.js">Screenlog.js</a> - By me :)</li>
<li><a target="_blank" href="https://nathancahill.github.io/Split.js/">Split.js</a> - Nathan Cahill</li> <li><a target="_blank" href="https://nathancahill.github.io/Split.js/">Split.js</a> - Nathan Cahill</li>
<li><a target="_blank" href="https://codemirror.net/">Codemirror</a> - Marijn Haverbeke</li> <li><a target="_blank" href="https://codemirror.net/">Codemirror</a> - Marijn Haverbeke</li>
<li><a target="_blank" href="https://emmet.io/">Emmet</a> - Sergey Chikuyonok</li> <li><a target="_blank" href="https://emmet.io/">Emmet</a> - Sergey Chikuyonok</li>

View File

@ -460,6 +460,7 @@ runBtn, searchInput, consoleEl, consoleLogEl
scope.cm.html.setValue(currentItem.html); scope.cm.html.setValue(currentItem.html);
scope.cm.css.setValue(currentItem.css); scope.cm.css.setValue(currentItem.css);
scope.cm.js.setValue(currentItem.js); scope.cm.js.setValue(currentItem.js);
scope.consoleCm.setValue('');
scope.cm.html.refresh(); scope.cm.html.refresh();
scope.cm.css.refresh(); scope.cm.css.refresh();
scope.cm.js.refresh(); scope.cm.js.refresh();
@ -701,6 +702,7 @@ runBtn, searchInput, consoleEl, consoleLogEl
window.previewException = function (error) { window.previewException = function (error) {
console.error('Possible infinite loop detected.', error.stack) console.error('Possible infinite loop detected.', error.stack)
window.onMessageFromConsole('Possible infinite loop detected.', error.stack);
} }
window.onunload = function () { window.onunload = function () {
saveCode('code'); saveCode('code');
@ -1330,7 +1332,7 @@ runBtn, searchInput, consoleEl, consoleLogEl
window.onMessageFromConsole = function() { window.onMessageFromConsole = function() {
[...arguments].forEach(function(arg) { [...arguments].forEach(function(arg) {
if (arg && arg.indexOf && arg.indexOf('filesystem:chrome-extension') !== -1) { if (arg && arg.indexOf && arg.indexOf('filesystem:chrome-extension') !== -1) {
arg = arg.replace(/filesystem:chrome-extension.*\.js:(\d+):(\d+)/g, 'script $1:$2'); arg = arg.replace(/filesystem:chrome-extension.*\.js:(\d+):*(\d*)/g, 'script $1:$2');
} }
scope.consoleCm.replaceRange('\n' + arg + ' ' + ((arg + '').match(/\[object \w+]/) ? JSON.stringify(arg) : ''), { line: Infinity }); scope.consoleCm.replaceRange('\n' + arg + ' ' + ((arg + '').match(/\[object \w+]/) ? JSON.stringify(arg) : ''), { line: Infinity });
scope.consoleCm.scrollTo(0, Infinity); scope.consoleCm.scrollTo(0, Infinity);

View File

@ -269,7 +269,7 @@ li.CodeMirror-hint-active {
#demo-frame { #demo-frame {
border: 0; border: 0;
width: 100%; width: 100%;
height: 100%; height: calc(100% - 29px); /* minus minimized console height */
position: absolute; position: absolute;
z-index: 1; z-index: 1;
background: white; background: white;