<commit_before><link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../paper-radio-button/paper-radio-button.html">
<link rel="import" href="../paper-radio-group/paper-radio-group.html">
<link rel="import" href="imports.html">

<dom-module id="ros-rviz-global-options">
  <template>
    <style include="iron-flex iron-flex-alignment"></style>
    <style>
      label {
        @apply(--paper-font-common-base);
      }
    </style>
    <paper-input id="fixedFrame" label="Fixed frame" value="[[globalOptions.fixedFrame]]" on-blur="_updateGlobalOptions"></paper-input>
    <paper-input id="bgColor" label="Background color" value="[[globalOptions.background]]" on-blur="_updateGlobalOptions"></paper-input>
    <paper-input id="websocketUrl" label="Websocket URL" value="[[globalOptions.url]]" on-blur="_updateGlobalOptions"></paper-input>
    <paper-input id="webVideoUrl" label="Web video server URL" value="[[globalOptions.videoServer]]" on-blur="_updateGlobalOptions"></paper-input>
    <paper-input id="colladaUrl" label="Collada file server URL" value="[[globalOptions.colladaServer]]" on-blur="_updateGlobalOptions"></paper-input>
    <label id="colladaLabel">Collada loader:</label>
    <paper-radio-group selected="{{globalOptions.colladaLoader}}" aria-labelledby="colladaLabel">
      <paper-radio-button name="collada">Loader 1</paper-radio-button>
      <paper-radio-button name="collada2">Loader 2</paper-radio-button>
    </paper-radio-group>
  </template>
  <script>
    Polymer({
      is: 'ros-rviz-global-options',

      properties: {
        globalOptions: {
          type: Object,
          notify: true,
        },
        name: {
          type: String,
          value: 'Options',
        },
      },

      ready: function() {
        if (!this.globalOptions.background) {
          this.set('globalOptions.background', '#111111');
        }
        if (!this.globalOptions.clientId) {
          // TODO: this is used by point cloud and depth cloud for dynamically starting backend streaming.
          // We want to get rid of those and let the user handle that.
          this.set('globalOptions.clientId', '' + Math.random());
        }
        if (!this.globalOptions.colladaLoader) {
          this.set('globalOptions.colladaLoader', 'collada2');
        }
        if (!this.globalOptions.colladaServer) {
          var protocol = window.location.protocol;
          var hostname = window.location.hostname;                  
          var url = protocol + '//' + hostname + ':8001/';
          this.set('globalOptions.colladaServer', url);
        }
        if (!this.globalOptions.fixedFrame) {
          this.set('globalOptions.fixedFrame', '/base_link');
        }
        if (!this.globalOptions.websocketUrl) {
          var hostname = window.location.hostname;
          var protocol = 'ws:';
          if (window.location.protocol === 'https:') {
            protocol = 'wss:';
          }
          var url = protocol + '//' + hostname + ':9090';
          this.set('globalOptions.url', url);
        }
        if (!this.globalOptions.videoServer) {
          var protocol = window.location.protocol;
          var hostname = window.location.hostname;
          var url = protocol + '//' + hostname + ':9999';
          this.set('globalOptions.videoServer', url);
        }
      },

      destroy: function() {<commit_msg>Removed clientId from global options.<commit_after><link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../paper-radio-button/paper-radio-button.html">
<link rel="import" href="../paper-radio-group/paper-radio-group.html">
<link rel="import" href="imports.html">

<dom-module id="ros-rviz-global-options">
  <template>
    <style include="iron-flex iron-flex-alignment"></style>
    <style>
      label {
        @apply(--paper-font-common-base);
      }
    </style>
    <paper-input id="fixedFrame" label="Fixed frame" value="[[globalOptions.fixedFrame]]" on-blur="_updateGlobalOptions"></paper-input>
    <paper-input id="bgColor" label="Background color" value="[[globalOptions.background]]" on-blur="_updateGlobalOptions"></paper-input>
    <paper-input id="websocketUrl" label="Websocket URL" value="[[globalOptions.url]]" on-blur="_updateGlobalOptions"></paper-input>
    <paper-input id="webVideoUrl" label="Web video server URL" value="[[globalOptions.videoServer]]" on-blur="_updateGlobalOptions"></paper-input>
    <paper-input id="colladaUrl" label="Collada file server URL" value="[[globalOptions.colladaServer]]" on-blur="_updateGlobalOptions"></paper-input>
    <label id="colladaLabel">Collada loader:</label>
    <paper-radio-group selected="{{globalOptions.colladaLoader}}" aria-labelledby="colladaLabel">
      <paper-radio-button name="collada">Loader 1</paper-radio-button>
      <paper-radio-button name="collada2">Loader 2</paper-radio-button>
    </paper-radio-group>
  </template>
  <script>
    Polymer({
      is: 'ros-rviz-global-options',

      properties: {
        globalOptions: {
          type: Object,
          notify: true,
        },
        name: {
          type: String,
          value: 'Options',
        },
      },

      ready: function() {
        if (!this.globalOptions.background) {
          this.set('globalOptions.background', '#111111');
        }
        if (!this.globalOptions.colladaLoader) {
          this.set('globalOptions.colladaLoader', 'collada2');
        }
        if (!this.globalOptions.colladaServer) {
          var protocol = window.location.protocol;
          var hostname = window.location.hostname;                  
          var url = protocol + '//' + hostname + ':8001/';
          this.set('globalOptions.colladaServer', url);
        }
        if (!this.globalOptions.fixedFrame) {
          this.set('globalOptions.fixedFrame', '/base_link');
        }
        if (!this.globalOptions.websocketUrl) {
          var hostname = window.location.hostname;
          var protocol = 'ws:';
          if (window.location.protocol === 'https:') {
            protocol = 'wss:';
          }
          var url = protocol + '//' + hostname + ':9090';
          this.set('globalOptions.url', url);
        }
        if (!this.globalOptions.videoServer) {
          var protocol = window.location.protocol;
          var hostname = window.location.hostname;
          var url = protocol + '//' + hostname + ':9999';
          this.set('globalOptions.videoServer', url);
        }
      },

      destroy: function() {
{'fraction_non_alphanumeric': 0.1598125188993045, 'fraction_numerical': 0.006652555185969156, 'mean_word_length': 2.7521270561542823, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 65, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1436310', 'n_tokens_mistral': 1941, 'n_tokens_neox': 1885, 'n_words': 344}