Skip to content

Commit 93e0346

Browse files
Change gitignore props
1 parent 5cb179b commit 93e0346

5 files changed

Lines changed: 67 additions & 1 deletion

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
node_modules
33

44
# Build directories
5-
src/public/dist/
5+
src/public/dist/local/bundle
6+
src/public/dist/standalone/bundle
67

78
# example for dev
89
# example-project

src/public/dist/local/favicon.ico

1.12 KB
Binary file not shown.

src/public/dist/local/index.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>Codecrumbs: better way to navigate the code maze!</title>
7+
</head>
8+
<body>
9+
<div id="mount-node" style="height: 100%"></div>
10+
<script src="./bundle/main.bundle.js" type="text/javascript"></script>
11+
<script type="text/javascript">
12+
(function(window) {
13+
if (!window.codecrumbs) {
14+
console.error('Codecrumbs project is not loaded!');
15+
return false;
16+
}
17+
window.codecrumbs.default({}, 'mount-node');
18+
})(window)
19+
</script>
20+
</body>
21+
</html>
1.12 KB
Binary file not shown.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>Codecrumbs standalone: learn and share your code knowledge!</title>
7+
</head>
8+
<body>
9+
<div id="mount-node" style="height: 100%">
10+
<div id="placeholder" style="text-align: center; color: #1890ff">
11+
Loading standalone codecrumbs experience...
12+
</div>
13+
</div>
14+
<script src="./bundle/main.bundle.js" type="text/javascript"></script>
15+
<script type="text/javascript">
16+
(function(window) {
17+
if (!window.codecrumbs) {
18+
console.error('Codecrumbs project is not loaded!');
19+
return false;
20+
}
21+
22+
var hash = location.hash;
23+
var key = '#showcase=';
24+
var showCaseName = hash.slice(hash.indexOf(key) + key.length) || 'todo-react-redux';
25+
26+
var fileElement = document.createElement('div');
27+
fileElement.innerText = 'Fetching "' + showCaseName + '" showcase...';
28+
document.getElementById('placeholder').appendChild(fileElement);
29+
30+
window.fetch('./json/' + showCaseName + '.json')
31+
.then(function(response) {
32+
return response.json();
33+
}).then((object) => {
34+
window.codecrumbs.default({ standalone: true, predefinedState: object.data }, 'mount-node');
35+
}).catch((e) => {
36+
console.error(e);
37+
38+
document.getElementById('placeholder').innerText = 'Ooopps.. :( Failed to load. ' +
39+
'Set hash params and reload page. E.g. #showcase=todo-react-redux'
40+
});
41+
})(window)
42+
</script>
43+
</body>
44+
</html>

0 commit comments

Comments
 (0)