Adding user preferences to LT and Viewer
This commit is contained in:
parent
3d081fe297
commit
e8d729c9b0
@ -26,6 +26,11 @@ Template.app.onCreated(() => {
|
|||||||
iconClasses: 'server',
|
iconClasses: 'server',
|
||||||
iconSvgUse: 'packages/ohif_user-management/assets/user-menu-icons.svg#server',
|
iconSvgUse: 'packages/ohif_user-management/assets/user-menu-icons.svg#server',
|
||||||
separatorAfter: true
|
separatorAfter: true
|
||||||
|
}, {
|
||||||
|
action: () => OHIF.ui.showDialog('userPreferencesDialog'),
|
||||||
|
text: 'Preferences',
|
||||||
|
icon: 'fa fa-user',
|
||||||
|
separatorAfter: true
|
||||||
}, {
|
}, {
|
||||||
action: OHIF.user.changePassword,
|
action: OHIF.user.changePassword,
|
||||||
text: 'Change Password',
|
text: 'Change Password',
|
||||||
|
|||||||
18
LesionTracker/client/components/userPreferences/dialog.html
Normal file
18
LesionTracker/client/components/userPreferences/dialog.html
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<template name="userPreferencesDialog">
|
||||||
|
{{#dialogSimple (extend this class='themed' dialogClass='dialog-user-preferences modal-lg' title='User Preferences')}}
|
||||||
|
<ul class="nav nav-tabs">
|
||||||
|
<li role="presentation" class="{{tabClasses 'hotkeys'}}">
|
||||||
|
<a href="#" data-id="hotkeys">Keyboard Shortcuts</a>
|
||||||
|
</li>
|
||||||
|
<li role="presentation" class="{{tabClasses 'wwwc'}}">
|
||||||
|
<a href="#" data-id="wwwc">Window W/L</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="{{#unless eq instance.activeTab.get 'hotkeys'}}hidden{{/unless}}">
|
||||||
|
{{>hotkeysForm (extend contextName='viewer')}}
|
||||||
|
</div>
|
||||||
|
<div class="{{#unless eq instance.activeTab.get 'wwwc'}}hidden{{/unless}}">
|
||||||
|
{{>windowLevelPresetsForm}}
|
||||||
|
</div>
|
||||||
|
{{/dialogSimple}}
|
||||||
|
</template>
|
||||||
22
LesionTracker/client/components/userPreferences/dialog.js
Normal file
22
LesionTracker/client/components/userPreferences/dialog.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { Template } from 'meteor/templating';
|
||||||
|
import { ReactiveVar } from 'meteor/reactive-var';
|
||||||
|
|
||||||
|
Template.userPreferencesDialog.onCreated(() => {
|
||||||
|
const instance = Template.instance();
|
||||||
|
instance.activeTab = new ReactiveVar('hotkeys');
|
||||||
|
});
|
||||||
|
|
||||||
|
Template.userPreferencesDialog.events({
|
||||||
|
'click .nav-tabs li a'(event, instance) {
|
||||||
|
const tabId = $(event.currentTarget).attr('data-id');
|
||||||
|
instance.activeTab.set(tabId);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Template.userPreferencesDialog.helpers({
|
||||||
|
tabClasses(tabId) {
|
||||||
|
const instance = Template.instance();
|
||||||
|
const activeTab = instance.activeTab.get();
|
||||||
|
return tabId === activeTab ? 'active' : '';
|
||||||
|
}
|
||||||
|
});
|
||||||
14
LesionTracker/client/components/userPreferences/dialog.styl
Normal file
14
LesionTracker/client/components/userPreferences/dialog.styl
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
@require '{ohif:design}/app'
|
||||||
|
|
||||||
|
.dialog-user-preferences
|
||||||
|
|
||||||
|
.form-content
|
||||||
|
margin-bottom: 10px
|
||||||
|
margin-left: -15px
|
||||||
|
margin-right: -15px
|
||||||
|
max-height: 70vh
|
||||||
|
overflow-y: auto
|
||||||
|
padding: 15px
|
||||||
|
|
||||||
|
.popover
|
||||||
|
width: 300px
|
||||||
@ -13,6 +13,11 @@ Template.ohifViewer.onCreated(() => {
|
|||||||
text: 'Server Information',
|
text: 'Server Information',
|
||||||
icon: 'fa fa-server fa-lg',
|
icon: 'fa fa-server fa-lg',
|
||||||
separatorAfter: true
|
separatorAfter: true
|
||||||
|
}, {
|
||||||
|
action: () => OHIF.ui.showDialog('userPreferencesDialog'),
|
||||||
|
text: 'Preferences',
|
||||||
|
icon: 'fa fa-user',
|
||||||
|
separatorAfter: true
|
||||||
}, {
|
}, {
|
||||||
action: () => OHIF.ui.showDialog('aboutModal'),
|
action: () => OHIF.ui.showDialog('aboutModal'),
|
||||||
text: 'About',
|
text: 'About',
|
||||||
|
|||||||
18
OHIFViewer/client/components/userPreferences/dialog.html
Normal file
18
OHIFViewer/client/components/userPreferences/dialog.html
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<template name="userPreferencesDialog">
|
||||||
|
{{#dialogSimple (extend this class='themed' dialogClass='dialog-user-preferences modal-lg' title='User Preferences')}}
|
||||||
|
<ul class="nav nav-tabs">
|
||||||
|
<li role="presentation" class="{{tabClasses 'hotkeys'}}">
|
||||||
|
<a href="#" data-id="hotkeys">Keyboard Shortcuts</a>
|
||||||
|
</li>
|
||||||
|
<li role="presentation" class="{{tabClasses 'wwwc'}}">
|
||||||
|
<a href="#" data-id="wwwc">Window W/L</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="{{#unless eq instance.activeTab.get 'hotkeys'}}hidden{{/unless}}">
|
||||||
|
{{>hotkeysForm (extend contextName='viewer')}}
|
||||||
|
</div>
|
||||||
|
<div class="{{#unless eq instance.activeTab.get 'wwwc'}}hidden{{/unless}}">
|
||||||
|
{{>windowLevelPresetsForm}}
|
||||||
|
</div>
|
||||||
|
{{/dialogSimple}}
|
||||||
|
</template>
|
||||||
22
OHIFViewer/client/components/userPreferences/dialog.js
Normal file
22
OHIFViewer/client/components/userPreferences/dialog.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { Template } from 'meteor/templating';
|
||||||
|
import { ReactiveVar } from 'meteor/reactive-var';
|
||||||
|
|
||||||
|
Template.userPreferencesDialog.onCreated(() => {
|
||||||
|
const instance = Template.instance();
|
||||||
|
instance.activeTab = new ReactiveVar('hotkeys');
|
||||||
|
});
|
||||||
|
|
||||||
|
Template.userPreferencesDialog.events({
|
||||||
|
'click .nav-tabs li a'(event, instance) {
|
||||||
|
const tabId = $(event.currentTarget).attr('data-id');
|
||||||
|
instance.activeTab.set(tabId);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Template.userPreferencesDialog.helpers({
|
||||||
|
tabClasses(tabId) {
|
||||||
|
const instance = Template.instance();
|
||||||
|
const activeTab = instance.activeTab.get();
|
||||||
|
return tabId === activeTab ? 'active' : '';
|
||||||
|
}
|
||||||
|
});
|
||||||
14
OHIFViewer/client/components/userPreferences/dialog.styl
Normal file
14
OHIFViewer/client/components/userPreferences/dialog.styl
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
@require '{ohif:design}/app'
|
||||||
|
|
||||||
|
.dialog-user-preferences
|
||||||
|
|
||||||
|
.form-content
|
||||||
|
margin-bottom: 10px
|
||||||
|
margin-left: -15px
|
||||||
|
margin-right: -15px
|
||||||
|
max-height: 70vh
|
||||||
|
overflow-y: auto
|
||||||
|
padding: 15px
|
||||||
|
|
||||||
|
.popover
|
||||||
|
width: 300px
|
||||||
@ -86,7 +86,9 @@ export class HotkeysManager {
|
|||||||
return reject();
|
return reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
context.extend(definitions);
|
context.destroy();
|
||||||
|
context.definitions = definitions;
|
||||||
|
context.initialize();
|
||||||
this.changeObserver.changed();
|
this.changeObserver.changed();
|
||||||
resolve(definitions);
|
resolve(definitions);
|
||||||
}).catch(reject);
|
}).catch(reject);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user