Page 4 of 7

Re: [Script] WazeWrap

Posted: Thu Mar 16, 2017 9:11 pm
by JustinS83
Update released - 0.2.8

Adding support for custom groups to the AddLayerCheckbox method.

The custom group will be built if it is not found, will persist between event/editing mode and the checked status will persist across hard refreshes (will be reset upon browser close/open). Child elements will now also check against the checked status of the parent when they are added and disable themselves (and send a call to the script to disable its layers) if the parent group is not enabled.

Re: [Script] WazeWrap

Posted: Fri Mar 17, 2017 4:57 pm
by JustinS83
Added documentation for the current state of WazeWrap implementation with short descriptors for each method.

Re: [Script] WazeWrap

Posted: Thu Mar 30, 2017 12:54 am
by JustinS83
jm6087 wrote:Is it possible for WazeWrap to include the fix for the en-US change that is breaking some scripts?
What fix are you referring to?

Re: [Script] WazeWrap

Posted: Thu Mar 30, 2017 2:40 am
by JustinS83
Nothing WazeWrap can do about that - the header is loaded before any required scripts. Scripter's have to use the regex that turbomkt linked, or simply call out each one individually and use a * in place of the language.

Re: [Script] WazeWrap

Posted: Fri Nov 10, 2017 6:16 pm
by JustinS83
Update released - 2017.11.10.01

It's been a while since we have made any changes to this library!

The Interface.Tab class (allows easy addition of a tab in the side bar for your script) will not automatically recreate the tab when the user switches in/out of Event Mode (the side bar is not shown in Event Mode...) or if they switch between imperial & metric units. Huzzah!

Devs:
The Tab class will automatically recreate the tab based upon the html originally given and will then re-call the callback method (which should, of course, enable any setting checkboxes based upon your current settings object...you're not checking directly against the checkboxes for different features, right? Right???).

Re: [Script] WazeWrap

Posted: Sat Feb 02, 2019 5:35 am
by JustinS83
Update released - 2019.02.01.01

A Script Updates interface is finally here! Holy moly I put that off for over a year...but now we have a way for scripts to publish update information in a consistent manner, and most importantly - no ridiculous alert() boxes interrupting the page loading and forcing focus to the tab.

Special thanks to falco_sparverius for the elegant design work - if it was left up to me it would have been an eyesore. Nice work :D

This update window will allow multiple scripts to display update information at once - so we do not have 2, 3, 4+ scripts popping up windows to announce their update. Each script that has an update to announce will get its own tab on the left side of the dialog. The right side will contain the update information with the new version at the top, followed by the update description and links to the Greasyfork and forum thread (optional).

https://imgur.com/1sgnAD6.png

For devs:

Code: Select all

WazeWrap.Interface.ShowScriptUpdate("Script Name", ScriptVersion, "Update description", "Greasyfork Link", "Forum Link");
I would recommend using

Code: Select all

GM_info.script.version
for the script version so it is automatically pulled from the script and does not have to be updated. The Greasyfork link and forum link are not required - you can pass empty strings for these if you do not wish for the links to be displayed.

The Script Update function will track the script name and version so you can call it with the same name and version but it will only display the update the first time - the version must be different on subsequent runs for the update to display again.

Re: [Script] WazeWrap

Posted: Sat Feb 02, 2019 2:17 pm
by JustinS83
jm6087 wrote:WOW, super nice and so clean looking.
I can take no credit for the aesthestics - all credit goes to falco_sparverius. She took my initial turd of a design and cleaned it up.

Re: [Script] WazeWrap

Posted: Sat Feb 02, 2019 8:43 pm
by JustinS83
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 :)

Re: [Script] WazeWrap

Posted: Tue Feb 12, 2019 2:31 pm
by JustinS83
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.

Re: [Script] WazeWrap

Posted: Mon Feb 18, 2019 8:46 pm
by JustinS83
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.