mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-28 17:20:13 +02:00
support public creations
This commit is contained in:
@@ -44,18 +44,18 @@ window.MonacoEnvironment = {
|
||||
getWorkerUrl(moduleId, label) {
|
||||
switch (label) {
|
||||
case 'html':
|
||||
return 'lib/monaco/workers/html.worker.bundle.js';
|
||||
return '/lib/monaco/workers/html.worker.bundle.js';
|
||||
case 'json':
|
||||
return 'lib/monaco/workers/json.worker.bundle.js';
|
||||
return '/lib/monaco/workers/json.worker.bundle.js';
|
||||
case 'css':
|
||||
case 'scss':
|
||||
case 'less':
|
||||
return 'lib/monaco/workers/css.worker.bundle.js';
|
||||
return '/lib/monaco/workers/css.worker.bundle.js';
|
||||
case 'typescript':
|
||||
case 'javascript':
|
||||
return 'lib/monaco/workers/ts.worker.bundle.js';
|
||||
return '/lib/monaco/workers/ts.worker.bundle.js';
|
||||
default:
|
||||
return 'lib/monaco/workers/editor.worker.bundle.js';
|
||||
return '/lib/monaco/workers/editor.worker.bundle.js';
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -235,9 +235,9 @@ export default class CodeEditor extends Component {
|
||||
if (this.props.type === 'monaco') {
|
||||
if (!monacoDepsDeferred) {
|
||||
monacoDepsDeferred = deferred();
|
||||
loadCss({ url: 'lib/monaco/monaco.css', id: 'monaco-css' });
|
||||
loadCss({ url: '/lib/monaco/monaco.css', id: 'monaco-css' });
|
||||
import(
|
||||
/* webpackChunkName: "monaco" */ '../lib/monaco/monaco.bundle.js'
|
||||
/* webpackChunkName: "monaco" */ '/lib/monaco/monaco.bundle.js'
|
||||
).then(() => {
|
||||
monacoDepsDeferred.resolve();
|
||||
});
|
||||
|
@@ -341,7 +341,7 @@ export default class ContentWrap extends Component {
|
||||
|
||||
// Replace correct css file in LINK tags's href
|
||||
if (prefs.editorTheme) {
|
||||
window.editorThemeLinkTag.href = `lib/codemirror/theme/${prefs.editorTheme}.css`;
|
||||
window.editorThemeLinkTag.href = `/lib/codemirror/theme/${prefs.editorTheme}.css`;
|
||||
}
|
||||
|
||||
window.fontStyleTag.textContent =
|
||||
|
@@ -54,12 +54,10 @@ export default class ContentWrapFiles extends Component {
|
||||
// `clearConsole` is on window because it gets called from inside iframe also.
|
||||
window.clearConsole = this.clearConsole.bind(this);
|
||||
|
||||
this.consoleHeaderDblClickHandler = this.consoleHeaderDblClickHandler.bind(
|
||||
this
|
||||
);
|
||||
this.clearConsoleBtnClickHandler = this.clearConsoleBtnClickHandler.bind(
|
||||
this
|
||||
);
|
||||
this.consoleHeaderDblClickHandler =
|
||||
this.consoleHeaderDblClickHandler.bind(this);
|
||||
this.clearConsoleBtnClickHandler =
|
||||
this.clearConsoleBtnClickHandler.bind(this);
|
||||
this.toggleConsole = this.toggleConsole.bind(this);
|
||||
this.evalConsoleExpr = this.evalConsoleExpr.bind(this);
|
||||
}
|
||||
@@ -259,7 +257,7 @@ export default class ContentWrapFiles extends Component {
|
||||
obj[file.path] =
|
||||
'<script src="' +
|
||||
(chrome.extension
|
||||
? chrome.extension.getURL('lib/screenlog.js')
|
||||
? chrome.extension.getURL('/lib/screenlog.js')
|
||||
: `${location.origin}${
|
||||
window.DEBUG ? '' : BASE_PATH
|
||||
}/lib/screenlog.js`) +
|
||||
@@ -360,12 +358,13 @@ export default class ContentWrapFiles extends Component {
|
||||
window.editorThemeLinkTag.href = `lib/codemirror/theme/${prefs.editorTheme}.css`;
|
||||
}
|
||||
|
||||
window.fontStyleTag.textContent = window.fontStyleTemplate.textContent.replace(
|
||||
/fontname/g,
|
||||
(prefs.editorFont === 'other'
|
||||
? prefs.editorCustomFont
|
||||
: prefs.editorFont) || 'FiraCode'
|
||||
);
|
||||
window.fontStyleTag.textContent =
|
||||
window.fontStyleTemplate.textContent.replace(
|
||||
/fontname/g,
|
||||
(prefs.editorFont === 'other'
|
||||
? prefs.editorCustomFont
|
||||
: prefs.editorFont) || 'FiraCode'
|
||||
);
|
||||
}
|
||||
|
||||
// Check all the code wrap if they are minimized or maximized
|
||||
@@ -376,7 +375,7 @@ export default class ContentWrapFiles extends Component {
|
||||
const { currentLayoutMode } = this.props;
|
||||
const prop =
|
||||
currentLayoutMode === 2 || currentLayoutMode === 5 ? 'width' : 'height';
|
||||
[htmlCodeEl].forEach(function(el) {
|
||||
[htmlCodeEl].forEach(function (el) {
|
||||
const bounds = el.getBoundingClientRect();
|
||||
const size = bounds[prop];
|
||||
if (size < 100) {
|
||||
|
@@ -235,7 +235,7 @@ export default function SavedItemPane({
|
||||
</h2>
|
||||
<img
|
||||
style="max-width: 80%; opacity:0.4"
|
||||
src="assets/empty.svg"
|
||||
src="/assets/empty.svg"
|
||||
/>
|
||||
</div>
|
||||
) : null}
|
||||
|
Reference in New Issue
Block a user