aboutsummaryrefslogtreecommitdiffstats
path: root/helpDialog.html
blob: 7bd08829ce8c84acc315557df8e152e7f5b44ceb (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!--
  This is shown when typing "?". This HTML is loaded by the background page and then populated with the
  latest keybindings information before displaying.
-->
  <!-- Note that the template placeholders (e.g. "pageNavigation") will be filled in by the background
       page with the up-to-date key bindings when the dialog is shown. -->
  <div id="vimiumHelpDialog" class="vimiumReset">
  <a class="vimiumReset optionsPage" href="#">Options</a>
  <a class="vimiumReset closeButton" href="#">x</a>
  <div id="vimiumTitle" class="vimiumReset"><span class="vimiumReset" style="color:#2f508e">Vim</span>ium {{title}}</div>
  <div class="vimiumReset vimiumColumn">
    <table class="vimiumReset">
      <tbody class="vimiumReset">
      <tr class="vimiumReset" ><td class="vimiumReset"></td><td class="vimiumReset" ></td><td class="vimiumReset vimiumHelpSectionTitle">Navigating the page</td></tr>
      {{pageNavigation}}
      </tbody>
    </table>
  </div>
  <div class="vimiumReset vimiumColumn">
    <table class="vimiumReset" >
      <tbody class="vimiumReset">
      <tr class="vimiumReset" ><td class="vimiumReset" ></td><td class="vimiumReset" ></td><td class="vimiumReset vimiumHelpSectionTitle">Using find</td></tr>
      {{findCommands}}
      <tr class="vimiumReset" ><td class="vimiumReset" ></td><td class="vimiumReset" ></td><td class="vimiumReset vimiumHelpSectionTitle">Navigating history</td></tr>
      {{historyNavigation}}
      <tr class="vimiumReset" ><td class="vimiumReset" ></td><td class="vimiumReset" ></td><td class="vimiumReset vimiumHelpSectionTitle">Manipulating tabs</td></tr>
      {{tabManipulation}}
      <tr class="vimiumReset" ><td class="vimiumReset" ></td><td class="vimiumReset" ></td><td class="vimiumReset vimiumHelpSectionTitle">Miscellaneous</td></tr>
      {{misc}}
      </tbody>
    </table>
  </div>

  <br clear="both"/>
  <div class="vimiumReset vimiumDivider"></div>

  <div id="vimiumHelpDialogFooter" class="vimiumReset">
    <a href="#" class="vimiumReset toggleAdvancedCommands">Show advanced commands</a>

    <div class="vimiumReset vimiumColumn">
      Enjoying Vimium?
      <a class="vimiumReset" href="https://chrome.google.com/extensions/detail/dbepggeogbaibhgnhhndojpepiihcmeb">Leave us
          feedback</a>.<br/>
      Found a bug? <a class="vimiumReset" href="http://github.com/philc/vimium/issues">Report it here</a>.
    </div>
    <div class="vimiumReset vimiumColumn" style="text-align:right">
      <span class="vimiumReset">Version {{version}}</span><br/>
    </div>
  </div>

  <script>
    VimiumHelpDialog = {
      // This setting is pulled out of local storage. It's false by default.
      advancedCommandsVisible: {{showAdvancedCommands}},

      init: function() {
        this.dialogElement = document.getElementById("vimiumHelpDialog");
        this.dialogElement.getElementsByClassName("toggleAdvancedCommands")[0].addEventListener("click", 
          VimiumHelpDialog.toggleAdvancedCommands, false);
        this.dialogElement.style.maxHeight = window.innerHeight - 80;
        this.showAdvancedCommands(this.advancedCommandsVisible);
      },

      /*
       * Advanced commands are hidden by default so they don't overwhelm new and casual users.
       */
      toggleAdvancedCommands: function(event) {
        event.preventDefault();
        VimiumHelpDialog.advancedCommandsVisible = !VimiumHelpDialog.advancedCommandsVisible;
        chrome.extension.sendRequest({ handler: "saveHelpDialogSettings",
            showAdvancedCommands: VimiumHelpDialog.advancedCommandsVisible });
        VimiumHelpDialog.showAdvancedCommands(VimiumHelpDialog.advancedCommandsVisible);
      },

      showAdvancedCommands: function(visible) {
        VimiumHelpDialog.dialogElement.getElementsByClassName("toggleAdvancedCommands")[0].innerHTML =
            visible ? "Hide advanced commands" : "Show advanced commands";
        var advanced = VimiumHelpDialog.dialogElement.getElementsByClassName("advanced");
        for (var i = 0; i < advanced.length; i++)
          advanced[i].style.display = (visible ? "table-row" : "none");
      }
    };

    VimiumHelpDialog.init();
  </script>
</div>