diff --git a/capsule-prototype/css/popup.css b/capsule-prototype/css/popup.css index 5f75752b2afe8aa9e8247ef56eb9ff2c3ec26330..b8f80ff6251cbf3a4a017b4bcca1abf41aa5f3ce 100644 --- a/capsule-prototype/css/popup.css +++ b/capsule-prototype/css/popup.css @@ -1,14 +1,28 @@ +#popupLabelsInput { + padding: 0; +} + #popupLabelsInput label { cursor: pointer; width: fit-content; - padding: 2px; + padding: 1px; + margin: 1px; } #popupLabelsInput input:checked + label { background-color: rgba(255, 255, 255, .5); } +#new_annotation_label { + color: white; + background-color: rgba(0, 0, 0, .5); + border: 0; + margin: 0; + margin-bottom: 2px; + font-size: 100%; +} + #popupSpace, #popupAlertSpace, #popupAddLinkSpace, #popupSettingsSpace { width: 100%; height: 100%; diff --git a/capsule-prototype/index.html b/capsule-prototype/index.html index a366e79b339b0bcc85570f5fe2901aa078403cbc..0e4a9817053e8c2343254b65f18fb3e3ad02d805 100644 --- a/capsule-prototype/index.html +++ b/capsule-prototype/index.html @@ -188,7 +188,7 @@ <div class="popupRightItem" id="popupLabels" title="Labels"></div> <!-- templates --> <div id='popupLabelsInput' class='popupInput flex-col'> - <input type='text' id='new_annotation_label' /> + <input type='text' id='new_annotation_label' placeholder='Add a new tag' class='editmode' /> <input class='annotation_labels_template' type='checkbox' id='' value='' style='display: none;' /> <label class='annotation_labels_template' for='' style='display: none;'></label> </div> diff --git a/capsule-prototype/js/online-script.js b/capsule-prototype/js/online-script.js index 9cff9adc834ba302a597922bd493739e1bbfa776..ad86b902a622a4f10f447450c075797368ae8074 100644 --- a/capsule-prototype/js/online-script.js +++ b/capsule-prototype/js/online-script.js @@ -816,12 +816,10 @@ function closeInputs() { var keyDoc = $(this).parent().attr("keydoc"); var newLabels = ''; - $('[name="annotation_labels"]:checked') + $('input.annotation_labels:checked') .toArray().forEach(e => { newLabels += e.value + ';'; - e.checked = false; }) - console.log('new labels: ', newLabels); setMetaFromDom(keyDoc, "Rekall->Labels", newLabels); if (newLabels === '') { @@ -850,7 +848,7 @@ function closeInputs() { setMetaFromDom(keyDoc, "Rekall->Link", newLink); if(newLink!="") { - if(rekall_common.owner.canEdit) $("#popupLink").html(newLink).removeClass("empty"); + if(rekall_common.owner.canEdit) $("#popupLink").html(newLink).removeClass("empty"); else $("#popupLink").html("<a href='"+newLink+"' target='_blank'>"+newLink+"</a>").removeClass("empty"); } else $("#popupLink").html("+ Add a link").addClass("empty"); @@ -998,11 +996,10 @@ function openMosaic() { $('.mosaic_label_filter').toArray().forEach(f => { f.my_state = undefined; $(f).removeClass('mosaic_label_filter_enabled'); - labels.add(f.innerHTML); }); } $('.mosaic_item').toArray().forEach(t => { - if (Array.from(labels).map(l => t.dataset.rekallLabels.indexOf(l) != -1).includes(true)) + if (!labels.size || Array.from(labels).map(l => t.dataset.rekallLabels.indexOf(l) != -1).includes(true)) $(t).show(); else $(t).hide(); @@ -1098,9 +1095,9 @@ bgColorLeft = getTagGradientColor(tag); else $("#popupSpeed").html("+ Set video speed during this annotation").addClass("empty"); var labels = tag.getMetadata("Rekall->Labels"); + $('input.annotation_labels').attr('checked', false); if (labels && labels != '') { var _labels = labels.split(';'); - console.log('got labels', _labels); $('input.annotation_labels').toArray().forEach(e => { e.checked = (_labels.indexOf(e.value) != -1); })