Compare commits

..

No commits in common. "4b7f526902b158746e3e87ea660670e5c61ab5a4" and "afb2f279d9c45440cbc498a79f67efacfb04749a" have entirely different histories.

2 changed files with 7 additions and 15 deletions

View File

@ -33,7 +33,7 @@ async function VRCYoutubeSearch(pool, query, options = {}) {
for (let tab of tabs) {
data.tabs.push({
name: tab.name,
vrcurl: await putVrcUrl(pool, {type: "trending", bp: tab.bp, options})
vrcurl: await putVrcUrl(pool, {type: "trending", bp: tab.bp})
});
}
break;

View File

@ -9,26 +9,24 @@
</head><body>
<div>
<label><button id="search">search:</button> <input id="input" type="text" value="nyan cat" /></label>
<br /><button id="trending">trending</button>
<br />
<label>search: <input id="input" type="text" value="nyan cat" /></label>
<button id="trending">trending</button>
<label><input id="thumbnails" type="checkbox" checked>thumbnails</label>
<label><input id="icons" type="checkbox" checked>icons</label>
<label><input id="captions" type="checkbox" checked>captions</label>
<button id="start">start</button>
</div>
<div id="output"></div>
<div id="buttons"></div>
<button id="nextpage" style="display: none">next page</button>
<button id="nextpage">next page</button>
<script>
var num = 0;
var lastData;
search.onclick = () => {
start.onclick = () => {
output.innerHTML = "";
loadData(`/search?pool=test1000&thumbnails=${thumbnails.checked}&icons=${icons.checked}&captions=${captions.checked}&input=${encodeURIComponent(input.value)}`);
};
@ -36,9 +34,9 @@ trending.onclick = () => {
output.innerHTML = "";
loadData(`/trending?pool=test1000&thumbnails=${thumbnails.checked}&icons=${icons.checked}&captions=${captions.checked}`);
}
nextpage.onclick = () => loadData(`/vrcurl/test1000/${lastData.nextpage_vrcurl}`);
async function loadData(url) {
buttons.innerHTML = '';
var data = await fetch(url).then(res => res.json());
var pre = document.createElement("pre");
pre.innerHTML = hljs.highlight(JSON.stringify(data, null, 4), {language: "json"}).value;
@ -46,12 +44,6 @@ async function loadData(url) {
var img = document.createElement("img");
img.src = `/vrcurl/test1000/${data.imagesheet_vrcurl}`;
output.appendChild(img);
if (data.nextpage_vrcurl) {
buttons.innerHTML = `<button onclick="loadData('/vrcurl/test1000/${data.nextpage_vrcurl}')">next page</button>`;
}
if (data.tabs) {
buttons.innerHTML = data.tabs.map(t => `<button onclick="loadData('/vrcurl/test1000/${t.vrcurl}')">${t.name}</button>`).join('');
}
lastData = data;
}