Prior to and after addressing Worklist Item #21420, it was observed that the
tool bar buttons popping in and out during load. Taking a while to become visible.
Ran JSHint on the edit.js script to see if something stood out.
Testing with the various lint fixes the odd loading behavior wasn't observed locally any longer.
Pushing this up for testing. This may be what @CainFoool was seeing regarding the create button
not appearing when testing a different PR as at times it took quite some time for the buttons
to load properly.
JSHint Issues Addressed:
* Resolved instance of \"Use the function form of \"use strict\"\"
** Moved use strict declaration to the file function level.
** This fixed various unknown or not defined errors.
* Resolved instances of \"\'const\' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).\"
** Switched const to var to avoid using keywords respected by only a subset of browsers.
* Resolved various multiply defined vars.
** Notable callouts being position var and properties var.
** This should fix issues where the same var was being used though the intent of use may have varied.
* Resolved instances of missing semi-colons
PreFix: 51 JSHint issues detected
PostFix: 0 JSHint issues detected.
Changes to be committed:
modified: scripts/system/edit.js
* Adds a local message/event: "Toolbar-DomainChanged"
** This message is sent by the application via its registered domain handlers:
*** hostnameChanged
*** connectedToDomain
*** disconnectedFromDomain
* edit.js subscribes to the "Toolbar-DomainChanged" event and updates the Create
button icon as long as there's a valid known valid create button.
Item Ticket Link: https://worklist.net/21420
Changes to be committed:
modified: interface/src/Application.cpp
modified: scripts/system/edit.js
* The create button icon is set to its disabled resource when the user
enters a domain where they have _neither_ Rez or TempRez permissions.
** If the user has either of the Rez permission levels then the normal edit-i.svg
icon is used and the user is able to create items as before.
* When the user clicks the button in this state, the INSUFFICIENT_PERMISSIONS_ERROR_MSG
is shown and creation menu is not shown.
* The disabled icon, edit-disabled.svg, is based on the edit-i.svg and is set to 33% opacity.
Item Ticket Link: https://worklist.net/21420
Changes to be committed:
new file: interface/resources/icons/tablet-icons/edit-disabled.svg
modified: scripts/system/edit.js