~djl/bookmark-keys

6ea3cb8897e0eb053ed4de7908367a8e6ec88404 — David Logie 9 years ago 692a137
Bookmark Keys.
6 files changed, 18 insertions(+), 23 deletions(-)

M Makefile
M README.markdown
M src/chrome.manifest
R src/chrome/content/{command_keys.js => bookmark_keys.js}
R src/chrome/content/{command_keys.xul => bookmark_keys.xul}
M src/install.rdf
M Makefile => Makefile +2 -7
@@ 1,11 1,6 @@
EXTENSION="`basename $(PWD)`"
VERSION=`grep "em:version" $(PWD)/src/install.rdf | sed -n -e 's/<.*>\(.*\)<\/.*>/\1/p' | sed 's/^[ \t]*//'`
FILENAME="$(EXTENSION)-$(VERSION).xpi"

help:
	@echo 'Commonly used make targets:'
	@echo '  build      Builds a complete XPI file from "src" dir'
	@echo '  release    Builds a complete XPI and sets up the symlink'
FILENAME="$(EXTENSION)_$(VERSION).xpi"

build:
	@echo "Building $(FILENAME)..."


@@ 13,4 8,4 @@ build:
	@mv "src/$(FILENAME)" .
	@echo "Done!"

.PHONY: help build
.PHONY: build

M README.markdown => README.markdown +3 -3
@@ 1,4 1,4 @@
Command Keys
------------
Bookmark Keys
-------------

Safari-style access to your bookmarks bar using command/control 1-9.
Access your bookmarks bar using cmd/ctrl 1-9.

M src/chrome.manifest => src/chrome.manifest +2 -2
@@ 1,2 1,2 @@
content command_keys chrome/content/
overlay chrome://browser/content/browser.xul chrome://command_keys/content/command_keys.xul
\ No newline at end of file
content bookmark_keys chrome/content/
overlay chrome://browser/content/browser.xul chrome://bookmark_keys/content/bookmark_keys.xul
\ No newline at end of file

R src/chrome/content/command_keys.js => src/chrome/content/bookmark_keys.js +5 -5
@@ 1,12 1,12 @@
var commandKeys = {
var bookmarkKeys = {
    init: function() {
        for (var i=0; i < 9; i++) {
            var tab = i + 1;
            var keyset = document.getElementById("mainKeyset");
            var key = document.createElement("key");
            key.setAttribute("id", "commandKeys_" + tab);
            key.setAttribute("id", "bookmarkKeys_" + tab);
            key.setAttribute("key", tab);
            key.setAttribute("oncommand", "commandKeys.go(" + i + ");");
            key.setAttribute("oncommand", "bookmarkKeys.go(" + i + ");");
            key.setAttribute("modifiers", "accel");
            keyset.appendChild(key);



@@ 44,11 44,11 @@ var commandKeys = {
    },

    go: function(i) {
        var node = commandKeys.getBookmark(i);
        var node = bookmarkKeys.getBookmark(i);
        if (node) {
            PlacesUIUtils._openNodeIn(node, "current", window);
        }
    }
}

window.addEventListener("load", commandKeys.init, false);
window.addEventListener("load", bookmarkKeys.init, false);

R src/chrome/content/command_keys.xul => src/chrome/content/bookmark_keys.xul +2 -2
@@ 1,4 1,4 @@
<?xml version="1.0"?>
<overlay id="command_keys" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
	<script type="application/x-javascript" src="chrome://command_keys/content/command_keys.js" />
</overlay>
\ No newline at end of file
	<script type="application/x-javascript" src="chrome://bookmark_keys/content/bookmark_keys.js" />
</overlay>

M src/install.rdf => src/install.rdf +4 -4
@@ 1,8 1,8 @@
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
    <Description about="urn:mozilla:install-manifest">
        <em:id>command-keys@djl.im</em:id>
        <em:version>2.3</em:version>
        <em:id>bookmark-keys@djl.firefox</em:id>
        <em:version>1.0</em:version>
        <em:type>2</em:type>
        <em:targetApplication>
            <Description>


@@ 11,8 11,8 @@
                <em:maxVersion>*</em:maxVersion>
            </Description>
        </em:targetApplication>
        <em:name>Command Keys</em:name>
        <em:description>Safari-style access to your bookmarks bar using command/control 1-9.</em:description>
        <em:name>Bookmark Keys</em:name>
        <em:description>Access your bookmarks bar using cmd/ctrl 1-9.</em:description>
        <em:creator>djl</em:creator>
    </Description>
</RDF>