First pass at a Hanging Protocol implementation and editor (LT-131)
This commit is contained in:
1 parent
dfcb33153f
commit
2e52d9e3c1
157 files changed
+8869
-23585
No files matched your search
@@ -0,0 +1,31 @@
|
||||
<template name="settingsTable">
|
||||
<table class="settingsTable table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Setting</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ #each objectToPairs settings }}
|
||||
{{#if value}}
|
||||
<tr>
|
||||
<td>
|
||||
<i class="fa fa-pencil editSetting"></i>
|
||||
<i class="fa fa-trash deleteSetting"></i>
|
||||
{{getSettingText}}
|
||||
</td>
|
||||
<td>
|
||||
{{prettyPrintStringify value}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/if}}
|
||||
{{ /each }}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="addSettingContainer">
|
||||
<span class="addSetting">
|
||||
Add Display Setting <i class="fa fa-plus-circle"></i>
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,57 @@
|
||||
Template.settingsTable.events({
|
||||
/**
|
||||
* Opens the Setting Entry dialog to allow the user to create a new setting
|
||||
* Specifies attributes and setting level for the Setting Entry dialog
|
||||
* based on the data given to this template.
|
||||
*/
|
||||
'click .addSetting': function() {
|
||||
// Open the Setting Entry Dialog
|
||||
openSettingEntryDialog();
|
||||
},
|
||||
/**
|
||||
* Opens the Setting Entry dialog to allow the user to edit an existing
|
||||
* setting. Passes setting details to the dialog so its current properties
|
||||
* can be displayed.
|
||||
*
|
||||
* Specifies attributes for the Setting Entry dialog
|
||||
* based on the data given to this template.
|
||||
*/
|
||||
'click .editSetting': function() {
|
||||
// Get the properties of the current setting
|
||||
var setting = this;
|
||||
|
||||
// Open the Setting Entry Dialog with the setting
|
||||
openSettingEntryDialog(setting);
|
||||
},
|
||||
/**
|
||||
* Removes a setting from the current Viewport
|
||||
*/
|
||||
'click .deleteSetting': function() {
|
||||
// Get the properties of the current setting
|
||||
var setting = this;
|
||||
|
||||
// Retrieve the current viewport model
|
||||
var viewport = getActiveViewportModel();
|
||||
|
||||
// Remove the specified setting
|
||||
delete viewport.viewportSettings[setting.key];
|
||||
|
||||
// Instruct the Protocol Engine to update the Layout Manager with new data
|
||||
var viewportIndex = Session.get('activeViewport');
|
||||
ProtocolEngine.updateViewports(viewportIndex);
|
||||
}
|
||||
});
|
||||
|
||||
Template.settingsTable.helpers({
|
||||
getSettingText: function() {
|
||||
var setting = this;
|
||||
if (HP.CustomViewportSettings[setting.key]) {
|
||||
return HP.CustomViewportSettings[setting.key].text;
|
||||
} else if (HP.displaySettings[setting.key]) {
|
||||
return HP.displaySettings[setting.key].text;
|
||||
} else {
|
||||
return Blaze._globalHelpers['prettyPrintStringify'](setting.key);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,44 @@
|
||||
table.settingsTable
|
||||
thead
|
||||
tr
|
||||
th
|
||||
color: whitesmoke
|
||||
text-align: center
|
||||
|
||||
th:first-child
|
||||
text-align: left
|
||||
|
||||
tbody
|
||||
background: #3e3e3e
|
||||
|
||||
tr
|
||||
td
|
||||
color: #ffffff
|
||||
text-align: center
|
||||
|
||||
.editSetting
|
||||
.deleteSetting
|
||||
&:hover, &:active
|
||||
cursor:pointer
|
||||
color: #48d3ff
|
||||
|
||||
-webkit-transition: all 0.1s ease
|
||||
-moz-transition: all 0.1s ease
|
||||
transition: all 0.1s ease
|
||||
|
||||
td:first-child
|
||||
text-align: left
|
||||
|
||||
.addSettingContainer
|
||||
margin: 10px 0
|
||||
text-align: center
|
||||
color: #ffffff
|
||||
|
||||
.addSetting
|
||||
&:hover, &:active
|
||||
cursor: pointer
|
||||
color: #48d3ff
|
||||
|
||||
-webkit-transition: all 0.1s ease
|
||||
-moz-transition: all 0.1s ease
|
||||
transition: all 0.1s ease
|
||||
Reference in new issue
Block a user