mirror of
https://github.com/chinchang/web-maker.git
synced 2025-08-06 13:26:36 +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) {
|
var externalJs = externalJsTextarea.value.split('\n').reduce(function (scripts, url) {
|
||||||
return scripts + (url ? '\n<script src="' + url + '"></script>' : '');
|
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'
|
+ '<style id="webmakerstyle">\n' + css + '\n</style>\n'
|
||||||
+ '</head>\n'
|
+ '</head>\n'
|
||||||
+ '<body>\n' + html + '\n'
|
+ '<body>\n' + html + '\n'
|
||||||
+ externalJs + '\n<script src="'
|
+ externalJs + '\n';
|
||||||
|
|
||||||
|
if (js) {
|
||||||
|
contents += '<script>\n' + js + '\n//# sourceURL=userscript.js';
|
||||||
|
} else {
|
||||||
|
contents += '<script src="'
|
||||||
+ 'filesystem:chrome-extension://'
|
+ 'filesystem:chrome-extension://'
|
||||||
+ chrome.i18n.getMessage('@@extension_id') + '/temporary/' + 'script.js' + '">\n'
|
+ chrome.i18n.getMessage('@@extension_id') + '/temporary/' + 'script.js' + '">'
|
||||||
+ '</script></body>\n</html>';
|
}
|
||||||
|
contents += '\n</script>\n</body>\n</html>';
|
||||||
|
|
||||||
return contents;
|
return contents;
|
||||||
}
|
}
|
||||||
@@ -658,7 +664,7 @@ settingsBtn, onboardModal, notificationsBtn, onboardShowInTabOptionBtn, onboardD
|
|||||||
}
|
}
|
||||||
|
|
||||||
function createPreviewFile(html, css, js) {
|
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 blob = new Blob([ contents ], { type: "text/plain;charset=UTF-8" });
|
||||||
var blobjs = new Blob([ js ], { 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,
|
lineWrapping: true,
|
||||||
autofocus: options.autofocus || false,
|
autofocus: options.autofocus || false,
|
||||||
autoCloseBrackets: true,
|
autoCloseBrackets: true,
|
||||||
|
autoCloseTags: true,
|
||||||
matchBrackets: true,
|
matchBrackets: true,
|
||||||
tabMode: 'indent',
|
tabMode: 'indent',
|
||||||
keyMap: 'sublime',
|
keyMap: 'sublime',
|
||||||
@@ -761,7 +768,7 @@ settingsBtn, onboardModal, notificationsBtn, onboardShowInTabOptionBtn, onboardD
|
|||||||
}, updateDelay);
|
}, updateDelay);
|
||||||
});
|
});
|
||||||
cm.on('inputRead', function onChange(editor, input) {
|
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 })
|
CodeMirror.commands.autocomplete(cm, null, { completeSingle: false })
|
||||||
});
|
});
|
||||||
return cm;
|
return cm;
|
||||||
|
@@ -33,6 +33,7 @@ a { text-decoration: none; color: crimson; cursor: pointer; }
|
|||||||
.tac { text-align: center; }
|
.tac { text-align: center; }
|
||||||
.full-width { width: 100%; }
|
.full-width { width: 100%; }
|
||||||
.opacity--30 { opacity: 0.3; }
|
.opacity--30 { opacity: 0.3; }
|
||||||
|
.pointer-none { pointer-events: none; }
|
||||||
|
|
||||||
[class*="hint--"]:after {
|
[class*="hint--"]:after {
|
||||||
text-transform: none;
|
text-transform: none;
|
||||||
@@ -483,11 +484,13 @@ li.CodeMirror-hint-active {
|
|||||||
color: #555;
|
color: #555;
|
||||||
}
|
}
|
||||||
.saved-item-tile__title {
|
.saved-item-tile__title {
|
||||||
|
pointer-events: none;
|
||||||
font-size: 1.6em;
|
font-size: 1.6em;
|
||||||
margin: 0 0 1em 0;
|
margin: 0 0 1em 0;
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
}
|
}
|
||||||
.saved-item-tile__meta {
|
.saved-item-tile__meta {
|
||||||
|
pointer-events: none;
|
||||||
opacity: 0.3;
|
opacity: 0.3;
|
||||||
}
|
}
|
||||||
.saved-items-pane__container {
|
.saved-items-pane__container {
|
||||||
|
Reference in New Issue
Block a user