Skip to content

Commit 8c6f9fd

Browse files
committed
ores/auto-commit => 'set'
1 parent 1c9b45c commit 8c6f9fd

File tree

4 files changed

+98
-17
lines changed

4 files changed

+98
-17
lines changed

index-1.html

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
2+
3+
<style>
4+
.version-selection-scroll-panel {
5+
width: 15%;
6+
height: 100%;
7+
overflow-y: scroll;
8+
}
9+
10+
.flex-container {
11+
display: flex;
12+
}
13+
14+
.flex-vertical-container {
15+
display: flex;
16+
flex-direction: column;
17+
}
18+
19+
html, body {
20+
margin: 0;
21+
height: 100%;
22+
overflow: hidden
23+
}
24+
25+
</style>
26+
27+
<script>
28+
29+
30+
let local = false;
31+
32+
// dom.appendChild('');
33+
34+
const asyncc = window.__asyncc__ = {};
35+
asyncc.latestVersion = 'v/0.1.0';
36+
asyncc.root = "https://async-java.github.io/";
37+
38+
asyncc.changeIframe = (versionPath) => {
39+
40+
let iframe = document.getElementsByClassName("main-iframe");
41+
if (!iframe) {
42+
return alert('Could not find iframe on page.');
43+
}
44+
45+
console.log('src:', versionPath);
46+
// iframe.src = asyncc.root + versionPath;
47+
48+
iframe.src = versionPath;
49+
console.log({iframe});
50+
// iframe.replaceWith(iframe);
51+
// iframe.location.reload();
52+
// iframe.contentWindow.location.reload();
53+
};
54+
55+
56+
</script>
57+
58+
<div class="flex-container">
59+
60+
<div class="version-selection-scroll-panel">
61+
<div class="flex-vertical-container">
62+
<button onclick="asyncc.changeIframe('v/0.1.0')">version 0.1.1</button>
63+
<button onclick="asyncc.changeIframe('v/0.1.2')">version 0.1.2</button>
64+
<button onclick="asyncc.changeIframe('v/0.1.3')">version 0.1.3</button>
65+
</div>
66+
</div>
67+
<div style="display: flex; flex-grow: 1">
68+
<!--<iframe id="main-iframe" src="https://async-java.github.io/v/0.1.0" width="100%" height="100%"></iframe>-->
69+
<iframe id="main-iframe" src="v/0.1.0" width="100%" height="100%"></iframe>
70+
</div>
71+
</div>
72+
73+
<script>
74+
asyncc.changeIframe('v/0.1.2');
75+
</script>

index.html

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?skin=sunburst&autoload=true&lang=java"></script>
2+
13
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
24

35
<style>
@@ -26,15 +28,9 @@
2628

2729
<script>
2830

29-
3031
let local = false;
31-
32-
// dom.appendChild('');
33-
3432
const asyncc = window.__asyncc__ = {};
35-
3633
asyncc.latestVersion = 'v/0.1.0';
37-
3834
asyncc.root = "https://async-java.github.io/";
3935

4036
asyncc.changeIframe = (versionPath) => {
@@ -43,16 +39,26 @@
4339
return alert('Could not find iframe on page.');
4440
}
4541

46-
console.log('src:', versionPath);
47-
// iframe.src = asyncc.root + versionPath;
48-
4942
iframe.src = versionPath;
50-
console.log({iframe});
51-
// iframe.replaceWith(iframe);
52-
// iframe.location.reload();
53-
// iframe.contentWindow.location.reload();
5443
};
5544

45+
asyncc.newIFrame = () => {
46+
const el = document.getElementById('foox');
47+
el.innerHTML = '<iframe id="main-iframe" src="v/0.1.0" width="100%" height="100%"></iframe>;';
48+
};
49+
50+
asyncc.getFrame = () => {
51+
return fetch('md/html-from-md.html')
52+
.then(r => {
53+
const el = document.getElementById('foox');
54+
return r.text().then(v => {
55+
console.log('here is the text:',v);
56+
// var div = document.createElement("div");
57+
el.innerHTML = v;
58+
// el.appendChild(div);
59+
});
60+
});
61+
};
5662

5763
</script>
5864

@@ -63,11 +69,12 @@
6369
<button onclick="asyncc.changeIframe('v/0.1.0')">version 0.1.1</button>
6470
<button onclick="asyncc.changeIframe('v/0.1.2')">version 0.1.2</button>
6571
<button onclick="asyncc.changeIframe('v/0.1.3')">version 0.1.3</button>
72+
<button onclick="asyncc.getFrame('v/0.1.3')">get markdown</button>
73+
<button onclick="asyncc.newIFrame()">new iframe</button>
6674
</div>
6775
</div>
68-
<div style="display: flex; flex-grow: 1">
69-
<!--<iframe id="main-iframe" src="https://async-java.github.io/v/0.1.0" width="100%" height="100%"></iframe>-->
70-
<iframe id="main-iframe" src="v/0.1.0" width="100%" height="100%"></iframe>
76+
<div id="foox" style="display: flex; flex-grow: 1">
77+
<iframe id="main-iframe" src="v/0.1.0" width="100%" height="100%"></iframe>
7178
</div>
7279
</div>
7380

md/html-from-md.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?autoload=true&lang=java"></script>
21

32
<h3 id="this-is-title">This is title</h3>
43
<p><a name="abcde"></a></p>
File renamed without changes.

0 commit comments

Comments
 (0)