Bug Fixes

This commit is contained in:
Tim Bentley 2010-08-21 11:07:59 +01:00
parent 3698f4abd9
commit 06901951a6
3 changed files with 23 additions and 6 deletions

View File

@ -176,8 +176,8 @@ body {
return text.clientHeight;
}
function show_footer(text){
document.getElementById('footer').innerHTML(text);
function show_footer(footertext){
document.getElementById('footer').innerHTML(footertext);
}
function show_text(newtext){
@ -314,6 +314,7 @@ def build_html(item, screen, alert):
build_lyrics(item),
u'true' if theme and theme.display_slideTransition else u'false',
image)
print html
return html
def build_lyrics(item):

View File

@ -91,6 +91,22 @@ class RenderManager(object):
u'start html':u'<font color=green>', \
u'end tag':u'{/g}', u'end html':u'</font>', \
u'protected':False})
self.html_expands.append({u'desc':u'Pink', u'start tag':u'{pk}', \
u'start html':u'<font color=#CC33CC>', \
u'end tag':u'{/pk}', u'end html':u'</font>', \
u'protected':False})
self.html_expands.append({u'desc':u'Orange', u'start tag':u'{o}', \
u'start html':u'<font color=#CC0033>', \
u'end tag':u'{/o}', u'end html':u'</font>', \
u'protected':False})
self.html_expands.append({u'desc':u'Purple', u'start tag':u'{pp}', \
u'start html':u'<font color=#9900FF>', \
u'end tag':u'{/pp}', u'end html':u'</font>', \
u'protected':False})
self.html_expands.append({u'desc':u'White', u'start tag':u'{w}', \
u'start html':u'<font color=white>', \
u'end tag':u'{/w}', u'end html':u'</font>', \
u'protected':False})
self.html_expands.append({u'desc':u'Superscript', u'start tag':u'{su}', \
u'start html':u'<sup>', \
u'end tag':u'{/su}', u'end html':u'</sup>', \
@ -243,8 +259,8 @@ class RenderManager(object):
serviceItem.theme = themedata
serviceItem.add_from_text(u'', verse, footer)
serviceItem.render_manager = self
serviceItem.render(True)
serviceItem.raw_footer = footer
serviceItem.render(True)
self.display.buildHtml(serviceItem)
frame, raw_html = serviceItem.get_rendered_frame(0)
preview = self.display.text(raw_html)

View File

@ -178,7 +178,7 @@ class MainDisplay(DisplayWidget):
or not self.isVisible():
shrink = True
else:
shrink = False
shrink = False
js = u'show_alert("%s", "%s")' % (
text.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"'),
u'top' if shrink else u'')
@ -315,13 +315,13 @@ class MainDisplay(DisplayWidget):
self.serviceItem = serviceItem
html = build_html(self.serviceItem, self.screen, self.parent.alertTab)
self.webView.setHtml(html)
if serviceItem.footer and serviceItem.foot_text:
if serviceItem.foot_text and serviceItem.foot_text:
self.footer(serviceItem.foot_text)
def footer(self, text):
log.debug(u'footer')
js = "show_footer('" + \
text.replace("\\", "\\\\").replace("\'", "\\\'") + "')"
text.replace("\\", "\\\\").replace("\'", "\\\'") + "')"
self.frame.evaluateJavaScript(js)
def hideDisplay(self, mode=HideMode.Screen):