diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 8c4ba2eba..5e9077e2f 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -132,7 +132,9 @@ class MainDisplay(QtGui.QGraphicsView): self.screen[u'size'].width(), self.screen[u'size'].height()) self.page = self.webView.page() self.frame = self.page.mainFrame() - self.webView.settings().setAttribute(7, True) + if self.isLive and log.getEffectiveLevel() == logging.DEBUG: + self.webView.settings().setAttribute( + QtWebKit.QWebSettings.DeveloperExtrasEnabled, True) QtCore.QObject.connect(self.webView, QtCore.SIGNAL(u'loadFinished(bool)'), self.isWebLoaded) self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py index 057c1075f..461525a70 100644 --- a/openlp/plugins/alerts/alertsplugin.py +++ b/openlp/plugins/alerts/alertsplugin.py @@ -71,10 +71,9 @@ JAVASCRIPT = """ function update_css(align, font, size, color, bgcolor){ var text = document.getElementById('alert'); - alert("Hello"); - document.getElementById('alert').style.verticalalign = align; - text.style.fontfamily = font; - text.style.size = size; + text.style.verticalAlign = align; + text.style.fontSize = size + "pt"; + text.style.fontFamily = font; text.style.color = color; text.style.backgroundColor = bgcolor; } @@ -194,6 +193,6 @@ class AlertsPlugin(Plugin): def refreshCss(self, frame): align = VerticalType.Names[self.settings_tab.location] - frame.evaluateJavaScript(u'update_css("%s,%s,%s,%s,%s")' % (align, - self.settings_tab.font_face, self.settings_tab.font_size, + frame.evaluateJavaScript(u'update_css("%s", "%s", "%s", "%s", "%s")' % + (align, self.settings_tab.font_face, self.settings_tab.font_size, self.settings_tab.font_color, self.settings_tab.bg_color))