Commit Graph

22 Commits

Author SHA1 Message Date
Paul Melnikow
105e383d93 Improve search performance (#1393)
Add a class which applies display: none to badges we don’t want to see. This is accomplished by passing a `shouldDisplay` function along with each badge, which pulls the current query through a closure and applies it.

A bit roundabout, but it works.

The rest of the changes are refactors to avoid code duplication.

I decreased the debouce rate to 50, which seems to work well.

Fix #1314
2017-12-26 23:53:15 -05:00
Pravdomil
e4fed8d178 Copyedit and add link in footer (#1366) 2017-12-21 18:34:48 -05:00
Danial
e243959420 add spacing between badges in footer (#1347) 2017-12-07 10:28:34 +13:00
Paul Melnikow
212903d0e1 Fix dynamic badge URL generator (#1344)
Fix #1339
2017-12-06 14:38:41 -05:00
tooomm
b33b8d5b53 uri --> url (#1341) 2017-12-06 11:05:18 -05:00
Paul Melnikow
7c1b1fc621 Fix style picker in markup modal (#1331)
- Restore correct list of styles to markup modal
- DRY lists of styles

Fix #1330
2017-12-05 18:08:13 -05:00
Paul Melnikow
1eedd458b8 Fix and refactor front-end URL generation (#1322)
- Fix issue in Firefox 57 when run from static build
- Fix color parameter in dynamic badge maker
- Correctly apply maxAge in usage badges
- Follow the WHATWG lead and begin to standardize on URL, not URI (https://url.spec.whatwg.org/#goals)
2017-12-04 10:08:54 -05:00
Paul Melnikow
33690c5555 Fix missing whitespace in usage + footer
Use Fragment support added in React 16.2:

https://reactjs.org/blog/2017/11/28/react-v16.2.0-fragment-support.html
2017-12-03 15:12:22 -05:00
Paul Melnikow
8d0b1347d7 Fix markup modal when baseUri is unset (#1307) 2017-12-01 16:51:15 -05:00
Paul Melnikow
2be271c22b Frontend: Allow BASE_URL to be unset (#1306)
- Do not use bogus `'undefined'` as base URI
2017-12-01 16:34:31 -05:00
Paul Melnikow
8fa751d0c5 Activating Open Collective (#1295)
See comments in #1250. Gratipay is shutting down.
2017-11-30 14:19:50 -05:00
Paul Melnikow
f403c2b5d3 Configure frontend tests (#1293)
While working on #1288 I configured frontend tests. I'm going in a different direction with that, though it seems worth keeping the test configuration. I added tests for one of the helper methods.
2017-11-29 18:19:05 -05:00
Paul Melnikow
c5e31b5de1 Fix frontend deploy and Heroku staging (#1288)
- Heroku reads the Node version from package.json. We're about to upgrade to Node 8 so this change to `engines` is only pre-emptive. It won't have any effect on the production servers.
- The production deploy scripts were missing the frontend files. This fixes that.
- This modifies the build setup to allow `BASE_URL=/`, which makes all requests relative to the page itself. That simplifies deploying the "debugging" frontend to the production servers, and makes it easy to host the frontend on Heroku.
2017-11-29 17:59:01 -05:00
Paul Melnikow
4b5bf03fea Rewrite frontend in React (#1273)
I rewrote the frontend in React using a module bundler. It's matched feature-for-feature with the current frontend, with only slight changes in the styling. I did not fuss about making the styling identical; the badge popup looks particularly different.

This makes the front end much easier to develop. I'm really looking forward to implementing #701, to which this paves the way.

This makes light use of Next.js, which provides webpack config and dev/build tooling. We’ll probably replace it with create-react-app or our own webpack setup because unfortunately it comes with a lot of runtime overhead (the build is 400k).

Let’s open new issues for bugs and features, and track other follow-ups here: https://github.com/badges/shields/projects/1
2017-11-28 11:34:17 -05:00
tooomm
9e864f1660 fix "flat-square" style badge example 2017-11-10 13:10:37 -05:00
Danial
ab9be32f35 Update Homepage - Styles & Badge Size (#1242)
* Add social & for-the-badge to dropdown list

* badge minimum height 20px
2017-11-09 11:51:14 +13:00
Paul Melnikow
a2f5cbb03a Push frontend to production servers at /index.html (#1222)
* Push frontend to production servers at /index.html

Local production builds will use local server instead of img.shields.io, to support local testing

* Restore https://img.shields.io to example URIs
2017-11-01 20:48:01 +01:00
Danial
ebcfb105a0 [badge/dynamic/json] User defined JSON source badge (#820)
* Add User Defined URL support

* Add test

* eslint fixes

* 100% coverage

* use JSONpath

* update try.html

* Update tests, restore prefix & suffix

* order dependencies alphabetically

* update jsonpath version dependency

* update url structure & move to query strings

* update error handling & remove xml refrences

* fix eslint errors

* update tests

* update dynamic badge generator

* url -> uri & decode uri

Allow an encoded url to be used.
needed for any uri that requires params in the address

* resolve conflicts

* update for new page generation

* check uri is defined

* add query params to `request-handler.js`

* eslint fixes

* add test for no uri specified

* move query params to be local to dynamic badge

* update tests

* dynamic badge gen use same base url as static badge
2017-11-01 17:02:37 +13:00
Paul Melnikow
9f918dbee1 Use destructuring 2017-10-28 14:32:11 -04:00
Paul Melnikow
bde4d925f2 Retire try.html and create new dev + prod builds (#1194)
- Followup from #1163
- Retire try.html
- Separate build config for dev and production
    - Move config for badge examples into the JS build
- Move the prod transform into npm scripts
    - In the future this could be handled using a bundler plugin
- make website builds production build as before
- Run the production build in CI to make sure it’s working
- Build the frontend on Heroku
2017-10-28 14:02:45 -04:00
Paul Melnikow
a3b5dcbee8 Fix more badge links in the production build 2017-10-22 09:42:49 -04:00
Paul Melnikow
b411f08ad1 Generate badge examples from data + code (#1163)
This pull request sets us up to generate the badge examples dynamically from data and code.

Right now, try.html is still checked in, mostly for the benefit of reading this diff, though it should be removed on the next pass to avoid unnecessary complexity at merge time.
2017-10-20 17:33:12 -04:00