Guest User

Untitled

a guest
Sep 19th, 2017
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>{{title}}</title>
  5. <meta charset="utf-8">
  6. <meta http-equiv="Cache-control" content="public">
  7. <meta name="viewport" content="width=device-width, initial-scale=1">
  8. <script src="jquery.min.js.gz"></script>
  9. </head>
  10. <body class="body">
  11. <div id="content">
  12. </div>
  13. <script>
  14. var template;
  15. $(document)
  16. .ready(
  17. function () {
  18. loadCSS = function (href) {
  19. var cssLink = $("<link rel='stylesheet' type='text/css' href='" + href + "'>");
  20. $("head").append(cssLink);
  21. };
  22. loadJS = function (src) {
  23. var jsLink = $("<script type='text/javascript' src='" + src + "'>");
  24. $("head").append(jsLink);
  25. };
  26. loadCSS("bootstrap.min.css.gz");
  27. loadCSS("bootstrap-theme.min.css.gz");
  28. loadCSS("site.css");
  29. loadJS("bootstrap.min.js.gz");
  30. loadJS("handlebars.min.js.gz");
  31. var source = $("#template").html();
  32. $("#template").remove();
  33. template = Handlebars.compile(source);
  34. $.post($(location).attr("href"), function (data) {
  35. var output = template(data);
  36. $("#content").html(output);
  37. document.title = $("#title").html();
  38. });
  39. });
  40. </script>
  41.  
  42. <template id="template" type="text/x-handlebars-template">
  43. Remote temp age: {{age1}}<br/>
  44. Remote temp: {{temp1}}C<br/>
  45. Temp: {{temp2}}C<br/>
  46. Humidity: {{humi2}}%<br/>
  47. Need temp: {{needTemp}}C<br/>
  48. Compared to temp: {{usedTemp}}C<br/>
  49. Program: {{program}}<br/>
  50. Program time remaining: {{programln}}<br/>
  51. State: {{state}}<br/>
  52. Uptime: {{uptime}}<br/>
  53. Time: {{time}}<br/>
  54. <title id="title">{{title}}</title>
  55. <input type="button" class="btn btn-primary" name="Reload"
  56. value="Reload" onclick="
  57. $.post($(location).attr('href'), function (data) {
  58. var output = template(data);
  59. $('#content').html(output);
  60. });
  61. "></input>
  62. <input type="button" class="btn btn-primary" name="Manage"
  63. value="Manage" onclick="window.location.href = '/login'"></input>
  64. </template>
  65.  
  66. </body>
  67. </html>
Advertisement
Add Comment
Please, Sign In to add comment