[docs] Fix readme bookmarklet script
All checks were successful
Deploy to mopidy1 / deploy (push) Successful in 9s
All checks were successful
Deploy to mopidy1 / deploy (push) Successful in 9s
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
# mopidy-smartplaylists
|
||||
|
||||
[](https://code.lab.unbl.ink/secstate/mopidy-smartplaylists/actions)
|
||||
[](https://code.lab.unbl.ink/secstate/mopidy-smartplaylists/actions)
|
||||
|
||||
Mopidy extension for generating diverse, full-length smart playlists from a local music library, with queue auto-refill.
|
||||
|
||||
@ -17,13 +17,13 @@ Mopidy extension for generating diverse, full-length smart playlists from a loca
|
||||
|
||||
## Bookmarklet: Toggle Smart Queue
|
||||
|
||||
Drag this link to your bookmarks bar to toggle the Smart Queue from any page:
|
||||
Drag this link to your bookmarks bar to toggle the Smart Queue:
|
||||
|
||||
```
|
||||
javascript:(function(){var h=location.origin.replace(/\/+$/,'');fetch(h+'/smart-queue',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({enabled:!confirm('Toggle Smart Queue?')})}).then(function(r){return r.json()}).then(function(d){alert('Smart Queue: '+(d.enabled?'On':'Off'))}).catch(function(){alert('Failed — not on Mopidy host?')})})();
|
||||
javascript:(function(){var u=location.origin.replace(/\/+$/,'');fetch(u+'/smartplaylists/smart-queue',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({enabled:!confirm('Toggle Smart Queue?')})}).then(function(r){return r.json()}).then(function(d){alert('Smart Queue: '+(d.enabled?'On':'Off'))}).catch(function(e){alert('Failed: '+e)})})();
|
||||
```
|
||||
|
||||
Works when your browser is on the same Mopidy server (e.g. `http://mopidy-dev.service:6680/...`). Replaces `location.origin` with your server URL if bookmarking from a different domain.
|
||||
Works from any page on the same Mopidy host (Iris, smart playlists UI, etc.). Uses `location.origin` and appends `/smartplaylists/smart-queue`.
|
||||
|
||||
## Configuration
|
||||
|
||||
|
||||
Reference in New Issue
Block a user