RTO_addRemovefavorite.js

Helper file documentation for RTO_addRemovefavorite.js.
Docs updated: 2025-12-17

Summary

Favorites UI binder.

  • Exports: RTOFavoritesUI
  • Depends on: RTO_favoritesList.js

What it is

UI binder for favorites management.

Download

Download RTO_addRemovefavorite.js

Example

<input id="favUrl" value="https://example.com" />
<input id="favLabel" value="Example" />
<button id="favAdd">Add</button>
<button id="favCheck">Check</button>
<button id="favRemove">Remove</button>
<div id="favMsg" style="display:none"></div>
<div id="favListWrap" style="display:none"><ul id="favList"></ul></div>

<script src="../RTO_helpers/RTO_favoritesList.js"></script>
<script src="../RTO_helpers/RTO_addRemovefavorite.js"></script>
<script>
  RTOFavoritesUI.bind({
    url: document.getElementById("favUrl").value,
    label: document.getElementById("favLabel").value,
    addBtn: "#favAdd",
    checkBtn: "#favCheck",
    removeBtn: "#favRemove",
    msgEl: "#favMsg",
    listWrap: "#favListWrap",
    listEl: "#favList"
  });
</script>

Config fields

  • url, label
  • addBtn, checkBtn, removeBtn
  • msgEl, listWrap, listEl

Next