Closed mattbk closed 8 years ago
Now, to the fun part.
I think a better approach will be to let
data-gratipay-username
continue to only mean ~userusername
, and write new widget code for Teams. https://github.com/gratipay/grtp.co/pull/112#issuecomment-207889689
An example, using default-widget.html
:
<!doctype html>
<script>grtpAPI = '/lib/v2/'</script>
<script>gratipayURI = '/test/gratipay.com/'</script>
<body>
<script src="/lib/v2.js" data-gratipay-username="rummik" async></script>
</body>
Where it says data-gratipay-username=
I should be able to put data-gratipay-teamslug=
(TBD), and then pick it up in v2.js
and go from there.
Forgot to test before committing.
I think it's ready for review. Very simple and stripped down. Does not modify anything from v1
.
default
and custom
widgets and associated tests (see /test/v2
).Example using default-widget.html
:
<!doctype html>
<script>grtpAPI = '/lib/v2/'</script>
<script>gratipayURI = '/test/gratipay.com/'</script>
<body>
<script src="/lib/v2.js" data-gratipay-teamslug="gratipay" async></script>
</body>
Gittip
from v2—https://github.com/gratipay/grtp.co/pull/138#discussion_r69001143 —done in 361df4c7e472e7638224457e0a3734905353785bHere's a diff between v1 and v2 in cc11356419e32d96b4b4db95ea61e954c36ea3d0:
https://gist.github.com/whit537/2411be1bb1037d4e6cfb15310f25715f
Comments sound good so far, can't test until tonight at earliest.
Here's a diff between v1 and v2 in cc11356:
Should I be using this information for something?
Should I be using this information for something?
Nope. That's just FYI at this point—mostly for me and @kaguillera as we review this. :)
Comments sound good, can't test until tonight at earliest.
More comments coming (probably). I will update the punchlist and let you know when I'm done reviewing. :)
Alright, @mattbk. I'm ready to merge this if you are. Even if we end up going a different direction on #103 with more of a Gumroad-style button, this work is basically done and is an improvement over having nothing for 2.0 widgets.
:+1:
Lots to do. Starting with a clean/working duplication of v1 to v2, then will start chipping away.
https://github.com/gratipay/grtp.co/issues/103#issuecomment-215474340:
A different PR:
public.json
.