Tweak desktop app JS to support Cocoa WebScript

(imported from commit 6b0c3442f92cffedbd210530479a13d4af5ea266)
This commit is contained in:
Leo Franchi
2013-06-13 18:25:02 -04:00
parent 8678148ad1
commit 3fd7c44331
2 changed files with 12 additions and 1 deletions

View File

@@ -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;
}());