diff --git a/Gruntfile.js b/Gruntfile.js
index 1f435b2..83de5d6 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -33,8 +33,6 @@ module.exports = function (grunt) {
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-compress");
- grunt.loadNpmTasks("grunt-jpm");
- grunt.loadNpmTasks("grunt-crx");
var releaseRoot = "../openseadragon.github.com/openseadragonizer/";
@@ -43,8 +41,7 @@ module.exports = function (grunt) {
grunt.initConfig({
clean: {
build: ["build"],
- chromium: ["build/chromium"],
- firefox: ["build/firefox"],
+ webextension: ["build/webextension"],
release: {
src: [releaseRoot],
options: {
@@ -53,32 +50,17 @@ module.exports = function (grunt) {
}
},
watch: {
- files: ["Gruntfile.js", "chromium/*", "firefox/*", "common/*"],
+ files: ["Gruntfile.js", "webextension/*", "common/*"],
tasks: "watchTask"
},
- jpm: {
- options: {
- src: "build/firefox",
- xpi: "build"
- }
- },
- crx: {
- crx: {
- "src": "build/chromium/**/*",
- "dest": "build",
- "options": {
- "privateKey": "../openseadragonizer.pem"
- }
- }
- },
compress: {
- chromium: {
+ webextension: {
options: {
- archive: "build/chromium.zip"
+ archive: "build/webextension.zip"
},
files: [{
expand: true,
- cwd: "build/chromium",
+ cwd: "build/webextension",
src: ["**/*"],
dest: ""
}
@@ -89,16 +71,8 @@ module.exports = function (grunt) {
// ----------
// Watch task.
- // Called from the watch feature; does a full build or a particular browser build,
- // depending on whether you used --browsername on the command line.
grunt.registerTask("watchTask", function () {
- if (grunt.option('chromium')) {
- grunt.task.run("build:chromium");
- } else if (grunt.option('firefox')) {
- grunt.task.run("build:firefox");
- } else {
grunt.task.run("build");
- }
});
function copyCommonDir(destination) {
@@ -113,26 +87,14 @@ module.exports = function (grunt) {
}
// ----------
- // Chromium build task.
- grunt.registerTask("build:chromium", function () {
- copyCommonDir("build/chromium/");
- grunt.file.recurse("chromium", function (abspath, rootdir, subdir, filename) {
- subdir = subdir ? subdir + "/" : "";
- grunt.file.copy(abspath, "build/chromium/" + subdir + filename);
- });
- grunt.task.run("compress:chromium");
- });
-
- // ----------
- // Firefox build task.
- grunt.registerTask("build:firefox", function () {
- copyCommonDir("build/firefox/data/");
- grunt.file.recurse("firefox", function (abspath, rootdir, subdir, filename) {
+ // WebExtension build task.
+ grunt.registerTask("build:webextension", function () {
+ copyCommonDir("build/webextension/");
+ grunt.file.recurse("webextension", function (abspath, rootdir, subdir, filename) {
subdir = subdir ? subdir + "/" : "";
- grunt.file.copy(abspath, "build/firefox/" + subdir + filename);
+ grunt.file.copy(abspath, "build/webextension/" + subdir + filename);
});
- grunt.file.copy("build/firefox/data/logo48.png", "build/firefox/icon.png");
- grunt.task.run("jpm:xpi");
+ grunt.task.run("compress:webextension");
});
// ----------
@@ -143,7 +105,7 @@ module.exports = function (grunt) {
// ----------
// Full build task.
- grunt.registerTask("build", ["clean", "build:chromium", "build:firefox"]);
+ grunt.registerTask("build", ["clean", "build:webextension"]);
// ----------
// Publish task.
diff --git a/README.md b/README.md
index f6f1252..b5be754 100644
--- a/README.md
+++ b/README.md
@@ -37,20 +37,14 @@ If you want Grunt to watch your source files and rebuild every time you change o
1. Go to your Chrome settings and then extensions.
1. Turn on the "Developer mode" checkbox.
-1. Choose "Load unpacked extension" and select build/chromium from this repository.
+1. Choose "Load unpacked extension" and select build/webextension from this repository.
### Testing in Firefox
-There are two ways to load the extension for testing in Firefox:
+1. Type `about:debugging` in the address bar.
+1. Click on "Load Temporary Add-on" and select build/webextension from this repository.
-#### Using jpm
+### Publishing the standalone web site
-1. Install [jpm](https://developer.mozilla.org/en-US/Add-ons/SDK/Tools/jpm) globally with `npm install jpm -g`.
-1. Run `jpm run` inside build/firefox
-
-It will start a fresh instance of Firefox with the extension installed.
-
-#### Loading the xpi
-
-1. Go to the extensions list (about:addons).
-1. Drag and drop the build/@openseadragonizer-[version].xpi file.
+1. Run `grunt publish`.
+1. Commit and push the `../openseadragon.github.com` website.
diff --git a/common/index.html b/common/index.html
index 8c170ae..2fd0794 100644
--- a/common/index.html
+++ b/common/index.html
@@ -21,6 +21,5 @@
-