Mattthew commited on
Commit
02fb1eb
1 Parent(s): c68f502

fixed broken edit mode

Browse files

also made it possible to get to actions by clicking

Files changed (2) hide show
  1. index.css +13 -2
  2. index.js +15 -6
index.css CHANGED
@@ -211,6 +211,7 @@ h4 {
211
 
212
  #toggles #options_info {
213
  margin-bottom: 10px;
 
214
  }
215
 
216
  #toggles #options_info .count {
@@ -222,6 +223,10 @@ h4 {
222
  opacity: 1;
223
  }
224
 
 
 
 
 
225
  #options_info i {
226
  box-sizing: border-box;
227
  padding: 1px 7px 1px 5px;
@@ -234,6 +239,7 @@ h4 {
234
  label {
235
  display: flex;
236
  gap: 8px;
 
237
  margin: 0 20px 6px 0;
238
  white-space: nowrap;
239
  opacity: 0.8;
@@ -304,6 +310,7 @@ input[type="checkbox"] {
304
  border-radius: 3px;
305
  place-content: center;
306
  box-shadow: inset 0px 3px 5px #00000045;
 
307
  }
308
 
309
  label.category input[type="checkbox"] {
@@ -314,6 +321,10 @@ label.top_control input[type="checkbox"] {
314
  border-color: rgba(255, 227, 0, 0.5);
315
  }
316
 
 
 
 
 
317
  label span:first-of-type {
318
  opacity: 0.8;
319
  }
@@ -745,13 +756,13 @@ input[type="checkbox"]:checked::before {
745
  flex-direction: column;
746
  overflow-y: scroll;
747
  overflow-x: hidden;
748
- background-color: #fbc1c1;
749
  border-radius: 4px;
750
  border: 2px solid #b30000;
751
  box-shadow: inset 0px 3px 4px #00000096;
752
  text-align: left;
753
  font-size: 14px;
754
- color: #000;
755
  opacity: 1;
756
  cursor: default;
757
  }
 
211
 
212
  #toggles #options_info {
213
  margin-bottom: 10px;
214
+ cursor: pointer;
215
  }
216
 
217
  #toggles #options_info .count {
 
223
  opacity: 1;
224
  }
225
 
226
+ #toggles #options_info:hover .count {
227
+ opacity: 0.8;
228
+ }
229
+
230
  #options_info i {
231
  box-sizing: border-box;
232
  padding: 1px 7px 1px 5px;
 
239
  label {
240
  display: flex;
241
  gap: 8px;
242
+ height: 22px;
243
  margin: 0 20px 6px 0;
244
  white-space: nowrap;
245
  opacity: 0.8;
 
310
  border-radius: 3px;
311
  place-content: center;
312
  box-shadow: inset 0px 3px 5px #00000045;
313
+ transition: all 100ms cubic-bezier(.35,1.63,.84,1.64);
314
  }
315
 
316
  label.category input[type="checkbox"] {
 
321
  border-color: rgba(255, 227, 0, 0.5);
322
  }
323
 
324
+ label.warning input[type="checkbox"] {
325
+ border-color: rgba(255, 0, 0, 0.5);
326
+ }
327
+
328
  label span:first-of-type {
329
  opacity: 0.8;
330
  }
 
756
  flex-direction: column;
757
  overflow-y: scroll;
758
  overflow-x: hidden;
759
+ background-color: #400;
760
  border-radius: 4px;
761
  border: 2px solid #b30000;
762
  box-shadow: inset 0px 3px 4px #00000096;
763
  text-align: left;
764
  font-size: 14px;
765
+ color: #f88;
766
  opacity: 1;
767
  cursor: default;
768
  }
index.js CHANGED
@@ -630,8 +630,9 @@ function updateArtistsCountPerTag(whoCalled) {
630
  }
631
  timer = setTimeout(function() {
632
  // for checkbox, we defer counts because it's slow
 
633
  updateArtistsCountPerTagSlow();
634
- },0);
635
  }
636
 
637
  function updateArtistsCountPerTagSlow() {
@@ -642,6 +643,7 @@ function updateArtistsCountPerTagSlow() {
642
  let divs = document.querySelectorAll('.image-item');
643
  let hiddenDivs = document.querySelectorAll('.image-item.hidden');
644
  let deprecatedDivs = document.querySelectorAll('.image-item[data-deprecated="true"]');
 
645
  checkboxes.forEach(function(checkbox) {
646
  let isTop = checkbox.parentNode.classList.contains('top_control');
647
  if(!isTop) {
@@ -1954,7 +1956,7 @@ function editTagsExitEditMode(imageItem) {
1954
  let tagLabels = tagArea.querySelectorAll('label');
1955
  tagLabels.forEach(function(label) {
1956
  let input = label.querySelector('input');
1957
- if(input.checked) {
1958
  tagList += input.value + ', ';
1959
  label.remove();
1960
  }
@@ -2014,9 +2016,10 @@ function searchForTags(input, event, tagList) {
2014
  let matches = 0;
2015
  let match = '';
2016
  let range = 'start'
2017
- for(i=0,il=tagsConcatenated.length; i<il; i++) {
2018
- let tag = tagsConcatenated[i];
2019
- for (var i=0, il=tagList.length; i<il; i++) {
 
2020
  if(typeof tagList[i] == 'string') {
2021
  // first tagList item is boolean
2022
  if(tag.toLowerCase() == tagList[i].toLowerCase()) {
@@ -2024,7 +2027,7 @@ function searchForTags(input, event, tagList) {
2024
  }
2025
  }
2026
  }
2027
- if(tag.toLowerCase().indexOf(input.value.toLowerCase()) == 0) {
2028
  range = 'continue';
2029
  let matchSpan = document.createElement('span');
2030
  matchSpan.textContent = tag;
@@ -2210,6 +2213,12 @@ function addAllListeners() {
2210
  });
2211
  });
2212
  // information
 
 
 
 
 
 
2213
  var info_actions = document.getElementById('info_actions');
2214
  info_actions.addEventListener('click', function(e) {
2215
  showInformation('actions');
 
630
  }
631
  timer = setTimeout(function() {
632
  // for checkbox, we defer counts because it's slow
633
+ // delay for 100 to allow CSS animation to complete
634
  updateArtistsCountPerTagSlow();
635
+ },100);
636
  }
637
 
638
  function updateArtistsCountPerTagSlow() {
 
643
  let divs = document.querySelectorAll('.image-item');
644
  let hiddenDivs = document.querySelectorAll('.image-item.hidden');
645
  let deprecatedDivs = document.querySelectorAll('.image-item[data-deprecated="true"]');
646
+ let last = performance.now();
647
  checkboxes.forEach(function(checkbox) {
648
  let isTop = checkbox.parentNode.classList.contains('top_control');
649
  if(!isTop) {
 
1956
  let tagLabels = tagArea.querySelectorAll('label');
1957
  tagLabels.forEach(function(label) {
1958
  let input = label.querySelector('input');
1959
+ if(input.checked && input.value != 'known' && input.value != 'unknown') {
1960
  tagList += input.value + ', ';
1961
  label.remove();
1962
  }
 
2016
  let matches = 0;
2017
  let match = '';
2018
  let range = 'start'
2019
+ let tagsConcatenatedArray = Array.from(tagsConcatenated);
2020
+ for(i=0,il=tagsConcatenatedArray.length; i<il; i++) {
2021
+ let tag = tagsConcatenatedArray[i];
2022
+ for (var j=0, jl=tagList.length; j<jl; j++) {
2023
  if(typeof tagList[i] == 'string') {
2024
  // first tagList item is boolean
2025
  if(tag.toLowerCase() == tagList[i].toLowerCase()) {
 
2027
  }
2028
  }
2029
  }
2030
+ if(tag.toLowerCase().indexOf(input.value.toLowerCase()) > -1) {
2031
  range = 'continue';
2032
  let matchSpan = document.createElement('span');
2033
  matchSpan.textContent = tag;
 
2213
  });
2214
  });
2215
  // information
2216
+ var options_info = document.getElementById('options_info');
2217
+ options_info.addEventListener('click', function(e) {
2218
+ showInfo();
2219
+ showInformation('actions');
2220
+ e.stopPropagation();
2221
+ });
2222
  var info_actions = document.getElementById('info_actions');
2223
  info_actions.addEventListener('click', function(e) {
2224
  showInformation('actions');