Browse Source

added JavaScript for removing random images

solr_update
Simon Bowie 2 years ago
parent
commit
c43f79afe0
2 changed files with 8 additions and 2 deletions
  1. +6
    -0
      web/app/static/js/main.js
  2. +2
    -2
      web/app/templates/images.html

+ 6
- 0
web/app/static/js/main.js View File

@@ -41,6 +41,12 @@ function removeRandomTitle() {
RandomSpan.style.display = "inline-block";
}

function removeRandomImage() {
var elts = document.getElementsByClassName("img-fluid");
var RandomImg = elts[Math.floor(Math.random() * elts.length)];
RandomImg.remove();
}

// code adapted from w3collective
function readingTime(text) {
const wpm = 200;

+ 2
- 2
web/app/templates/images.html View File

@@ -8,8 +8,8 @@

<div class="action">
<button onClick="refresh(this)" type="button" value="Refresh" title="new iteration">↻</button>
<button onclick="" title="add one">+</button>
<button onclick="" title="remove">-</button>
<!--<button onclick="" title="add one">+</button>-->
<button onclick="removeRandomImage()" title="remove">-</button>
</div>

<a href="{{ url_for('main.index') }}" class="h1 text-left contrast" style="color: var(--color-lightyellow) !important;"> ⇽ </a>

Loading…
Cancel
Save