Rev 2071 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 2071 | Rev 2080 | ||
|---|---|---|---|
| Line 40... | Line 40... | ||
| 40 | 40 | ||
| 41 | /* If no values were found print a nice text */ |
41 | /* If no values were found print a nice text */ |
| 42 | if (text.length == 0) |
42 | if (text.length == 0) |
| 43 | { |
43 | { |
| 44 | text = "<i>No data available</i>"; |
44 | text = "<i>No data available</i>"; |
| - | 45 | } |
|
| - | 46 | ||
| - | 47 | var name = alias; |
|
| - | 48 | ||
| - | 49 | if (aliasNames[alias]) |
|
| - | 50 | { |
|
| - | 51 | name = aliasNames[alias]; |
|
| 45 | } |
52 | } |
| 46 | 53 | ||
| 47 | /* Add the title */ |
54 | /* Add the title */ |
| 48 | text = "<h3>" + |
55 | text = "<h3>" + name + "</h3>" + text + "<br/>"; |
| 49 | 56 | ||
| 50 | /* Update the element markup */ |
57 | /* Update the element markup */ |
| 51 | pageInstance.pageInfoElements[alias].html(text); |
58 | pageInstance.pageInfoElements[alias].html(text); |
| 52 | } |
59 | } |
| 53 | }); |
60 | }); |
| 54 | } |
61 | } |
| 55 | 62 | ||
| 56 | 63 | ||
| 57 | /* Function to request new values from the server */ |
64 | /* Function to request new values from the server */ |
| 58 | function requestServerData() |
65 | function requestServerData() |
| 59 | { |
66 | { |
| 60 | sendCommand("Module_GetLastDataRaw " + pageInstance.aliases.join(" "), handleServerData); |
67 | sendCommand("Module_GetLastDataRaw " + pageInstance.aliases.join(" "), handleServerData); |
| 61 | } |
68 | } |
| 62 | 69 | ||
| 63 | 70 | ||
| 64 | /* Loop through all the aliases and create sliders */ |
71 | /* Loop through all the aliases and create sliders */ |
| 65 | jQuery.each(pageInstance.aliases, function(n, alias) |
72 | jQuery.each(pageInstance.aliases, function(n, alias) |
| 66 | { |
73 | { |
| - | 74 | var name = alias; |
|
| - | 75 | ||
| - | 76 | if (aliasNames[alias]) |
|
| - | 77 | { |
|
| - | 78 | name = aliasNames[alias]; |
|
| - | 79 | } |
|
| - | 80 | ||
| 67 | /* Create the slider HTML from the template and add it to the DOM */ |
81 | /* Create the slider HTML from the template and add it to the DOM */ |
| 68 | pageInstance.pageInfoElements[alias] = $("#page-info-template").tmpl({ alias: alias }).appendTo(pageInstance.pageContentElement).trigger("create"); |
82 | pageInstance.pageInfoElements[alias] = $("#page-info-template").tmpl({ alias: alias, name: name }).appendTo(pageInstance.pageContentElement).trigger("create"); |
| 69 | }); |
83 | }); |
| 70 | 84 | ||
| 71 | 85 | ||
| 72 | /* Request the initial value from the server */ |
86 | /* Request the initial value from the server */ |
| 73 | requestServerData(); |
87 | requestServerData(); |