Skip to content

Commit

Permalink
Merge pull request chinchang#55 from chinchang/release-2.2.2
Browse files Browse the repository at this point in the history
Release 2.2.2
  • Loading branch information
chinchang authored Jan 27, 2017
2 parents 8ea2444 + ebcfdbf commit 76de070
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<script src="' + url + '"></script>' : '');
}, '');
Expand All @@ -623,10 +623,16 @@ settingsBtn, onboardModal, notificationsBtn, onboardShowInTabOptionBtn, onboardD
+ '<style id="webmakerstyle">\n' + css + '\n</style>\n'
+ '</head>\n'
+ '<body>\n' + html + '\n'
+ externalJs + '\n<script src="'
+ 'filesystem:chrome-extension://'
+ chrome.i18n.getMessage('@@extension_id') + '/temporary/' + 'script.js' + '">\n'
+ '</script></body>\n</html>';
+ externalJs + '\n';

if (js) {
contents += '<script>\n' + js + '\n//# sourceURL=userscript.js';
} else {
contents += '<script src="'
+ 'filesystem:chrome-extension://'
+ chrome.i18n.getMessage('@@extension_id') + '/temporary/' + 'script.js' + '">'
}
contents += '\n</script>\n</body>\n</html>';

return contents;
}
Expand Down Expand Up @@ -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" });

Expand Down Expand Up @@ -744,6 +750,7 @@ settingsBtn, onboardModal, notificationsBtn, onboardShowInTabOptionBtn, onboardD
lineWrapping: true,
autofocus: options.autofocus || false,
autoCloseBrackets: true,
autoCloseTags: true,
matchBrackets: true,
tabMode: 'indent',
keyMap: 'sublime',
Expand All @@ -761,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;
Expand Down
3 changes: 3 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 76de070

Please sign in to comment.