diff --git a/.sandstorm/.vagrant/machines/default/virtualbox/action_set_name b/.sandstorm/.vagrant/machines/default/virtualbox/action_set_name index baa47a5..374d10f 100644 --- a/.sandstorm/.vagrant/machines/default/virtualbox/action_set_name +++ b/.sandstorm/.vagrant/machines/default/virtualbox/action_set_name @@ -1 +1 @@ -1458759122 \ No newline at end of file +1460677669 \ No newline at end of file diff --git a/.sandstorm/sandstorm-pkgdef.capnp b/.sandstorm/sandstorm-pkgdef.capnp index 2d1d163..4f4e77e 100644 --- a/.sandstorm/sandstorm-pkgdef.capnp +++ b/.sandstorm/sandstorm-pkgdef.capnp @@ -19,9 +19,9 @@ const pkgdef :Spk.PackageDefinition = ( appTitle = (defaultText = "Annotate"), - appVersion = 5, # Increment this for every release. + appVersion = 6, # Increment this for every release. - appMarketingVersion = (defaultText = "1.2.1"), + appMarketingVersion = (defaultText = "1.3.0"), # Human-readable representation of appVersion. Should match the way you # identify versions of your app in documentation and marketing. diff --git a/client/directives/anDropbox.directive.js b/client/directives/anDropbox.directive.js index 04a1da8..d57da8f 100644 --- a/client/directives/anDropbox.directive.js +++ b/client/directives/anDropbox.directive.js @@ -21,24 +21,41 @@ angular.module('annotate').directive('anDropbox', {'sort': {'uploadedAt': -1}} ).fetch() + // Let's also check what the most recent + // highest ordering is, and add it to the end. + + var highestOrder = Images.find( + {}, + {'sort': {'metadata.order': -1}} + ).fetch()[0].metadata.order + Images.insert(file, function(err, newFile) { if (err) console.log('error insterting image', err); + let updateSetForNewFile = { + 'metadata.owner': Meteor.user(), + 'metadata.order': highestOrder + 1 + } + if (existingImages.length > 0) { existingImages.forEach(function(img) { - Images.update({_id: img._id}, - {$set: {'metadata.newest': newFile._id}}) + Images.update({_id: img._id}, + {$set: {'metadata.newest': newFile._id}}) }) + Images.update({_id: existingImages[0]._id}, {$set: {'metadata.next': newFile._id}}) - Images.update({_id: newFile._id}, - {$set: { - 'metadata.previous': existingImages[0]._id, - 'metadata.description': existingImages[0].metadata.description, - 'metadata.order': existingImages[0].metadata.order - }}) + + updateSetForNewFile['metadata.previous'] = existingImages[0]._id + if (existingImages[0].metadata) { + updateSetForNewFile['metadata.description'] = existingImages[0].metadata.description + updateSetForNewFile['metadata.order'] = existingImages[0].metadata.order + } } + Images.update({_id: newFile._id}, + {$set: updateSetForNewFile}) + $scope.$apply(function() { $timeout(function() { $scope.onImageAdded(); diff --git a/client/index.html b/client/index.html index fbdd3de..7e19ab5 100644 --- a/client/index.html +++ b/client/index.html @@ -70,7 +70,9 @@
- {{ image.metadata.order + 1 }}. + + {{ image.metadata.order + 1 }}. +
diff --git a/client/styles/components/image-container.import.less b/client/styles/components/image-container.import.less index 9cbb951..de89460 100644 --- a/client/styles/components/image-container.import.less +++ b/client/styles/components/image-container.import.less @@ -1,7 +1,7 @@ .images-container-title.double .image-container { - width: 40%; + width: 44%; display: inline-block; - margin: 1rem 5%; + margin: 1rem 3%; } .image-container { diff --git a/meta/changelog.md b/meta/changelog.md index d4497c3..e890455 100644 --- a/meta/changelog.md +++ b/meta/changelog.md @@ -1,3 +1,9 @@ +# 1.3.0 + +* Adding a file that already exists will replace the existing file, and references to the previous file will be stored. (Files are not deleted). +* We now ask for confirmation before adding an annotation. +* You can now view images in one or two columns. + # 1.2.0 * Annotations now maintain an order and don't change order. They're unique in the entire grain too.