projects
/
kiosk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2b9b0b7
)
More fuckery with indented sublists in gkeep and with the countdown line.
author
Scott Gasch
<
[email protected]
>
Wed, 15 Jul 2020 05:18:02 +0000
(22:18 -0700)
committer
Scott Gasch
<
[email protected]
>
Wed, 15 Jul 2020 05:18:02 +0000
(22:18 -0700)
gkeep_renderer.py
patch
|
blob
|
history
kiosk.py
patch
|
blob
|
history
diff --git
a/gkeep_renderer.py
b/gkeep_renderer.py
index bad6830e09b85247e333846f8357e6d8f4593251..f8313bd64f239a49b6ca741b0af7b88090a46e56 100644
(file)
--- a/
gkeep_renderer.py
+++ b/
gkeep_renderer.py
@@
-52,7
+52,7
@@
class gkeep_renderer(renderer.debuggable_abstaining_renderer):
self.debug_print("Note title '%s'" % title)
if contents != '' and not contents.isspace():
contents = strikethrough.sub('', contents)
self.debug_print("Note title '%s'" % title)
if contents != '' and not contents.isspace():
contents = strikethrough.sub('', contents)
- contents = contents.replace(u'\u2610',
+ contents = contents.replace(u'\u2610
',
u'<LI><INPUT TYPE="checkbox"> ')
#self.debug_print("Note contents:\n%s" % contents)
u'<LI><INPUT TYPE="checkbox"> ')
#self.debug_print("Note contents:\n%s" % contents)
@@
-61,7
+61,6
@@
class gkeep_renderer(renderer.debuggable_abstaining_renderer):
individual_lines = contents.split("\n")
num_lines = len(individual_lines)
max_length = 0
individual_lines = contents.split("\n")
num_lines = len(individual_lines)
max_length = 0
- indent = 0
contents = ""
for x in individual_lines:
length = len(x)
contents = ""
for x in individual_lines:
length = len(x)
@@
-69,12
+68,12
@@
class gkeep_renderer(renderer.debuggable_abstaining_renderer):
max_length = length
spaces = len(x) - len(x.lstrip(' '))
spaces /= 2
max_length = length
spaces = len(x) - len(x.lstrip(' '))
spaces /= 2
+ spaces = int(spaces)
x = x.lstrip(' ')
x = x.lstrip(' ')
-
if spaces > indent
:
+
for y in range(0, spaces)
:
x = "<UL>" + x
x = "<UL>" + x
- elif spaces < indent:
- x = "</UL>" + x
- indent = spaces
+ for y in range(0, spaces):
+ x = x + "</UL>"
contents = contents + x + "\n"
individual_lines = contents.split("\n")
contents = contents + x + "\n"
individual_lines = contents.split("\n")
@@
-97,7
+96,7
@@
class gkeep_renderer(renderer.debuggable_abstaining_renderer):
(num_lines, max_length))
f.write("<TABLE BORDER=0 WIDTH=100%%><TR valign=\"top\">")
f.write("<TD WIDTH=50%% style=\"color:#eeeeee; font-size:large\">\n")
(num_lines, max_length))
f.write("<TABLE BORDER=0 WIDTH=100%%><TR valign=\"top\">")
f.write("<TD WIDTH=50%% style=\"color:#eeeeee; font-size:large\">\n")
- f.write("<FONT><UL>")
+ f.write("<FONT><UL
STYLE='list-style-type:none'
>")
count = 0
for x in individual_lines:
f.write(x + "\n")
count = 0
for x in individual_lines:
f.write(x + "\n")
@@
-105,7
+104,7
@@
class gkeep_renderer(renderer.debuggable_abstaining_renderer):
if count == num_lines / 2:
f.write("</UL></FONT></TD>\n")
f.write("<TD WIDTH=50%% style=\"color:#eeeeee; font-size:large\">\n")
if count == num_lines / 2:
f.write("</UL></FONT></TD>\n")
f.write("<TD WIDTH=50%% style=\"color:#eeeeee; font-size:large\">\n")
- f.write("<FONT><UL>")
+ f.write("<FONT><UL
STYLE='list-style-type:none'
>")
f.write("</UL></FONT></TD></TR></TABLE></DIV>\n");
else:
self.debug_print("%d lines (max=%d chars): one column" %
f.write("</UL></FONT></TD></TR></TABLE></DIV>\n");
else:
self.debug_print("%d lines (max=%d chars): one column" %
@@
-123,5
+122,5
@@
class gkeep_renderer(renderer.debuggable_abstaining_renderer):
return True
# Test
return True
# Test
-
#
x = gkeep_renderer({"Test", 1234})
-
#
x.periodic_render("Test")
+x = gkeep_renderer({"Test", 1234})
+x.periodic_render("Test")
diff --git
a/kiosk.py
b/kiosk.py
index fd509101804bf41312d77eccc01ea99b91500bc6..6003165a674e1f2ed76f18f8ffe8812f7c67b6e5 100755
(executable)
--- a/
kiosk.py
+++ b/
kiosk.py
@@
-191,11
+191,11
@@
def emit_wrapped(f, filename):
if (remainingMs > 0) {
var hr = document.getElementById("countdown");
var width = (remainingMs / (totalMs - 5000)) * 100.0;
if (remainingMs > 0) {
var hr = document.getElementById("countdown");
var width = (remainingMs / (totalMs - 5000)) * 100.0;
- if (width > 100) {
- width = 100;
+ if (width <= 100) {
+ hr.style.visibility = "visible";
+ hr.style.width = " ".concat(width, "%%");
+ hr.style.backgroundColor = "maroon";
}
}
- hr.style.width = " ".concat(width, "%%");
- hr.style.backgroundColor = "maroon";
} else {
// Reload unconditionally after 22 sec.
window.location.reload();
} else {
// Reload unconditionally after 22 sec.
window.location.reload();
@@
-256,11
+256,11
@@
def emit_wrapped(f, filename):
</P>
<HR id="countdown" STYLE="width:0px;
text-align:left;
</P>
<HR id="countdown" STYLE="width:0px;
text-align:left;
+ margin:0;
border:none;
border:none;
- margin-top:0;
- margin-left:0;
- margin-bottom:2px;
+ border-width:0;
height:5px;
height:5px;
+ visibility:hidden;
background-color:#ffffff;">
</TD>
</TR>
background-color:#ffffff;">
</TD>
</TR>