This repository has been archived by the owner on Feb 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add bootstrap basics (after running jpm init and customizing its output
- Loading branch information
Showing
7 changed files
with
98 additions
and
78 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
var utils = require('sdk/window/utils'); | ||
|
||
var actions = [ | ||
{key: 'h', command: 'cmd_scrollLeft'}, | ||
{key: 'j', command: 'cmd_scrollLineDown'}, | ||
{key: 'k', command: 'cmd_scrollLineUp'}, | ||
{key: 'l', command: 'cmd_scrollRight'}, | ||
{key: 'g', command: 'cmd_scrollTop'}, | ||
{key: 'G', command: 'cmd_scrollBottom'} | ||
]; | ||
|
||
function currentAndFutureWindows(func) { | ||
var windows = require('sdk/windows').browserWindows, | ||
{ viewFor } = require("sdk/view/core"); | ||
for (let window of windows) { | ||
func(viewFor(window)); | ||
} | ||
windows.on('open', function(window) { | ||
func(viewFor(window)); | ||
}); | ||
} | ||
|
||
function onWindow(window) { | ||
window.gBrowser.addEventListener("keypress", function(event) { | ||
var action = actions.find(function(value) { | ||
return value.key == event.key; | ||
}); | ||
|
||
if (action) { | ||
runCommand(action.command); | ||
} | ||
}, false); | ||
} | ||
|
||
function runCommand(cmd) { | ||
var window = utils.getMostRecentBrowserWindow(); | ||
var controller = window.document.commandDispatcher.getControllerForCommand(cmd); | ||
controller.doCommand(cmd); | ||
} | ||
|
||
currentAndFutureWindows(onWindow); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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>[email protected]</em:id> | ||
<em:name>Vimkeys</em:name> | ||
<em:version>0.2.2</em:version> | ||
<em:creator>engeld</em:creator> | ||
<em:description>Adds vim keybindings.</em:description> | ||
<em:homepageURL>http://engeld.github.io/vimkeys/</em:homepageURL> | ||
<em:type>2</em:type> | ||
<em:targetApplication> | ||
<Description> | ||
<!-- the id below is the GUID of firefox --> | ||
<!-- see https://addons.mozilla.org/en-US/firefox/pages/appversions/ --> | ||
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> | ||
<em:minVersion>3.0</em:minVersion> | ||
<em:maxVersion>34.*</em:maxVersion> | ||
</Description> | ||
</em:targetApplication> | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<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>[email protected]</em:id> | ||
<em:name>vimkeys</em:name> | ||
<em:version>0.2.5</em:version> | ||
<em:creator>Dana Engel (engeld)</em:creator> | ||
<em:description>Adds vim keybindings.</em:description> | ||
<em:homepageURL>http://engeld.github.io/vimkeys/</em:homepageURL> | ||
<em:type>2</em:type> | ||
<em:bootstrap>true</em:bootstrap> | ||
<em:unpack>false</em:unpack> | ||
|
||
<em:targetApplication> | ||
<Description> | ||
<!-- the id below is the GUID of firefox --> | ||
<!-- see https://addons.mozilla.org/en-US/firefox/pages/appversions/ --> | ||
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> | ||
<em:minVersion>3.0</em:minVersion> | ||
<em:maxVersion>42.*</em:maxVersion> | ||
</Description> | ||
</em:targetApplication> | ||
</Description> | ||
</RDF> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"title": "vimkeys", | ||
"name": "vimkeys", | ||
"version": "0.2.3", | ||
"description": "Adds vim keybindings.", | ||
"main": "index.js", | ||
"author": "Dana Engel", | ||
"engines": { | ||
"firefox": ">=38.0a1", | ||
"fennec": ">=38.0a1" | ||
}, | ||
"license": "MIT", | ||
"keywords": [ | ||
"jetpack" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
var main = require("../"); | ||
|
||
exports["test main"] = function(assert) { | ||
assert.pass("Unit test running!"); | ||
}; | ||
|
||
exports["test main async"] = function(assert, done) { | ||
assert.pass("async Unit test running!"); | ||
done(); | ||
}; | ||
|
||
exports["test dummy"] = function(assert, done) { | ||
main.dummy("foo", function(text) { | ||
assert.ok((text === "foo"), "Is the text actually 'foo'"); | ||
done(); | ||
}); | ||
}; | ||
|
||
require("sdk/test").run(exports); |