Last active
June 9, 2020 21:52
-
-
Save salsalabs/5dbb3cfd03a20a2e708dd1a6c619e133 to your computer and use it in GitHub Desktop.
Change displayed names for selected countries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- BEGIN Change displayed names for selected countries. --> | |
| <script type="text/javascript"> | |
| (function() { | |
| // This object maps country abbreviations to text. | |
| // - The keys are ISO-3166 Alpha 2 abbreviations for countries. | |
| // - The values are the countries names to display. | |
| // You can find the abbreviations by viewing the HTML source | |
| // of any page that has a country field. | |
| countries = { | |
| "LY": "Libya", | |
| "MK": "North Macedonia, Republic of" | |
| } | |
| document.addEventListener("DOMContentLoaded", () => { | |
| for (const abbr in countries) { | |
| var q = `option[value="${abbr}"]`; | |
| var e = document.querySelector(q); | |
| if (e != null) { | |
| e.text = countries[abbr]; | |
| } | |
| } | |
| }) | |
| })(); | |
| </script> | |
| <!-- End Change displayed names for selected countries. --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment