[Script] WazeWrap

Discussion for the unofficial, community-developed addons, extensions and scripts built for the Waze Map Editor.

The official index of these tools is the Community Plugins, Extensions and Tools wiki page.

Moderators: Unholy, bextein, Glodenox, JustinS83

Forum rules
Discussion for the unofficial, community-developed addons, extensions and scripts built for the Waze Map Editor.

DO NOT START a new thread unless it is about a new idea. Keep discussion of existing tools within the main thread for that tool.

The official index of these tools is the Community Plugins, Extensions and Tools wiki page.

Re: [Script] WazeWrap

Postby dBsooner » Sat Feb 02, 2019 8:51 pm

JustinS83 wrote:
dBsooner wrote:Thank you, Justin! Good stuff! Is the update content capable of being HTML encode?

Yes, you can pass html for the content. Just don't do anything to crazy and change the look of the window or I'll have to start sanitizing the css and that's no fun :)

Just want to pass in a UL with LIs. Basically take what I’m already doing and pass it to WazeWrap instead of my own alertbox. Gracias!
[ img ][ img ][ img ][ img ][ img ]
• AM: Eastern Oklahoma, DFW, Southern Florida
• Wiki: WME | Editing Manual | Best Practices | FAQ | Places
• AT&T | iPhone XS Max | iOS 12 | Waze Latest Beta
dBsooner
Map Editor - Level 5
Map Editor - Level 5
 
Posts: 507
Joined: Thu Oct 31, 2013 10:53 pm
Location: Tulsa / Broken Arrow, Oklahoma, US
Has thanked: 325 times
Been thanked: 220 times

Re: [Script] WazeWrap

Postby jm6087 » Thu Feb 07, 2019 2:02 am

I am not sure if this is WazeWrap or not but it didn't start happening until the new update window was added.

I have seen various scripts "stuck" in my address bar, BED, Outreach Tracker and some others. Also it appears to never finish loading. I have had the page show it is still loading for over 30 minutes.

[ img ]
jm6087
Country Manager
Country Manager
 
Posts: 2747
Joined: Wed Jun 17, 2015 10:05 pm
Has thanked: 477 times
Been thanked: 1105 times

Re: [Script] WazeWrap

Postby crazycaveman » Mon Feb 11, 2019 2:09 pm

I haven't seen that problem (regarding page never finishing loading) with the new update dialog, editor loads fine whether an update log is shown or not. However, regarding the update log, if there are several scripts that update and produce a scroll bar, I am unable to scroll the list with the mouse (in Chrome and Firefox, have to click and drag the bar). Would it be possible to make the list scrollable with the mouse wheel?
[ img ][ img ] [ img ][ img ][ img ]
ARC: South Atlantic Region
crazycaveman
US Waze Champs
US Waze Champs
 
Posts: 814
Joined: Fri Sep 03, 2010 1:48 am
Location: Rock Hill, SC, USA
Has thanked: 342 times
Been thanked: 502 times

Re: [Script] WazeWrap

Postby JustinS83 » Tue Feb 12, 2019 2:31 pm

crazycaveman wrote:I haven't seen that problem (regarding page never finishing loading) with the new update dialog, editor loads fine whether an update log is shown or not. However, regarding the update log, if there are several scripts that update and produce a scroll bar, I am unable to scroll the list with the mouse (in Chrome and Firefox, have to click and drag the bar). Would it be possible to make the list scrollable with the mouse wheel?


I noticed the scroll wheel was not working when I was developing it but I don't see a reason for it to not work. I tried forcing it and still no-go. Not sure what is going on to be honest.
Script Writing Community Coordinator
[ img ][ img ][ img ][ img ][ img ][ img ]

Local Champ: United States
Country Manager: United States
State Manager: Ohio
JustinS83
Local Champ Mentor
Local Champ Mentor
 
Posts: 1239
Joined: Wed Dec 03, 2014 4:33 am
Location: Franklin, OH
Has thanked: 316 times
Been thanked: 2178 times

Re: [Script] WazeWrap

Postby dBsooner » Thu Feb 14, 2019 4:16 am

JustinS83 wrote:
crazycaveman wrote:I haven't seen that problem (regarding page never finishing loading) with the new update dialog, editor loads fine whether an update log is shown or not. However, regarding the update log, if there are several scripts that update and produce a scroll bar, I am unable to scroll the list with the mouse (in Chrome and Firefox, have to click and drag the bar). Would it be possible to make the list scrollable with the mouse wheel?


I noticed the scroll wheel was not working when I was developing it but I don't see a reason for it to not work. I tried forcing it and still no-go. Not sure what is going on to be honest.

I see this behavior in other webpages. One of which is my companies MNS / RMM portal. If I click to see a systems profile (popup of a ton of info about a computer / server) it opens in a overlaying div. wheel doesn’t work to scroll. Have to use scroll bar. Also, page down / page up doesn’t work either, unless I click somewhere in the actual div first. I think this is a problem with Chrome and handling DIV layer scrolling.
[ img ][ img ][ img ][ img ][ img ]
• AM: Eastern Oklahoma, DFW, Southern Florida
• Wiki: WME | Editing Manual | Best Practices | FAQ | Places
• AT&T | iPhone XS Max | iOS 12 | Waze Latest Beta
dBsooner
Map Editor - Level 5
Map Editor - Level 5
 
Posts: 507
Joined: Thu Oct 31, 2013 10:53 pm
Location: Tulsa / Broken Arrow, Oklahoma, US
Has thanked: 325 times
Been thanked: 220 times

Re: [Script] WazeWrap

Postby JustinS83 » Mon Feb 18, 2019 8:46 pm

Update released - 2019.02.18.01

Added an Events class. This class is designed to add extra, simple error handling when hooking WME events. All scripts that hook any of the WME events should add in their own error handling, but many do not, to prevent WME updates from breaking multiple scripts - even if there is only an error in one.

If one script breaks after hooking one of the events and the error that is thrown is not caught, the rest of the event handling queue is not executed so other scripts can/will be affected. Changing to use the WW events will prevent other scripts from being affected if there is an issue. Additional error handling should be done in the script, but switching to these events is a quick and easy way to protect your script, and others, in case of an error.

The following events are supported:
Code: Select all
moveend
zoomend
mousemove
changelayer
selectionchanged
change:editingHouseNumbers
afterundoaction
afterclearactions
afteraction


Implement virtually the same as when hooking native events.
Native:
Code: Select all
W.selectionManager.events.register("selectionchanged", null, handler);
W.model.actionManager.events.register("afterundoaction",null, handler);
W.model.actionManager.events.register("afterclearactions",null, handler);
W.model.actionManager.events.register("afteraction",null, handler);


Using WazeWrap:
Code: Select all
WazeWrap.Events.register("selectionchanged", null, handler);
WazeWrap.Events.register("afterundoaction",null, handler);
WazeWrap.Events.register("afterclearactions",null, handler);
WazeWrap.Events.register("afteraction",null, handler);


It is possible to pass an error handling method to the WazeWrap.Events.register() method as well if you want to try and recover from any error that occurs.
Code: Select all
WazeWrap.Events.register("selectionchanged", null, handler, errorHandler);

If no error handling method is passed then the error will be logged to the console, including the method name that threw the error.

To unregister the events, it is again essentially the same as unregistering natively
Code: Select all
WazeWrap.Events.unregister("selectionchanged", null, handler);
WazeWrap.Events.unregister("afterundoaction",null, handler);
WazeWrap.Events.unregister("afterclearactions",null, handler);
WazeWrap.Events.unregister("afteraction",null, handler);


Registering/unregistering for entering/exiting house number edit mode is the only one that is different, but you continue to use the same syntax as registering the other events with WazeWrap.Events
Native:
Code: Select all
W.editingMediator.on('change:editingHouseNumbers', handler);
W.editingMediator.off('change:editingHouseNumbers', handler);

WazeWrap:
Code: Select all
WazeWrap.Events.register("change:editingHouseNumbers", null, handler);
WazeWrap.Events.unregister("change:editingHouseNumbers", null, handler);


Note that when using the WazeWrap.Events.register for these you must pass a null value as the 2nd parameter - this is to keep the usage in line with all of the other register calls, despite the native registrations only taking two parameters.
Last edited by JustinS83 on Wed Mar 06, 2019 6:43 pm, edited 1 time in total.
Script Writing Community Coordinator
[ img ][ img ][ img ][ img ][ img ][ img ]

Local Champ: United States
Country Manager: United States
State Manager: Ohio
JustinS83
Local Champ Mentor
Local Champ Mentor
 
Posts: 1239
Joined: Wed Dec 03, 2014 4:33 am
Location: Franklin, OH
Has thanked: 316 times
Been thanked: 2178 times

Re: [Script] WazeWrap

Postby dBsooner » Tue Feb 19, 2019 12:40 am

Found an interesting z-index issue tonight. I can't seem to get the z-index high enough to be on-top of the UR Panel, but going to 10000 instead of 1000 gets above the turn restriction arrows. I found this by going directly to a UR in the URL (while I left my disabled turns enabled).

EDIT: Yep and I see a bug with URC-E too. LOL.

2019_02_18_18_34_55_Waze_Map_Editor.png
(194.86 KiB) Downloaded 62 times
[ img ][ img ][ img ][ img ][ img ]
• AM: Eastern Oklahoma, DFW, Southern Florida
• Wiki: WME | Editing Manual | Best Practices | FAQ | Places
• AT&T | iPhone XS Max | iOS 12 | Waze Latest Beta
dBsooner
Map Editor - Level 5
Map Editor - Level 5
 
Posts: 507
Joined: Thu Oct 31, 2013 10:53 pm
Location: Tulsa / Broken Arrow, Oklahoma, US
Has thanked: 325 times
Been thanked: 220 times

Re: [Script] WazeWrap

Postby JustinS83 » Tue Feb 19, 2019 12:52 am

dBsooner wrote:Found an interesting z-index issue tonight. I can't seem to get the z-index high enough to be on-top of the UR Panel, but going to 10000 instead of 1000 gets above the turn restriction arrows. I found this by going directly to a UR in the URL (while I left my disabled turns enabled).

EDIT: Yep and I see a bug with URC-E too. LOL.

2019_02_18_18_34_55_Waze_Map_Editor.png


I wasn't going to mess with the zindex to get on top of that stuff but people won't stop pointing it out. So. FINE.
Script Writing Community Coordinator
[ img ][ img ][ img ][ img ][ img ][ img ]

Local Champ: United States
Country Manager: United States
State Manager: Ohio
JustinS83
Local Champ Mentor
Local Champ Mentor
 
Posts: 1239
Joined: Wed Dec 03, 2014 4:33 am
Location: Franklin, OH
Has thanked: 316 times
Been thanked: 2178 times

Re: [Script] WazeWrap

Postby dBsooner » Tue Feb 19, 2019 2:51 am

JustinS83 wrote:
dBsooner wrote:Found an interesting z-index issue tonight. I can't seem to get the z-index high enough to be on-top of the UR Panel, but going to 10000 instead of 1000 gets above the turn restriction arrows. I found this by going directly to a UR in the URL (while I left my disabled turns enabled).

EDIT: Yep and I see a bug with URC-E too. LOL.

2019_02_18_18_34_55_Waze_Map_Editor.png


I wasn't going to mess with the zindex to get on top of that stuff but people won't stop pointing it out. So. FINE.


Lol! Hey. You don’t gotta fix it. I only mentioned it so others might not. Hehehe. Thanks for fixin it!
[ img ][ img ][ img ][ img ][ img ]
• AM: Eastern Oklahoma, DFW, Southern Florida
• Wiki: WME | Editing Manual | Best Practices | FAQ | Places
• AT&T | iPhone XS Max | iOS 12 | Waze Latest Beta
dBsooner
Map Editor - Level 5
Map Editor - Level 5
 
Posts: 507
Joined: Thu Oct 31, 2013 10:53 pm
Location: Tulsa / Broken Arrow, Oklahoma, US
Has thanked: 325 times
Been thanked: 220 times

Previous

Return to Addons, Extensions, and Scripts

Who is online

Users browsing this forum: denysdgcf, ramblinwreck_81, Skulllzzcode, Twister-UK