Skip to content

Commit

Permalink
Remove the AnnotationUISync service
Browse files Browse the repository at this point in the history
Its functionality has now been moved into the FrameSync service, except
for the logic that was intended to synchronize the "Show Annotation
Highlights" logic across multiple frames, since this is clearly broken
[1].

The two pieces of functionality related to this we need to support at
the moment are:

 1. The `showHighlights` config option to set whether highlights are
    initially visible.

 2. The highlight toggle button in the sidebar's outer frame

Both of these work without the sidebar app's involvement.

[1] See hypothesis/h#3433 and
    hypothesis/h#3295
  • Loading branch information
robertknight committed Nov 8, 2016
1 parent 95e4599 commit 42d9aba
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 160 deletions.
51 changes: 0 additions & 51 deletions h/static/scripts/annotation-ui-sync.js

This file was deleted.

1 change: 0 additions & 1 deletion h/static/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ module.exports = angular.module('h', [

.factory('store', require('./store'))

.value('AnnotationUISync', require('./annotation-ui-sync'))
.value('Discovery', require('./discovery'))
.value('ExcerptOverflowMonitor', require('./directive/excerpt-overflow-monitor'))
.value('VirtualThreadList', require('./virtual-thread-list'))
Expand Down
12 changes: 1 addition & 11 deletions h/static/scripts/frame-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ function formatAnnot(ann) {
* sidebar.
*/
// @ngInject
function FrameSync($rootScope, $window, AnnotationUISync, Discovery,
annotationUI, bridge) {
function FrameSync($rootScope, $window, Discovery, annotationUI, bridge) {

// List of frames currently connected to the sidebar
var frames = [];
Expand Down Expand Up @@ -133,15 +132,6 @@ function FrameSync($rootScope, $window, AnnotationUISync, Discovery,
bridge.on('sidebarOpened', function () {
$rootScope.$broadcast('sidebarOpened');
});

// Create an instance of the AnnotationUISync class which listens for
// selection/focus messages from the frame and propagates them to the rest
// of the sidebar app.
//
// FIXME: The frame message listeners from AnnotationUISync should be
// extracted and moved here and then the AnnotationUISync class can be
// removed entirely.
new AnnotationUISync($rootScope, $window, annotationUI, bridge);
}

/**
Expand Down
97 changes: 0 additions & 97 deletions h/static/scripts/test/annotation-ui-sync-test.js

This file was deleted.

0 comments on commit 42d9aba

Please sign in to comment.