Add prebuilt Firefox & Safari extensions

This commit is contained in:
Buu Nguyen 2014-05-13 23:27:02 -07:00
parent c485b144a3
commit 5f5529e75c
9 changed files with 17 additions and 19 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
node_modules node_modules
dist tmp

View File

@ -3,24 +3,24 @@ Chrome extension to display GitHub code in tree format. Useful for developers wh
* Easy-to-navigate code tree like IDEs * Easy-to-navigate code tree like IDEs
* Fast browsing with pjax * Fast browsing with pjax
* Work with both public and private repositories * Support private repositories (require [personal access token](#github-api-rate-limit))
## Install ## Install
* Download and install [Octotree](https://chrome.google.com/webstore/detail/octotree/bkhaagjahfmjljalopjnoealnfndnagc) from the Chrome store * Download and install [Octotree](https://chrome.google.com/webstore/detail/octotree/bkhaagjahfmjljalopjnoealnfndnagc) from the Chrome store
* Navigate to any GitHub project (or just refresh this page as an example) * Navigate to any GitHub project (or just refresh this page as an example)
* The code tree should show as follows: * The code tree should show as follows:
![When extension is active](https://raw.githubusercontent.com/buunguyen/octotree/master/docs/screen_ext.png) ![When extension is active](https://raw.githubusercontent.com/buunguyen/octotree/master/docs/chrome.png)
## GitHub API Rate Limit ## GitHub API Rate Limit
Octotree uses [GitHub API](https://developer.github.com/v3/) to retrieve repository metadata. By default, it makes unauthenticated requests to the GitHub API. However, there are two situations when requests must be authenticated: Octotree uses [GitHub API](https://developer.github.com/v3/) to retrieve repository metadata. By default, it makes unauthenticated requests to the GitHub API. However, there are two situations when requests must be authenticated:
* You are accessing a private repository * You access a private repository
* You exceed the [rate limit of unauthenticated requests](https://developer.github.com/v3/#rate-limiting) * You exceed the [rate limit of unauthenticated requests](https://developer.github.com/v3/#rate-limiting)
When that happens, Octotree will show the following screen to ask for your [GitHub personal access token](https://help.github.com/articles/creating-an-access-token-for-command-line-use). When that happens, Octotree will show the following screen to ask for your [GitHub personal access token](https://help.github.com/articles/creating-an-access-token-for-command-line-use).
![Enter personal access token](https://raw.githubusercontent.com/buunguyen/octotree/master/docs/screen_token.png) ![Enter personal access token](https://raw.githubusercontent.com/buunguyen/octotree/master/docs/token.png)
If you don't already have one, create one at [this page](https://github.com/settings/tokens/new). Then enter the generated token into the textbox and save. If you don't already have one, create one at [this page](https://github.com/settings/tokens/new). Then enter the generated token into the textbox and save.

BIN
dist/octotree.safariextz vendored Normal file

Binary file not shown.

BIN
dist/octotree.xpi vendored Normal file

Binary file not shown.

View File

Before

Width:  |  Height:  |  Size: 401 KiB

After

Width:  |  Height:  |  Size: 401 KiB

BIN
docs/firefox.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 957 KiB

View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -3,7 +3,6 @@ var gulp = require('gulp')
, es = require('event-stream') , es = require('event-stream')
, rseq = require('gulp-run-sequence') , rseq = require('gulp-run-sequence')
// helpers
function pipe(src, transforms, dest) { function pipe(src, transforms, dest) {
if (typeof transforms === 'string') { if (typeof transforms === 'string') {
dest = transforms dest = transforms
@ -17,33 +16,32 @@ function pipe(src, transforms, dest) {
return stream return stream
} }
// tasks
gulp.task('clean', function() { gulp.task('clean', function() {
return pipe('./dist', [clean()]) return pipe('./tmp', [clean()])
}) })
gulp.task('chrome', function() { gulp.task('chrome', function() {
return es.merge( return es.merge(
pipe('./src/lib/**/*', './dist/chrome/lib'), pipe('./src/lib/**/*', './tmp/chrome/lib'),
pipe('./src/icons/**/*', './dist/chrome/icons'), pipe('./src/icons/**/*', './tmp/chrome/icons'),
pipe(['./src/inject.js', './src/inject.css', './src/manifest.json'], './dist/chrome/') pipe(['./src/inject.js', './src/inject.css', './src/manifest.json'], './tmp/chrome/')
) )
}) })
gulp.task('safari', function() { gulp.task('safari', function() {
return es.merge( return es.merge(
pipe('./src/lib/**/*', './dist/safari/octotree.safariextension/lib'), pipe('./src/lib/**/*', './tmp/safari/octotree.safariextension/lib'),
pipe('./src/icons/**/*', './dist/safari/octotree.safariextension/icons'), pipe('./src/icons/**/*', './tmp/safari/octotree.safariextension/icons'),
pipe(['./src/inject.js', './src/inject.css', './src/Info.plist'], './dist/safari/octotree.safariextension/') pipe(['./src/inject.js', './src/inject.css', './src/Info.plist'], './tmp/safari/octotree.safariextension/')
) )
}) })
gulp.task('firefox', function() { gulp.task('firefox', function() {
return es.merge( return es.merge(
pipe('./src/lib/**/*', './dist/firefox/data/lib'), pipe('./src/lib/**/*', './tmp/firefox/data/lib'),
pipe('./src/icons/**/*', './dist/firefox/data/icons'), pipe('./src/icons/**/*', './tmp/firefox/data/icons'),
pipe(['./src/inject.js', './src/inject.css', './src/firefox.js'], './dist/firefox/data'), pipe(['./src/inject.js', './src/inject.css', './src/firefox.js'], './tmp/firefox/data'),
pipe('./src/package.json', './dist/firefox') pipe('./src/package.json', './tmp/firefox')
) )
}) })

View File

@ -11,6 +11,6 @@ pageMod.PageMod({
data.url('lib/js/github.js'), data.url('lib/js/github.js'),
data.url('inject.js')], data.url('inject.js')],
contentStyleFile: [data.url('lib/css/jstree.css'), contentStyleFile: [data.url('lib/css/jstree.css'),
data.url('inject.css'),], data.url('inject.css')],
contentScriptWhen: 'start' contentScriptWhen: 'start'
}) })