index.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  5. <title></title>
  6. <link href="css/roboto.css" type="text/css" rel="stylesheet">
  7. <link rel="stylesheet" href="css/semantic.min.css"/>
  8. <link rel="stylesheet" type="text/css" href="css/codemirror.css">
  9. <link rel="stylesheet" type="text/css" href="css/show-hint.css">
  10. <link rel="stylesheet" type="text/css" href="css/ttcn.css">
  11. <link rel="stylesheet" type="text/css" href="css/ivprog-visual-1.0.css">
  12. <link rel="stylesheet" type="text/css" href="css/ivprog-term.css">
  13. <link rel="stylesheet" type="text/css" href="css/ivprog-editor.css">
  14. <script src="js/jquery.min.js"></script>
  15. <script src="js/jquery-ui.min.js"></script>
  16. <script src="js/semantic.min.js"></script>
  17. <script src="js/Sortable.js"></script>
  18. <script src="js/iassign-integration-functions.js"></script>
  19. <!-- Accessible UI CSS -->
  20. <link rel="stylesheet" href="css/accessible/style.css"/>
  21. <link rel="stylesheet" href="css/accessible/bootstrap/bootstrap.css"/>
  22. <link rel="stylesheet" href="css/accessible/bootstrap/bootstrap-grid.css"/>
  23. <link rel="stylesheet" href="css/accessible/bootstrap/bootstrap-reboot.css"/>
  24. <link rel="stylesheet" href="css/accessible/design.css"/>
  25. <link rel="stylesheet" href="css/accessible/forms_var_comand.css"/>
  26. </head>
  27. <body>
  28. <!-- Change UI -->
  29. <div class="row">
  30. <div class="col-12 p-3 text-center">
  31. <div class="btn-group">
  32. <button type="button" class="btn btn-info" id="enableVisualUI">Interface interativa</button>
  33. <button type="button" class="btn btn-info" id="enableAccessibleUI">Interface acessível</button>
  34. </div>
  35. </div>
  36. </div>
  37. <!-- Change UI -->
  38. <!-- Visual UI -->
  39. <div id="visualInterface">
  40. <div class="ui height_100 add_accordion" id="ui_main_div">
  41. <div class="title default_visual_title">
  42. <i class="dropdown icon"></i>
  43. </div>
  44. <div class="content height_100">
  45. <div class="ui raised container segment div_to_body">
  46. <div class="ui container main_title only_in_frame">
  47. <h2>iVProg</h2>
  48. </div>
  49. <div class="ui icon menu center aligned container" style="width: 438px; margin-top: -20px;">
  50. <a class="item active visual_coding_button">
  51. <i class="window maximize outline icon"></i>
  52. </a>
  53. <a class="item textual_coding_button">
  54. <i class="code icon"></i>
  55. </a>
  56. <a class="item upload_file_button disabled">
  57. <i class="upload icon"></i>
  58. </a>
  59. <a class="item download_file_button disabled">
  60. <i class="download icon"></i>
  61. </a>
  62. <a class="item undo_button disabled">
  63. <i class="undo icon"></i>
  64. </a>
  65. <a class="item redo_button disabled">
  66. <i class="redo icon"></i>
  67. </a>
  68. <a id="run_button" class="item run_button">
  69. <i class="play icon"></i>
  70. </a>
  71. <a id="stop_button" class="item stop_button" style="display: none">
  72. <i class="stop icon"></i>
  73. </a>
  74. <a class="item assessment assessment_button">
  75. <i class="check icon"></i>
  76. </a>
  77. <!--<a class="item expand_button">
  78. <i class="expand arrows alternate icon"></i>
  79. </a>-->
  80. <a class="item help_button">
  81. <i class="help icon"></i>
  82. </a>
  83. </div>
  84. <div class="ui one column container segment ivprog_visual_panel loading">
  85. <div class="global_var">
  86. <div class="ui icon button add-globalVar-button add_global_button purple">
  87. <i class="icons">
  88. <i class="icon superscript"
  89. style="margin-top: -2px;margin-bottom: 2px;margin-left: 1px;margin-right: 1px; font-size: 18px;"></i>
  90. <i class="corner add icon inverted"
  91. style="font-size: 10px;padding-top: 5px;padding-left: 7px;"></i>
  92. </i>
  93. </div>
  94. <div class="list_globals" id="listGlobalsHandle"></div>
  95. </div>
  96. <div class="all_functions list-group" id="listWithHandle">
  97. </div>
  98. <div class="ui teal small labeled icon button add_function_button">
  99. <data class="i18n" value="ui:btn_function">Function</data>
  100. <i class="add icon"></i>
  101. </div>
  102. <div class="program_final"></div>
  103. </div>
  104. <div class="ui one column container segment ivprog_textual_panel loading" style="display: none;">
  105. <textarea id="ivprog-text-editor" class=".ivprog_textual_code"></textarea>
  106. </div>
  107. <div id='ivprog-term-div' class="six column wide">
  108. </div>
  109. </div>
  110. </div>
  111. <div class="dimmer_content_message">
  112. <h3>Aconteceu um erro ao processar a atividade. <br> Recarregue a página para tentar novamente.</h3>
  113. <button class="positive ui button" onclick="window.parent.location.reload()">Recarregar</button>
  114. </div>
  115. <script src="js/iassign-integration-functions.js"></script>
  116. </div>
  117. </div>
  118. <!-- Visual UI -->
  119. <!-- Accessible UI -->
  120. <div class="container" id="accessibleInterface" style="display: none;">
  121. <!-- Header -->
  122. <nav class="navbar navbar-expand-lg navbar-dark">
  123. <a class="navbar-brand" tabindex="0">iVProg Acessível</a>
  124. <div class="collapse navbar-collapse" id="navbarNav">
  125. <ul class="navbar-nav">
  126. <li class="nav-item">
  127. <a class="nav-link" href="#inicio" title="Alt + i" accesskey="i">Ir função inicio</a>
  128. </li>
  129. <li class="nav-item">
  130. <a class="nav-link" href="#terminal" title="Alt + t" accesskey="t">Ir para o terminal</a>
  131. </li>
  132. </ul>
  133. </div>
  134. </nav>
  135. <!-- Header -->
  136. <!-- Main container -->
  137. <div id="main" class="row" role="main">
  138. <div class="col-12">
  139. <fieldset>
  140. <legend class="p-1">
  141. <h1 tabindex="0" id="inicio">Função início</h1>
  142. </legend>
  143. <ol id="htmlOlCommandsVariablesVariables"></ol>
  144. <ol id="htmlOlCommandsVariablesOperations"></ol>
  145. <div class="row">
  146. <div class="col-12 p-4" style="text-align: right;">
  147. <div id="botoes" class="btn-group">
  148. <div class="dropdown btn btn-primary" id="bt_add_comand">
  149. <a class="btn btn-primary dropdown-toggle" role="button" tabindex="0"
  150. id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true"
  151. aria-expanded="false">
  152. Comandos
  153. </a>
  154. <div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
  155. <a class="dropdown-item" href="#" id="createVariableButton">
  156. Nova Variável
  157. </a>
  158. <a class="dropdown-item" href="#" id="assignVariableButton">
  159. Atribuição e Operações
  160. </a>
  161. </div>
  162. </div>
  163. <button class="btn btn-success" id="runCodeButton">
  164. Executar
  165. <i id="runCodePlayIcon" class="play icon" style="display: inline;"></i>
  166. <i id="runCodeStopIcon" class="stop icon" style="display: none;"></i>
  167. </button>
  168. </div>
  169. </div>
  170. </div>
  171. </fieldset>
  172. </div>
  173. </div>
  174. <!-- Main container -->
  175. <br/>
  176. <!-- Terminal -->
  177. <div class="row">
  178. <div class="col-12">
  179. <div id="terminal" class="acessible-terminal" style="width: 97%; margin-left: 2%"></div>
  180. </div>
  181. </div>
  182. <!-- Terminal -->
  183. <!-- Debug only -->
  184. <div class="row" style="display: none">
  185. <div class="col-12">
  186. <h5>Código gerado para debug - Código gerado</h5>
  187. <div style="width: 97%; margin-left: 2%; background-color: wheat; color: black;">
  188. <code id="generatedCode">
  189. </code>
  190. </div>
  191. </div>
  192. </div>
  193. <!-- Debug only -->
  194. </div>
  195. <!-- Accessible UI -->
  196. <!-- Accessible UI JS -->
  197. </body>
  198. <script>
  199. var mouseX;
  200. var mouseY;
  201. $(document).ready(() => {
  202. var $buttons = $('.ivprog_format .button'),
  203. handler = {
  204. activate: function () {
  205. $(this)
  206. .addClass('active')
  207. .siblings()
  208. .removeClass('active');
  209. }
  210. };
  211. $buttons.on('click', handler.activate);
  212. $('.ivprog_format_info').popup(
  213. {
  214. popup: $('.custom.popup'),
  215. on: 'click'
  216. });
  217. $(".data_types_dropdown").dropdown();
  218. $('.ui.dropdown').dropdown();
  219. $('.ivprog_visual_panel').removeClass("loading");
  220. $(document).mousemove(function (e) {
  221. var parentOffset = $('.ivprog_visual_panel').offset();
  222. ;
  223. mouseX = e.pageX - parentOffset.left + 300;
  224. mouseY = e.pageY - parentOffset.top + 100;
  225. /*$('.created_element').css('top', mouseY);
  226. $('.created_element').css('left', mouseX);*/
  227. });
  228. ivprogCore.LocalizedStrings.updateTagText();
  229. ivprogCore.CodeEditor.initTextEditor("ivprog-text-editor");
  230. iassingIntegration();
  231. if (iLMparameters.iLM_PARAM_TeacherAutoEval == null) {
  232. ivprogCore.initVisualUI();
  233. }
  234. ivprogCore.initAccessibleUI();
  235. });
  236. </script>
  237. <!-- Accessible JS -->
  238. <script src="js/accessible/bootstrap/bootstrap.bundle.js"></script>
  239. <script src="js/accessible/bootstrap/bootstrap.js"></script>
  240. <script>
  241. const visualInterface = document.getElementById('visualInterface');
  242. const accessibleInterface = document.getElementById('accessibleInterface');
  243. document.getElementById('enableVisualUI').addEventListener('click', (event) => {
  244. visualInterface.style.display = 'block';
  245. accessibleInterface.style.display = 'none';
  246. });
  247. document.getElementById('enableAccessibleUI').addEventListener('click', (event) => {
  248. visualInterface.style.display = 'none';
  249. accessibleInterface.style.display = 'block';
  250. });
  251. </script>
  252. </html>