Compare commits
No commits in common. "fb27b4c46aeb289619db731599cfe06d00733d36" and "b3470dce7b4e6983cd04b65c13805453d8ee5966" have entirely different histories.
fb27b4c46a
...
b3470dce7b
|
|
@ -316,11 +316,6 @@ class PushPull(WebSocketHandler):
|
||||||
for socket in websockets:
|
for socket in websockets:
|
||||||
socket.write_message({"course" : content})
|
socket.write_message({"course" : content})
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def update_scroll(cls, content):
|
|
||||||
for socket in websockets:
|
|
||||||
socket.write_message({"scroll" : content[0]/float(content[1])})
|
|
||||||
|
|
||||||
def open(self):
|
def open(self):
|
||||||
if self not in websockets:
|
if self not in websockets:
|
||||||
websockets.append(self)
|
websockets.append(self)
|
||||||
|
|
@ -397,6 +392,5 @@ async def main(base_path):
|
||||||
Publisher.subscribe("PushPull", "title", PushPull.update_title)
|
Publisher.subscribe("PushPull", "title", PushPull.update_title)
|
||||||
Publisher.subscribe("PushPull", "course", PushPull.update_course)
|
Publisher.subscribe("PushPull", "course", PushPull.update_course)
|
||||||
Publisher.subscribe("PushPull", "date", PushPull.update_date)
|
Publisher.subscribe("PushPull", "date", PushPull.update_date)
|
||||||
Publisher.subscribe("PushPull", "scroll", PushPull.update_scroll)
|
|
||||||
application.listen(8888)
|
application.listen(8888)
|
||||||
await asyncio.Event().wait()
|
await asyncio.Event().wait()
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
type Set
|
type Set
|
||||||
|
|
||||||
predicate SubSet(Set s1, Set s2)
|
predicate SubSet(Set s1, Set s2)
|
||||||
predicate Disjoint(Set s1, Set s2)
|
|
||||||
predicate Union(Set s1, Set s2)
|
|
||||||
|
|
|
||||||
|
|
@ -1,37 +1,17 @@
|
||||||
canvas {
|
canvas {
|
||||||
width = 500
|
width = 100
|
||||||
height = 500
|
height = 100
|
||||||
}
|
}
|
||||||
|
|
||||||
forall Set A; Set B
|
forall Set A; Set B
|
||||||
where SubSet(A, B) {
|
where SubSet(A, B) {
|
||||||
ensure disjoint(B.text, A.icon, 10.0)
|
|
||||||
ensure contains(A.icon, B.icon, 5.0)
|
ensure contains(A.icon, B.icon, 5.0)
|
||||||
layer A.icon above B.icon
|
A.icon above B.icon
|
||||||
}
|
|
||||||
|
|
||||||
forall Set A; Set B
|
|
||||||
where Disjoint(A, B) {
|
|
||||||
ensure disjoint(A.icon, B.icon)
|
|
||||||
}
|
|
||||||
|
|
||||||
forall Set A; Set B
|
|
||||||
where Union(A,B) {
|
|
||||||
ensure overlapping(A.icon, B.icon)
|
|
||||||
ensure disjoint(A.text, B.icon)
|
|
||||||
ensure disjoint(B.text, A.icon)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
forall Set x {
|
forall Set x {
|
||||||
shape x.icon = Circle {
|
x.icon = Circle {
|
||||||
strokeWidth : 0.0
|
strokeWidth : 0.0
|
||||||
}
|
}
|
||||||
shape x.text = Equation {
|
ensure x.icon.r > 25
|
||||||
string : x.label
|
|
||||||
fontSize : "32px"
|
|
||||||
}
|
|
||||||
ensure contains(x.icon, x.text)
|
|
||||||
encourage norm(x.text.center - x.icon.center) == 0
|
|
||||||
layer x.text above x.icon
|
|
||||||
ensure x.icon.r > 25.0
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
~/.local/bin/pex ./Server/ -o MarkdownPreviewer.pex -e MarkdownPreviewer:launcher -r ./Server/requirements.txt
|
|
||||||
|
|
@ -80,7 +80,7 @@ function module.setup()
|
||||||
local base_location = cwd:gsub("lua/MarkdownPreviewer", "")
|
local base_location = cwd:gsub("lua/MarkdownPreviewer", "")
|
||||||
|
|
||||||
o.cmd = {
|
o.cmd = {
|
||||||
base_location .. "MarkdownPreviewer.pex",
|
base_location .. "Server/test.pex",
|
||||||
"--base",
|
"--base",
|
||||||
base_location
|
base_location
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ function module.open()
|
||||||
group = augroup,
|
group = augroup,
|
||||||
buffer = bufnr,
|
buffer = bufnr,
|
||||||
callback = function()
|
callback = function()
|
||||||
server_connection:scroll({vim.fn.line('.'), vim.fn.line('$')})
|
server_connection:scroll(vim.fn.line('.'))
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,13 +77,6 @@
|
||||||
Object.entries(data).forEach(([k,v]) => {
|
Object.entries(data).forEach(([k,v]) => {
|
||||||
console.log(k,v);
|
console.log(k,v);
|
||||||
switch (k) {
|
switch (k) {
|
||||||
case "scroll":
|
|
||||||
var height = window.innerHeight
|
|
||||||
|| document.documentElement.clientHeight
|
|
||||||
|| document.body.clientHeight;
|
|
||||||
|
|
||||||
window.scrollTo({left : 0, top: height * v, behavior: 'smooth'});
|
|
||||||
break;
|
|
||||||
case "show":
|
case "show":
|
||||||
change_body(v)
|
change_body(v)
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user