Skip to content

Commit d611943

Browse files
committed
fix histogram initialization, format with standard, update README, add per-channel contributions pie chart
1 parent 8e4356d commit d611943

7 files changed

+268
-173
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 1.0.1 --- Patch
2+
3+
- Display per-channel contributions pie chart
4+
- Histograms initialized when not logged in are done properly now
5+
- Video currency defaults to USD if not set
6+
17
# 1.0.0 --- Stable release
28

39
- Add receipt verification to check payments server-side

README.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,19 @@ Viewers can sign up for a service such as [Coil](https://coil.com/) and either i
77
Creators can monetize their content by using a PeerTube instance with the Web Monetization plugin installed, and adding their Interledger payment pointer.
88
A payment pointer provides a way for funds to be deposited, and a supported wallet can be created using [GateHub](https://gatehub.net/) or [Uphold](https://uphold.com). The payment pointer is added under the "Plugin Settings" tab in the video editing interface. You can also set a minimum pay rate to view.
99

10-
![Editing plugin settings on a video](https://milesdewitt.com/peertube-web-monetization/video-edit.png)
10+
![Editing plugin settings on a video](https://milesdewitt.com/peertube-web-monetization/video-edit3.png)
11+
12+
The monetization status of videos will then show when viewing their thumbnails.
13+
14+
![Badges on video titles](https://milesdewitt.com/peertube-web-monetization/badges.png)
1115

1216
Creators can specify the location of sponsors segments using the [PeerTube chapters plugin](https://milesdewitt.com/peertube-chapters), and those who pay with Web Monetization will automatically skip those sponsor segments. You can also set a minimum pay rate for ad-skipping as seen above.
1317

1418
![Chapter menu including sponsor segments](https://milesdewitt.com/peertube-chapters/chapters-menu.png)
1519

16-
Segments of the video which have already been paid for are remembered and will not receive double-payment. This is currently only during a single page view. In the future users can optionally store this data to not pay multiple times. They will also have the option to make data available to the creator on which videos or parts of videos thay have paid. On the other hand, the architecture of Web Monetization makes it simple to contribute without sharing any data with the PeerTube instance or video uploader.
17-
18-
Currently, the amount paid for each segment of the video can be seen in the web console. It updates each time a seek occurs.
20+
Segments of the video which have already been paid for are remembered and will not receive double-payment. Users can store this data when logged-in to not pay multiple times. General contribution data is made available in the stats tray below the video. However, no data sharing is necessary.
1921

20-
![Listing of total payments made for segments of video viewed](https://milesdewitt.com/peertube-web-monetization/segment-payments-debug.png)
22+
![Stats tray](https://milesdewitt.com/peertube-web-monetization/stats.png)
2123

2224
## Contributing
2325

client/common-client-plugin.js

+9-12
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ async function populateBadges (recurse) {
1616
const names = document.getElementsByClassName('video-miniature-name')
1717

1818
var fetchMonetizationStatus = []
19-
19+
2020
for (var i = 0; i < names.length; i++) {
2121
if (names[i].classList.contains('web-monetization-badge-checked')) {
2222
continue
2323
}
2424
// Price labels may wrap to second line
25-
names[i].style.maxHeight = '3em';
25+
names[i].style.maxHeight = '3em'
2626
if (names[i].tagName.toLowerCase() == 'a') {
2727
const dest = names[i].href
2828
const videoUuid = dest.substring(dest.lastIndexOf('/') + 1)
29-
if (monetizationStatus[videoUuid] != null ) {
30-
var badge = document.createElement('img')
31-
badge.style = 'padding-left:0.5em;height:1.5em;'
29+
if (monetizationStatus[videoUuid] != null) {
30+
var badge = document.createElement('img')
31+
badge.style = 'padding-left:0.5em;height:1.5em;'
3232
if (monetizationStatus[videoUuid].monetization == 'monetized') {
3333
badge.src = ptHelpers.getBaseStaticRoute() + '/images/wm-icon.svg'
3434
badge.title = 'Monetized'
@@ -82,7 +82,7 @@ async function populateBadges (recurse) {
8282
costTag.innerText += ' (' + exchanged.display() + ')'
8383
}
8484
}
85-
85+
8686
names[i].append(costTag)
8787
}
8888
names[i].classList.add('web-monetization-badge-checked')
@@ -94,7 +94,7 @@ async function populateBadges (recurse) {
9494

9595
if (0 < fetchMonetizationStatus.length) {
9696
var route = ptHelpers.getBaseStaticRoute()
97-
route = route.slice(0, route.lastIndexOf('/') + 1)+'router/monetization_status_bulk'
97+
route = route.slice(0, route.lastIndexOf('/') + 1) + 'router/monetization_status_bulk'
9898

9999
var headers = {}
100100
if (ptHelpers != null) {
@@ -105,7 +105,7 @@ async function populateBadges (recurse) {
105105
headers = {}
106106
}
107107
headers['content-type'] = 'application/json; charset=utf-8'
108-
108+
109109
fetch(route, {
110110
method: 'POST',
111111
headers,
@@ -120,9 +120,6 @@ async function populateBadges (recurse) {
120120
}
121121
})
122122
}
123-
124123
}
125124

126-
export {
127-
register
128-
}
125+
export { register}

0 commit comments

Comments
 (0)