mirror of
https://github.com/zulip/zulip.git
synced 2025-11-19 14:08:23 +00:00
Tweak desktop app JS to support Cocoa WebScript
(imported from commit 6b0c3442f92cffedbd210530479a13d4af5ea266)
This commit is contained in:
@@ -5,6 +5,9 @@ var globals =
|
|||||||
// Third-party libraries
|
// Third-party libraries
|
||||||
' $ jQuery Spinner Handlebars XDate zxcvbn Intl mixpanel'
|
' $ jQuery Spinner Handlebars XDate zxcvbn Intl mixpanel'
|
||||||
|
|
||||||
|
// Cocoa<-> Javascript bridge
|
||||||
|
+ ' bridge'
|
||||||
|
|
||||||
// index.html
|
// index.html
|
||||||
+ ' page_params'
|
+ ' page_params'
|
||||||
|
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ function process_desktop_notification(message) {
|
|||||||
notification_object.show();
|
notification_object.show();
|
||||||
} else {
|
} else {
|
||||||
// Shunt the message along to the desktop client
|
// 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;
|
return exports;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|||||||
Reference in New Issue
Block a user