Browse Source

create separate options for likes, dislikes, and ratings bars

main
Xenon Fiber 11 months ago
parent
commit
59aa27c2aa
  1. 14
      client/video-watch-client-plugin.js
  2. 16
      main.js

14
client/video-watch-client-plugin.js

@ -16,7 +16,19 @@ function initUngamify (registerHook, peertubeHelpers) {
if (s["ungamify-likes"] === "true") {
[
"action-button-like",
].map(className =>
[...document.getElementsByClassName(className)].forEach(node => node.style.visibility = "hidden")
)
}
if (s["ungamify-dislikes"] === "true") {
[
"action-button-dislike",
].map(className =>
[...document.getElementsByClassName(className)].forEach(node => node.style.visibility = "hidden")
)
}
if (s["ungamify-likes-dislikes-bar"] === "true") {
[
"video-info-likes-dislikes-bar"
].map(className =>
[...document.getElementsByClassName(className)].forEach(node => node.style.visibility = "hidden")
@ -43,4 +55,4 @@ function initUngamify (registerHook, peertubeHelpers) {
}
})
})
}
}

16
main.js

@ -3,7 +3,21 @@ async function register ({
}) {
registerSetting({
name: "ungamify-likes",
label: "Hide likes and like buttons",
label: "Hide like buttons",
type: "input",
private: false,
default: "true"
})
registerSetting({
name: "ungamify-dislikes",
label: "Hide dislike buttons",
type: "input",
private: false,
default: "true"
})
registerSetting({
name: "ungamify-likes-dislikes-bar",
label: "Hide rating bars",
type: "input",
private: false,
default: "true"

Loading…
Cancel
Save