Skip to content

Commit

Permalink
add flasgger custom header
Browse files Browse the repository at this point in the history
  • Loading branch information
n00rsy committed Nov 21, 2023
1 parent bc9fc1f commit 6478fb8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
Binary file added static/img/gigwork-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions templates/flasgger_custom_head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script>
async function setImage(selector, timeout = 10000) {
const start = Date.now();
// wait for image to exist
while (Date.now() - start < timeout) {
const el = document.querySelector(selector);
if (el) {
// create link to home page
let link = document.createElement('a')
link.href = "/"
el.parentNode.insertBefore(link, el);
link.appendChild(el);
// set image
el.src = "/static/img/gigwork-white.png";
el.height = "75"
return;
}
await new Promise(resolve => setTimeout(resolve, 10));
}
return;
}
window.addEventListener('load', function (){
let imgSelector = "#swagger-ui > section > div.topbar > div > div > a > img";
setImage(imgSelector);
});
</script>
1 change: 1 addition & 0 deletions templates/help/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ <h1><strong>{{brand}}</strong>: API Help</h1>
low level API calls, providing a more simple and easy to use API. PyBossa.JS is available at the server for every project, but if you prefer to download it
you can do it from its official <a href="http://github.com/PyBossa/pybossa.js">repository</a>.</p>
<hr>
<p>View pybossa swagger documentation <a href="/apidocs">here</a>.</p>
<h2>Projects API end point</h2>
<p>
For example, if you want to <strong>get a list of available projects</strong> on this server,
Expand Down

0 comments on commit 6478fb8

Please sign in to comment.