0
|
1 <?xml version="1.0" encoding="UTF-8"?>
|
|
2 <overlay id="googleBookmarksIncsearchOverlay"
|
|
3 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
|
4 <commandset id="mainCommandSet">
|
|
5 <command id="googleBookmarksIncsearchCommand" oncommand="open_googleBookmarksIncsearch();"/>
|
|
6 </commandset>
|
|
7 <menupopup id="menu_ToolsPopup">
|
|
8 <menuitem id="googleBookmarksIncsearchMenuitem"
|
|
9 label="Google Bookmarks IncSearch"
|
|
10 insertbefore="sanitizeSeparator"
|
|
11 key="key_open_googleBookmarksIncsearch"
|
|
12 command="googleBookmarksIncsearchCommand" />
|
|
13 </menupopup>
|
|
14 <toolbarpalette id="BrowserToolbarPalette">
|
|
15 <toolbarbutton id="googleBookmarksIncsearchButton" class="toolbarbutton-1"
|
|
16 label="Google Bookmarks IncSearch" tooltiptext="Google Bookmarks IncSearch"
|
|
17 command="googleBookmarksIncsearchCommand" />
|
|
18 </toolbarpalette>
|
|
19 <keyset id="mainKeyset">
|
1
|
20 <key id="key_open_googleBookmarksIncsearch" modifiers="accel" key=":" command="googleBookmarksIncsearchCommand" />
|
0
|
21 </keyset>
|
|
22 <script type="application/x-javascript">
|
|
23 <![CDATA[
|
|
24 window.addEventListener('load', function() {
|
|
25
|
|
26 var openKey = document.getElementById('key_open_googleBookmarksIncsearch');
|
|
27
|
|
28 var prefSvc = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
|
|
29 var prefBranch = prefSvc.getBranch('extensions.googlebookmarks_incsearch.');
|
|
30
|
|
31 try {
|
|
32 var modifiers = prefBranch.getCharPref('shortcut.open.modifiers');
|
|
33 openKey.setAttribute('modifiers', modifiers);
|
|
34 } catch(e) {}
|
|
35
|
|
36 try {
|
|
37 var key = prefBranch.getCharPref('shortcut.open.key');
|
|
38 openKey.setAttribute('key', key);
|
|
39 } catch(e) {}
|
|
40
|
|
41 try {
|
|
42 if (prefBranch.getBoolPref('shortcut.open.disabled')) {
|
|
43 openKey.parentNode.removeChild(openKey);
|
|
44 }
|
|
45 } catch(e) {}
|
|
46
|
|
47 }, false);
|
|
48
|
|
49 var open_googleBookmarksIncsearch = function() {
|
|
50 var openUrl = 'chrome://googlebookmarks_incsearch/content/view.html';
|
|
51 var target = null;
|
|
52
|
|
53 var tabs = gBrowser.tabContainer.childNodes;
|
|
54
|
|
55 for (var i = 0, len = tabs.length; i < len; i++) {
|
|
56 if (tabs[i].linkedBrowser.currentURI.spec == openUrl) {
|
|
57 target = tabs[i];
|
|
58 break;
|
|
59 }
|
|
60 }
|
|
61
|
|
62 if (!target) {
|
|
63 gBrowser.selectedTab = gBrowser.addTab(openUrl);
|
|
64 } else {
|
|
65 gBrowser.selectedTab = target;
|
|
66 target.linkedBrowser.contentDocument.getElementById('text').focus();
|
|
67 }
|
|
68 }
|
|
69
|
|
70 ]]>
|
|
71 </script>
|
|
72
|
|
73 </overlay>
|