Skip to content

Commit

Permalink
Improve gui styles. Improve tooltip. Improve FragmentParser.
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-wu committed Jul 14, 2019
1 parent a9954aa commit da9e310
Show file tree
Hide file tree
Showing 10 changed files with 211 additions and 68 deletions.
162 changes: 128 additions & 34 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions src/modules/BaseModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var BaseModule = function() {
this.messageFunction = undefined;
/** Notifier handle for informing other modules of any changes **/
this.eventNotifiers = [];
this.broadcastChannels = {};
}

BaseModule.prototype.setName = function(name) {
Expand All @@ -19,6 +20,22 @@ BaseModule.prototype.setName = function(name) {
}
}

BaseModule.prototype.addBroadcastChannels = function(ChannelName) {
if (ChannelName in this.broadcastChannels)
return false;
var newChannel = new (require('broadcast-channel')).default(ChannelName);
this.broadcastChannels[ChannelName] = newChannel;
return true;
}

BaseModule.prototype.removeBroadcastChannels = function(ChannelName) {
if (ChannelName in this.broadcastChannels) {
this.broadcastChannels[ChannelName].close();
delete broadcastChannels[ChannelName];
}

}

BaseModule.prototype.settingsChanged = function() {
var callbackArray = this.onChangedCallbacks.slice();
for (var i = 0; i < callbackArray.length; i++) {
Expand All @@ -45,6 +62,11 @@ BaseModule.prototype.publishChanges = function(annotations, eventType) {
for (var i = 0; i < this.eventNotifiers.length; i++) {
this.eventNotifiers[i].publish(this, eventType, annotations);
}
if (eventType === require("../utilities/eventNotifier").EVENT_TYPE.SELECTED) {
for (var key in this.broadcastChannels) {
this.broadcastChannels[key].postMessage(annotations);
}
}
}

BaseModule.prototype.setMessageFunction = function(functionIn) {
Expand Down
4 changes: 2 additions & 2 deletions src/modules/organsRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ var OrgansViewer = function(ModelsLoaderIn) {
var modelPanel = undefined;
var modelsLoader = ModelsLoaderIn;
var _this = this;
_this.typeName = "Organs Viewer";
_this.typeName = "Organ Viewer";
// Secondary renderer, used for comparing species models.
var secondaryRenderer = undefined;
var secondaryRendererContainer = undefined;
Expand Down Expand Up @@ -896,7 +896,7 @@ var OrgansViewer = function(ModelsLoaderIn) {
settings.species = sceneData.currentSpecies;
settings.metaURL = sceneData.metaURL;
settings.viewURL = sceneData.viewURL;
settings.dialog = "Organs Viewer";
settings.dialog = "Organ Viewer";
return settings;
}

Expand Down

0 comments on commit da9e310

Please sign in to comment.