You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

webclient3.html 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  4. <meta http-equiv="Expires" content="0"/>
  5. <meta http-equiv="Cache-Control" content ="no-cache"/>
  6. <meta http-equiv="Cache-Control" content ="no-store, must-revalidate, max-age=0"/>
  7. <meta http-equiv="Cache-Control" content ="post-check=0, pre-check=0"/>
  8. <meta http-equiv="Pragma" content="no-cache"/>
  9. <title>Flash RDP Client</title>
  10. <script type="text/javascript" src="webclient.js"></script>
  11. <script type="text/javascript" src="swfobject.js"></script>
  12. <script type="text/javascript">
  13. var FlashId = "FlashRDP";
  14. function Init()
  15. {
  16. document.getElementById("Information").innerHTML = "Loading Flash...";
  17. RDPWebClient.embedSWF ("RDPClientUI.swf", FlashId);
  18. }
  19. var fFlashLoaded = false;
  20. var FlashVersion = "";
  21. function getFlashProperty(id, name)
  22. {
  23. var value = "";
  24. var flash = RDPWebClient.getFlashById(id);
  25. if (flash)
  26. {
  27. value = flash.getProperty(name);
  28. }
  29. return value;
  30. }
  31. /*
  32. * RDP client event handlers.
  33. * They will be called when the flash movie is ready and some event occurs.
  34. * Note: the function name must be the "flash_id" + "event name".
  35. */
  36. function RDPWebEventLoaded(flashId)
  37. {
  38. /* The movie loading is complete, the flash client is ready. */
  39. fFlashLoaded = true;
  40. FlashVersion = getFlashProperty(flashId, "version");
  41. document.getElementById("Information").innerHTML = "Version: " + FlashVersion;
  42. }
  43. function RDPWebEventConnected(flashId)
  44. {
  45. /* RDP connection has been established */
  46. document.getElementById("Information").innerHTML =
  47. "Version: " + FlashVersion + ". Connected to " + getFlashProperty(flashId, "serverAddress");
  48. }
  49. function RDPWebEventServerRedirect(flashId)
  50. {
  51. /* RDP connection has been established */
  52. document.getElementById("Information").innerHTML =
  53. "Version: " + FlashVersion + ". Redirection by " + getFlashProperty(flashId, "serverAddress");
  54. }
  55. function RDPWebEventDisconnected(flashId)
  56. {
  57. /* RDP connection has been lost */
  58. alert("Disconnect reason:\n" + getFlashProperty(flashId, "lastError"));
  59. document.InputForm.connectionButton.value = "Connect";
  60. document.InputForm.onsubmit=function() {return Connect();}
  61. document.getElementById("Information").innerHTML = "Version: " + FlashVersion;
  62. }
  63. /*
  64. * Examples how to call a flash method from HTML.
  65. */
  66. function Connect()
  67. {
  68. if (fFlashLoaded != true)
  69. {
  70. return false;
  71. }
  72. /* Do something with the input form:
  73. *
  74. * to hide: document.getElementById("InputForm").style.display = 'none';
  75. * to redisplay: document.getElementById("InputForm").style.display = 'block';
  76. *
  77. * Just rename the button and attach another submit action.
  78. */
  79. document.InputForm.connectionButton.value = "Disconnect";
  80. document.InputForm.onsubmit=function() {return Disconnect();}
  81. var flash = RDPWebClient.getFlashById(FlashId);
  82. if (flash)
  83. {
  84. /* Setup the client parameters. */
  85. // flash.setProperty("serverPort", "4777");
  86. flash.setProperty("serverAddress", document.InputForm.serverAddress.value);
  87. flash.setProperty("logonUsername", document.InputForm.logonUsername.value);
  88. flash.setProperty("logonPassword", document.InputForm.logonPassword.value);
  89. if (document.InputForm.desktopSize.value == "800")
  90. {
  91. flash.setProperty("displayWidth", "800");
  92. flash.setProperty("displayHeight", "600");
  93. }
  94. else if (document.InputForm.desktopSize.value == "1024")
  95. {
  96. flash.setProperty("displayWidth", "1024");
  97. flash.setProperty("displayHeight", "768");
  98. }
  99. else if (document.InputForm.desktopSize.value == "1280")
  100. {
  101. flash.setProperty("displayWidth", "1280");
  102. flash.setProperty("displayHeight", "1024");
  103. }
  104. flash.setProperty("keyboardLayout", document.InputForm.keyboardLayout.value);
  105. document.getElementById("Information").innerHTML =
  106. "Version: " + FlashVersion +". Connecting to " + getFlashProperty(FlashId, "serverAddress") + "...";
  107. /* Establish the connection. */
  108. flash.connect();
  109. }
  110. /* If false is returned, the form will not be submitted and we stay on the same page. */
  111. return false;
  112. }
  113. function Disconnect()
  114. {
  115. var flash = RDPWebClient.getFlashById(FlashId);
  116. if (flash)
  117. {
  118. flash.disconnect();
  119. }
  120. /* Restore the "Connect" form. */
  121. document.InputForm.connectionButton.value = "Connect";
  122. document.InputForm.onsubmit=function() {return Connect();}
  123. /* If false is returned, the form will not be submitted and we stay on the same page. */
  124. return false;
  125. }
  126. function sendCAD()
  127. {
  128. var flash = RDPWebClient.getFlashById(FlashId);
  129. if (flash)
  130. {
  131. flash.keyboardSendCAD();
  132. }
  133. /* If false is returned, the form will not be submitted and we stay on the same page. */
  134. return false;
  135. }
  136. function sendScancodes()
  137. {
  138. var flash = RDPWebClient.getFlashById(FlashId);
  139. if (flash)
  140. {
  141. flash.keyboardSendScancodes('1f 9f 2e ae 1e 9e 31 b1');
  142. }
  143. /* If false is returned, the form will not be submitted and we stay on the same page. */
  144. return false;
  145. }
  146. function applyKeyboardLayout()
  147. {
  148. var flash = RDPWebClient.getFlashById(FlashId);
  149. if (flash)
  150. {
  151. flash.setProperty("keyboardLayout", document.InputForm.keyboardLayout.value);
  152. }
  153. /* If false is returned, the form will not be submitted and we stay on the same page. */
  154. return false;
  155. }
  156. </script>
  157. </head>
  158. <body onload="Init()">
  159. <h2>RDP Web Client</h2>
  160. <form name="InputForm" onsubmit="return Connect()">
  161. <p>
  162. Computer: <input type=text size=20 name=serverAddress value="">
  163. User name: <input type=text size=20 name=logonUsername value="">
  164. Password: <input type=password size=20 name=logonPassword value="">
  165. </p>
  166. <p>
  167. Desktop size: <select name=desktopSize>
  168. <option value="800">800x600</option>
  169. <option value="1024">1024x768</option>
  170. <option value="1280">1280x1024</option>
  171. </select>
  172. Keyboard layout: <select name=keyboardLayout>
  173. <option value="en">EN</option>
  174. <option value="de">DE</option>
  175. </select>
  176. <input name=layoutButton type=button value="Change keyboard layout" onClick="return applyKeyboardLayout()">
  177. </p>
  178. <p>
  179. <input name=connectionButton type=submit value="Connect">
  180. <input name=cadButton type=button value="Ctrl-Alt-Del" onClick="return sendCAD()">
  181. <input name=scanButton type=button value="Scancodes test" onClick="return sendScancodes()">
  182. </p>
  183. </form>
  184. <div id="FlashRDPContainer">
  185. <div id="FlashRDP">
  186. </div>
  187. </div>
  188. <div id="Information"></div>
  189. <br>(C) 2009-2010 Oracle Corporation
  190. <iframe style="height:0px;width:0px;visibility:hidden" src="about:blank">
  191. this frame prevents back forward cache in Safari
  192. </iframe>
  193. </body>
  194. <head><meta http-equiv="Pragma" content="no-cache"/></head>
  195. </html>