mirror of https://github.com/MISP/MISP
chg: [UI] Simplify code for adding galaxies
parent
9b9e332019
commit
d85fbbaf95
|
@ -320,9 +320,6 @@ echo $this->element('/genericElements/SideMenu/side_menu', ['menuList' => 'event
|
|||
$('.screenshot').click(function() {
|
||||
screenshotPopup($(this).attr('src'), $(this).attr('title'));
|
||||
});
|
||||
$('.addGalaxy').click(function() {
|
||||
addGalaxyListener(this);
|
||||
});
|
||||
$('.sightings_advanced_add').click(function() {
|
||||
var selected = [];
|
||||
var object_context = $(this).data('object-context');
|
||||
|
|
|
@ -227,9 +227,6 @@ attributes or the appropriate distribution level. If you think there is a mistak
|
|||
var deleted = <?php echo (!empty($deleted)) ? '1' : '0';?>;
|
||||
var includeRelatedTags = <?php echo (!empty($includeRelatedTags)) ? '1' : '0';?>;
|
||||
$(function() {
|
||||
$('.addGalaxy').click(function() {
|
||||
addGalaxyListener(this);
|
||||
});
|
||||
<?php
|
||||
if (isset($focus)):
|
||||
?>
|
||||
|
|
|
@ -123,21 +123,21 @@ echo $this->Form->end();
|
|||
<?php endif; ?>
|
||||
<?php
|
||||
if ($editButtonsEnabled) {
|
||||
$link = "$baseurl/galaxies/selectGalaxyNamespace/" . h($target_id) . "/" . h($target_type) . "/local:0";
|
||||
echo sprintf(
|
||||
'<button class="%s" data-target-type="%s" data-target-id="%s" data-local="false" role="button" tabindex="0" aria-label="' . __('Add new cluster') . '" title="' . __('Add new cluster') . '">%s</button>',
|
||||
'useCursorPointer btn btn-inverse addGalaxy',
|
||||
h($target_type),
|
||||
h($target_id),
|
||||
'<button class="%s" data-popover-popup="%s" role="button" tabindex="0" aria-label="' . __('Add new cluster') . '" title="' . __('Add new cluster') . '">%s</button>',
|
||||
'useCursorPointer btn btn-inverse',
|
||||
$link,
|
||||
'<i class="fas fa-globe-americas"></i> <i class="fas fa-plus"></i>'
|
||||
);
|
||||
}
|
||||
|
||||
if ($editButtonsLocalEnabled) {
|
||||
$link = "$baseurl/galaxies/selectGalaxyNamespace/" . h($target_id) . "/" . h($target_type) . "/local:1";
|
||||
echo sprintf(
|
||||
'<button class="%s" data-target-type="%s" data-target-id="%s" data-local="true" role="button" tabindex="0" aria-label="' . __('Add new local cluster') . '" title="' . __('Add new local cluster') . '">%s</button>',
|
||||
'useCursorPointer btn btn-inverse addGalaxy',
|
||||
h($target_type),
|
||||
h($target_id),
|
||||
'<button class="%s" data-popover-popup="%s" role="button" tabindex="0" aria-label="' . __('Add new local cluster') . '" title="' . __('Add new local cluster') . '">%s</button>',
|
||||
'useCursorPointer btn btn-inverse',
|
||||
$link,
|
||||
'<i class="fas fa-user"></i> <i class="fas fa-plus"></i>'
|
||||
);
|
||||
}
|
||||
|
|
|
@ -14,9 +14,4 @@ echo $this->element('galaxyQuickViewNew', [
|
|||
?>
|
||||
<script type="text/javascript">
|
||||
var showContext = false;
|
||||
$(function () {
|
||||
$('.addGalaxy').click(function() {
|
||||
addGalaxyListener(this);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -1,11 +1,3 @@
|
|||
<?php
|
||||
echo $this->element('TagCollections/index_row');
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('.addGalaxy').click(function() {
|
||||
addGalaxyListener(this);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -19,11 +19,4 @@
|
|||
));
|
||||
|
||||
echo $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'tag-collections', 'menuItem' => 'index'));
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('.addGalaxy').click(function() {
|
||||
addGalaxyListener(this);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -4221,18 +4221,6 @@ $('#eventToggleButtons button').click(function() {
|
|||
}
|
||||
});
|
||||
|
||||
function addGalaxyListener(id) {
|
||||
var target_type = $(id).data('target-type');
|
||||
var target_id = $(id).data('target-id');
|
||||
var local = $(id).data('local');
|
||||
if (local) {
|
||||
local = 1;
|
||||
} else {
|
||||
local = 0;
|
||||
}
|
||||
popoverPopup(id, target_id + '/' + target_type + '/local:' + local, 'galaxies', 'selectGalaxyNamespace');
|
||||
}
|
||||
|
||||
function quickSubmitGalaxyForm(cluster_ids, additionalData) {
|
||||
cluster_ids = cluster_ids === null ? [] : cluster_ids;
|
||||
var target_id = additionalData['target_id'];
|
||||
|
|
Loading…
Reference in New Issue