$("span[class=result-entry]:contains('" + term + "')").html(function(_, html) { | $("span[class=result-entry]:contains('" + term + "')").html(function(_, html) { | ||||
var replace = "(" + term + ")"; | var replace = "(" + term + ")"; | ||||
var re = new RegExp(replace, "g"); | var re = new RegExp(replace, "g"); | ||||
return html.replace(re, '<span style="color:orange">$1</span>'); | |||||
return html.replace(re, '<span class="search_term">$1</span>'); | |||||
}); | }); | ||||
} | } | ||||
} | } | ||||
RandomSpan.style.display = "inline-block"; | RandomSpan.style.display = "inline-block"; | ||||
} | } | ||||
// code adapted from w3collective | |||||
function readingTime(text) { | function readingTime(text) { | ||||
const wpm = 200; | const wpm = 200; | ||||
const words = text.trim().split(/\s+/).length; | const words = text.trim().split(/\s+/).length; |
/* PAGE —> RANDOM IMAGES */ | /* PAGE —> RANDOM IMAGES */ | ||||
body#random-img-page{ | |||||
#random-img-page{ | |||||
background-color: var(--color-dark) !important; | background-color: var(--color-dark) !important; | ||||
} | } | ||||
<link href="{{ url_for('static',filename='styles/custom.css') }}" rel="stylesheet"> | <link href="{{ url_for('static',filename='styles/custom.css') }}" rel="stylesheet"> | ||||
<!-- JavaScript --> | <!-- JavaScript --> | ||||
<script src="https://code.jquery.com/jquery-3.6.0.js" integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk=" crossorigin="anonymous"></script> | <script src="https://code.jquery.com/jquery-3.6.0.js" integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk=" crossorigin="anonymous"></script> | ||||
<script src="{{ url_for('static',filename='js/main.js') }}"></script> | |||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script> | <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script> | ||||
<script src="{{ url_for('static',filename='js/main.js') }}"></script> | |||||
</head> | </head> | ||||
<body class="d-flex flex-column min-vh-100" id="main"> | <body class="d-flex flex-column min-vh-100" id="main"> | ||||
<main class="flex-shrink-0"> | <main class="flex-shrink-0"> | ||||
<div class="container-fluid p-5 my-5"> | |||||
<div class="container-fluid p-5 mb-5"> | |||||
{% block content %} | {% block content %} | ||||
{% endblock %} | {% endblock %} |
{% block content %} | {% block content %} | ||||
<div id="random-img-page"> | |||||
<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> | |||||
</div> | |||||
<a href="{{ url_for('main.index') }}" class="h1 text-left contrast" style="color: var(--color-lightyellow) !important;"> ⇽ </a> | |||||
<div class="row"> | |||||
<div class="col m-5"> | |||||
<p class="h1 text-center contrast">Layering of Images</p> | |||||
</div> | |||||
</div> | |||||
<div class="container-fluid compare"> | |||||
{% for result in results %} | {% for result in results %} | ||||
<img class="img-fluid" src="data:image/jpg;base64,{{ result['image'] }}" alt="Drawing accompanying patent for{{ result['title'] }}" />' | |||||
<img class="img-fluid" src="data:image/jpg;base64,{{ result['image'] }}" alt="Drawing accompanying patent for{{ result['title'] }}" /> | |||||
{% endfor %} | {% endfor %} | ||||
</div> | |||||
</div> | |||||
{% endblock %} | {% endblock %} |
<div class="index-row"> | <div class="index-row"> | ||||
<div class="col text-center m-5"> | <div class="col text-center m-5"> | ||||
<p class="h1">Performing Patents Otherwise</p> | <p class="h1">Performing Patents Otherwise</p> | ||||
<div class="info" style="display: none;"> | |||||
<p class="code"> | |||||
Archival conversations with 320,000 clothing inventions | |||||
</p> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="info" style="display: none;"> | <div class="info" style="display: none;"> | ||||
<p class="code"> | <p class="code"> | ||||
// Main search engine sorting code: | // Main search engine sorting code: | ||||
$search_results = solr_search($_POST["search"], $_POST["searchopt"], $_POST["sort"]); if(is_array($search_results)): foreach($search_results as $result): ?> | |||||
solrurl = 'http://' + solr_hostname + ':' + solr_port + '/solr/' + core + '/select?q.op=OR&q=content%3A' + urllib.parse.quote_plus(search) + '&wt=json&sort=' + sort; request = requests.get(solrurl); json = request.json() | |||||
</p> | </p> | ||||
</div> | </div> | ||||