1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-28 17:20:13 +02:00

Helpmodal + add library + toggle layouts

This commit is contained in:
Kushagra Gour
2018-05-27 01:19:00 +05:30
parent 84f1ceae10
commit 0cc0e4d9ee
5 changed files with 99 additions and 28 deletions

View File

@@ -73,24 +73,27 @@ export default class ContentWrap extends Component {
/* eslint max-params: ["error", 4] */
getCompleteHtml(html, css, js, isForExport) {
/* var externalJs = externalJsTextarea.value
if (!this.props.currentItem) {
return '';
}
var externalJs = this.props.currentItem.externalLibs.js
.split('\n')
.reduce(function(scripts, url) {
return scripts + (url ? '\n<script src="' + url + '"></script>' : '');
}, '');
var externalCss = externalCssTextarea.value
var externalCss = this.props.currentItem.externalLibs.css
.split('\n')
.reduce(function(links, url) {
return (
links +
(url ? '\n<link rel="stylesheet" href="' + url + '"></link>' : '')
);
}, ''); */
}, '');
var contents =
'<!DOCTYPE html>\n' +
'<html>\n<head>\n' +
'<meta charset="UTF-8" />\n' +
// externalCss +
externalCss +
'\n' +
'<style id="webmakerstyle">\n' +
css +
@@ -99,7 +102,7 @@ export default class ContentWrap extends Component {
'<body>\n' +
html +
'\n' +
// externalJs +
externalJs +
'\n';
if (!isForExport) {
@@ -285,13 +288,14 @@ export default class ContentWrap extends Component {
this.codeInPreview.js = currentCode.js;
}
componentWillReceiveProps() {
console.log('compoenntwillrecvprops', this.props.currentItem);
// console.log('compoenntwillrecvprops', this.props.currentItem);
}
componentDidUpdate() {
this.setPreviewContent(true);
console.log('componentdidupdate', this.props.currentItem);
}
componentWillUpdate() {
console.log('compoenntwillupdate', this.props.currentItem);
// console.log('compoenntwillupdate', this.props.currentItem);
}
render() {