Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmerfield committed Dec 1, 2018
2 parents e44342b + 77a4aa8 commit eca9728
Show file tree
Hide file tree
Showing 223 changed files with 819 additions and 174 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -9,11 +9,11 @@ cache:
directories:
- node_modules
env:
- CXX=g++-4.8
- CXX=g++-4.8 DEBUG=*
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- pandoc
- g++-4.8
- g++-4.8
Binary file added app/blog/static/fonts/charter/bold-italic.eot
Binary file not shown.
Binary file added app/blog/static/fonts/charter/bold-italic.ttf
Binary file not shown.
Binary file added app/blog/static/fonts/charter/bold-italic.woff
Binary file not shown.
Binary file not shown.
242 changes: 242 additions & 0 deletions app/blog/static/fonts/charter/bold-small-cap.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/blog/static/fonts/charter/bold-small-cap.ttf
Binary file not shown.
Binary file added app/blog/static/fonts/charter/bold-small-cap.woff
Binary file not shown.
Binary file not shown.
Binary file added app/blog/static/fonts/charter/bold.eot
Binary file not shown.
Binary file added app/blog/static/fonts/charter/bold.ttf
Binary file not shown.
Binary file added app/blog/static/fonts/charter/bold.woff
Binary file not shown.
Binary file added app/blog/static/fonts/charter/italic.eot
Binary file not shown.
Binary file added app/blog/static/fonts/charter/italic.ttf
Binary file not shown.
Binary file added app/blog/static/fonts/charter/italic.woff
Binary file not shown.
Binary file not shown.
114 changes: 114 additions & 0 deletions app/blog/static/fonts/charter/regular-small-cap.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added app/blog/static/fonts/charter/regular.eot
Binary file not shown.
Binary file added app/blog/static/fonts/charter/regular.ttf
Binary file not shown.
Binary file added app/blog/static/fonts/charter/regular.woff
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions app/blog/static/fonts/cooper-hewitt/bold-italic.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added app/blog/static/fonts/cooper-hewitt/bold.eot
Binary file not shown.
1 change: 1 addition & 0 deletions app/blog/static/fonts/cooper-hewitt/bold.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/blog/static/fonts/cooper-hewitt/bold.woff
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions app/blog/static/fonts/cooper-hewitt/book-italic.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added app/blog/static/fonts/cooper-hewitt/book.eot
Binary file not shown.
1 change: 1 addition & 0 deletions app/blog/static/fonts/cooper-hewitt/book.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/blog/static/fonts/cooper-hewitt/book.woff
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions app/blog/static/fonts/cooper-hewitt/heavy-italic.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added app/blog/static/fonts/cooper-hewitt/heavy.eot
Binary file not shown.
1 change: 1 addition & 0 deletions app/blog/static/fonts/cooper-hewitt/heavy.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/blog/static/fonts/cooper-hewitt/heavy.woff
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions app/blog/static/fonts/cooper-hewitt/light-italic.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added app/blog/static/fonts/cooper-hewitt/light.eot
Binary file not shown.
1 change: 1 addition & 0 deletions app/blog/static/fonts/cooper-hewitt/light.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/blog/static/fonts/cooper-hewitt/light.woff
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions app/blog/static/fonts/cooper-hewitt/medium-italic.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added app/blog/static/fonts/cooper-hewitt/medium.eot
Binary file not shown.
1 change: 1 addition & 0 deletions app/blog/static/fonts/cooper-hewitt/medium.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/blog/static/fonts/cooper-hewitt/medium.woff
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions app/blog/static/fonts/cooper-hewitt/semibold-italic.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added app/blog/static/fonts/cooper-hewitt/semibold.eot
Binary file not shown.
1 change: 1 addition & 0 deletions app/blog/static/fonts/cooper-hewitt/semibold.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/blog/static/fonts/cooper-hewitt/semibold.woff
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions app/blog/static/fonts/cooper-hewitt/thin-italic.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added app/blog/static/fonts/cooper-hewitt/thin.eot
Binary file not shown.
1 change: 1 addition & 0 deletions app/blog/static/fonts/cooper-hewitt/thin.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/blog/static/fonts/cooper-hewitt/thin.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/bold-italic.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/bold-italic.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/bold-italic.woff2
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/bold.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/bold.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/bold.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/extra-light.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/extra-light.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/extra-light.woff2
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/italic.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/italic.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/italic.woff2
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/light-italic.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/light-italic.woff
Binary file not shown.
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/light.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/light.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/light.woff2
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/medium-italic.eot
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/medium.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/medium.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/medium.woff2
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/regular.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/regular.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/regular.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/semi-bold.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/semi-bold.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/semi-bold.woff2
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/text-italic.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/text-italic.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/text-italic.woff2
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/text.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/text.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/text.woff2
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/thin-italic.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/thin-italic.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/thin-italic.woff2
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/thin.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/thin.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/mono/thin.woff2
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/bold-italic.eot
Binary file not shown.
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/bold-italic.woff2
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/bold.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/bold.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/bold.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/extra-light.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/extra-light.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/extra-light.woff2
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/italic.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/italic.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/italic.woff2
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/light-italic.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/light-italic.woff
Binary file not shown.
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/light.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/light.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/light.woff2
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/medium-italic.eot
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/medium.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/medium.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/medium.woff2
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/regular.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/regular.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/regular.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/semi-bold.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/semi-bold.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/semi-bold.woff2
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/text-italic.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/text-italic.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/text-italic.woff2
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/text.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/text.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/text.woff2
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/thin-italic.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/thin-italic.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/thin-italic.woff2
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/thin.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/thin.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/sans/thin.woff2
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/bold-italic.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/bold-italic.woff
Binary file not shown.
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/bold.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/bold.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/bold.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/extra-light.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/extra-light.woff
Binary file not shown.
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/italic.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/italic.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/italic.woff2
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/light-italic.eot
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/light.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/light.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/light.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/medium.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/medium.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/medium.woff2
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/regular.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/regular.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/regular.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/semi-bold.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/semi-bold.woff
Binary file not shown.
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/text-italic.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/text-italic.woff
Binary file not shown.
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/text.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/text.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/text.woff2
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/thin-italic.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/thin-italic.woff
Binary file not shown.
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/thin.eot
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/thin.woff
Binary file not shown.
Binary file added app/blog/static/fonts/plex/serif/thin.woff2
Binary file not shown.
18 changes: 11 additions & 7 deletions app/blog/tests/assets.js
Expand Up @@ -41,7 +41,7 @@ describe("asset middleware", function() {
});
});

// This test ensures that the middleware will pass
// This test ensures that the middleware will pass
// the request on if it can't find a matching file.
it("returns a 404 correctly", function(done) {
this.get("/" + this.fake.random.uuid(), function(err, body, res) {
Expand Down Expand Up @@ -75,14 +75,18 @@ describe("asset middleware", function() {
});

ctx.server.use(require("../assets"));
ctx.server = ctx.server.listen(port, function(err) {
if (err && err.code === "EADDRINUSE") return attempt(done);
if (err && err.code === "EACCESS") return attempt(done);
if (err) return done(err);
done();
});

try {
ctx.server = ctx.server.listen(port);
} catch (err) {
if (err.code === "EADDRINUSE") return attempt(done);
if (err.code === "EACCESS") return attempt(done);
return done(err);
}

ctx.server.port = port;
ctx.url = "http://localhost:" + port;
done();
})(done);
});

Expand Down
35 changes: 32 additions & 3 deletions app/clients/dropbox/routes/index.js
Expand Up @@ -44,9 +44,22 @@ dashboard
.get(require("./checkAppFolder"))
.get(require("./askToMigrateIfNeeded"))
.get(require("./createFolder"))
.get(require("./writeExistingContents"))
.get(require("./saveDropboxAccount"))
.get(function(req, res, next) {
res.message("/", "Set up Dropbox successfuly!");

require("./writeExistingContents")(req, res, function(err) {
// Headers have been sent at this point, so just log this error
if (err) console.log("Dropbox authentication error:", err);

console.log(
"Blog:",
req.blog.id,
"Set up Dropbox client successfully! Full access?",
req.unsavedAccount.full_access
);
});
})
// If we encounter some error during
// the authentication flow, send them
// back to the setup page where they started
Expand All @@ -70,8 +83,24 @@ dashboard
})
.post(require("./moveExistingFiles"))
.post(require("./createFolder"))
.post(require("./writeExistingContents"))
.post(require("./saveDropboxAccount"));
.post(require("./saveDropboxAccount"))
.post(function(req, res, next) {
res.message("/", "Set up Dropbox successfuly!");

// This happens in the background. It would be nice to
// expose a progress bar in future.
require("./writeExistingContents")(req, res, function(err) {
// Headers have been sent at this point, so just log this error
if (err) console.log("Dropbox authentication error:", err);

console.log(
"Blog:",
req.blog.id,
"Set up Dropbox client successfully! Full access?",
req.unsavedAccount.full_access
);
});
});

// Will remove the Dropbox account from the client's database
// and revoke the token if needed.
Expand Down
6 changes: 1 addition & 5 deletions app/clients/dropbox/routes/saveDropboxAccount.js
@@ -1,8 +1,4 @@
var database = require("../database");
module.exports = function saveDropboxAccount(req, res, next) {
database.set(req.blog.id, req.unsavedAccount, function(err) {
if (err) return next(err);

res.message("/", "Set up Dropbox successfuly!");
});
database.set(req.blog.id, req.unsavedAccount, next);
};
8 changes: 7 additions & 1 deletion app/clients/dropbox/sync.js
Expand Up @@ -37,6 +37,7 @@ module.exports = function main(blog, callback) {
// blog folder in the user's Dropbox folder.
delta(account.cursor, function handle(err, result) {
if (err) {
debug("Delta error", err);
return Database.set(
blog.id,
{ error_code: err.status || 400 },
Expand All @@ -46,6 +47,8 @@ module.exports = function main(blog, callback) {
);
}

debug("Retrieved", result.entries.length, "changes");

// Now we attempt to apply the changes which occured in the
// user's folder on Dropbox to the blog folder on Blot's server.
// This means making any new directories, downloading any new
Expand Down Expand Up @@ -102,7 +105,10 @@ module.exports = function main(blog, callback) {
// we get them before returning the callback.
// This is important because a rename could
// be split across two pages of file events.
if (result.has_more) return delta(result.cursor, handle);
if (result.has_more) {
debug("There are more change to fetch");
return delta(result.cursor, handle);
}

debug("Finished sync!");
done(null, callback);
Expand Down
25 changes: 21 additions & 4 deletions app/clients/local/controllers/sync.js
Expand Up @@ -36,10 +36,26 @@ function walk(dir) {
}

function init(blogID, userFolder, callback) {
var watcher = fs.watch(userFolder, { recursive: true }, handler);

var queue = async.queue(function(task, callback) {
console.log("Beginning sync...");
handler(task.event, task.path, function(err) {
if (err) console.log(err);
console.log("Finished sync...");
callback();
});
});

var watcher = fs.watch(userFolder, { recursive: true }, function(
event,
path
) {
queue.push({ event: event, path: path });
});

callback(null);

function handler(event, path) {
function handler(event, path, callback) {
if (!path) return;

// Blot likes leading slashes
Expand All @@ -55,7 +71,7 @@ function init(blogID, userFolder, callback) {
if (!folder) return watcher.close();

Sync(blogID, syncOptions, function(err, folder, done) {
if (err) return console.log(err);
if (err) return callback(err);

fs.stat(pathInUserFolder, function(err, stat) {
try {
Expand Down Expand Up @@ -83,7 +99,8 @@ function init(blogID, userFolder, callback) {
async.each(affectedPaths, folder.update, function(err) {
if (err) console.log(err);
done(null, function(err) {
if (err) console.log(err);
if (err) return callback(err);
callback();
});
});
});
Expand Down

0 comments on commit eca9728

Please sign in to comment.