Issue #1784128 by steven.wichers, gaofengzzz, theunraveler: Fixed JavaScript errors when buttons.js included multiple times.