Use injectScript in certSelect

This commit is contained in:
shortcutme 2018-11-26 00:07:08 +01:00
parent cbefc5b81e
commit 316cd7710f
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -804,24 +804,22 @@ class UiWebsocket(object):
body += "<div style='background-color: #F7F7F7; margin-right: -30px'>"
for domain in more_domains:
body += _(u"""
<a href='/{domain}' onclick='zeroframe.certSelectGotoSite(this)' class='select'>
<a href='/{domain}' target='_top' class='select'>
<small style='float: right; margin-right: 40px; margin-top: -1px'>{_[Register]} &raquo;</small>{domain}
</a>
""")
body += "</div>"
body += """
<script>
script = """
$(".notification .select.cert").on("click", function() {
$(".notification .select").removeClass('active')
zeroframe.response(%s, this.title)
return false
})
</script>
""" % self.next_message_id
# Send the notification
self.cmd("notification", ["ask", body], lambda domain: self.actionCertSet(to, domain))
self.cmd("injectScript", script)
# - Admin actions -