diff --git a/tools/jslint/check-all.js b/tools/jslint/check-all.js index a3d3c903e2..a882c17326 100644 --- a/tools/jslint/check-all.js +++ b/tools/jslint/check-all.js @@ -5,6 +5,9 @@ var globals = // Third-party libraries ' $ jQuery Spinner Handlebars XDate zxcvbn Intl mixpanel' + // Cocoa<-> Javascript bridge + + ' bridge' + // index.html + ' page_params' diff --git a/zephyr/static/js/notifications.js b/zephyr/static/js/notifications.js index c0a6c21ec7..10cc20c642 100644 --- a/zephyr/static/js/notifications.js +++ b/zephyr/static/js/notifications.js @@ -182,7 +182,7 @@ function process_desktop_notification(message) { notification_object.show(); } else { // Shunt the message along to the desktop client - window.bridge.desktopNotification({title: title, content: content}); + window.bridge.desktopNotification(title, content); } } @@ -232,6 +232,14 @@ exports.received_messages = function (messages) { }); }; +$(function () { + // Shim for Cocoa WebScript exporting top-level JS + // objects instead of window.foo objects + if (typeof(bridge) !== 'undefined' && window.bridge === undefined) { + window.bridge = bridge; + } +}); + return exports; }());