23
function getMessageCountElement() {
24
return document.getElementById('mercurymessagesCountValue');
27
function getNotificationCountElement() {
28
return document.getElementById('notificationsCountValue');
32
if (!getMessageCountElement()) {
33
reportTestState('FAILED: getMessageCountElement is null');
37
if (!getNotificationCountElement()) {
38
reportTestState('FAILED: getNotificationCountElement is null');
42
reportTestState('PASS SELF TEST');
23
45
function messagingIndicatorSetup() {
24
46
if (!isCorrectPage()) {
27
var countElement = document.getElementById('mercurymessagesCountValue');
28
var notificationElement = document.getElementById('notificationsCountValue');
49
var countElement = getMessageCountElement();
50
var notificationElement = getNotificationCountElement();
30
52
function checkMessangesCount() {
31
54
function makeCallback(node) {
32
55
return function () { launchClickEvent(node.parentNode); };
34
Unity.MessagingIndicator.showIndicator(_("Messages"), { count: countElement.textContent,
35
callback: makeCallback(countElement) });
36
Unity.MessagingIndicator.showIndicator(_("Notifications"), { count: notificationElement.textContent,
37
callback: makeCallback(notificationElement) });
57
indicators.push({ name: _("Messages"),
58
count: countElement.textContent,
59
callback: makeCallback(countElement) });
60
indicators.push({ name: _("Notifications"),
61
count: notificationElement.textContent,
62
callback: makeCallback(notificationElement) });
40
setInterval(checkMessangesCount, 1000);
41
checkMessangesCount();
65
var indicatorsController = new Indicators(checkMessangesCount);
43
67
if (document.location.hostname === 'apps.facebook.com') {
44
68
var name = document.evaluate('//div[@role="contentinfo"]/div/span', document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.textContent;
45
69
linkVisited(document.location.toString(), name);
49
75
if (document.getElementById('email')) {