Uploaded image for project: 'Guacamole'
  1. Guacamole
  2. GUACAMOLE-1402

Expose client state enum values

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Implemented
    • None
    • 1.6.0
    • guacamole-common-js
    • None

    Description

      In Client.js you have what is essentially an enum of state values (https://github.com/apache/guacamole-client/blob/a54c78554f855bb5a0f49011a8f6e576a6bde164/guacamole-common-js/src/main/webapp/modules/Client.js#L35-L40) and these are exposed to the user via the onstatechange callback, however the enum names are not exposed to the user, being function-scoped variables. Having access to these states by name would allow the user to write more self-documenting code and insulate from changes in the underlying state values. This practice is common in compiled languages.

      Indeed you do so correctly in Tunnel.js where you have a very similar construct that IS properly exposed to the user (https://github.com/apache/guacamole-client/blob/a54c78554f855bb5a0f49011a8f6e576a6bde164/guacamole-common-js/src/main/webapp/modules/Tunnel.js#L190-L224).

      Could the state values in Client.js please be similarly exposed?

      Attachments

        Activity

          People

            vnick Nick Couchman
            jberger Joel Berger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: