Looks like I 'beat' you with 5 minutes The fact that the message '[missing %{date} value]' is missing is explained when you see that the string doesn't contain the %{date} placeholder.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
https://www.tomputtemans.com/images/WazeBelgium.pnghttps://www.tomputtemans.com/images/WazeWMEbeta.png
https://www.tomputtemans.com/images/WazeBelgium.pnghttps://www.tomputtemans.com/images/WazeWMEbeta.png
FYI, in the drives list the current solution results in the time being displayed twice: Wed Nov 16 2016, 08:11, 08:11
This is because the key 'date.formats.long' is also displaying the hours. Changing this back to "%a %b %d %Y" will result in the UR comments and date information of segments no longer showing their time. Especially the second side-effect seems like a downgrade to me that might weigh up against having the time two times in the drives tab...
This is because the key 'date.formats.long' is also displaying the hours. Changing this back to "%a %b %d %Y" will result in the UR comments and date information of segments no longer showing their time. Especially the second side-effect seems like a downgrade to me that might weigh up against having the time two times in the drives tab...
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
https://www.tomputtemans.com/images/WazeBelgium.pnghttps://www.tomputtemans.com/images/WazeWMEbeta.png
https://www.tomputtemans.com/images/WazeBelgium.pnghttps://www.tomputtemans.com/images/WazeWMEbeta.png
It's one of the 3 keys that are currently missing in I18n.translations[I18n.currentLocale()], so unless you've installed this userscript or mine, you won't find it.Twister-UK wrote:Whereabouts is that key stored? Can't find it in I18n, and I'm assuming that's the only place such a string would be defined...
Once it has been set, it still won't display correctly as update_requests.panel.reported doesn't provide a placeholder for the date that it'll get as argument.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
https://www.tomputtemans.com/images/WazeBelgium.pnghttps://www.tomputtemans.com/images/WazeWMEbeta.png
https://www.tomputtemans.com/images/WazeBelgium.pnghttps://www.tomputtemans.com/images/WazeWMEbeta.png
Just noticed that the date formats date.formats.long and date.formats.default have become available again in the WME beta. The time.formats.long format hasn't been added back yet though.
At least it's some progress
At least it's some progress
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
https://www.tomputtemans.com/images/WazeBelgium.pnghttps://www.tomputtemans.com/images/WazeWMEbeta.png
https://www.tomputtemans.com/images/WazeBelgium.pnghttps://www.tomputtemans.com/images/WazeWMEbeta.png
I might be missing something, but I manage to retrieve the map comments layer easily with its uniqueName on both release and beta WME:
Whether it is enabled or not can be checked by looking at its visibility attribute which will be undefined/true or false:
Code: Select all
Waze.map.getLayerByUniqueName('mapComments')
Code: Select all
Waze.map.getLayerByUniqueName('mapComments').visibility == false
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
https://www.tomputtemans.com/images/WazeBelgium.pnghttps://www.tomputtemans.com/images/WazeWMEbeta.png
https://www.tomputtemans.com/images/WazeBelgium.pnghttps://www.tomputtemans.com/images/WazeWMEbeta.png
I've been trying to make time to write a technical overview on the wiki on how the WME works technically for userscript authors (which components are there, where to find documentation, how to interact with them, etc.). It'd still be fairly high-level, but I think that would be sufficient for most people to get to know what is available.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
https://www.tomputtemans.com/images/WazeBelgium.pnghttps://www.tomputtemans.com/images/WazeWMEbeta.png
https://www.tomputtemans.com/images/WazeBelgium.pnghttps://www.tomputtemans.com/images/WazeWMEbeta.png
You could attempt to observe the element for changes with a MutationObserver. Then you don't need to rely on timeouts to make changes but can instead react immediately after the element was added. I use this a lot in my Tab Manager userscript, as I can't predict when a certain userscript is going to add its tab.
I'm not saying that you should, though. If there's a workaround, that could be sufficient as well.
I'm not saying that you should, though. If there's a workaround, that could be sufficient as well.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
https://www.tomputtemans.com/images/WazeBelgium.pnghttps://www.tomputtemans.com/images/WazeWMEbeta.png
https://www.tomputtemans.com/images/WazeBelgium.pnghttps://www.tomputtemans.com/images/WazeWMEbeta.png
With the latest release of the WME, the layers menu requires a click for it to appear. I had created a userscript to fix this in the beta version and just made it available for release as well. Feel free to add this fix to your userscript if you want to (I think it would fit in well here).
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
https://www.tomputtemans.com/images/WazeBelgium.pnghttps://www.tomputtemans.com/images/WazeWMEbeta.png
https://www.tomputtemans.com/images/WazeBelgium.pnghttps://www.tomputtemans.com/images/WazeWMEbeta.png
FYI: I've created a small userscript today that probably fits into Fix UI as well: displaying additional data (most notably the description) on closures in the road closure list. Currently you can't see the details of a closure unless it is in your editing area and you are allowed to add/edit closures.
[Script] WME Closure Details (v0.1)
The script currently clashes with Fix UI though, as Fix UI changes the long time format, making it impossible to match the closure dates. The only available identifiers are the segment IDs and the dates, so I don't see any other solutions. For the same reason this script will also not result in 100% correct matches whenever several segments are selected that have different closures with the same start and end dates. I tried to hook into the code generation section of the WME, but couldn't immediately find a way in.
[Script] WME Closure Details (v0.1)
The script currently clashes with Fix UI though, as Fix UI changes the long time format, making it impossible to match the closure dates. The only available identifiers are the segment IDs and the dates, so I don't see any other solutions. For the same reason this script will also not result in 100% correct matches whenever several segments are selected that have different closures with the same start and end dates. I tried to hook into the code generation section of the WME, but couldn't immediately find a way in.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
https://www.tomputtemans.com/images/WazeBelgium.pnghttps://www.tomputtemans.com/images/WazeWMEbeta.png
https://www.tomputtemans.com/images/WazeBelgium.pnghttps://www.tomputtemans.com/images/WazeWMEbeta.png
It only took me two months to realise I had to do the matching of dates in the WME Closure Details script the other way around to match all dates. Just a heads up that if you've included this logic in your script, it's probably best you also adjust this part.
Belgium & Luxembourg Coordinator • Script Writing Community Coordinator
https://www.tomputtemans.com/images/WazeBelgium.pnghttps://www.tomputtemans.com/images/WazeWMEbeta.png
https://www.tomputtemans.com/images/WazeBelgium.pnghttps://www.tomputtemans.com/images/WazeWMEbeta.png
Re: [Script] WME Fix UI v1.5.3 -- 2016-11-21