Subversion Repositories HomeAutomation

Rev

Details | Last modification | View Log | SVN | RSS feed

Rev Author Line No. Line
2073 runge 1
 
2
pages.irremotes = {
3
  init: function(pageInstance)
4
  {
5
    pageInstance.pageButtonElements = {};
6
 
7
 
8
    jQuery.each(pageInstance.remotes, function(n, remote)
9
    {
10
      sendCommand("Storage_ListParametersRaw Remote_" + remote, function(jsonData)
11
      {
12
        jQuery.each(jsonData.results, function(button, data)
13
        {
14
          pageInstance.pageButtonElements[remote + "_" + button] = $("#page-irremotes-button-template").tmpl({ button: button }).appendTo(pageInstance.pageContentElement).trigger("create").find("button").on("click", function(event)
15
          {
16
            jQuery.each(pageInstance.aliases, function(i, alias)
17
            {
18
              sendCommand("IROut_SendBurst " + alias + " " + remote + " " + button);
19
            });
20
 
21
            event.preventDefault();
22
          });
23
        });
24
      });
25
    });
26
  }
27
};