Skip to content

Commit

Permalink
Release v1.2.0
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 428a82f19e6c3c73ab8c6abd96c9cd20e6e85b84
Author: John Dunning <[email protected]>
Date:   Sat Oct 12 19:29:25 2019 -0700

    Tweak tooltip in options

commit 9ce43e00b46df071d9fc2db46c5858fdd2efea04
Author: John Dunning <[email protected]>
Date:   Sat Oct 12 19:10:05 2019 -0700

    Refactor Gruntfile.js

    Compress all the PNG images, saving close to 1MB.
    Remove errant console.log from background.js.

commit 47967e1b2c7b921d06c2ed4a4af547d0d26f8503
Author: John Dunning <[email protected]>
Date:   Sat Oct 12 13:39:10 2019 -0700

    Update version to 1.2.0

    Put MRU description before searching for tabs.
    Update releases/index.md.
    Tweak size of help button on options.
    Add tooltip to incognito screenshot.

commit cc06c0a6fd999462521122a69484d4b864bd6b38
Author: John Dunning <[email protected]>
Date:   Fri Oct 11 17:55:32 2019 -0700

    Update Options page

    Add tracking to clicks on non-settings buttons in Options.
    Add help button to open main site from Options.
    Add incognito-option.png screenshot to Options.
    Remove retrievedSettings state from app-container.js.
    Pass tracker to options app.
    Update label for switch between last two tabs shortcut.
    Tweak privacy page.
    Add gear icon to incognito section of site.

commit cf670596b8feb442cf9564faa3a4ec959fae5413
Author: John Dunning <[email protected]>
Date:   Sun Oct 6 19:17:21 2019 -0700

    Tweak docs/index.md

    Update chrome-store-description.txt to mention the gear icon.

commit a4ffdf2ad978af9843284b0f87118125cd9b50d2
Author: John Dunning <[email protected]>
Date:   Sun Oct 6 18:27:35 2019 -0700

    Add docs/img/gear.svg

commit d23860830be2be3ef7eca02b92b9e9897c9de202
Author: John Dunning <[email protected]>
Date:   Sun Oct 6 16:22:48 2019 -0700

    Use a different padding on Mac for index numbers

    Lowercase o in options.

commit e34c23f3ab2a232f9dc9b59ddad064d66f3b614c
Author: John Dunning <[email protected]>
Date:   Tue Oct 1 20:03:14 2019 -0700

    Always build out/popup.html from src/popup.html

    Add a placeholder to build/prod/popup.html and replace it with the current React string on every build instead of trying to keep the mock file up to date.
    Rename checkPopup task to buildPopup.
    Remove mock/popup.html.

commit cc66cdce1b755c5b4a9dd0af855a97c3a157cbb1
Author: John Dunning <[email protected]>
Date:   Tue Oct 1 07:42:21 2019 -0700

    Update React markup in popup.html

    Use src/popup.html as the template for updating the React markup instead of using a mock file.
    Remove mock/popup.html.

commit 5da52a6008edbde9ce6ce36da643599bbcccdcea
Author: John Dunning <[email protected]>
Date:   Mon Sep 30 18:41:59 2019 -0700

    Add options gear button in popup

    Open options page and track event when gear button is clicked.
    Add hover state to clear button in search field.
    Make scripts in mock/popup.html consistent with src/popup.html.
    Add gear.svg and icon to index.md.
    Tweak ctrl-tab/index.md.

commit 9d6f93954edffc7310af0de426c7f8a5255c636c
Author: John Dunning <[email protected]>
Date:   Sat Sep 28 17:24:16 2019 -0700

    Fix navigating back into the stack and then using the toggle shortcut

    Use tabChangedFromToggle only for whether to invert the icon, not to immediately add the pending tab.
    Always use a debouced addTab().
    Clean up recentTabs.print().

commit 30e1f86f9d0d086e269a7af4d9dcd2ca8d77bbb1
Author: John Dunning <[email protected]>
Date:   Sun Sep 22 18:50:24 2019 -0700

    Add recentTabs.toggle()

commit 186f0f1656cc8ac8bcf9b8715bf8e2f7da0da2e9
Author: John Dunning <[email protected]>
Date:   Sun Sep 15 19:54:33 2019 -0700

    Handle undefined error in tracker.exception()

    Partial attempt at fixing rapid navigation via alt-A and then alt-Z while icon is inverted.

commit feb42804cb60eaf6b2141580753f48f6005d1c1e
Author: John Dunning <[email protected]>
Date:   Sun Sep 15 16:23:31 2019 -0700

    Tweak ctrl-tab/index.md

commit b434d6f01672ea24c63ec3519df019ca2c23a800
Author: John Dunning <[email protected]>
Date:   Sat Sep 14 20:09:20 2019 -0700

    Update ctrl-tab/index.md to use new toggle shortcut

    Update and add screenshots for new ctrl-tab options.
    Change _config.yml to support CommonMark Markup.
    Remove keyboard.png, which hasn't been used in forever.

commit 25ba78b42213442185c1f0cddce968c50f98a350
Author: John Dunning <[email protected]>
Date:   Sun Sep 8 19:41:26 2019 -0700

    Add key to toggle between two most recent tabs

    Use alt-Z as the default shortcut.
    Add toggleRecentTabs() to handle toggling in one place.
    Update docs with info on new feature.
  • Loading branch information
fwextensions committed Oct 14, 2019
1 parent ea58a2a commit dc198b9
Show file tree
Hide file tree
Showing 62 changed files with 462 additions and 294 deletions.
111 changes: 52 additions & 59 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ module.exports = function(grunt) {
};
const buildManifestPath = "build/out/manifest.json";
const devPopupPath = "src/popup.html";
const buildPopupPath = "build/out/popup.html";
const prodPopupPath = "build/prod/popup.html";
const outPopupPath = "build/out/popup.html";
const extensionInfo = {
quickey: {
fullName: "QuicKey – The quick tab switcher",
Expand Down Expand Up @@ -226,6 +227,8 @@ module.exports = function(grunt) {
}
}
};
const rootPattern = /<div id="root">[^<]+(<.+)\s+/m;
const popupPlaceholder = "<!-- rendered html -->";

grunt.initConfig(config);

Expand All @@ -236,78 +239,69 @@ module.exports = function(grunt) {
console.log("Started at", new Date().toLocaleString());
});

grunt.registerTask("checkPopup", function() {
grunt.registerTask("buildPopup", function() {
const devPopup = grunt.file.read(devPopupPath);
const devBody = devPopup.slice(devPopup.indexOf("<body>"));
const buildPopup = grunt.file.read(buildPopupPath);
const buildBody = buildPopup.slice(buildPopup.indexOf("<body>"));
const devBody = devPopup.match(rootPattern)[1];
const outPopup = grunt.file.read(prodPopupPath).replace(popupPlaceholder, devBody);

if (devBody !== buildBody) {
grunt.fail.fatal("Source and build popup.html don't match:\n\nSource:\n" +
devBody + "\n\nBuild:" + buildBody);
}
// write out the built popup template with the latest React code
grunt.file.write(outPopupPath, outPopup);
});

function updateManifest(
path,
...overrides)
{
let manifest = grunt.file.readJSON(path);

manifest = merge.all([manifest, ...overrides]);
grunt.file.write(path, JSON.stringify(manifest, null, "\t"));

return manifest;
}

function incrementVersion(
manifestPath,
overrides = {})
manifestPath)
{
let manifest = grunt.file.readJSON(manifestPath);
let version = manifest.version.split(".");
const manifest = grunt.file.readJSON(manifestPath);
const version = manifest.version.split(".");
let versionString;

version[2] = parseInt(version[2]) + 1;
versionString = version.join(".");
manifest.version = versionString;

manifest = merge(manifest, overrides);

grunt.file.write(manifestPath, JSON.stringify(manifest, null, "\t"));
updateManifest(manifestPath, { version: versionString });

return versionString;
}

function incrementVersionAndSrc(
buildManifestPath,
srcManifestPath,
overrides = {})
{
const versionString = incrementVersion(buildManifestPath, overrides);
const srcManifest = grunt.file.readJSON(srcManifestPath);
grunt.registerTask("incrementVersion", function(target = "quickey") {
// set the name back to the full name and icon tooltip that was
// overridden in the cleanupManifest task
const {srcManifestPath} = extensionInfo[target];
const versionString = incrementVersion(buildManifestPath);

srcManifest.version = versionString;
grunt.file.write(srcManifestPath, JSON.stringify(srcManifest, null, "\t"));
updateManifest(srcManifestPath, { version: versionString });

console.log(`Updated ${srcManifestPath} to version ${versionString}.`);
}
});

grunt.registerTask("incrementVersion", function(target = "quickey") {
// set the name back to the full name and icon tooltip that was
// overridden in the cleanupManifest task
const {fullName, shortName, srcManifestPath} = extensionInfo[target];
grunt.registerTask("cleanupManifest", function(target, env) {
const manifest = grunt.file.readJSON(buildManifestPath);
let {fullName, shortName} = extensionInfo[target];

incrementVersionAndSrc(
buildManifestPath,
srcManifestPath,
if (env == "dev") {
fullName = shortName = `${manifest.short_name} BUILD ${new Date().toLocaleString()}`;
}

updateManifest(buildManifestPath,
{
// we don't need the unsafe-eval policy in the built extension
content_security_policy: manifest.content_security_policy.replace("'unsafe-eval' ", ""),
name: fullName,
browser_action: {
default_title: shortName
}
}
);
});

grunt.registerTask("cleanupManifest", function() {
const manifest = grunt.file.readJSON(buildManifestPath);

// we don't need the unsafe-eval policy in the built extension
manifest.content_security_policy = manifest.content_security_policy.replace("'unsafe-eval' ", "");

manifest.browser_action.default_title = manifest.name =
`${manifest.short_name} BUILD ${new Date().toLocaleString()}`;

grunt.file.write(buildManifestPath, JSON.stringify(manifest, null, "\t"));
});
});

function publish(
Expand Down Expand Up @@ -351,13 +345,13 @@ module.exports = function(grunt) {
.then(done);
});

grunt.registerTask("build", function(target = "quickey") {
grunt.registerTask("build", function(target = "quickey", env = "dev") {
grunt.task.run([
"time",
"sync:out",
"copy:" + target,
"cleanupManifest",
"checkPopup",
`copy:${target}`,
`cleanupManifest:${target}:${env}`,
"buildPopup",
"requirejs",
"babel",
"sync:build",
Expand All @@ -368,16 +362,15 @@ module.exports = function(grunt) {
grunt.registerTask("pack", function(target = "quickey", test) {
const tasks = [
"clean:out",
"build:" + target,
"incrementVersion:" + target,
"compress:" + target
`build:${target}:prod`,
];

if (test == "test") {
// don't increment the version in the manifest
tasks.splice(2, 1);
// increment the version in the manifest only if this isn't a test
if (test !== "test") {
tasks.push("incrementVersion");
}

tasks.push("compress:" + target);
grunt.task.run(tasks);
});

Expand Down
26 changes: 0 additions & 26 deletions build/mock/popup.html

This file was deleted.

2 changes: 1 addition & 1 deletion build/prod/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<body>
<div id="root">
<div class="win" data-reactroot="" data-reactid="1" data-react-checksum="-1013649714"><div data-reactid="2"><input type="search" class="search-box" tabindex="0" placeholder="Search for a tab title or URL, or type / for more options" spellcheck="false" value="" data-reactid="3"/></div><div class="results-list-container" style="display:none;" data-reactid="4"><div aria-label="grid" aria-readonly="true" class="ReactVirtualized__Grid ReactVirtualized__List results-list" role="grid" style="box-sizing:border-box;direction:ltr;height:0;position:relative;width:490px;-webkit-overflow-scrolling:touch;will-change:transform;overflow-x:hidden;overflow-y:hidden;" tabindex="-1" data-reactid="5"></div></div></div>
<!-- rendered html -->
</div>
</body>

Expand Down
39 changes: 18 additions & 21 deletions build/scripts/build-popup.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
const ReactDOMServer = require("react-dom/server"),
React = require("react"),
requirejs = require("requirejs"),
fs = require("fs"),
_ = require("lodash");
const ReactDOMServer = require("react-dom/server");
const React = require("react");
const requirejs = require("requirejs");
const fs = require("fs");
const _ = require("lodash");


const ConfigPattern = /(\{[\s\S]+\})/m,
Placeholder = "<!-- rendered html -->";
const ConfigPattern = /({[\s\S]+})/m;
const RootPattern = /<div id="root">[^<]+(<.+)\s+/m;


var configFile = fs.readFileSync("./src/js/require-config.js", "utf8"),
currentHTML = fs.readFileSync("./src/popup.html", "utf8"),
templateHTML = fs.readFileSync("./build/mock/popup.html", "utf8"),
match = configFile.match(ConfigPattern),
config;
const configFile = fs.readFileSync("./src/js/require-config.js", "utf8");
const currentPopupHTML = fs.readFileSync("./src/popup.html", "utf8");
const currentReactMarkup = currentPopupHTML.match(RootPattern)[1];
const match = configFile.match(ConfigPattern);
let config;


if (!match) {
Expand Down Expand Up @@ -54,25 +54,22 @@ requirejs([
], function(
App
) {
const html = ReactDOMServer.renderToString(React.createElement(App, {
const newReactMarkup = ReactDOMServer.renderToString(React.createElement(App, {
initialQuery: "",
initialShortcuts: [],
platform: "win",
tracker: {
set: function() {
}
set: function() {}
},
port: {}
}));
// insert the rendered HTML into the root node in the template
// popup.html file
const newHTML = templateHTML.replace(Placeholder, html);


// we only want to change the source file if the rendered markup has changed
if (newHTML !== currentHTML) {
if (newReactMarkup !== currentReactMarkup) {
const newPopupHTML = currentPopupHTML.replace(currentReactMarkup, newReactMarkup);

fs.writeFileSync("./src/popup.html", newPopupHTML, "utf8");
console.log("\n\n===== popup.html updated =====\n\n");
fs.writeFileSync("./src/popup.html", newHTML, "utf8");
} else {
console.log("\n\n===== no update needed =====\n\n");
}
Expand Down
2 changes: 2 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ theme: jekyll-theme-minimal
gems:
- jekyll-seo-tag

markdown: CommonMarkGhPages

url: https://fwextensions.github.io/QuicKey

title: QuicKey | Jump between recent tabs in Chrome via keyboard or menu
Expand Down
Loading

0 comments on commit dc198b9

Please sign in to comment.