User:He7d3r/Tools/LowerCaseLabels.js
Appearance
From Meta, a Wikimedia project coordination wiki
This is an archived version of this page, as edited by He7d3r (talk | contribs) at 17:21, 18 June 2015 (Sync with https://github.com/he7d3r/mw-gadget-LowerCaseLabels; minify with UgliPyJS 0.2.5). It may differ significantly from the current version .
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
// [[File:User:He7d3r/Tools/LowerCaseLabels.js]] (workaround for [[phab:T35355]]) /** * Adds links to fix the capitalization of labels on Wikidata * @author: Helder (https://github.com/he7d3r) * @license: CC BY-SA 3.0 <https://creativecommons.org/licenses/by-sa/3.0/> */ // <nowiki> (function(e,t){"use strict";functioni(){vari=t(".wb-terms .wikibase-toolbareditgroup-editbutton, .wb-firstHeading .wikibase-toolbareditgroup-editbutton");i.each(function(){vari=t(this),r=i.parent(),a=r.clone();a.find("a").text(e.msg("link-lower-case-first")).attr({href:"#",title:e.msg("link-lower-case-first-description")}).click(function(e){varr,a;e.preventDefault(),i.click(),r=t(":focus"),a=r.val(),r.attr("value",a.charAt(0).toLowerCase()+a.slice(1)),t(".wb-ui-propertyedittool-editablevalueinterface input").trigger("input")}).end().insertAfter(r.is("h1 *")?r:r.parent())})}varr={en:{"link-lower-case-first":"LCFirst","link-lower-case-first-description":"Converts the first character to lower case"}};e.messages.set(t.extend(r.en,r[e.config.get("wgUserLanguage")])),t(i)})(mediaWiki,jQuery); // </nowiki>