E3V3A / TESTT

TEST -- This is only a test repo - nothing here
0 stars 0 forks source link

Consider removing the materialdesign CDN image dependencies #30

Open E3V3A opened 6 years ago

E3V3A commented 6 years ago

There is no good reason to keep the module having to download the material design icons, every time they are needed. It also prevent the module to display properly if:

Here is the line that does the loading:

  loadCSS: function() {
    var css = [{
        id:   'materialDesignIcons',
        href: 'https://cdn.materialdesignicons.com/2.0.46/css/materialdesignicons.min.css',
    }]

So to accomplish this we need to download the images and keep them in ./images/ (?). The icons in question are specified here (and possible in other places).

  getDom : function() {
    var wrapper = document.createElement("div")
    wrapper.className = "ASSTNT"
    var iconDom = document.createElement("div")
    iconDom.className = "mdi status " + this.status + " "
    switch(this.status) {
      case 'INITIALIZED':
        iconDom.className += "mdi-microphone-outline"
        break
      case 'HOTWORD_STARTED':
        iconDom.className += "mdi-microphone"
        break
      case 'HOTWORD_DETECTED':
        iconDom.className += "mdi-microphone"
        break
      case 'ASSISTANT_STARTED':
        iconDom.className += "mdi-google-assistant"
        break
      case 'ASSISTANT_SPEAKING':
        iconDom.className += "mdi-google-assistant"
        break
      case 'COMMAND_STARTED':
        iconDom.className += "mdi-apple-keyboard-command"
        break
      case 'COMMAND_LISTENED':
        iconDom.className += "mdi-apple-keyboard-command"
        break
      case 'SPEAK_STARTED':
        iconDom.className += "mdi-message-processing"
        break
      case 'SPEAK_ENDED':
        iconDom.className += "mdi-microphone"
        break
}