invite.handlebars 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html lang="en">
  3. <head>
  4. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  5. <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
  6. <meta name="viewport" content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
  7. <meta name="apple-mobile-web-app-capable" content="yes" />
  8. <meta name="format-detection" content="telephone=no" />
  9. <meta name="robots" content="noindex,nofollow" />
  10. <link type="text/css" href="styles/style.css" media="screen" rel="stylesheet" title="CSS" />
  11. {{{customCSSTags}}}
  12. <link rel="apple-touch-icon" href="/favicon-303x303.png" />
  13. <script type="text/javascript" src="scripts/common-0.0.1{{min}}.js"></script>
  14. {{{customJSTags}}}
  15. <title>Agent Installation</title>
  16. <style>
  17. .tab {
  18. overflow: hidden;
  19. border: 1px solid #ccc;
  20. background-color: #f1f1f1;
  21. }
  22. .tab button {
  23. background-color: inherit;
  24. float: left;
  25. border: none;
  26. outline: none;
  27. cursor: pointer;
  28. padding: 14px 16px;
  29. transition: 0.3s;
  30. }
  31. .tab button:hover {
  32. background-color: #ddd;
  33. }
  34. .tab button.active {
  35. background-color: #8f8;
  36. }
  37. .tabcontent {
  38. display: none;
  39. padding: 6px 12px;
  40. border: 1px solid #ccc;
  41. border-top: none;
  42. }
  43. </style>
  44. </head>
  45. <body id="body" onload="if (typeof(startup) !== 'undefined') startup();" style="display:none;overflow:hidden">
  46. <div id="container">
  47. <!-- Begin Masthead -->
  48. <div id="masthead" class=noselect style="background:url(logo.png) 0px 0px;background-color:#036;background-repeat:no-repeat;height:66px;width:100%;overflow:hidden;">
  49. <div style="float:left;text-shadow: 1px 1px 2px #000">{{{titlehtml}}}</div>
  50. <div style="float:left; height: 66px; color:#c8c8c8; padding-left:14px; padding-top:7px">
  51. <strong><font style="font-size:46px; font-family: Arial, Helvetica, sans-serif;text-shadow: 1px 1px 2px #000">{{{title1}}}</font></strong>
  52. </div>
  53. <div style="float:left; height: 66px; color:#c8c8c8; padding-left:5px; padding-top:14px">
  54. <strong><font style="font-size:14px; font-family: Arial, Helvetica, sans-serif;text-shadow: 1px 1px 2px #000">{{{title2}}}</font></strong>
  55. </div>
  56. <p id="logoutControl" style="color:white;font-size:11px;margin: 10px 10px 0;">{{{logoutControl}}}</p>
  57. </div>
  58. <div id="page_leftbar">
  59. <div style="height:16px"></div>
  60. </div>
  61. <div id=topbar class="noselect style3" style="height:24px;position:relative">
  62. <div id=uiMenuButton title="User interface selection" onclick="showUserInterfaceSelectMenu()">
  63. &diams;
  64. <div id=uiMenu style="display:none">
  65. <div id=uiViewButton1 class=uiSelector onclick=userInterfaceSelectMenu(1) title="Left bar interface"><div class="uiSelector1"></div></div>
  66. <div id=uiViewButton2 class=uiSelector onclick=userInterfaceSelectMenu(2) title="Top bar interface"><div class="uiSelector2"></div></div>
  67. <div id=uiViewButton3 class=uiSelector onclick=userInterfaceSelectMenu(3) title="Fixed width interface"><div class="uiSelector3"></div></div>
  68. <div id=uiViewButton4 class=uiSelector onclick=toggleNightMode() title="Toggle night mode"><div class="uiSelector4"></div></div>
  69. </div>
  70. </div>
  71. </div>
  72. <div id="column_l" style="overflow-y:auto">
  73. <h1>Welcome</h1>
  74. <p>
  75. This is a portal for computer remote management and support.
  76. </p>
  77. <table style="text-align:center;margin-top:60px;width:100%">
  78. <tr>
  79. <td style="width:33%"></td>
  80. <td style="font-size:20px;background-color:#DDD;padding:12px;border-radius:16px">
  81. <div style="margin-bottom:10px">Invitation&nbsp;Code</div>
  82. <form method=post>
  83. <div><input id="inviteCode" name="inviteCode" style="font-size:26px;text-align:center;border-radius:6px" maxlength="20" /></div>
  84. <div><input type="submit" style="margin-top:10px" value="Submit" /></div>
  85. </form>
  86. <div id="message" style="margin-top:8px;font-size:16px;display:none"></div>
  87. </td>
  88. <td style="width:33%"></td>
  89. </tr>
  90. </table>
  91. </div>
  92. <div id="footer">
  93. <table cellpadding="0" cellspacing="10" style="width: 100%">
  94. <tr>
  95. <td style="text-align:left"></td>
  96. <td style="text-align:right"></td>
  97. </tr>
  98. </table>
  99. </div>
  100. </div>
  101. <script>
  102. 'use strict';
  103. var random = '{{{randomlength}}}' // Random length string for BREACH mitigation
  104. var urlargs = parseUriArgs();
  105. if (urlargs.key && (isAlphaNumeric(urlargs.key) == false)) { delete urlargs.key; }
  106. var uiMode = parseInt(getstore('uiMode', 1));
  107. var webPageStackMenu = false;
  108. var webPageFullScreen = true;
  109. var nightMode = (getstore('_nightMode', '0') == '1');
  110. userInterfaceSelectMenu();
  111. Q('inviteCode').focus();
  112. start();
  113. document.onclick = function (e) { Q('inviteCode').focus(); }
  114. function start() {
  115. if (urlargs.c != null) { Q('inviteCode').value = urlargs.c; }
  116. // Setup page visuals
  117. var hide = 0;
  118. var globalHide = parseInt('{{{hide}}}');
  119. if (globalHide || urlargs.hide) {
  120. if (urlargs.hide) { hide = parseInt(urlargs.hide); }
  121. if (globalHide) { hide = (hide | globalHide); }
  122. }
  123. urlargs.hide = hide;
  124. QV('masthead', !(hide & 1));
  125. QV('topbar', !(hide & 2));
  126. QV('footer', !(hide & 4));
  127. if ((hide & 4) != 0) { QC('body').add('nofooter'); } else { QC('body').remove('nofooter'); }
  128. if (hide != 0) {
  129. // Fix the main grid to zero-height elements we want to hide.
  130. QS('container')['grid-template-rows'] = ((hide & 1) ? '0' : '66') + 'px fit-content(48px) auto ' + ((hide & 4) ? '0' : '45') + 'px';
  131. QS('container')['-ms-grid-rows'] = ((hide & 1) ? '0' : '66') + 'px fit-content(48px) auto ' + ((hide & 4) ? '0' : '45') + 'px';
  132. }
  133. var messageid = parseInt('{{{messageid}}}');
  134. var okmessages = [''];
  135. var failmessages = ["Invalid invitation code."];
  136. if (messageid > 0) {
  137. var msg = '';
  138. if ((messageid < 100) && (messageid < okmessages.length)) { msg = okmessages[messageid]; }
  139. else if ((messageid >= 100) && ((messageid - 100) < failmessages.length)) { msg = failmessages[messageid - 100]; }
  140. if (msg != '') {
  141. if (messageid >= 100) { msg = ('<span class="msg error"><b style=color:#8C001A>' + msg + '<b></span>'); } else { msg = ('<span class="msg success"><b>' + msg + '</b></span>'); }
  142. QH('message', msg);
  143. QV('message', true);
  144. }
  145. }
  146. }
  147. // Toggle user interface menu
  148. function showUserInterfaceSelectMenu() {
  149. Q('uiViewButton1').classList.remove('uiSelectorSel');
  150. Q('uiViewButton2').classList.remove('uiSelectorSel');
  151. Q('uiViewButton3').classList.remove('uiSelectorSel');
  152. Q('uiViewButton4').classList.remove('uiSelectorSel');
  153. try { Q('uiViewButton' + uiMode).classList.add('uiSelectorSel'); } catch (ex) { }
  154. QV('uiMenu', (QS('uiMenu').display == 'none'));
  155. if (nightMode) { Q('uiViewButton4').classList.add('uiSelectorSel'); }
  156. }
  157. function userInterfaceSelectMenu(s) {
  158. if (s) { uiMode = s; putstore('uiMode', uiMode); }
  159. webPageFullScreen = (uiMode < 3);
  160. webPageStackMenu = true;//(uiMode > 1);
  161. toggleFullScreen(0);
  162. toggleStackMenu(0);
  163. QC('column_l').add('room4submenu');
  164. }
  165. function toggleNightMode() {
  166. nightMode = !nightMode;
  167. if (nightMode) { QC('body').add('night'); } else { QC('body').remove('night'); }
  168. putstore('_nightMode', nightMode ? '1' : '0');
  169. }
  170. // Toggle the web page to full screen
  171. function toggleFullScreen(toggle) {
  172. if (toggle === 1) { webPageFullScreen = !webPageFullScreen; putstore('webPageFullScreen', webPageFullScreen); }
  173. var hide = 0;
  174. //if (args.hide) { hide = parseInt(args.hide); }
  175. if (webPageFullScreen == false) {
  176. QC('body').remove('menu_stack');
  177. QC('body').remove('fullscreen');
  178. QC('body').remove('arg_hide');
  179. //if (xxcurrentView >= 10) QC('column_l').add('room4submenu');
  180. //QV('UserDummyMenuSpan', false);
  181. //QV('page_leftbar', false);
  182. } else {
  183. QC('body').add('fullscreen');
  184. if (hide & 16) QC('body').add('arg_hide'); // This is replacement for QV('page_leftbar', !(hide & 16));
  185. //QV('UserDummyMenuSpan', (xxcurrentView < 10) && webPageFullScreen);
  186. //QV('page_leftbar', true);
  187. }
  188. QV('body', true);
  189. }
  190. // If FullScreen, toggle menu to be horisontal or vertical
  191. function toggleStackMenu(toggle) {
  192. if (webPageFullScreen == true) {
  193. if (toggle === 1) {
  194. webPageStackMenu = !webPageStackMenu;
  195. putstore('webPageStackMenu', webPageStackMenu);
  196. }
  197. if (webPageStackMenu == false) {
  198. QC('body').remove('menu_stack');
  199. } else {
  200. QC('body').add('menu_stack');
  201. //if (xxcurrentView >= 10) QC('column_l').remove('room4submenu');
  202. }
  203. }
  204. }
  205. function putstore(name, val) { try { if (typeof (localStorage) === 'undefined') return; localStorage.setItem(name, val); } catch (e) { } }
  206. function getstore(name, val) { try { if (typeof (localStorage) === 'undefined') return val; var v = localStorage.getItem(name); if ((v == null) || (v == null)) return val; return v; } catch (e) { return val; } }
  207. function format(format) { var args = Array.prototype.slice.call(arguments, 1); return format.replace(/{(\d+)}/g, function (match, number) { return typeof args[number] != 'undefined' ? args[number] : match; }); };
  208. </script>
  209. </body>
  210. </html>