mirror of https://github.com/MISP/MISP
UI tooltip love
parent
90dd14808d
commit
0d66ef931a
|
@ -5,18 +5,15 @@
|
|||
<?php
|
||||
echo $this->Form->hidden('event_id');
|
||||
echo $this->Form->input('category', array(
|
||||
'after' => $this->Html->div('forminfo', '', array('id' => 'AttributeCategoryDiv')),
|
||||
'empty' => '(choose one)'
|
||||
));
|
||||
echo $this->Form->input('type', array(
|
||||
'after' => $this->Html->div('forminfo', '', array('id' => 'AttributeTypeDiv')),
|
||||
'empty' => '(first choose category)'
|
||||
));
|
||||
if ('true' == Configure::read('CyDefSIG.sync')) {
|
||||
echo $this->Form->input('distribution', array(
|
||||
'label' => 'Distribution',
|
||||
'selected' => $maxDist,
|
||||
'after' => $this->Html->div('forminfo', '', array('id' => 'AttributeDistributionDiv'))
|
||||
));
|
||||
}
|
||||
echo $this->Form->input('value', array(
|
||||
|
@ -30,18 +27,16 @@
|
|||
<?php
|
||||
echo $this->Form->input('to_ids', array(
|
||||
'checked' => true,
|
||||
'after' => $this->Html->div('forminfo', isset($attrDescriptions['signature']['formdesc']) ? $attrDescriptions['signature']['formdesc'] : $attrDescriptions['signature']['desc']),
|
||||
'data-content' => isset($attrDescriptions['signature']['formdesc']) ? $attrDescriptions['signature']['formdesc'] : $attrDescriptions['signature']['desc'],
|
||||
'label' => 'IDS Signature?',
|
||||
));
|
||||
echo $this->Form->input('batch_import', array(
|
||||
'type' => 'checkbox',
|
||||
'after' => $this->Html->div('forminfo', 'Create multiple attributes one per line'),
|
||||
'data-content' => 'Create multiple attributes one per line',
|
||||
));
|
||||
|
||||
// link an onchange event to the form elements
|
||||
$this->Js->get('#AttributeCategory')->event('change', 'formCategoryChanged("#AttributeCategory")');
|
||||
$this->Js->get('#AttributeType')->event('change', 'showFormInfo("#AttributeType")');
|
||||
$this->Js->get('#AttributeDistribution')->event('change', 'showFormInfo("#AttributeDistribution")');
|
||||
?>
|
||||
</fieldset>
|
||||
<?php
|
||||
|
@ -52,17 +47,12 @@ echo $this->Form->end();
|
|||
<div class="actions">
|
||||
<ul class="nav nav-list">
|
||||
<li><?php echo $this->Html->link('View Event', array('controller' => 'events', 'action' => 'view', $this->request->data['Attribute']['event_id'])); ?> </li>
|
||||
<?php if ($isSiteAdmin || $mayModify): ?>
|
||||
<li><?php echo $this->Html->link('Edit Event', array('controller' => 'events', 'action' => 'edit', $this->request->data['Attribute']['event_id'])); ?> </li>
|
||||
<li><?php echo $this->Form->postLink('Delete Event', array('controller' => 'events', 'action' => 'delete', $this->request->data['Attribute']['event_id']), null, __('Are you sure you want to delete # %s?', $this->request->data['Attribute']['event_id'])); ?></li>
|
||||
<li class="divider"></li>
|
||||
<li class="active"><?php echo $this->Html->link('Add Attribute', array('controller' => 'attributes', 'action' => 'add', $this->request->data['Attribute']['event_id']));?> </li>
|
||||
<li><?php echo $this->Html->link('Add Attachment', array('controller' => 'attributes', 'action' => 'add_attachment', $this->request->data['Attribute']['event_id']));?> </li>
|
||||
<li><?php echo $this->Html->link('Populate event from IOC', array('controller' => 'events', 'action' => 'addIOC', $this->request->data['Attribute']['event_id']));?> </li>
|
||||
<?php else: ?>
|
||||
<li><?php echo $this->Html->link('Propose Attribute', array('controller' => 'shadow_attributes', 'action' => 'add', $this->request->data['Attribute']['event_id']));?> </li>
|
||||
<li><?php echo $this->Html->link('Propose Attachment', array('controller' => 'shadow_attributes', 'action' => 'add_attachment', $this->request->data['Attribute']['event_id']));?> </li>
|
||||
<?php endif; ?>
|
||||
<li class="divider"></li>
|
||||
<li><?php echo $this->Html->link(__('Contact reporter', true), array('controller' => 'events', 'action' => 'contact', $this->request->data['Attribute']['event_id'])); ?> </li>
|
||||
<li><?php echo $this->Html->link(__('Download as XML', true), array('controller' => 'events', 'action' => 'xml', 'download', $this->request->data['Attribute']['event_id'])); ?></li>
|
||||
|
@ -94,7 +84,6 @@ foreach ($categoryDefinitions as $category => $def) {
|
|||
?>
|
||||
|
||||
function formCategoryChanged(id) {
|
||||
showFormInfo(id); // display the tooltip
|
||||
// fill in the types
|
||||
var options = $('#AttributeType').prop('options');
|
||||
$('option', $('#AttributeType')).remove();
|
||||
|
@ -125,23 +114,39 @@ foreach ($distributionDescriptions as $type => $def) {
|
|||
}
|
||||
?>
|
||||
|
||||
function showFormInfo(id) {
|
||||
idDiv = id+'Div';
|
||||
// LATER use nice animations
|
||||
//$(idDiv).hide('fast');
|
||||
// change the content
|
||||
var value = $(id).val(); // get the selected value
|
||||
$(idDiv).html(formInfoValues[value]); // search in a lookup table
|
||||
$(document).ready(function() {
|
||||
|
||||
// show it again
|
||||
$(idDiv).fadeIn('slow');
|
||||
}
|
||||
$("#AttributeType, #AttributeCategory, #Attribute, #AttributeDistribution").on('mouseleave', function(e) {
|
||||
$('#'+e.currentTarget.id).popover('destroy');
|
||||
});
|
||||
|
||||
$("#AttributeType, #AttributeCategory, #Attribute, #AttributeDistribution").on('mouseover', function(e) {
|
||||
var $e = $(e.target);
|
||||
if ($e.is('option')) {
|
||||
$('#'+e.currentTarget.id).popover('destroy');
|
||||
$('#'+e.currentTarget.id).popover({
|
||||
trigger: 'manual',
|
||||
placement: 'right',
|
||||
content: formInfoValues[$e.val()],
|
||||
}).popover('show');
|
||||
}
|
||||
});
|
||||
|
||||
$("input, label").on('mouseleave', function(e) {
|
||||
$('#'+e.currentTarget.id).popover('destroy');
|
||||
});
|
||||
|
||||
$("input, label").on('mouseover', function(e) {
|
||||
var $e = $(e.target);
|
||||
$('#'+e.currentTarget.id).popover('destroy');
|
||||
$('#'+e.currentTarget.id).popover({
|
||||
trigger: 'manual',
|
||||
placement: 'right',
|
||||
}).popover('show');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// hide the formInfo things
|
||||
$('#AttributeTypeDiv').hide();
|
||||
$('#AttributeCategoryDiv').hide();
|
||||
$('#AttributeType').prop('disabled', true);
|
||||
$('#AttributeDistributionDiv').hide();
|
||||
|
||||
|
||||
</script>
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
<?php
|
||||
$mayModify = (($isAclModify && $attribute['Event']['user_id'] == $me['id']) || ($isAclModifyOrg && $attribute['Event']['org'] == $me['org']));
|
||||
?>
|
||||
<div class="attributes form">
|
||||
<?php echo $this->Form->create('Attribute');?>
|
||||
<fieldset>
|
||||
|
@ -8,18 +5,15 @@ $mayModify = (($isAclModify && $attribute['Event']['user_id'] == $me['id']) || (
|
|||
<?php
|
||||
echo $this->Form->hidden('event_id');
|
||||
echo $this->Form->input('category', array(
|
||||
'after' => $this->Html->div('forminfo', '', array('id' => 'AttributeCategoryDiv')),
|
||||
'empty' => '(choose one)'
|
||||
));
|
||||
echo $this->Form->input('type', array(
|
||||
'after' => $this->Html->div('forminfo', '', array('id' => 'AttributeTypeDiv')),
|
||||
'empty' => '(first choose category)'
|
||||
));
|
||||
if ('true' == Configure::read('CyDefSIG.sync')) {
|
||||
if ('true' == Configure::read('CyDefSIG.sync') && $canEditDist) {
|
||||
echo $this->Form->input('distribution', array(
|
||||
'label' => 'Distribution',
|
||||
'selected' => $maxDist,
|
||||
'after' => $this->Html->div('forminfo', '', array('id' => 'AttributeDistributionDiv'))
|
||||
));
|
||||
}
|
||||
echo $this->Form->input('value', array(
|
||||
|
@ -33,18 +27,16 @@ $mayModify = (($isAclModify && $attribute['Event']['user_id'] == $me['id']) || (
|
|||
<?php
|
||||
echo $this->Form->input('to_ids', array(
|
||||
'checked' => true,
|
||||
'after' => $this->Html->div('forminfo', isset($attrDescriptions['signature']['formdesc']) ? $attrDescriptions['signature']['formdesc'] : $attrDescriptions['signature']['desc']),
|
||||
'data-content' => isset($attrDescriptions['signature']['formdesc']) ? $attrDescriptions['signature']['formdesc'] : $attrDescriptions['signature']['desc'],
|
||||
'label' => 'IDS Signature?',
|
||||
));
|
||||
echo $this->Form->input('batch_import', array(
|
||||
'type' => 'checkbox',
|
||||
'after' => $this->Html->div('forminfo', 'Create multiple attributes one per line'),
|
||||
'data-content' => 'Create multiple attributes one per line',
|
||||
));
|
||||
|
||||
// link an onchange event to the form elements
|
||||
$this->Js->get('#AttributeCategory')->event('change', 'formCategoryChanged("#AttributeCategory")');
|
||||
$this->Js->get('#AttributeType')->event('change', 'showFormInfo("#AttributeType")');
|
||||
$this->Js->get('#AttributeDistribution')->event('change', 'showFormInfo("#AttributeDistribution")');
|
||||
?>
|
||||
</fieldset>
|
||||
<?php
|
||||
|
@ -55,17 +47,12 @@ echo $this->Form->end();
|
|||
<div class="actions">
|
||||
<ul class="nav nav-list">
|
||||
<li><?php echo $this->Html->link('View Event', array('controller' => 'events', 'action' => 'view', $this->request->data['Attribute']['event_id'])); ?> </li>
|
||||
<?php if ($isSiteAdmin || $mayModify): ?>
|
||||
<li><?php echo $this->Html->link('Edit Event', array('controller' => 'events', 'action' => 'edit', $this->request->data['Attribute']['event_id'])); ?> </li>
|
||||
<li><?php echo $this->Form->postLink('Delete Event', array('controller' => 'events', 'action' => 'delete', $this->request->data['Attribute']['event_id']), null, __('Are you sure you want to delete # %s?', $this->request->data['Attribute']['event_id'])); ?></li>
|
||||
<li class="divider"></li>
|
||||
<li><?php echo $this->Html->link('Add Attribute', array('controller' => 'attributes', 'action' => 'add', $this->request->data['Attribute']['event_id']));?> </li>
|
||||
<li><?php echo $this->Html->link('Add Attachment', array('controller' => 'attributes', 'action' => 'add_attachment', $this->request->data['Attribute']['event_id']));?> </li>
|
||||
<li><?php echo $this->Html->link('Populate event from IOC', array('controller' => 'events', 'action' => 'addIOC', $this->request->data['Attribute']['event_id']));?> </li>
|
||||
<?php else: ?>
|
||||
<li><?php echo $this->Html->link('Propose Attribute', array('controller' => 'shadow_attributes', 'action' => 'add', $this->request->data['Attribute']['event_id']));?> </li>
|
||||
<li><?php echo $this->Html->link('Propose Attachment', array('controller' => 'shadow_attributes', 'action' => 'add_attachment', $this->request->data['Attribute']['event_id']));?> </li>
|
||||
<?php endif; ?>
|
||||
<li class="divider"></li>
|
||||
<li><?php echo $this->Html->link(__('Contact reporter', true), array('controller' => 'events', 'action' => 'contact', $this->request->data['Attribute']['event_id'])); ?> </li>
|
||||
<li><?php echo $this->Html->link(__('Download as XML', true), array('controller' => 'events', 'action' => 'xml', 'download', $this->request->data['Attribute']['event_id'])); ?></li>
|
||||
|
@ -96,7 +83,6 @@ foreach ($categoryDefinitions as $category => $def) {
|
|||
?>
|
||||
|
||||
function formCategoryChanged(id) {
|
||||
showFormInfo(id); // display the tooltip
|
||||
// fill in the types
|
||||
var options = $('#AttributeType').prop('options');
|
||||
$('option', $('#AttributeType')).remove();
|
||||
|
@ -121,32 +107,48 @@ foreach ($categoryDefinitions as $category => $def) {
|
|||
$info = isset($def['formdesc']) ? $def['formdesc'] : $def['desc'];
|
||||
echo "formInfoValues['" . addslashes($category) . "'] = \"" . addslashes($info) . "\";\n"; // as we output JS code we need to add slashes
|
||||
}
|
||||
foreach ($distributionDescriptions as $type => $def) {
|
||||
$info = isset($def['formdesc']) ? $def['formdesc'] : $def['desc'];
|
||||
echo "formInfoValues['" . addslashes($type) . "'] = \"" . addslashes($info) . "\";\n"; // as we output JS code we need to add slashes
|
||||
if ($canEditDist) {
|
||||
foreach ($distributionDescriptions as $type => $def) {
|
||||
$info = isset($def['formdesc']) ? $def['formdesc'] : $def['desc'];
|
||||
echo "formInfoValues['" . addslashes($type) . "'] = \"" . addslashes($info) . "\";\n"; // as we output JS code we need to add slashes
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
function showFormInfo(id) {
|
||||
idDiv = id+'Div';
|
||||
// LATER use nice animations
|
||||
//$(idDiv).hide('fast');
|
||||
// change the content
|
||||
var value = $(id).val(); // get the selected value
|
||||
$(idDiv).html(formInfoValues[value]); // search in a lookup table
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#AttributeType, #AttributeCategory, #Attribute, #AttributeDistribution").on('mouseleave', function(e) {
|
||||
$('#'+e.currentTarget.id).popover('destroy');
|
||||
});
|
||||
|
||||
$("#AttributeType, #AttributeCategory, #Attribute, #AttributeDistribution").on('mouseover', function(e) {
|
||||
var $e = $(e.target);
|
||||
if ($e.is('option')) {
|
||||
$('#'+e.currentTarget.id).popover('destroy');
|
||||
$('#'+e.currentTarget.id).popover({
|
||||
trigger: 'manual',
|
||||
placement: 'right',
|
||||
content: formInfoValues[$e.val()],
|
||||
}).popover('show');
|
||||
}
|
||||
});
|
||||
|
||||
$("input, label").on('mouseleave', function(e) {
|
||||
$('#'+e.currentTarget.id).popover('destroy');
|
||||
});
|
||||
|
||||
$("input, label").on('mouseover', function(e) {
|
||||
var $e = $(e.target);
|
||||
$('#'+e.currentTarget.id).popover('destroy');
|
||||
$('#'+e.currentTarget.id).popover({
|
||||
trigger: 'manual',
|
||||
placement: 'right',
|
||||
}).popover('show');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// show it again
|
||||
$(idDiv).fadeIn('slow');
|
||||
}
|
||||
|
||||
//hide the formInfo things
|
||||
$('#AttributeTypeDiv').hide();
|
||||
$('#AttributeCategoryDiv').hide();
|
||||
$('#AttributeDistributionDiv').hide();
|
||||
// fix the select box based on what was selected
|
||||
var type_value = $('#AttributeType').val();
|
||||
formCategoryChanged("#AttributeCategory");
|
||||
$('#AttributeType').val(type_value);
|
||||
|
||||
</script>
|
||||
<?php echo $this->Js->writeBuffer(); // Write cached scripts
|
||||
|
|
|
@ -145,4 +145,15 @@ endforeach;
|
|||
<li><?php echo $this->Html->link('Automation', array('controller' => 'events', 'action' => 'automation')); ?></li>
|
||||
<?php endif;?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
// tooltips
|
||||
$(document).ready(function () {
|
||||
$("td, div").tooltip({
|
||||
'placement': 'top',
|
||||
'container' : 'body',
|
||||
delay: { show: 500, hide: 100 }
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
|
@ -16,9 +16,9 @@
|
|||
<?php
|
||||
echo $this->Form->input('type', array(
|
||||
'div' => 'input clear',
|
||||
'after' => $this->Html->div('forminfo', '', array('id' => 'AttributeTypeDiv'))
|
||||
));
|
||||
echo $this->Form->input('category', array('after' => $this->Html->div('forminfo', '', array('id' => 'AttributeCategoryDiv'))));
|
||||
echo $this->Form->input('category', array(
|
||||
));
|
||||
?>
|
||||
</fieldset>
|
||||
<?php
|
||||
|
@ -99,7 +99,6 @@ foreach ($typeDefinitions as $type => $def) {
|
|||
|
||||
function formCategoryChanged(id) {
|
||||
var alreadySelected = $('#AttributeType').val();
|
||||
showFormInfo(id); // display the tooltip
|
||||
// empty the types
|
||||
document.getElementById("AttributeType").options.length = 1;
|
||||
// add new items to options
|
||||
|
@ -112,15 +111,10 @@ function formCategoryChanged(id) {
|
|||
});
|
||||
// enable the form element
|
||||
$('#AttributeType').prop('disabled', false);
|
||||
if ("ALL" == $('#AttributeCategory').val()) {
|
||||
//alert($('#AttributeCategory').val());
|
||||
$('#AttributeCategoryDiv').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function formTypeChanged(id) {
|
||||
var alreadySelected = $('#AttributeCategory').val();
|
||||
showFormInfo(id); // display the tooltip
|
||||
// empty the categories
|
||||
document.getElementById("AttributeCategory").options.length = 2;
|
||||
// add new items to options
|
||||
|
@ -133,10 +127,6 @@ function formTypeChanged(id) {
|
|||
});
|
||||
// enable the form element
|
||||
$('#AttributeCategory').prop('disabled', false);
|
||||
if ("ALL" == $('#AttributeType').val()) {
|
||||
//alert($('#AttributeType').val());
|
||||
$('#AttributeTypeDiv').hide();
|
||||
}
|
||||
}
|
||||
|
||||
var formInfoValues = new Array();
|
||||
|
@ -151,33 +141,36 @@ foreach ($categoryDefinitions as $category => $def) {
|
|||
echo "formInfoValues['$category'] = \"$info\";\n";
|
||||
}
|
||||
$this->Js->get('#AttributeCategory')->event('change', 'formCategoryChanged("#AttributeCategory")');
|
||||
$this->Js->get('#AttributeCategory')->event('change', 'showFormInfo("#AttributeCategory")');
|
||||
$this->Js->get('#AttributeType')->event('change', 'formTypeChanged("#AttributeType")');
|
||||
$this->Js->get('#AttributeType')->event('change', 'showFormInfo("#AttributeType")');
|
||||
?>
|
||||
|
||||
formInfoValues['ALL'] = '';
|
||||
formInfoValues[''] = '';
|
||||
|
||||
function showFormInfo(id) {
|
||||
idDiv = id+'Div';
|
||||
if (("ALL" != $(id).val()) && ("" != $(id).val())) {
|
||||
// LATER use nice animations
|
||||
//$(idDiv).hide('fast');
|
||||
// change the content
|
||||
var value = $(id).val(); // get the selected value
|
||||
$(idDiv).html(formInfoValues[value]); // search in a lookup table
|
||||
|
||||
// show it again
|
||||
$(idDiv).fadeIn('slow');
|
||||
} else {
|
||||
$(idDiv).hide();
|
||||
}
|
||||
}
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#AttributeType, #AttributeCategory").on('mouseleave', function(e) {
|
||||
$('#'+e.currentTarget.id).popover('destroy');
|
||||
});
|
||||
|
||||
$("#AttributeType, #AttributeCategory").on('mouseover', function(e) {
|
||||
var $e = $(e.target);
|
||||
if ($e.is('option')) {
|
||||
$('#'+e.currentTarget.id).popover('destroy');
|
||||
$('#'+e.currentTarget.id).popover({
|
||||
trigger: 'manual',
|
||||
placement: 'right',
|
||||
content: formInfoValues[$e.val()],
|
||||
}).popover('show');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
// hide the formInfo things
|
||||
$('#AttributeTypeDiv').hide();
|
||||
$('#AttributeCategoryDiv').hide();
|
||||
|
||||
</script>
|
||||
<?php echo $this->Js->writeBuffer(); // Write cached scripts ?>
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
|
||||
</ul>
|
||||
</div>
|
||||
<div class="nav-collapse collapse" style="float:right">
|
||||
<div class="nav-collapse collapse pull-right">
|
||||
<ul class="nav">
|
||||
<li><?php echo $this->Html->link(__('Log out', true), array('controller' => 'users', 'action' => 'logout', 'plugin' => false)); ?> </li>
|
||||
</ul>
|
||||
|
|
|
@ -10,17 +10,14 @@
|
|||
if ('true' == Configure::read('CyDefSIG.sync')) {
|
||||
echo $this->Form->input('distribution', array(
|
||||
'label' => 'Distribution',
|
||||
'selected' => 'All communities',
|
||||
'after' => $this->Html->div('forminfo', '', array('id' => 'EventDistributionDiv')),
|
||||
'selected' => 'All communities'
|
||||
));
|
||||
}
|
||||
echo $this->Form->input('risk', array(
|
||||
'after' => $this->Html->div('forminfo', '', array('id' => 'EventRiskDiv')),
|
||||
'div' => 'input clear'
|
||||
));
|
||||
echo $this->Form->input('analysis', array(
|
||||
'options' => array($analysisLevels),
|
||||
'after' => $this->Html->div('forminfo', '', array('id' => 'EventAnalysisDiv'))
|
||||
));
|
||||
echo $this->Form->input('info', array(
|
||||
'div' => 'clear',
|
||||
|
@ -29,13 +26,8 @@
|
|||
echo $this->Form->input('Event.submittedgfi', array(
|
||||
'label' => '<b>GFI sandbox</b>',
|
||||
'type' => 'file',
|
||||
// 'between' => $this->Html->div('forminfo', isset($eventDescriptions['submittedgfi']['formdesc']) ? $eventDescriptions['submittedgfi']['formdesc'] : $eventDescriptions['submittedgfi']['desc']),
|
||||
'div' => 'clear'
|
||||
));
|
||||
// link an onchange event to the form elements
|
||||
$this->Js->get('#EventDistribution')->event('change', 'showFormInfo("#EventDistribution")');
|
||||
$this->Js->get('#EventRisk')->event('change', 'showFormInfo("#EventRisk")');
|
||||
$this->Js->get('#EventAnalysis')->event('change', 'showFormInfo("#EventAnalysis")');
|
||||
?>
|
||||
</fieldset>
|
||||
<?php
|
||||
|
@ -81,20 +73,24 @@ foreach ($analysisDescriptions as $type => $def) {
|
|||
}
|
||||
?>
|
||||
|
||||
function showFormInfo(id) {
|
||||
idDiv = id+'Div';
|
||||
// LATER use nice animations
|
||||
//$(idDiv).hide('fast');
|
||||
// change the content
|
||||
var value = $(id).val(); // get the selected value
|
||||
$(idDiv).html(formInfoValues[value]); // search in a lookup table
|
||||
// show it again
|
||||
$(idDiv).fadeIn('slow');
|
||||
}
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#EventAnalysis, #EventRisk, #EventDistribution").on('mouseleave', function(e) {
|
||||
$('#'+e.currentTarget.id).popover('destroy');
|
||||
});
|
||||
|
||||
$("#EventAnalysis, #EventRisk, #EventDistribution").on('mouseover', function(e) {
|
||||
var $e = $(e.target);
|
||||
if ($e.is('option')) {
|
||||
$('#'+e.currentTarget.id).popover('destroy');
|
||||
$('#'+e.currentTarget.id).popover({
|
||||
trigger: 'manual',
|
||||
placement: 'right',
|
||||
content: formInfoValues[$e.val()],
|
||||
}).popover('show');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// hide the formInfo things
|
||||
$('#EventDistributionDiv').hide();
|
||||
$('#EventRiskDiv').hide();
|
||||
$('#EventAnalysisDiv').hide();
|
||||
</script>
|
||||
<?php echo $this->Js->writeBuffer();
|
||||
|
|
|
@ -13,29 +13,20 @@ if ('true' == Configure::read('CyDefSIG.sync')) {
|
|||
echo $this->Form->input('distribution', array(
|
||||
'label' => 'Distribution',
|
||||
'selected' => 'All communities',
|
||||
'after' => $this->Html->div('forminfo', '', array('id' => 'EventDistributionDiv')),
|
||||
));
|
||||
}
|
||||
}
|
||||
echo $this->Form->input('risk', array(
|
||||
'after' => $this->Html->div('forminfo', '', array('id' => 'EventRiskDiv')),
|
||||
'div' => 'input clear'
|
||||
));
|
||||
echo $this->Form->input('analysis', array(
|
||||
'options' => array($analysisLevels),
|
||||
'after' => $this->Html->div('forminfo', '', array('id' => 'EventAnalysisDiv'))
|
||||
));
|
||||
echo $this->Form->input('info', array(
|
||||
'div' => 'clear',
|
||||
'class' => 'input-xxlarge'
|
||||
));
|
||||
|
||||
// link an onchange event to the form elements
|
||||
if ('true' == $canEditDist) {
|
||||
$this->Js->get('#EventDistribution')->event('change', 'showFormInfo("#EventDistribution")');
|
||||
}
|
||||
$this->Js->get('#EventRisk')->event('change', 'showFormInfo("#EventRisk")');
|
||||
$this->Js->get('#EventAnalysis')->event('change', 'showFormInfo("#EventAnalysis")');
|
||||
?>
|
||||
</fieldset>
|
||||
<?php
|
||||
|
@ -46,17 +37,13 @@ echo $this->Form->end();
|
|||
<div class="actions">
|
||||
<ul class="nav nav-list">
|
||||
<li><?php echo $this->Html->link('View Event', array('action' => 'view', $this->request->data['Event']['id'])); ?> </li>
|
||||
<?php if ($isSiteAdmin || $mayModify): ?>
|
||||
|
||||
<li class="active"><?php echo $this->Html->link('Edit Event', array('action' => 'edit', $this->request->data['Event']['id'])); ?> </li>
|
||||
<li><?php echo $this->Form->postLink('Delete Event', array('action' => 'delete', $this->request->data['Event']['id']), null, __('Are you sure you want to delete # %s?', $this->request->data['Event']['id'])); ?></li>
|
||||
<li class="divider"></li>
|
||||
<li><?php echo $this->Html->link('Add Attribute', array('controller' => 'attributes', 'action' => 'add', $this->request->data['Event']['id']));?> </li>
|
||||
<li><?php echo $this->Html->link('Add Attachment', array('controller' => 'attributes', 'action' => 'add_attachment', $this->request->data['Event']['id']));?> </li>
|
||||
<li><?php echo $this->Html->link('Populate event from IOC', array('controller' => 'events', 'action' => 'addIOC', $this->request->data['Event']['id']));?> </li>
|
||||
<?php else: ?>
|
||||
<li><?php echo $this->Html->link('Propose Attribute', array('controller' => 'shadow_attributes', 'action' => 'add', $this->request->data['Event']['id']));?> </li>
|
||||
<li><?php echo $this->Html->link('Propose Attachment', array('controller' => 'shadow_attributes', 'action' => 'add_attachment', $this->request->data['Event']['id']));?> </li>
|
||||
<?php endif; ?>
|
||||
<li class="divider"></li>
|
||||
<?php if ( 0 == $this->request->data['Event']['published'] && ($isAdmin || $mayPublish)): ?>
|
||||
<li><?php echo $this->Form->postLink('Publish Event', array('action' => 'alert', $this->request->data['Event']['id']), null, 'Are you sure this event is complete and everyone should be informed?'); ?></li>
|
||||
|
@ -101,22 +88,24 @@ foreach ($analysisDescriptions as $type => $def) {
|
|||
}
|
||||
?>
|
||||
|
||||
function showFormInfo(id) {
|
||||
idDiv = id+'Div';
|
||||
// LATER use nice animations
|
||||
//$(idDiv).hide('fast');
|
||||
// change the content
|
||||
var value = $(id).val(); // get the selected value
|
||||
$(idDiv).html(formInfoValues[value]); // search in a lookup table
|
||||
// show it again
|
||||
$(idDiv).fadeIn('slow');
|
||||
}
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#EventAnalysis, #EventRisk, #EventDistribution").on('mouseleave', function(e) {
|
||||
$('#'+e.currentTarget.id).popover('destroy');
|
||||
});
|
||||
|
||||
$("#EventAnalysis, #EventRisk, #EventDistribution").on('mouseover', function(e) {
|
||||
var $e = $(e.target);
|
||||
if ($e.is('option')) {
|
||||
$('#'+e.currentTarget.id).popover('destroy');
|
||||
$('#'+e.currentTarget.id).popover({
|
||||
trigger: 'manual',
|
||||
placement: 'right',
|
||||
content: formInfoValues[$e.val()],
|
||||
}).popover('show');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// hide the formInfo things
|
||||
if ('true' == $canEditDist) {
|
||||
$('#EventDistributionDiv').hide();
|
||||
}
|
||||
$('#EventRiskDiv').hide();
|
||||
$('#EventAnalysisDiv').hide();
|
||||
</script>
|
||||
<?php echo $this->Js->writeBuffer();
|
|
@ -84,12 +84,12 @@ $mayPublish = ($isAclPublish && $event['Event']['orgc'] == $me['org']);
|
|||
<?php echo h($event['Event']['date']); ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php echo ' title="' . $eventDescriptions['risk']['desc'] . '"';?>>Risk</dt>
|
||||
<dt title="<?php echo $eventDescriptions['risk']['desc'];?>">Risk</dt>
|
||||
<dd>
|
||||
<?php echo h($event['Event']['risk']); ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php echo ' title="' . $eventDescriptions['analysis']['desc'] . '"';?>>Analysis</dt>
|
||||
<dt title="<?php echo $eventDescriptions['analysis']['desc'];?>">Analysis</dt>
|
||||
<dd>
|
||||
<?php echo h($analysisLevels[$event['Event']['analysis']]); ?>
|
||||
|
||||
|
@ -105,7 +105,7 @@ $mayPublish = ($isAclPublish && $event['Event']['orgc'] == $me['org']);
|
|||
|
||||
</dd>
|
||||
<dt>Published</dt>
|
||||
<dd style = "color: red;">
|
||||
<dd style="color: red;">
|
||||
<b><?php echo ($event['Event']['published'] == 1 ? 'Yes' : 'No'); ?></b>
|
||||
|
||||
</dd>
|
||||
|
@ -155,16 +155,23 @@ if (!empty($event['Attribute'])):?>
|
|||
if (count($attribute['ShadowAttribute'])) $extra .= 'highlight1';
|
||||
?>
|
||||
<tr>
|
||||
<td class= "short <?php echo $extra; ?>" title="<?php if('' != $attribute['category']) echo $categoryDefinitions[$attribute['category']]['desc'];?>"><?php
|
||||
if ($first) {
|
||||
<?php if($first): ?>
|
||||
<td class= "short <?php echo $extra; ?>" title="<?php if('' != $attribute['category']) echo $categoryDefinitions[$attribute['category']]['desc'];?>">
|
||||
<?php
|
||||
if ('' == $attribute['category']) echo '(no category)';
|
||||
echo h($attribute['category']);
|
||||
} else {
|
||||
echo ' ';
|
||||
}?></td>
|
||||
<td class="short <?php echo $extra; ?>" title="<?php
|
||||
echo $typeDefinitions[$attribute['type']]['desc'];?>"><?php
|
||||
echo h($attribute['type']);?></td>
|
||||
else echo h($attribute['category']);
|
||||
?>
|
||||
</td>
|
||||
<?php else: ?>
|
||||
<td class= "short <?php echo $extra; ?>">
|
||||
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<td class="short <?php echo $extra; ?>" title="<?php echo $typeDefinitions[$attribute['type']]['desc'];?>">
|
||||
|
||||
<?php echo h($attribute['type']);?>
|
||||
|
||||
</td>
|
||||
<td class="<?php echo $extra; ?>"><?php
|
||||
$sigDisplay = $attribute['value'];
|
||||
if ('attachment' == $attribute['type'] || 'malware-sample' == $attribute['type'] ) {
|
||||
|
@ -371,3 +378,13 @@ if (!empty($event['Attribute'])):?>
|
|||
endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
// tooltips
|
||||
$(document).ready(function () {
|
||||
$("th, td, dt, div, span").tooltip({
|
||||
'placement': 'top',
|
||||
'container' : 'body',
|
||||
delay: { show: 500, hide: 100 }
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue