Skip to content

Commit e63cb83

Browse files
authored
Added code for search all projects
1 parent 98f9f2b commit e63cb83

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

search.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
if (window.location.href.includes('%23')) {
2+
} else {
3+
var btn = document.createElement('button')
4+
btn.className = 'button showAll'
5+
btn.textContent = 'Show All'
6+
btn.onclick = function() {
7+
str = window.location.href
8+
var apple = str.split('https://scratch.mit.edu/search/projects?q=')[1];
9+
window.location.href = `https://scratch.mit.edu/search/projects?q=%23${apple.replaceAll('%20', "%20%23")}`
10+
}
11+
document.querySelector('#view > div > div > div.sort-controls').appendChild(btn)
12+
}

0 commit comments

Comments
 (0)