Skip to content

Commit

Permalink
Update demo.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhuix committed Jul 26, 2024
1 parent dc4bea4 commit 97488b0
Show file tree
Hide file tree
Showing 7 changed files with 308 additions and 155 deletions.
24 changes: 20 additions & 4 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,16 @@
.makeHtml(md, csstypes => {
mdCssTypes = csstypes;
})
.then(content => {
element.innerHTML = content;
.then(res => {
if (typeof res === 'object') {
element.innerHTML = res.html;
showdowns.completedHtml(res.scripts);
} else {
element.innerHTML = res;
}
})
.catch(err => {
element.innerText = err;
});
})
.catch(function(error) {
Expand All @@ -127,8 +135,16 @@
.makeHtml(md, csstypes => {
mdCssTypes = csstypes;
})
.then(content => {
element.innerHTML = content;
.then(res => {
if (typeof res === 'object') {
element.innerHTML = res.html;
showdowns.completedHtml(res.scripts);
} else {
element.innerHTML = res;
}
})
.catch(err => {
element.innerText = err;
});
}
});
Expand Down
24 changes: 20 additions & 4 deletions docs/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,16 @@
.makeHtml(md, csstypes => {
mdCssTypes = csstypes;
})
.then(content => {
element.innerHTML = content;
.then(res => {
if (typeof res === 'object') {
element.innerHTML = res.html;
showdowns.completedHtml(res.scripts);
} else {
element.innerHTML = res;
}
})
.catch(err => {
element.innerText = err;
});
})
.catch(function(error) {
Expand All @@ -127,8 +135,16 @@
.makeHtml(md, csstypes => {
mdCssTypes = csstypes;
})
.then(content => {
element.innerHTML = content;
.then(res => {
if (typeof res === 'object') {
element.innerHTML = res.html;
showdowns.completedHtml(res.scripts);
} else {
element.innerHTML = res;
}
})
.catch(err => {
element.innerText = err;
});
}
});
Expand Down
8 changes: 4 additions & 4 deletions docs/dist/showdowns.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/dist/showdowns.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/dist/showdowns.min.js.map

Large diffs are not rendered by default.

27 changes: 19 additions & 8 deletions livedemo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@
background: rgba(128, 135, 139, 0.8);
}
</style>
<link rel="stylesheet" href="../dist/showdowns.css" />
<link rel="stylesheet" href="../dist/showdowns.min.css" />
</head>

<body style="display:none;" onload="document.body.style.display = 'block'">
<div id="main" class="workspace-container"></div>
<script src="../dist/showdowns.js"></script>
<script src="../dist/showdowns.min.js"></script>
<script>
(function(element) {
showdowns.setCDN("local");
Expand Down Expand Up @@ -129,9 +129,13 @@
.makeHtml(md, csstypes => {
cssTypes = csstypes;
})
.then(obj => {
element.innerHTML = obj.html;
showdowns.completedHtml(obj.scripts);
.then(res => {
if (typeof res === 'object') {
element.innerHTML = res.html;
showdowns.completedHtml(res.scripts);
} else {
element.innerHTML = res;
}
})
.catch(err => {
element.innerText = err;
Expand All @@ -144,9 +148,16 @@
.makeHtml(md, csstypes => {
cssTypes = csstypes;
})
.then( obj => {
element.innerHTML = obj.html;
showdowns.completedHTML(obj.scritps);
.then(res => {
if (typeof res === 'object') {
element.innerHTML = res.html;
showdowns.completedHtml(res.scripts);
} else {
element.innerHTML = res;
}
})
.catch(err => {
element.innerText = err;
});
}
});
Expand Down
Loading

0 comments on commit 97488b0

Please sign in to comment.