From 1b4fcc67f4ec94ed53a2f86ad6889e551f00815e Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Mon, 25 May 2015 21:49:06 +0200 Subject: Upgrade sandstorm integration Both sandstorm and LibreBoard have significantly evolved since the last release of LibreBoard on sandstorm. This commit: * adds some more attributes on the sandstorm manifest * introduces support with the sandstorm sharing box * uses a server redirection to point to the board document * hides the top shortcut bar on sandstorm Fixes #163. --- collections/boards.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'collections/boards.js') diff --git a/collections/boards.js b/collections/boards.js index e406b10c..2d5c6099 100644 --- a/collections/boards.js +++ b/collections/boards.js @@ -139,7 +139,7 @@ Boards.before.insert(function(userId, doc) { // In some cases (Chinese and Japanese for instance) the `getSlug` function // return an empty string. This is causes bugs in our application so we set // a default slug in this case. - doc.slug = getSlug(doc.title) || 'board'; + doc.slug = doc.slug || getSlug(doc.title) || 'board'; doc.createdAt = new Date(); doc.archived = false; doc.members = [{ @@ -153,22 +153,13 @@ Boards.before.insert(function(userId, doc) { // Handle labels var colors = Boards.simpleSchema()._schema['labels.$.color'].allowedValues; var defaultLabelsColors = _.clone(colors).splice(0, 6); - doc.labels = []; - _.each(defaultLabelsColors, function(val) { - doc.labels.push({ + doc.labels = _.map(defaultLabelsColors, function(val) { + return { _id: Random.id(6), name: '', color: val - }); - }); - - // We randomly chose one of the default background colors for the board - if (Meteor.isClient) { - doc.background = { - type: 'color', - color: Random.choice(Boards.simpleSchema()._schema.color.allowedValues) }; - } + }); }); Boards.before.update(function(userId, doc, fieldNames, modifier) { -- cgit v1.2.3-1-g7c22