Close #187
This commit is contained in:
parent
6d4da42eb2
commit
93589e80ef
@ -4924,7 +4924,7 @@
|
||||
}
|
||||
if (QR.captcha.isEnabled && /captcha|verification/i.test(el.textContent)) {
|
||||
QR.captcha.nodes.input.focus();
|
||||
if (Conf['Captcha Warning Notifications']) {
|
||||
if (Conf['Captcha Warning Notifications'] && !d.hidden) {
|
||||
QR.notify(el);
|
||||
} else {
|
||||
$.addClass(QR.captcha.nodes.input, 'error');
|
||||
@ -4942,17 +4942,17 @@
|
||||
notify: function(el) {
|
||||
var notice, notif;
|
||||
notice = new Notice('warning', el);
|
||||
QR.notifications.push(notice);
|
||||
if (!Header.areNotificationsEnabled) {
|
||||
return;
|
||||
if (!(Header.areNotificationsEnabled && d.hidden)) {
|
||||
return QR.notifications.push(notice);
|
||||
} else {
|
||||
notif = new Notification(el.textContent, {
|
||||
body: el.textContent,
|
||||
icon: Favicon.logo
|
||||
});
|
||||
return notif.onclick = function() {
|
||||
return window.focus();
|
||||
};
|
||||
}
|
||||
notif = new Notification(el.textContent, {
|
||||
body: el.textContent,
|
||||
icon: Favicon.logo
|
||||
});
|
||||
return notif.onclick = function() {
|
||||
return window.focus();
|
||||
};
|
||||
},
|
||||
notifications: [],
|
||||
cleanNotifications: function() {
|
||||
|
||||
@ -4927,7 +4927,7 @@
|
||||
}
|
||||
if (QR.captcha.isEnabled && /captcha|verification/i.test(el.textContent)) {
|
||||
QR.captcha.nodes.input.focus();
|
||||
if (Conf['Captcha Warning Notifications']) {
|
||||
if (Conf['Captcha Warning Notifications'] && !d.hidden) {
|
||||
QR.notify(el);
|
||||
} else {
|
||||
$.addClass(QR.captcha.nodes.input, 'error');
|
||||
@ -4945,26 +4945,26 @@
|
||||
notify: function(el) {
|
||||
var notice, notif;
|
||||
notice = new Notice('warning', el);
|
||||
QR.notifications.push(notice);
|
||||
if (!Header.areNotificationsEnabled) {
|
||||
return;
|
||||
if (!(Header.areNotificationsEnabled && d.hidden)) {
|
||||
return QR.notifications.push(notice);
|
||||
} else {
|
||||
notif = new Notification(el.textContent, {
|
||||
body: el.textContent,
|
||||
icon: Favicon.logo
|
||||
});
|
||||
notif.onclick = function() {
|
||||
return window.focus();
|
||||
};
|
||||
notif.onclose = function() {
|
||||
return notice.close();
|
||||
};
|
||||
return notif.onshow = function() {
|
||||
return setTimeout(function() {
|
||||
notif.onclose = null;
|
||||
return notif.close();
|
||||
}, 7 * $.SECOND);
|
||||
};
|
||||
}
|
||||
notif = new Notification(el.textContent, {
|
||||
body: el.textContent,
|
||||
icon: Favicon.logo
|
||||
});
|
||||
notif.onclick = function() {
|
||||
return window.focus();
|
||||
};
|
||||
notif.onclose = function() {
|
||||
return notice.close();
|
||||
};
|
||||
return notif.onshow = function() {
|
||||
return setTimeout(function() {
|
||||
notif.onclose = null;
|
||||
return notif.close();
|
||||
}, 7 * $.SECOND);
|
||||
};
|
||||
},
|
||||
notifications: [],
|
||||
cleanNotifications: function() {
|
||||
|
||||
@ -141,7 +141,7 @@ QR =
|
||||
if QR.captcha.isEnabled and /captcha|verification/i.test el.textContent
|
||||
# Focus the captcha input on captcha error.
|
||||
QR.captcha.nodes.input.focus()
|
||||
if Conf['Captcha Warning Notifications']
|
||||
if Conf['Captcha Warning Notifications'] and !d.hidden
|
||||
QR.notify el
|
||||
else
|
||||
$.addClass QR.captcha.nodes.input, 'error'
|
||||
@ -153,22 +153,23 @@ QR =
|
||||
|
||||
notify: (el) ->
|
||||
notice = new Notice 'warning', el
|
||||
QR.notifications.push notice
|
||||
return unless Header.areNotificationsEnabled
|
||||
notif = new Notification el.textContent,
|
||||
body: el.textContent
|
||||
icon: Favicon.logo
|
||||
notif.onclick = -> window.focus()
|
||||
<% if (type === 'crx') { %>
|
||||
# Firefox automatically closes notifications
|
||||
# so we can't control the onclose properly.
|
||||
notif.onclose = -> notice.close()
|
||||
notif.onshow = ->
|
||||
setTimeout ->
|
||||
notif.onclose = null
|
||||
notif.close()
|
||||
, 7 * $.SECOND
|
||||
<% } %>
|
||||
unless Header.areNotificationsEnabled and d.hidden
|
||||
QR.notifications.push notice
|
||||
else
|
||||
notif = new Notification el.textContent,
|
||||
body: el.textContent
|
||||
icon: Favicon.logo
|
||||
notif.onclick = -> window.focus()
|
||||
<% if (type === 'crx') { %>
|
||||
# Firefox automatically closes notifications
|
||||
# so we can't control the onclose properly.
|
||||
notif.onclose = -> notice.close()
|
||||
notif.onshow = ->
|
||||
setTimeout ->
|
||||
notif.onclose = null
|
||||
notif.close()
|
||||
, 7 * $.SECOND
|
||||
<% } %>
|
||||
|
||||
notifications: []
|
||||
cleanNotifications: ->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user