Skip to content

Commit

Permalink
Merge pull request #946 from IIIF/837-refresh-icon
Browse files Browse the repository at this point in the history
by default, icon to refresh annotations is hidden.  new setting to co…
  • Loading branch information
aeschylus committed Jun 6, 2016
2 parents 76a35e7 + 35bc6df commit 634940f
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 12 deletions.
3 changes: 2 additions & 1 deletion js/src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
//default window settings, but can be changed in Mirador configuration on initialization
'windowSettings' : {
"availableViews" : ['ThumbnailsView', 'ImageView', 'ScrollView', 'BookView'], //any subset removes others
"viewType" : 'ThumbnailsView', //one of [_'ThumbnailsView'_, 'ImageView', 'ScrollView', 'BookView'] - if using availableViews, must be in subset
"viewType" : 'ImageView', //one of [_'ThumbnailsView'_, 'ImageView', 'ScrollView', 'BookView'] - if using availableViews, must be in subset
"bottomPanel" : true, //whether or not to make the bottom panel available in this window
"bottomPanelVisible" : true, //whether or not to make the bottom panel visible in this window on load. This setting is dependent on bottomPanel being true
"sidePanel" : true, //whether or not to make the side panel available in this window
Expand All @@ -61,6 +61,7 @@
only valid if annotationLayer is set to True and an annotationEndpoint is defined.
This setting does NOT affect whether or not a user can edit an individual annotation that has already been created.*/
"annotationState" : 'annoOff', //[_'annoOff'_, 'annoOnCreateOff', 'annoOnCreateOn'] whether or not to turn on the annotation layer on window load
"annotationRefresh" : false, //whether or not to display the refresh icon for annotations
"fullScreen" : true, //whether or not to make the window's fullScreen button visible to user
"displayLayout" : true, //whether or not to display all layout options, removing individual menu options is separate
//control individual menu items in layout menu. if "displayLayout" is false, these options won't be applied
Expand Down
11 changes: 7 additions & 4 deletions js/src/widgets/contextControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
var _this = this;
this.element = jQuery(this.template({
tools : _this.availableTools,
showEdit : this.annotationCreationAvailable
showEdit : this.annotationCreationAvailable,
showRefresh : this.annotationRefresh
})).appendTo(this.container);
_this.container.find(".borderColorPicker").spectrum({
showInput: true,
Expand Down Expand Up @@ -163,9 +164,11 @@
'<a class="hud-control draw-tool mirador-osd-save-mode">',
'<i class="fa fa-lg fa-save"></i>',
'</a>',
'<a class="hud-control draw-tool mirador-osd-refresh-mode">',
'<i class="fa fa-lg fa-refresh"></i>',
'</a>',
'{{#if showRefresh}}',
'<a class="hud-control draw-tool mirador-osd-refresh-mode">',
'<i class="fa fa-lg fa-refresh"></i>',
'</a>',
'{{/if}}',
'{{/if}}',
/*'<a class="mirador-osd-list hud-control">',
'<i class="fa fa-lg fa-list"></i>',
Expand Down
1 change: 1 addition & 0 deletions js/src/widgets/hud.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
mode: 'displayAnnotations',
windowId: this.windowId,
annotationCreationAvailable: this.annotationCreationAvailable,
annotationRefresh: this.annotationRefresh,
availableTools: this.availableTools,
eventEmitter: this.eventEmitter
});
Expand Down
1 change: 1 addition & 0 deletions js/src/widgets/imageView.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
windowId: this.windowId,
annotationLayerAvailable: this.annotationLayerAvailable,
annotationCreationAvailable: this.annotationCreationAvailable,
annotationRefresh: this.annotationRefresh,
annoEndpointAvailable: this.annoEndpointAvailable,
showNextPrev : this.imagesList.length !== 1,
availableTools: this.availableTools,
Expand Down
3 changes: 2 additions & 1 deletion js/src/workspaces/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,8 @@
annotationLayerAvailable: this.annotationLayer,
annotationCreationAvailable: this.annotationCreation,
annoEndpointAvailable: this.annoEndpointAvailable,
annotationState : this.annotationState
annotationState : this.annotationState,
annotationRefresh: this.annotationRefresh
});
} else {
var view = this.focusModules.ImageView;
Expand Down
25 changes: 20 additions & 5 deletions spec/viewer/manifestListItem.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ describe('ManifestListItem', function () {
'<div class="repo-image"><img src="build/mirador/images/logos/iiif_logo.png" alt="repoImg"></div>'+
'<div class="select-metadata"><div class="manifest-title"><h3 title="Dummy Manifest">Dummy Manifest</h3></div>'+
'<div class="item-info"><div class="item-info-row"><div class="repo-label">Dummy Location</div>'+
'<div class="canvas-count">1 </div></div></div></div><div class="preview-images"></div><i class="fa fa fa-ellipsis-h remaining"></i></li>'+
'<div class="canvas-count">1 </div></div></div></div>'+
'<div class="preview-thumb">'+
'<div class="preview-images"><img src="http://www.example.org/iiif/image/1/full/22,/0/native.jpg" width="22.846563295533443" height="80" class="preview-image flash" data-image-id="http://www.example.org/iiif/book1/canvas/p1">'+
'</div></div></li>'+
'<li data-index-number="1"></li>'+
'<li data-index-number="5"></li>'+
'<li data-index-number="8"></li>'+
Expand Down Expand Up @@ -74,7 +77,10 @@ describe('ManifestListItem', function () {
'<div class="repo-image"><img src="build/mirador/images/logos/iiif_logo.png" alt="repoImg"></div>'+
'<div class="select-metadata"><div class="manifest-title"><h3 title="Dummy Manifest">Dummy Manifest</h3></div>'+
'<div class="item-info"><div class="item-info-row"><div class="repo-label">Dummy Location</div>'+
'<div class="canvas-count">1 </div></div></div></div><div class="preview-images"></div><i class="fa fa fa-ellipsis-h remaining"></i></li>'+
'<div class="canvas-count">1 </div></div></div></div>'+
'<div class="preview-thumb">'+
'<div class="preview-images"><img src="http://www.example.org/iiif/image/1/full/22,/0/native.jpg" width="22.846563295533443" height="80" class="preview-image flash" data-image-id="http://www.example.org/iiif/book1/canvas/p1">'+
'</div></div></li>'+
'<li data-index-number="5"></li>'+
'<li data-index-number="8"></li>'+
'<li data-index-number="13"></li>'+
Expand Down Expand Up @@ -113,7 +119,10 @@ describe('ManifestListItem', function () {
'<div class="repo-image"><img src="build/mirador/images/logos/iiif_logo.png" alt="repoImg"></div>'+
'<div class="select-metadata"><div class="manifest-title"><h3 title="Dummy Manifest">Dummy Manifest</h3></div>'+
'<div class="item-info"><div class="item-info-row"><div class="repo-label">Dummy Location</div>'+
'<div class="canvas-count">1 </div></div></div></div><div class="preview-images"></div><i class="fa fa fa-ellipsis-h remaining"></i></li>'+
'<div class="canvas-count">1 </div></div></div></div>'+
'<div class="preview-thumb">'+
'<div class="preview-images"><img src="http://www.example.org/iiif/image/1/full/22,/0/native.jpg" width="22.846563295533443" height="80" class="preview-image flash" data-image-id="http://www.example.org/iiif/book1/canvas/p1">'+
'</div></div></li>'+
'<li data-index-number="8"></li>'+
'<li data-index-number="13"></li>'+
'<li data-index-number="14"></li>'+
Expand Down Expand Up @@ -166,7 +175,10 @@ describe('ManifestListItem', function () {
'<div class="repo-image"><img src="build/mirador/images/logos/iiif_logo.png" alt="repoImg"></div>'+
'<div class="select-metadata"><div class="manifest-title"><h3 title="Dummy Manifest">Dummy Manifest</h3></div>'+
'<div class="item-info"><div class="item-info-row"><div class="repo-label">Dummy Location</div>'+
'<div class="canvas-count">1 </div></div></div></div><div class="preview-images"></div><i class="fa fa fa-ellipsis-h remaining"></i></li>'+
'<div class="canvas-count">1 </div></div></div></div>'+
'<div class="preview-thumb">'+
'<div class="preview-images"><img src="http://www.example.org/iiif/image/1/full/22,/0/native.jpg" width="22.846563295533443" height="80" class="preview-image flash" data-image-id="http://www.example.org/iiif/book1/canvas/p1">'+
'</div></div></li>'+
'</ul>';

expect(this.appendTo[0].outerHTML).toBe(expectedHTML);
Expand All @@ -193,7 +205,10 @@ describe('ManifestListItem', function () {
'<div class="repo-image"><img src="build/mirador/images/logos/iiif_logo.png" alt="repoImg"></div>'+
'<div class="select-metadata"><div class="manifest-title"><h3 title="Dummy Manifest">Dummy Manifest</h3></div>'+
'<div class="item-info"><div class="item-info-row"><div class="repo-label">Dummy Location</div>'+
'<div class="canvas-count">1 </div></div></div></div><div class="preview-images"></div><i class="fa fa fa-ellipsis-h remaining"></i></li>'+
'<div class="canvas-count">1 </div></div></div></div>'+
'<div class="preview-thumb">'+
'<div class="preview-images"><img src="http://www.example.org/iiif/image/1/full/22,/0/native.jpg" width="22.846563295533443" height="80" class="preview-image flash" data-image-id="http://www.example.org/iiif/book1/canvas/p1">'+
'</div></div></li>'+
'<li data-index-number="-1"></li>'+
'<li data-index-number="1"></li>'+
'<li data-index-number="5"></li>'+
Expand Down
6 changes: 5 additions & 1 deletion spec/workspaces/window.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ describe('Window', function() {
this.adjustHeight = jasmine.createSpy();
this.updateFocusImages = jasmine.createSpy();
});
spyOn(Mirador, 'ImageView').and.callFake(function() {
this.toggle = jasmine.createSpy();
this.adjustHeight = jasmine.createSpy();
});
spyOn(Mirador, 'BookView').and.callFake(function() {
this.updateImages = jasmine.createSpy();
this.toggle = jasmine.createSpy();
Expand Down Expand Up @@ -70,7 +74,7 @@ describe('Window', function() {
expect(this.appendTo.find('.remove-object-option').css('display')).toBe('none');
expect(this.appendTo.find('.book-option')).toExist();
expect(this.appendTo.find('.scroll-option')).toExist();
var calls = Mirador.ThumbnailsView.calls;
var calls = Mirador.ImageView.calls;
expect(calls.count()).toBe(1);
expect(calls.first().args[0].appendTo.is(this.appendTo.find('.view-container'))).toBe(true);
});
Expand Down

0 comments on commit 634940f

Please sign in to comment.