npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gerrit-f-button

v2.1.4

Published

Gerrit F button TamperMonkey script

Downloads

4

Readme

gerrit-f-button

Baby, the F button is back.

gerrit-f-button screenshot

Installation

There are two ways to use this super cool script: either by installing it globally for all users, or by injecting it into the page to keep all the cool to yourself.

Global installation (all users)

Download the script and place it inside the $site_path/static directory of your Gerrit installation. Then you only need to inject in one of the Gerrit theme files, like etc/GerritSiteHeader.html if you're using the default theme:

<div>
  <script src="static/gerrit-f-button.js"></script>
</div>

You will need jQuery, so if you don't have it, load it from the CDN before loading the script:

<div>
  <script src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
  <script src="static/gerrit-f-button.js"></script>
</div>

Make sure to restart Gerrit once this is all done. Press F in one of the patchset pages and bask yourself in glory.

Local installation

Use something like greasemonkey to inject the script gerrit-f-button.js. It inlines all the CSS it needs and should work in such an environment without any modifications.

I used TamperMonkey on Chrome.

The script expects Gerrit and jQuery to become available on window within 30 seconds since it gets loaded, otherwise it will not work. If it works, you can see a message on the console saying "gerrit-f-button" is active or something.

Usage

Simply press F (or f) when you're viewing a change (or a file in a change revision) to bring up the F-button frame. Please keep in mind that this script is so cool that it naturally expects users to be as cool (or cooler, if that's even possible), so if you're lacking on cool, I advise you to work on that first.

But wait, there's more.

Should you either intentionally or via the casual faceroll happen to land on a CTRL + META + SHIFT + F key combination, the F panel will unconditionally take itself to the stage. No seriously, this is quite useful to accommodate a keyboard-only reviewing flow since Gerrit's editor will normally steal all (well, most) key presses, preventing you from reaching out to the panel, pressing this combination will forcefully steal the focus away from the editor and pass it on to the glorious F frame.

If you're thinking the combination is mad, well, you may be right, but it's only because having scripts steal and manage focus is so maddening in the first place, it was only appropriate to make an opt-in behavior just as maddening.

Changelog

2.1.4

  • Now publishing to NPM

2.1.3

  • No longer intercepts J, K, or RETURN if the popup is not shown.

2.1.2

  • No longer toggles for CMD+F or CTRL+F.

2.1.1

  • Version is now attached in the banner inside gerrit-f-button.js

2.1.0

  • Added an option to hide the panel in Unified Diff view since Gerrit still supports the native F button functionality there
  • Added an option to display files in a "list" view; no folders, full filepaths similar to the legacy F UI
  • Added an option to display the panel as an overlay, similar to the legacy F UI
  • Keyboard navigation is now possible using J, K, and RETURN
  • (internal) Broke the thing into modules since it was getting big

2.0

  • Files are now displayed in a tree view, upping the glory factor to a Phabricating level (oh-uh)
  • Removed the option for showing the comment bodies in-line as it was useless within such a confined space (and usually you needed the code context to make sense of the comments anyway)

1.1.0

  • The popup will no longer show up if you're writing in an <input /> or a <textarea /> widgets

License

MIT