First pass at a Hanging Protocol implementation and editor (LT-131)

This commit is contained in:
Erik Ziegler committed 2016-05-07 12:40:02 +02:00
1 parent dfcb33153f
commit 2e52d9e3c1
157 files changed
+8869 -23585

No files matched your search

@@ -0,0 +1,29 @@
<template name="matchedProtocols">
<div id='matchedProtocols' class="btn-group">
{{ #if matchedProtocols }}
<button type="button" class="btn btn-sm dropdown-toggle"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
title="Select Hanging Protocol">
<i class="fa fa-list-ol"></i><span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<h5>Select a Hanging Protocol</h5>
</li>
{{ #each matchedProtocols }}
<li>
<a class='matchedProtocol {{#if active}}active{{/if}}'>{{name}}</a>
</li>
{{ /each }}
</ul>
{{ /if }}
<button id="toggleProtocolEditor" type="button" class="btn btn-sm"
title="Toggle Hanging Protocol Editor"
data-toggle="tooltip">
<i class="fa fa-cog"></i>
</button>
</div>
</template>
@@ -0,0 +1,50 @@
Template.matchedProtocols.onRendered(function() {
$('#matchedProtocols button').tooltip(OHIF.viewer.tooltipConfig);
});
Template.matchedProtocols.helpers({
/**
* Reactively re-render the MatchedProtocols Collection contents
*/
matchedProtocols: function() {
return MatchedProtocols.find();
}
});
Template.matchedProtocols.events({
/**
* Instruct the ProtocolEngine to apply the specified Hanging Protocol
*/
'click .matchedProtocol': function() {
var protocol = this;
ProtocolEngine.setHangingProtocol(protocol);
},
/**
* Show/hide the Protocol Editor sidebar
*/
'click #toggleProtocolEditor': function() {
// Select the Protocol Editor DOM element
var editor = $('#protocolEditor');
// Modulate the main viewer width in response to the sidebar being open
// This code is commented out so that the protocol editor is an overlay, rather than a sidebar
// This is something that is debatable at the moment, so I am not removing the code just yet
//
/* if (editor.hasClass('cbp-spmenu-open')) {
// Set the Viewer widths to reflect a hidden Protocol Editor
$('.viewerMain').width('calc(100% - 120px)');
$('.navbar').width('100%');
} else {
// Set the Viewer widths to reflect an open Protocol Editor
$('.viewerMain').width('calc(100% - 120px - 450px)');
$('.navbar').width('calc(100% - 450px)');
}*/
// Toggle a class reflect whether or not the Protocol Editor is displayed
editor.toggleClass('cbp-spmenu-open');
// Fire the resize handler after a short delay so that the animation can complete
setTimeout(handleResize, 150);
}
});
@@ -0,0 +1,14 @@
#matchedProtocols
ul.dropdown-menu
li
a
cursor: pointer
&:selected
color: #4fbfff
h5
display: block;
padding: 3px 20px;
clear: both;
line-height: 1.42857143;