root/lang/javascript/vimperator-plugins/trunk/twittperator/reply-popup-alert.tw @ 38526

Revision 38261, 0.9 kB (checked in by anekos, 3 years ago)

設定変数名を変更

  • Property svn:executable set to *
Line 
1/*
2 * Please write the below line into .vimperatorrc.
3 * let g:twittperator_plugin_reply_popup_alert = 1
4 * let g:twittperator_screen_name = "<YOUR_SCREEN_NAME>"
5 */
6
7(function () {
8  let screenName = liberator.globalVariables.twittperator_screen_name;
9
10  function popupAlert (iconPath, title, text, buttonEnabled, a, b) {
11    const ALERT_SVC =
12      Components.classes["@mozilla.org/alerts-service;1"].
13        getService(Components.interfaces.nsIAlertsService);
14    ALERT_SVC.showAlertNotification.apply(ALERT_SVC, arguments);
15  }
16
17  function simplePopupAlert (title, text, icon) {
18    return popupAlert(icon, title, text, false, null, null);
19  }
20
21  plugins.twittperator.ChirpUserStream.addListener(
22    function onMsg (msg, raw) {
23      if (msg.text && msg.user && msg.in_reply_to_screen_name === screenName)
24        simplePopupAlert(msg.user.screen_name, msg.text, msg.user.profile_image_url);
25    }
26  );
27})();
28
29// vim: sw=2 ts=2 et fdm=marker ft=javascript:
Note: See TracBrowser for help on using the browser.