               console.log 'failed parsing imported json'
               console.log e
 
-        $ '#dialog-close'
+        H.$ '#dialog-close'
           .addEventListener 'click', (ev) =>
             ev.stopPropagation()
             @clear_dialog()
 
-        $ '#dialog'
+        H.$ '#dialog'
           .addEventListener 'click', => @clear_dialog()
 
-        $ '#dialog-json'
+        H.$ '#dialog-json'
           .addEventListener 'click', (ev) -> ev.stopPropagation()
 
     mode: 'auto',
     color: {},
 
     toggle_slides: ->
-        $ '#auto'
+        H.$ '#auto'
             .classList.toggle 'active', @mode is 'auto'
-        $ '#manual'
+        H.$ '#manual'
             .classList.toggle 'active', @mode is 'manual'
 
     clear_dialog: ->
-      $ '#dialog'
+      H.$ '#dialog'
         .style.visibility = "hidden"
 
-      for el in $$ '.import-dialog'
+      for el in H.$H.$ '.import-dialog'
         do -> el.style.visibility = "hidden"
 
-      $ '#dialog-json'
+      H.$ '#dialog-json'
         .value = ""
 
 

                        console.log 'ERROR when setting mode!'
                        console.log chrome.runtime.lastError

        $ '#auto_opac-toggle'
            .addEventListener 'click', (event) ->
                chrome.runtime.sendMessage {
                    type: 'set', 

        chrome.runtime.sendMessage type: 'init_options', (resp) =>
            @mode = resp.mode
            @color = resp.color
            @table = new KFTable H.$('#keyframes'), resp.keymode

            @table.add kf for kf in resp.kfs
            @table.create()
                .render()

            H.$ '#color'
                .value = C.rgb_to_hex resp.color

            H.$ '#mode'
                .checked = @mode is 'auto'

            H.$ '#auto_opac-toggle'
                .checked = resp.auto_opac

            @toggle_slides()
