From 9972874722b99ea9e547e8e78dc1fd62ef6355c0 Mon Sep 17 00:00:00 2001 From: benweet Date: Thu, 24 Oct 2013 21:57:42 +0100 Subject: [PATCH] Added sync/publish icons in front of document title --- public/res/classes/FileDescriptor.js | 30 ++++++++++++++++++++------ public/res/extensions/buttonPublish.js | 2 +- public/res/html/bodyIndex.html | 4 ++-- public/res/html/buttonShare.html | 2 +- public/res/styles/main.less | 23 ++++++++++++++++---- 5 files changed, 46 insertions(+), 15 deletions(-) diff --git a/public/res/classes/FileDescriptor.js b/public/res/classes/FileDescriptor.js index 90e3f893..0ce30d3a 100644 --- a/public/res/classes/FileDescriptor.js +++ b/public/res/classes/FileDescriptor.js @@ -113,17 +113,33 @@ define([ FileDescriptor.prototype.composeTitle = function() { var result = []; var syncAttributesList = _.values(this.syncLocations); - var publishAttributesList = _.values(this.publishLocations); - var attributesList = syncAttributesList.concat(publishAttributesList); - _.chain(attributesList).sortBy(function(attributes) { + var syncLocationIcon = []; + _.chain(syncAttributesList).sortBy(function(attributes) { return attributes.provider.providerId; }).each(function(attributes) { var classes = 'icon-provider-' + attributes.provider.providerId; - if(attributes.isRealtime === true) { - classes += ' realtime'; - } - result.push(''); + attributes.isRealtime === true && (classes += ' realtime'); + syncLocationIcon.push(''); }); + if(syncLocationIcon.length !== 0) { + result.push(''); + result = result.concat(syncLocationIcon); + result.push(''); + } + var publishAttributesList = _.values(this.publishLocations); + var publishLocationIcon = []; + _.chain(publishAttributesList).sortBy(function(attributes) { + return attributes.provider.providerId; + }).each(function(attributes) { + var classes = 'icon-provider-' + attributes.provider.providerId; + attributes.isRealtime === true && (classes += ' realtime'); + publishLocationIcon.push(''); + }); + if(publishLocationIcon.length !== 0) { + result.push(''); + result = result.concat(publishLocationIcon); + result.push(''); + } result.push(' '); result.push(this.title); return result.join(''); diff --git a/public/res/extensions/buttonPublish.js b/public/res/extensions/buttonPublish.js index 6cbbdfe3..47a2ceb4 100644 --- a/public/res/extensions/buttonPublish.js +++ b/public/res/extensions/buttonPublish.js @@ -35,7 +35,7 @@ define([ buttonPublish.onCreateButton = function() { var button = crel('button', { class: 'btn btn-success button-publish', - title: 'Publish this document' + title: 'Publish document' }, crel('i', { class: 'icon-share' })); diff --git a/public/res/html/bodyIndex.html b/public/res/html/bodyIndex.html index 4da4e1d6..b1864bf6 100644 --- a/public/res/html/bodyIndex.html +++ b/public/res/html/bodyIndex.html @@ -19,7 +19,7 @@ class="btn btn-success action-create-file" title="New document"> - @@ -29,7 +29,7 @@