mirror of https://github.com/MISP/MISP
new: [eventview] value quickedit are triggered by clicking a button
And no longer using double-clickpull/3940/head
parent
260f75d8c3
commit
e076239a0e
|
@ -99,13 +99,16 @@
|
|||
<?php echo h($object['type']); ?>
|
||||
</div>
|
||||
</td>
|
||||
<td id="Attribute_<?php echo h($object['id']); ?>_container" class="showspaces limitedWidth shortish">
|
||||
<div id="Attribute_<?php echo $object['id']; ?>_value_placeholder" class="inline-field-placeholder"></div>
|
||||
<?php
|
||||
if ('attachment' !== $object['type'] && 'malware-sample' !== $object['type']) $editable = ' ondblclick="activateField(\'' . $editScope . '\', \'' . $object['id'] . '\', \'value\', \'' . $event['Event']['id'] . '\');"';
|
||||
else $editable = '';
|
||||
?>
|
||||
<div id = "Attribute_<?php echo $object['id']; ?>_value_solid" class="inline-field-solid" <?php echo $editable; ?>>
|
||||
<?php
|
||||
if ('attachment' !== $object['type'] && 'malware-sample' !== $object['type']):
|
||||
$editable = ' onmouseenter="quickEditHover(this, \'' . $editScope . '\', \'' . $object['id'] . '\', \'value\', \'' . $event['Event']['id'] . '\' );"';
|
||||
else:
|
||||
$editable = '';
|
||||
endif;
|
||||
?>
|
||||
<td id="Attribute_<?php echo h($object['id']); ?>_container" class="showspaces limitedWidth shortish" <?php echo $editable; ?>>
|
||||
<div id="Attribute_<?php echo $object['id']; ?>_value_placeholder" class="inline-field-placeholder"></div>
|
||||
<div id = "Attribute_<?php echo $object['id']; ?>_value_solid" class="inline-field-solid">
|
||||
<span>
|
||||
<?php
|
||||
$spanExtra = '';
|
||||
|
|
|
@ -2078,6 +2078,35 @@ table tr:hover .down-expand-button {
|
|||
}
|
||||
}
|
||||
|
||||
.label-icon {
|
||||
left: 5px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.fa-as-icon {
|
||||
font-size: 20px;
|
||||
padding-left: 2px;
|
||||
padding-top: 2px;
|
||||
width: 18px;
|
||||
height: 20px;
|
||||
cursor: pointer;
|
||||
background-image: unset;
|
||||
text-shadow: -1px 0 white, 0 1px white, 1px 0 white, 0 -1px white;
|
||||
transition: background .2s linear;
|
||||
color: black;
|
||||
}
|
||||
.fa-as-icon:hover {
|
||||
text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;
|
||||
font-weight: 900;
|
||||
font-size: 22px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.quick-edit-row-div {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#attackmatrix_div {
|
||||
border-color: #363636;
|
||||
overflow: visible;
|
||||
|
|
|
@ -453,6 +453,26 @@ function postActivationScripts(name, type, id, field, event) {
|
|||
$(name + '_solid').hide();
|
||||
}
|
||||
|
||||
function quickEditHover(td, type, id, field, event) {
|
||||
$td = $(td);
|
||||
$td.find('#quickEditButton').remove(); // clean all similar if exist
|
||||
$div = $('<div id="quickEditButton"></div>');
|
||||
$div.addClass('quick-edit-row-div');
|
||||
$span = $('<span></span>');
|
||||
$span.addClass('fa-as-icon fa fa-edit');
|
||||
$span.css('font-size', '12px');
|
||||
$div.append($span);
|
||||
$td.find("[id*=value_solid]").append($div);
|
||||
|
||||
$span.click(function() {
|
||||
activateField(type, id, field, event);
|
||||
});
|
||||
|
||||
$td.off('mouseleave').on('mouseleave', function(e) {
|
||||
$div.remove();
|
||||
});
|
||||
}
|
||||
|
||||
function addSighting(type, attribute_id, event_id, page) {
|
||||
$('#Sighting_' + attribute_id + '_type').val(type);
|
||||
$.ajax({
|
||||
|
|
Loading…
Reference in New Issue