User:IagoQnsi/OgreGalleryUpdater

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

This is a very simple user script designed to do nothing but remove an extra click from your life. On OgreBot's new user upload pages and notable upload pages, there is an "Update this gallery" link to refresh the gallery. However, once you click that, you have to click an additional button on the next page to actually make OgreBot refresh the page. This plugin adds a link beside the "Update this gallery" link titled "(Ajax)" that removes that step. When you click the Ajax button, it'll fire off the request to OgreBot, and automatically refresh the page when it's done.

Installation[edit]

Installation is the same as any other user script. Open your common.js page, and add the following on a new line:

{{subst:iusc|User:IagoQnsi/OgreGalleryUpdater.js}}

Issues[edit]

This is a pretty simple script so I don't anticipate any major issues, but feel free to drop me a note if you have any problems or suggestions or whatever.

The one caveat to this script is that, due to same-origin policy, the script is not able to determine whether or not the request actually worked or not. So when you get the notification "Update request complete!", that doesn't mean that the update request succeeded, it just means that we sent the request and hopefully OgreBot was able to handle it. This would only really matter if OgreBot was offline or something though, as it typically does not reject any requests.