Skip to content

Commit

Permalink
bump to 1.3.2, fixed version script
Browse files Browse the repository at this point in the history
  • Loading branch information
mchangrh committed May 23, 2023
1 parent d968cd3 commit f833d10
Show file tree
Hide file tree
Showing 15 changed files with 44 additions and 34 deletions.
2 changes: 1 addition & 1 deletion build/config-header.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// @namespace mchang.name
// @homepage https://github.com/mchangrh/sb.js
// @icon https://mchangrh.github.io/sb.js/icon.png
// @version 1.2.4
// @version 1.3.2
// @license LGPL-3.0-or-later
// @match https://www.youtube.com/watch*
// @match https://mchangrh.github.io/sb.js/config
Expand Down
2 changes: 1 addition & 1 deletion build/header.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// @namespace mchang.name
// @homepage https://github.com/mchangrh/sb.js
// @icon https://mchangrh.github.io/sb.js/icon.png
// @version 1.3.1
// @version 1.3.2
// @license LGPL-3.0-or-later
// @match https://www.youtube.com/watch*
// @connect sponsor.ajay.app
Expand Down
2 changes: 1 addition & 1 deletion build/loader-header.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// @namespace mchang.name
// @homepage https://github.com/mchangrh/sb.js
// @icon https://mchangrh.github.io/sb.js/icon.png
// @version 1.3.1
// @version 1.3.2
// @license LGPL-3.0-or-later
// @match https://www.youtube.com/watch*
// @connect sponsor.ajay.app
Expand Down
10 changes: 10 additions & 0 deletions build/version-up.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const { resolve } = require("path")
const { version } = require("../src/version.json")
const bodyFile = resolve(__dirname, "../src/sb.js")
const headerFile = resolve(__dirname, "../build/header.user.js")
const configHeaderFile = resolve(__dirname, "../build/config-header.user.js")
const loaderHeaderFile = resolve(__dirname, "../build/loader-header.user.js")

function bumpBody() {
Expand All @@ -22,6 +23,15 @@ function bumpUserScript(file) {
fs.writeFileSync(file, text)
}

function bumpPackage() {
const packageFile = resolve(__dirname, "../package.json")
const packageInfo = JSON.parse(fs.readFileSync(packageFile, "utf8"))
packageInfo.version = version
fs.writeFileSync(packageFile, JSON.stringify(packageInfo, null, 2))
}

bumpBody()
bumpPackage()
bumpUserScript(headerFile)
bumpUserScript(configHeaderFile)
bumpUserScript(loaderHeaderFile)
24 changes: 12 additions & 12 deletions docs/sb-config.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@
// @namespace mchang.name
// @homepage https://github.com/mchangrh/sb.js
// @icon https://mchangrh.github.io/sb.js/icon.png
// @version 1.2.4
// @version 1.3.2
// @license LGPL-3.0-or-later
// @match https://www.youtube.com/watch*
// @match https://mchangrh.github.io/sb.js/config
// @connect sponsor.ajay.app
// @grant GM_setValue
// @grant GM_getValue
// ==/UserScript==
const getJSONSetting = async (key, fallback) => JSON.parse(await GM_getValue(key, fallback))

const categories = await getJSONSetting("categories", `["sponsor","selfpromo","interaction","intro","outro","preview","music_offtopic","exclusive_access","poi_highlight"]`)
const actionTypes = await getJSONSetting("actionTypes", `["skip","mute","full","poi"]`)
const skipThreshold = await getJSONSetting("skipThreshold", `[0.2,1]`)
const serverEndpoint = await GM_getValue("serverEndpoint","https://sponsor.ajay.app")
const skipTracking = await GM_getValue("skipTracking", true)
const highlightKey = await GM_getValue("highlightKey", "Enter")
const getJSONSetting = (key, fallback) => JSON.parse(GM_getValue(key, fallback))

const categories = getJSONSetting("categories", `["sponsor","selfpromo","interaction","intro","outro","preview","music_offtopic","exclusive_access","poi_highlight"]`)
const actionTypes = getJSONSetting("actionTypes", `["skip","mute","full","poi"]`)
const skipThreshold = getJSONSetting("skipThreshold", `[0.2,1]`)
const serverEndpoint = GM_getValue("serverEndpoint","https://sponsor.ajay.app")
const skipTracking = GM_getValue("skipTracking", true)
const highlightKey = GM_getValue("highlightKey", "Enter")
/* sb.js - SponsorBlock for restrictive environments - by mchangrh
https://github.com/mchangrh/sb.js
Uses SponsorBlock data licensed used under CC BY-NC-SA 4.0 from https://sponsor.ajay.app/
LICENCED UNDER LGPL-3.0-or-later */
const VERSION = "1.2.4"
const VERSION = "1.3.2" // version constant

// initial setup
let video, videoID, muteEndTime
Expand Down Expand Up @@ -181,7 +181,7 @@ setup()
function setupConfigPage() {
// clear placeholder
document.getElementById("placeholder").style.display = "none"
document.getElementById("config").display = "block"
document.getElementById("config").style.display = "block"

const categoryInput = document.getElementById("categories")
const actionTypesInput = document.getElementById("actionTypes")
Expand Down Expand Up @@ -213,4 +213,4 @@ function setupConfigPage() {
setValue("highlightKey", highlightKeyInput.value, highlightKey)
})
}
if (document.url === "https://mchangrh.github.io/sb.js/config") setupConfigPage()
if (document.URL === "https://mchangrh.github.io/sb.js/config") setupConfigPage()
2 changes: 1 addition & 1 deletion docs/sb-loader.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// @namespace mchang.name
// @homepage https://github.com/mchangrh/sb.js
// @icon https://mchangrh.github.io/sb.js/icon.png
// @version 1.3.1
// @version 1.3.2
// @license LGPL-3.0-or-later
// @match https://www.youtube.com/watch*
// @connect sponsor.ajay.app
Expand Down
2 changes: 1 addition & 1 deletion docs/sb-nosettings.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/sb.bookmarklet.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/sb.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ https://github.com/mchangrh/sb.js
Uses SponsorBlock data licensed used under CC BY-NC-SA 4.0 from https://sponsor.ajay.app/
LICENCED UNDER LGPL-3.0-or-later */
const VERSION = "1.2.4"
const VERSION = "1.3.2" // version constant

// initial setup
let video, videoID, muteEndTime
Expand Down
Loading

0 comments on commit f833d10

Please sign in to comment.