Skip to content

Commit 81dffd7

Browse files
committed
ores/auto-commit => 'set'
1 parent 753f646 commit 81dffd7

File tree

8 files changed

+274
-47
lines changed

8 files changed

+274
-47
lines changed

index.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22

3-
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
3+
<!--<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">-->
44

55
<!--<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?skin=sunburst"></script>-->
66

@@ -17,10 +17,18 @@
1717
}
1818

1919
.flex-container {
20+
display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */
21+
display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */
22+
display: -ms-flexbox; /* TWEENER - IE 10 */
23+
display: -webkit-flex; /* NEW - Chrome */
2024
display: flex;
2125
}
2226

2327
.flex-vertical-container {
28+
display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */
29+
display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */
30+
display: -ms-flexbox; /* TWEENER - IE 10 */
31+
display: -webkit-flex; /* NEW - Chrome */
2432
display: flex;
2533
flex-direction: column;
2634
}
@@ -62,6 +70,7 @@
6270
console.log('here is the text:',v);
6371
// var div = document.createElement("div");
6472
el.innerHTML = `<div style="overflow: scroll;" width="100%" height="100%">${v}</div>`;
73+
// el.innerHTML = `<iframe id="main-iframe" src="${v}" width="100%" height="100%"></iframe>;`;
6574
// el.textContent = v;
6675
// el.appendChild(div);
6776
});
@@ -78,7 +87,9 @@
7887
<button onclick="asyncc.newIFrame('v/0.1.2')">version 0.1.2</button>
7988
<button onclick="asyncc.newIFrame('v/0.1.3')">version 0.1.3</button>
8089
<button onclick="asyncc.getFrame('v/0.1.3')">get markdown</button>
90+
<button onclick="asyncc.newIFrame('md/html-from-md.html#foo')">get markdown</button>
8191
<button onclick="asyncc.newIFrame('v/0.1.0')">new iframe</button>
92+
<button onclick="asyncc.newIFrame('v/0.1.0/org/ores/async/Asyncc.html#Concat(java.util.List,org.ores.async.Asyncc.IAsyncCallback)')">hash search</button>
8293
</div>
8394
</div>
8495
<div id="foox" style="display: flex; flex-grow: 1">

md/html-from-md.html

Lines changed: 88 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,17 @@
1+
<script src="http://shjs.sourceforge.net/sh_main.js"></script>
2+
<script src="http://shjs.sourceforge.net/lang/sh_java.js"></script>
3+
<!--<link rel="stylesheet" href="http://shjs.sourceforge.net/sh_style.css">-->
4+
<!--<link rel="stylesheet" href="http://shjs.sourceforge.net/css/sh_darkblue.css">-->
5+
<!--<link rel="stylesheet" href="http://shjs.sourceforge.net/css/sh_zellner.css">-->
6+
<link rel="stylesheet" href="http://shjs.sourceforge.net/css/sh_acid.css">
17

2-
<!--<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?skin=sunburst"></script>-->
3-
4-
<!--<h3 id="concat">Concat</h3>-->
5-
<!--<p><a name="abcde"></a></p>-->
6-
<!--<pre lang="java" class="prettyprint">-->
7-
8-
<!--class NeoEach {-->
9-
<!---->
10-
<!--static {@code <T, V, E> void Each(int limit, Iterable<T> i, Asyncc.IEacher<T, E> m, Asyncc.IEachCallback<E> f)} {-->
11-
<!---->
12-
<!--final CounterLimit c = new CounterLimit(limit);-->
13-
<!--final ShortCircuit s = new ShortCircuit();-->
14-
<!--final var iterator = i.iterator();-->
15-
<!--RunEach(iterator, c, s, m, f);-->
16-
<!--handleSameTickCall(s);-->
17-
<!--}-->
18-
<!---->
19-
<!--}-->
20-
<!--</pre>-->
21-
22-
<!--<h3 id="series">Series</h3>-->
23-
<!--<p><a name="abcde"></a></p>-->
24-
<!--<pre lang="java" class="prettyprint">-->
25-
26-
<!--class NeoEach {-->
27-
<!---->
28-
<!--static {@code <T, V, E>} void Each(int limit, Iterable<T> i, Asyncc.IEacher<T, E> m, Asyncc.IEachCallback<E> f) {-->
29-
<!---->
30-
<!--final CounterLimit c = new CounterLimit(limit);-->
31-
<!--final ShortCircuit s = new ShortCircuit();-->
32-
<!--final var iterator = i.iterator();-->
33-
<!--RunEach(iterator, c, s, m, f);-->
34-
<!--handleSameTickCall(s);-->
35-
<!--}-->
36-
<!---->
37-
<!--}-->
38-
<!--</pre>-->
39-
40-
<!--<h3 id="parallel">Parallel</h3>-->
41-
<!--<p><a name="abcde"></a></p>-->
42-
43-
<div width="1900px" height="1800px">
448

459
<pre class="sh_java">
4610

4711
class NeoEach {
4812

4913
@Suppression()
50-
static &lt;T, V, E&gt; void Each(int limit, Iterable&lt;T&gt; i, Asyncc.IEacher&lt;T, E&gt; m, Asyncc.IEachCallback&lt;E&gt; f) {
14+
static <T, V, E> void Each(int limit, Iterable&lt;T&gt; i, Asyncc.IEacher&lt;T, E&gt; m, Asyncc.IEachCallback&lt;E&gt; f) {
5115

5216
final CounterLimit c = new CounterLimit(limit);
5317
final ShortCircuit s = new ShortCircuit();
@@ -59,4 +23,84 @@
5923
}
6024
</pre>
6125

62-
</div>
26+
27+
28+
<pre class="sh_java">
29+
30+
class NeoEach {
31+
32+
@Suppression()
33+
static <T, V, E> void Each(int limit, Iterable&lt;T&gt; i, Asyncc.IEacher&lt;T, E&gt; m, Asyncc.IEachCallback&lt;E&gt; f) {
34+
35+
final CounterLimit c = new CounterLimit(limit);
36+
final ShortCircuit s = new ShortCircuit();
37+
final var iterator = i.iterator();
38+
RunEach(iterator, c, s, m, f);
39+
handleSameTickCall(s);
40+
}
41+
42+
}
43+
</pre>
44+
45+
46+
<pre class="sh_java">
47+
48+
class NeoEach {
49+
50+
@Suppression()
51+
static <T, V, E> void Each(int limit, Iterable&lt;T&gt; i, Asyncc.IEacher&lt;T, E&gt; m, Asyncc.IEachCallback&lt;E&gt; f) {
52+
53+
final CounterLimit c = new CounterLimit(limit);
54+
final ShortCircuit s = new ShortCircuit();
55+
final var iterator = i.iterator();
56+
RunEach(iterator, c, s, m, f);
57+
handleSameTickCall(s);
58+
}
59+
60+
}
61+
</pre>
62+
63+
64+
<pre class="sh_java">
65+
66+
class NeoEach {
67+
68+
@Suppression()
69+
static <T, V, E> void Each(int limit, Iterable&lt;T&gt; i, Asyncc.IEacher&lt;T, E&gt; m, Asyncc.IEachCallback&lt;E&gt; f) {
70+
71+
final CounterLimit c = new CounterLimit(limit);
72+
final ShortCircuit s = new ShortCircuit();
73+
final var iterator = i.iterator();
74+
RunEach(iterator, c, s, m, f);
75+
handleSameTickCall(s);
76+
}
77+
78+
}
79+
</pre>
80+
81+
<a name="foo"></a>
82+
this is the foo section
83+
<pre class="sh_java">
84+
85+
class NeoEach {
86+
87+
@Suppression()
88+
static <T, V, E> void Each(int limit, Iterable&lt;T&gt; i, Asyncc.IEacher&lt;T, E&gt; m, Asyncc.IEachCallback&lt;E&gt; f) {
89+
90+
final CounterLimit c = new CounterLimit(limit);
91+
final ShortCircuit s = new ShortCircuit();
92+
final var iterator = i.iterator();
93+
RunEach(iterator, c, s, m, f);
94+
handleSameTickCall(s);
95+
}
96+
97+
}
98+
</pre>
99+
100+
<script>
101+
sh_highlightDocument();
102+
window.onload = function () {
103+
sh_highlightDocument();
104+
};
105+
106+
</script>

md/html-from-md2.html

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<h3 id="concat">Concat</h3>
2+
<p><a name="abcde"></a></p>
3+
<pre lang="java" class="prettyprint">
4+
5+
class NeoEach {
6+
7+
static <T, V, E> void Each(int limit, Iterable<T> i, Asyncc.IEacher<T, E> m, Asyncc.IEachCallback<E> f) {
8+
9+
final CounterLimit c = new CounterLimit(limit);
10+
final ShortCircuit s = new ShortCircuit();
11+
final var iterator = i.iterator();
12+
RunEach(iterator, c, s, m, f);
13+
handleSameTickCall(s);
14+
}
15+
16+
}
17+
</pre>
18+
19+
<h3 id="series">Series</h3>
20+
<p><a name="abcde"></a></p>
21+
<pre lang="java" class="prettyprint">
22+
23+
class NeoEach {
24+
25+
static {@code <T, V, E> } void Each(int limit, Iterable<T> i, Asyncc.IEacher<T, E> m, Asyncc.IEachCallback<E> f) {
26+
27+
final CounterLimit c = new CounterLimit(limit);
28+
final ShortCircuit s = new ShortCircuit();
29+
final var iterator = i.iterator();
30+
RunEach(iterator, c, s, m, f);
31+
handleSameTickCall(s);
32+
}
33+
34+
}
35+
</pre>
36+
37+
<h3 id="parallel">Parallel</h3>
38+
<p><a name="abcde"></a> <code ></p>
39+
<p>class NeoEach {</p>
40+
<p>static &lt;T, V, E&gt; void Each(int limit, Iterable<T> i, Asyncc.IEacher&lt;T, E&gt; m, Asyncc.IEachCallback<E> f) {</p>
41+
<pre><code> final CounterLimit c = new CounterLimit(limit);
42+
final ShortCircuit s = new ShortCircuit();
43+
final var iterator = i.iterator();
44+
RunEach(iterator, c, s, m, f);
45+
handleSameTickCall(s);
46+
</code></pre>
47+
<p>}</p>
48+
<p>} </code></p>
49+
<h3 id="parallel-1">Parallel</h3>
50+
<p><a name="abcde"></a></p>
51+
<pre lang="java" class="prettyprint">
52+
<code>
53+
class NeoEach {
54+
55+
static <T, V, E> void Each(int limit, Iterable<T> i, Asyncc.IEacher<T, E> m, Asyncc.IEachCallback<E> f) {
56+
57+
final CounterLimit c = new CounterLimit(limit);
58+
final ShortCircuit s = new ShortCircuit();
59+
final var iterator = i.iterator();
60+
RunEach(iterator, c, s, m, f);
61+
handleSameTickCall(s);
62+
}
63+
64+
}
65+
</code>
66+
</pre>
67+

md/markdown-input.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,24 @@
3939
}
4040
</pre>
4141

42+
### Parallel
43+
44+
<a name="abcde"></a>
45+
<code >
46+
47+
class NeoEach {
48+
49+
static <T, V, E> void Each(int limit, Iterable<T> i, Asyncc.IEacher<T, E> m, Asyncc.IEachCallback<E> f) {
50+
51+
final CounterLimit c = new CounterLimit(limit);
52+
final ShortCircuit s = new ShortCircuit();
53+
final var iterator = i.iterator();
54+
RunEach(iterator, c, s, m, f);
55+
handleSameTickCall(s);
56+
}
57+
58+
}
59+
</code>
4260

4361
### Parallel
4462

@@ -57,4 +75,5 @@
5775
}
5876

5977
}
78+
6079
</pre>

scripts/convert-md-to-html.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env bash
22

3-
pandoc md/markdown-input.md --from=gfm -t html -o md/html-from-md.html
3+
pandoc md/markdown-input.md --from=gfm -t html -o md/html-from-md2.html

scripts/convert.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
const path = require('path');
3+
const fs = require('fs');
4+
const inputHtml = path.resolve(__dirname + '/../md/markdown-input.md');
5+
6+
const htmlin = String(fs.readFileSync(inputHtml) || '');
7+
8+
let inPre = false;
9+
let prev = [];
10+
let results = [];
11+
12+
const splitted = htmlin.split(/<pre.*>/);
13+
splitted.shift();
14+
15+
const justPost = splitted.join('').split('</pre>');
16+
justPost.pop();
17+
18+
console.log(justPost);
19+
console.log(justPost.length);
20+
21+
22+
23+
24+
console.log(results.join(''));
25+

scripts/post-convert.js

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
2+
const path = require('path');
3+
const fs = require('fs');
4+
const inputHtml = path.resolve(__dirname + '/../md/html-from-md.html');
5+
6+
const htmlin = String(fs.readFileSync(inputHtml) || '');
7+
8+
let startPre = false;
9+
let inPre = false;
10+
let prev = [];
11+
let results = [];
12+
13+
let i = -1;
14+
for(let v of htmlin){
15+
16+
i++;
17+
18+
const joined = prev.join('');
19+
20+
if(joined === '<pre ' || joined === '<pre>'){
21+
inPre = true;
22+
}
23+
24+
if(startPre && htmlin.slice(i,i+6) === '</pre>'){
25+
if(!inPre){
26+
throw 'Missing opening pre tag.';
27+
}
28+
startPre = false;
29+
inPre = false;
30+
}
31+
32+
if(startPre && v === '<'){
33+
results.push('&lt;')
34+
}
35+
else if(startPre && v === '>'){
36+
results.push('&gt;')
37+
}
38+
else{
39+
results.push(v)
40+
}
41+
42+
if(inPre === true && v === '>'){
43+
startPre = true;
44+
}
45+
46+
if(prev.length > 4){
47+
prev.shift();
48+
}
49+
50+
prev.push(v);
51+
52+
53+
}
54+
55+
56+
console.log(results.join(''));
57+

todos.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11

22
https://github.com/cwjohan/markdown-to-html
33

4-
https://stackoverflow.com/questions/31206176/how-to-use-anchor-tag-to-scroll-within-div-without-autoscrolling-entire-page
4+
https://stackoverflow.com/questions/31206176/how-to-use-anchor-tag-to-scroll-within-div-without-autoscrolling-entire-page
5+
6+
http://shjs.sourceforge.net/css/
7+
8+
http://shjs.sourceforge.net/

0 commit comments

Comments
 (0)