From 2d091a292a72977fd220f78d88293f9e2d2658eb Mon Sep 17 00:00:00 2001 From: Kushagra Gour Date: Sat, 28 Jan 2017 00:38:46 +0530 Subject: [PATCH 1/4] fix js not showing inline in downloaded file. fixes #53 --- src/script.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/script.js b/src/script.js index febadc0..b6df6c8 100644 --- a/src/script.js +++ b/src/script.js @@ -611,7 +611,7 @@ settingsBtn, onboardModal, notificationsBtn, onboardShowInTabOptionBtn, onboardD }); } - function getCompleteHtml(html, css) { + function getCompleteHtml(html, css, js) { var externalJs = externalJsTextarea.value.split('\n').reduce(function (scripts, url) { return scripts + (url ? '\n' : ''); }, ''); @@ -623,10 +623,16 @@ settingsBtn, onboardModal, notificationsBtn, onboardShowInTabOptionBtn, onboardD + '\n' + '\n' + '\n' + html + '\n' - + externalJs + '\n\n'; + + externalJs + '\n'; + + if (js) { + contents += '\n\n'; return contents; } @@ -658,7 +664,7 @@ settingsBtn, onboardModal, notificationsBtn, onboardShowInTabOptionBtn, onboardD } function createPreviewFile(html, css, js) { - var contents = getCompleteHtml(html, css, js); + var contents = getCompleteHtml(html, css); var blob = new Blob([ contents ], { type: "text/plain;charset=UTF-8" }); var blobjs = new Blob([ js ], { type: "text/plain;charset=UTF-8" }); From 75449afb6c868ebd2a2db72fe4ee7ae4dcab7557 Mon Sep 17 00:00:00 2001 From: Kushagra Gour Date: Sat, 28 Jan 2017 00:50:36 +0530 Subject: [PATCH 2/4] fix click on saved items. fixes #54 --- src/style.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/style.css b/src/style.css index 4610729..9f12bd2 100644 --- a/src/style.css +++ b/src/style.css @@ -33,6 +33,7 @@ a { text-decoration: none; color: crimson; cursor: pointer; } .tac { text-align: center; } .full-width { width: 100%; } .opacity--30 { opacity: 0.3; } +.pointer-none { pointer-events: none; } [class*="hint--"]:after { text-transform: none; @@ -483,11 +484,13 @@ li.CodeMirror-hint-active { color: #555; } .saved-item-tile__title { + pointer-events: none; font-size: 1.6em; margin: 0 0 1em 0; opacity: 0.8; } .saved-item-tile__meta { + pointer-events: none; opacity: 0.3; } .saved-items-pane__container { From b78c033aba73f6fcd6ad4cf6497cdd41fd979169 Mon Sep 17 00:00:00 2001 From: Kushagra Gour Date: Sat, 28 Jan 2017 01:27:07 +0530 Subject: [PATCH 3/4] add missing option to auto close tags. --- src/script.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/script.js b/src/script.js index b6df6c8..d89e917 100644 --- a/src/script.js +++ b/src/script.js @@ -750,6 +750,7 @@ settingsBtn, onboardModal, notificationsBtn, onboardShowInTabOptionBtn, onboardD lineWrapping: true, autofocus: options.autofocus || false, autoCloseBrackets: true, + autoCloseTags: true, matchBrackets: true, tabMode: 'indent', keyMap: 'sublime', From ebcfdbf1a02e8454f4a7e13d22481bdebe29d81d Mon Sep 17 00:00:00 2001 From: Kushagra Gour Date: Sat, 28 Jan 2017 01:27:45 +0530 Subject: [PATCH 4/4] dont show hints when space is typed --- src/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script.js b/src/script.js index d89e917..e8f1667 100644 --- a/src/script.js +++ b/src/script.js @@ -768,7 +768,7 @@ settingsBtn, onboardModal, notificationsBtn, onboardShowInTabOptionBtn, onboardD }, updateDelay); }); cm.on('inputRead', function onChange(editor, input) { - if (input.text[0] === ';') { return; } + if (input.text[0] === ';' || input.text[0] === ' ') { return; } CodeMirror.commands.autocomplete(cm, null, { completeSingle: false }) }); return cm;