Skip to content

Commit

Permalink
work on user story #2
Browse files Browse the repository at this point in the history
  • Loading branch information
edsilv committed Nov 22, 2017
1 parent 4be6117 commit 38f517c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples
Submodule examples updated 3 files
+6 −0 manifests.json
+ uv-3.0.0.zip
+17 −2 uv/uv.js
18 changes: 17 additions & 1 deletion src/extensions/uv-seadragon-extension/DownloadDialogue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,17 @@ export class DownloadDialogue extends BaseDownloadDialogue {
this.$selectionButton.hide();
}

this.resetDynamicDownloadOptions();
this.resetDynamicDownloadOptions(); // todo: not very nice

if (this.isDownloadOptionAvailable(DownloadOption.rangeRendering)) {

if (canvas.ranges && canvas.ranges.length) {
for (let i = 0; i < canvas.ranges.length; i++) {
const range: Manifesto.IRange = canvas.ranges[i];
this.addDownloadOptionsForRenderings(range, this.content.entireFileAsOriginal, DownloadOption.dynamicCanvasRenderings);
}
}
}

if (this.isDownloadOptionAvailable(DownloadOption.dynamicImageRenderings)) {
const images: Manifesto.IAnnotation[] = canvas.getImages();
Expand Down Expand Up @@ -620,6 +630,12 @@ export class DownloadDialogue extends BaseDownloadDialogue {
return (!(<ISeadragonExtension>this.extension).isPagingSettingEnabled() && (size.width > this.options.confinedImageSize));
case DownloadOption.selection:
return this.options.selectionEnabled;
case DownloadOption.rangeRendering:
if (canvas.ranges.length) {
const range: Manifesto.IRange = canvas.ranges[0];
return range.getRenderings().length > 0;
}
return false;
default:
return super.isDownloadOptionAvailable(option);
}
Expand Down
3 changes: 2 additions & 1 deletion src/modules/uv-shared-module/DownloadOption.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ export class DownloadOption {
static dynamicImageRenderings = new DownloadOption("dynamicImageRenderings");
static dynamicSequenceRenderings = new DownloadOption("dynamicSequenceRenderings");
static entireFileAsOriginal = new DownloadOption("entireFileAsOriginal");
static rangeRendering = new DownloadOption("rangeRendering");
static selection = new DownloadOption("selection");
static wholeImageHighRes = new DownloadOption("wholeImageHighRes");
static wholeImagesHighRes = new DownloadOption("wholeImagesHighRes");
static wholeImageLowResAsJpg = new DownloadOption("wholeImageLowResAsJpg");
static wholeImagesHighRes = new DownloadOption("wholeImagesHighRes");

constructor(public value: string) {
}
Expand Down

0 comments on commit 38f517c

Please sign in to comment.