summaryrefslogtreecommitdiffstats
path: root/comm/suite/mailnews/components/calendar/content/suite-overlay-addons.xhtml
blob: c1ccec4917601563c160a709b6b1e55a25494bdb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?xml version="1.0"?>

<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this file,
   - You can obtain one at http://mozilla.org/MPL/2.0/.  -->

<overlay id="suiteAddonsOverlay"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml">

  <script><![CDATA[
    var lightningPrefs = {
      guid: "{e2fda1a4-762b-4020-b5ad-a41df1933103}",
      handleEvent: function(aEvent) {
        var item = gListView.getListItemForID(this.guid);
        if (!item)
          return;

        item.showPreferences = this.showPreferences;
      },
      showPreferences: function() {
        var win = Services.wm.getMostRecentWindow("mozilla:preferences");
        if (win) {
          win.focus();
          var doc = win.document;
          var pane = doc.getElementById("paneLightning");
          doc.querySelector("dialog").syncTreeWithPane(pane, true);
        } else {
          openDialog("chrome://communicator/content/pref/preferences.xhtml",
                     "PrefWindow",
                     "non-private,chrome,titlebar,dialog=no,resizable",
                     "paneLightning");
        }
      },
    };

    window.addEventListener("ViewChanged", lightningPrefs, false);
  ]]></script>

</overlay>