User talk:GregorB/ConvertLocationMap.js

In today's world, User talk:GregorB/ConvertLocationMap.js is a topic that has captured the attention and interest of a large number of individuals. Whether due to its historical relevance, its impact on current society, or its influence in different areas of daily life, User talk:GregorB/ConvertLocationMap.js has become a constant point of conversation between experts and the general public. In this article, we will explore in depth different aspects related to User talk:GregorB/ConvertLocationMap.js, analyzing its importance, its implications and its evolution over time. From its origin to its eventual outcome, User talk:GregorB/ConvertLocationMap.js represents a topic of great interest that deserves to be examined from different angles.

Some remarks about the script

  • Should be used only for Croatian settlements that have a standalone {{Location map}} template in them (i.e. it is not embedded in a table or something like that).
  • The script is based on regex matching so not all conversions will succeed, depending on formatting. If that's the case, the script will do nothing.
  • After a successful conversion, a diff will automatically be displayed. If this is annoying, I could make it user-customizable.
  • Also, edit summary is auto-populated. Ditto.
  • {{coord}}, if present, is not touched. Infobox coordinates are always displayed inline, while title coordinates are set by {{coord}}, if it exists. This is perhaps not ideal.
  • I'll write the docs with more details soon; in the meantime, you can complain here. :-D GregorB (talk) 21:49, 3 January 2015 (UTC)
Oh yeah, these articles are the candidates. GregorB (talk) 21:59, 3 January 2015 (UTC)
I opened Adamovec in edit mode, and clicked on the newly listed "Convert Location map to Infobox settlement" tool item, but nothing happened. Can you add a few alert()s in the various else cases so that it becomes obvious what went wrong? --Joy (talk) 16:27, 4 January 2015 (UTC)
Yup, Adamovec is precisely the reason why I noted that the script does not always work. I've just managed to make it work for Adamovec by "cheating" (manually deleting the |label= beforehand). I could add the alert, but either the script worked (diff is displayed) or it didn't, in which case I could only say that Location map was not detected - or? GregorB (talk) 17:26, 4 January 2015 (UTC)
Yes, do that, make it explicit, anything is better than clicking and having nothing happen :) I see it now, the logic is too simplistic - it would be better if we first found e.g. {{ocation map*\|(+)}} in the text, and then parsed $1 from that to find the parameters we want. --Joy (talk) 18:36, 4 January 2015 (UTC)
Well, it is simplistic, as I wanted to avoid both parsing and monstrous REs. I'm considering ignoring the |caption= parameter (might be as well hardcoded to "Location of Foo in Croatia") and extracting only latitude and longitude, that could be simpler and more reliable.
I'll add an alert for an unsuccessful run. GregorB (talk) 18:54, 4 January 2015 (UTC)