-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
431 additions
and
0 deletions.
There are no files selected for viewing
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,3 @@ | ||
{ | ||
"presets": ["es2015"] | ||
} |
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,3 @@ | ||
{ | ||
"directory": "app/bower_components" | ||
} |
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,24 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
|
||
[*] | ||
|
||
# Change these settings to your own preference | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.json] | ||
indent_size = 2 | ||
|
||
# We recommend you to keep these unchanged | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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 @@ | ||
* text=auto |
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,10 @@ | ||
node_modules | ||
temp | ||
.tmp | ||
dist | ||
.sass-cache | ||
app/bower_components | ||
test/bower_components | ||
package | ||
app/scripts | ||
|
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,6 @@ | ||
{ | ||
"generator-mocha": { | ||
"ui": "bdd", | ||
"rjs": false | ||
} | ||
} |
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,10 @@ | ||
{ | ||
"appName": { | ||
"message": "Where am I?", | ||
"description": "The name of the application" | ||
}, | ||
"appDescription": { | ||
"message": "This extension appends a ribbon on top a locally served webpage", | ||
"description": "The description of the application" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,47 @@ | ||
{ | ||
"name": "__MSG_appName__", | ||
"version": "0.0.1", | ||
"manifest_version": 2, | ||
"description": "__MSG_appDescription__", | ||
"icons": { | ||
"16": "images/icon-16.png", | ||
"128": "images/icon-128.png" | ||
}, | ||
"default_locale": "en", | ||
"background": { | ||
"scripts": [ | ||
"scripts/chromereload.js", | ||
"scripts/background.js" | ||
] | ||
}, | ||
"permissions": [ | ||
"tabs", | ||
"http://*/*", | ||
"https://*/*" | ||
], | ||
"options_ui": { | ||
"page": "options.html", | ||
"chrome_style": true | ||
}, | ||
"content_scripts": [ | ||
{ | ||
"matches": [ | ||
"http://*/*", | ||
"https://*/*" | ||
], | ||
"js": [ | ||
"scripts/contentscript.js" | ||
], | ||
"run_at": "document_end", | ||
"all_frames": false | ||
} | ||
], | ||
"page_action": { | ||
"default_icon": { | ||
"19": "images/icon-19.png", | ||
"38": "images/icon-38.png" | ||
}, | ||
"default_title": "Where am I?", | ||
"default_popup": "popup.html" | ||
} | ||
} |
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,24 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<!-- build:css styles/options-vendor.css --> | ||
<!-- bower:css --> | ||
<!-- endbower --> | ||
<!-- endbuild --> | ||
<!-- build:css styles/main.css --> | ||
<link href="styles/main.css" rel="stylesheet"> | ||
<!-- endbuild --> | ||
</head> | ||
<body> | ||
<h1>'Allo, 'Allo!</h1> | ||
|
||
<!-- build:js scripts/options-vendor.js --> | ||
<!-- bower:js --> | ||
<!-- endbower --> | ||
<!-- endbuild --> | ||
|
||
<!-- build:js scripts/options.js --> | ||
<script src="scripts/options.js"></script> | ||
<!-- endbuild --> | ||
</body> | ||
</html> |
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,25 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<!-- build:css styles/popup-vendor.css --> | ||
<!-- bower:css --> | ||
<!-- endbower --> | ||
<!-- endbuild --> | ||
<!-- build:css styles/main.css --> | ||
<link href="styles/main.css" rel="stylesheet"> | ||
<!-- endbuild --> | ||
</head> | ||
<body> | ||
<h1>'Allo, 'Allo!</h1> | ||
|
||
<!-- build:js scripts/popup-vendor.js --> | ||
<!-- bower:js --> | ||
<!-- endbower --> | ||
<!-- endbuild --> | ||
|
||
<!-- build:js scripts/popup.js --> | ||
<script src="scripts/popup.js"></script> | ||
<!-- endbuild --> | ||
</body> | ||
</html> |
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,11 @@ | ||
'use strict'; | ||
|
||
chrome.runtime.onInstalled.addListener(details => { | ||
console.log('previousVersion', details.previousVersion); | ||
}); | ||
|
||
chrome.tabs.onUpdated.addListener(tabId => { | ||
chrome.pageAction.show(tabId); | ||
}); | ||
|
||
console.log('\'Allo \'Allo! Event Page for Page Action'); |
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,23 @@ | ||
'use strict'; | ||
|
||
// Reload client for Chrome Apps & Extensions. | ||
// The reload client has a compatibility with livereload. | ||
// WARNING: only supports reload command. | ||
|
||
const LIVERELOAD_HOST = 'localhost:'; | ||
const LIVERELOAD_PORT = 35729; | ||
const connection = new WebSocket('ws://' + LIVERELOAD_HOST + LIVERELOAD_PORT + '/livereload'); | ||
|
||
connection.onerror = error => { | ||
console.log('reload connection got error:', error); | ||
}; | ||
|
||
connection.onmessage = e => { | ||
if (e.data) { | ||
const data = JSON.parse(e.data); | ||
if (data && data.command === 'reload') { | ||
chrome.runtime.reload(); | ||
} | ||
} | ||
}; | ||
|
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,3 @@ | ||
'use strict'; | ||
|
||
console.log('\'Allo \'Allo! Content script'); |
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,3 @@ | ||
'use strict'; | ||
|
||
console.log('\'Allo \'Allo! Option'); |
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,3 @@ | ||
'use strict'; | ||
|
||
console.log('\'Allo \'Allo! Popup'); |
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,3 @@ | ||
body { | ||
padding: 20px; | ||
} |
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,10 @@ | ||
{ | ||
"name": "where-am-i", | ||
"private": true, | ||
"version": "0.0.0", | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"chai": "^3.5.0", | ||
"mocha": "^3.0.1" | ||
} | ||
} |
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,135 @@ | ||
// generated on 2016-08-06 using generator-chrome-extension 0.6.0 | ||
import gulp from 'gulp'; | ||
import gulpLoadPlugins from 'gulp-load-plugins'; | ||
import del from 'del'; | ||
import runSequence from 'run-sequence'; | ||
import {stream as wiredep} from 'wiredep'; | ||
|
||
const $ = gulpLoadPlugins(); | ||
|
||
gulp.task('extras', () => { | ||
return gulp.src([ | ||
'app/*.*', | ||
'app/_locales/**', | ||
'!app/scripts.babel', | ||
'!app/*.json', | ||
'!app/*.html', | ||
], { | ||
base: 'app', | ||
dot: true | ||
}).pipe(gulp.dest('dist')); | ||
}); | ||
|
||
function lint(files, options) { | ||
return () => { | ||
return gulp.src(files) | ||
.pipe($.eslint(options)) | ||
.pipe($.eslint.format()); | ||
}; | ||
} | ||
|
||
gulp.task('lint', lint('app/scripts.babel/**/*.js', { | ||
env: { | ||
es6: true | ||
} | ||
})); | ||
|
||
gulp.task('images', () => { | ||
return gulp.src('app/images/**/*') | ||
.pipe($.if($.if.isFile, $.cache($.imagemin({ | ||
progressive: true, | ||
interlaced: true, | ||
// don't remove IDs from SVGs, they are often used | ||
// as hooks for embedding and styling | ||
svgoPlugins: [{cleanupIDs: false}] | ||
})) | ||
.on('error', function (err) { | ||
console.log(err); | ||
this.end(); | ||
}))) | ||
.pipe(gulp.dest('dist/images')); | ||
}); | ||
|
||
gulp.task('html', () => { | ||
return gulp.src('app/*.html') | ||
.pipe($.useref({searchPath: ['.tmp', 'app', '.']})) | ||
.pipe($.sourcemaps.init()) | ||
.pipe($.if('*.js', $.uglify())) | ||
.pipe($.if('*.css', $.cleanCss({compatibility: '*'}))) | ||
.pipe($.sourcemaps.write()) | ||
.pipe($.if('*.html', $.htmlmin({removeComments: true, collapseWhitespace: true}))) | ||
.pipe(gulp.dest('dist')); | ||
}); | ||
|
||
gulp.task('chromeManifest', () => { | ||
return gulp.src('app/manifest.json') | ||
.pipe($.chromeManifest({ | ||
buildnumber: true, | ||
background: { | ||
target: 'scripts/background.js', | ||
exclude: [ | ||
'scripts/chromereload.js' | ||
] | ||
} | ||
})) | ||
.pipe($.if('*.css', $.cleanCss({compatibility: '*'}))) | ||
.pipe($.if('*.js', $.sourcemaps.init())) | ||
.pipe($.if('*.js', $.uglify())) | ||
.pipe($.if('*.js', $.sourcemaps.write('.'))) | ||
.pipe(gulp.dest('dist')); | ||
}); | ||
|
||
gulp.task('babel', () => { | ||
return gulp.src('app/scripts.babel/**/*.js') | ||
.pipe($.babel({ | ||
presets: ['es2015'] | ||
})) | ||
.pipe(gulp.dest('app/scripts')); | ||
}); | ||
|
||
gulp.task('clean', del.bind(null, ['.tmp', 'dist'])); | ||
|
||
gulp.task('watch', ['lint', 'babel', 'html'], () => { | ||
$.livereload.listen(); | ||
|
||
gulp.watch([ | ||
'app/*.html', | ||
'app/scripts/**/*.js', | ||
'app/images/**/*', | ||
'app/styles/**/*', | ||
'app/_locales/**/*.json' | ||
]).on('change', $.livereload.reload); | ||
|
||
gulp.watch('app/scripts.babel/**/*.js', ['lint', 'babel']); | ||
gulp.watch('bower.json', ['wiredep']); | ||
}); | ||
|
||
gulp.task('size', () => { | ||
return gulp.src('dist/**/*').pipe($.size({title: 'build', gzip: true})); | ||
}); | ||
|
||
gulp.task('wiredep', () => { | ||
gulp.src('app/*.html') | ||
.pipe(wiredep({ | ||
ignorePath: /^(\.\.\/)*\.\./ | ||
})) | ||
.pipe(gulp.dest('app')); | ||
}); | ||
|
||
gulp.task('package', function () { | ||
var manifest = require('./dist/manifest.json'); | ||
return gulp.src('dist/**') | ||
.pipe($.zip('Where am I?-' + manifest.version + '.zip')) | ||
.pipe(gulp.dest('package')); | ||
}); | ||
|
||
gulp.task('build', (cb) => { | ||
runSequence( | ||
'lint', 'babel', 'chromeManifest', | ||
['html', 'images', 'extras'], | ||
'size', cb); | ||
}); | ||
|
||
gulp.task('default', ['clean'], cb => { | ||
runSequence('build', cb); | ||
}); |
Oops, something went wrong.