mirror of
https://github.com/chinchang/web-maker.git
synced 2025-08-03 11:57:34 +02:00
@@ -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>' : '');
|
||||
}, '');
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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" });
|
||||
|
||||
@@ -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',
|
||||
@@ -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;
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user