-
Notifications
You must be signed in to change notification settings - Fork 0
/
splitwindow.html
201 lines (181 loc) · 5.75 KB
/
splitwindow.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<!DOCTYPE html>
<html lang="en-US"><!-- N and S Suffixes mean {N:North, S:South} -->
<head>
<meta charset="utf-8" />
<meta name="keywords" content="split window" />
<meta name="description" content="split window unit test" />
<title>SPLIT WINDOW UNIT TEST</title>
<script src="splitwindow.js"></script>
<script src="wiki.js"></script>
<script src="keymap.js"></script>
<script type="text/javascript">
var bodyN = splitwindow.HERE(function() {/*
== Shakespeare sonnet CXVI: ==
Let me not to the marriage of true minds
Admit impediments. Love is not love
Which alters when it alteration finds,
Or bends with the remover to remove:
O, no! it is an ever-fixed mark,
That looks on tempests and is never shaken;
It is the star to every wandering bark,
Whose worth's unknown, although his height be taken.
Love's not Time's fool, though rosy lips and cheeks
Within his bending sickle's compass come;
Love alters not with his brief hours and weeks,
But bears it out even to the edge of doom.
If this be error and upon me proved,
I never writ, nor no man ever loved.
@- wiki markdown color fails.
@- wiki paragraph break on multiple newlines fails.
@- wiki userS final comment closing is visible.
@- wiki box fails.
*/});
splitwindow.pane.North.id = 'remote'
splitwindow.pane.North.markup = bodyN;
var bodyS = splitwindow.HERE(function() {/*
== Shakespeare sonnet CX: ==
Alas! 'tis true, I have gone here and there,
And made my self a motley to the view,
Gored mine own thoughts, sold cheap what is most dear,
Made old offences of affections new;
Most true it is, that I have looked on truth
Askance and strangely; but, by all above,
These blenches gave my heart another youth,
And worse essays proved thee my best of love.
Now all is done, have what shall have no end:
Mine appetite I never more will grind
On newer proof, to try an older friend,
A god in love, to whom I am confined.
Then give me welcome, next my heaven the best,
Even to thy pure and most most loving breast.
== Checkbox items ==
@+ wiki markdown is working with some bugs.
== First lines of Edgar Allen Poe's "The Raven" ==
Once upon a midnight dreary,
while I pondered weak and weary
over many a quaint and curious
volume of forgotten lore.
== URLs ==
![rote.training/rote/integrals.php
integrals]!
== Lists ==
* bullet item 1
* bullet item 2
# numbered item 1
# numbered item 2
=== CHECK LISTS ===
@ Check unmarked
@+ Check accepted
@- Check rejected
@0 Check numbered
@9 Check numbered
@a Check lettered
@z Check lettered
@A Check Lettered
@Z Check Lettered
=== FONT EFFECTS ===
!=Bold=!,^^
!/italic/!,^^
!_underline_!,^^
!-strike-!.
=== INDENT, LINE BREAK: ===
___Indent paragraph 1,
let it wrap, and then
break for next paragraph.
___Indent paragraph 2,
let it wrap, and then
break for next paragraph.^^^
Break^^a^^line^^into^^words.^^
&book{CajalHistology,
author = {Santiago Ram\'{o}n y Cajal},
title = {Histology of the Nervous System of Man and Vertebrates},
publisher = {Oxford},
pages = {145},
isbn = {ISBN 0-19-507401-7},
year = {1995},
note = {English translation by Swanson and Swanson, original completed in 1904}
}
&article{LettvinSeenMovement,
author = {Jerome Y. Lettvin et. al.},
title = {How seen movement appears in the frog's optic nerve},
journal = {Federation Proceedings},
year = {1959},
month = {march},
volume = {18},
number = {1},
pages = {393 and 354}
}
&book{WaxmanAxons,
editor = {Stephen G. Waxman},
title = {Physiology and Pathobiology of Axons},
isbn = {ISBN 0-89004-215-2}
}
|box up
|some text
&references;
*/});
splitwindow.pane.South.id = 'local'
splitwindow.pane.South.markup = bodyS;
//_____________________________________________________________________________
function renderIf(condition, text) {
if (condition) return window.markdown(text);
else return '<pre>' + text + '</pre>';
}
//_____________________________________________________________________________
function render() {
var renderN = splitwindow.pane.North.render;
var renderS = splitwindow.pane.South.render;
console.log('render: ' + renderN + '/' + renderS)
splitwindow.pane.North.body = renderIf(renderN, bodyN);
splitwindow.pane.South.body = renderIf(renderS, bodyS);
}
//_____________________________________________________________________________
var keyState = {
Shift:false,
Down: function(e) {
var name = keyMap[e.keyCode];
if (name == "SHIFT") keyState.Shift = true;
else if (keyState.Shift == true) {
if (name == "DOWN") {
var renderp = splitwindow.pane.South.render;
splitwindow.getScroll(renderp, 'paneS');
splitwindow.pane.South.render = !renderp;
render();
splitwindow.resize();
}
else if (name == "UP") {
var renderp = splitwindow.pane.North.render;
splitwindow.getScroll(renderp, 'paneN');
splitwindow.pane.North.render = !renderp;
render();
splitwindow.resize();
}
}
else if (name == "F1") {
alert(splitwindow.HERE(function() {/*
Use:
<Shift><Up> to toggle North wiki/view
<Shift><Down> to toggle South wiki/view
*/}));
}
},
Up: function(e) {
var name = keyMap[e.keyCode];
if (name == "SHIFT") keyState.Shift = false;
},
};
//_____________________________________________________________________________
//splitwindow.init(data);
render();
//_____________________________________________________________________________
</script>
</head>
<body
onLoad ="splitwindow.resize()"
onkeydown="keyState.Down(event)"
onkeyup ="keyState.Up (event)"
id="splitwindow">
<article id="paneN"></article>
<article id="paneS"></article>
</body>
</html>