create.html 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <script type="text/ng-template" id="nodes.html">
  2. <ul ui:sortable="sortableOptions" ng:model="node.nodes" class="instrs" ng-show="node.nodes.length > 0">
  3. <li ng-repeat="node in node.nodes" ng-include="getTemplate(node)"></li>
  4. </ul>
  5. </script>
  6. <script type="text/ng-template" id="nodes1.html">
  7. <ul ui:sortable="sortableOptions" ng:model="node.nodes1" class="instrs" ng-show="node.nodes1.length > 0">
  8. <li ng-repeat="node in node.nodes1" ng-include="getTemplate(node)"></li>
  9. </ul>
  10. </script>
  11. <script type="text/ng-template" id="nodes2.html">
  12. <ul ui:sortable="sortableOptions" ng:model="node.nodes2" class="instrs" ng-show="node.nodes2.length > 0">
  13. <li ng-repeat="node in node.nodes2" ng-include="getTemplate(node)"></li>
  14. </ul>
  15. </script>
  16. <script type="text/ng-template" id="tree_item_renderer.html">
  17. {{node.name}} {{node.type}}
  18. <button ng-click="delete(node)" ng-show="node.nodes.length > 0" class="btn">Limpar</button>
  19. <span ng-include="'nodes.html'"></span>
  20. <span ng-include="'partials/elements/btns.html'"></span>
  21. </script>
  22. <script type="text/ng-template" id="start.html">
  23. {{node.name}} {{node.type}}
  24. <button ng-click="delete(node)" ng-show="node.nodes.length > 0" class="btn">Limpar</button>
  25. <span ng-include="'nodes.html'"></span>
  26. <span ng-include="'partials/elements/btns.html'"></span>
  27. </script>
  28. <script type="text/ng-template" id="var.html">
  29. <i>{{node.name}}</i> <span edit-in-place='node.data.varName'></span> = <input type="text" value="VAR"> {{node.data.varName}}
  30. </script>
  31. <div class="container">
  32. <div class="row-fluid">
  33. <ul class="nav nav-tabs">
  34. <!-- tab : send/eval button -->
  35. <button class="btn btn-default" ng-click="run(true)"><img
  36. src="img/autochecking.png" title="{{'alt_button_eval' | i18n}}"/> {{'button_eval' | i18n }} </button> <!-- Avaliar -->
  37. <!--div class="history">
  38. <ul class="hide">
  39. <li ng-repeat="ah in actionsHistory">{{$index}} ) {{ah.name}}</li>
  40. </ul>
  41. <button class="btn" ng-click="undo()" ng-hide="historyStack<=0"><img src="img/undo.png" /></button>
  42. <button class="btn disabled" ng-show="historyStack<=0"><img src="img/undo.png" /></button>
  43. <button class="btn" ng-click="redo()" ng-show="historyStack < actionsHistory.length-1"><img src="img/redo.png" /></button>
  44. <button class="btn disabled" ng-hide="historyStack < actionsHistory.length-1"><img src="img/redo.png" /></button>
  45. </div-->
  46. <!-- main tab -->
  47. <!--h2>Programa: {{program.programName}}</h2-->
  48. <li ng-class="{active: $index==currentFunction}" ng-repeat="func in program.functions"><a
  49. href="javascript:;" ng-click="setCurrentFunction($index)"><i class="fa fa-code"></i> {{func.name}}</a></li> <!-- Principal -->
  50. </ul>
  51. </div>
  52. <div class="row-fluid" id="program">
  53. <div class="span6">
  54. <div class="ivprog">
  55. <div class="parameters" ng-hide="program.functions[currentFunction].isMain">
  56. <h5>
  57. <i class="fa fa-bars fa-fw"></i> Parâmetros
  58. <button class="btn btn-info" ng-click="addParam()"><i class="fa fa-plus"></i></button>
  59. </h5>
  60. <span class="var" ng-repeat="param in program.functions[currentFunction].params">&nbsp;<span edit-in-place='param.name'></span> = <span edit-in-place='param.initialValue'></span> <span edit-in-place="param.opa" /> <button class="btn btn-mini" ng-click="removeParam(var)"><i class="fa fa-minus"></i></button></span>
  61. <span class="clearfix"></span>
  62. </div>
  63. <div class="variables">
  64. <h5>
  65. <i><button class="btn btn-info btn-sm" ng-click="addVar()" title="{{'alt_button_create_var' | i18n}}">
  66. <i class="fa fa-plus fa-fw"></i> {{'button_create_var' | i18n}} </button></i>
  67. </h5>
  68. <span class="var" ng-repeat="var in program.functions[currentFunction].vars">&nbsp;<span edit-in-place-var-name='var.name'></span> = <span edit-in-place-var-value='var.initialValue' type='var.type'></span>
  69. <div class="btn-group">
  70. <button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown">
  71. <i class="fa fa-wrench"></i>
  72. <span class="caret"></span>
  73. </button>
  74. <ul class="dropdown-menu">
  75. <li><a ng-click="varSetType(var, 'int')">Número inteiro</a></li>
  76. <li><a ng-click="varSetType(var, 'float')">Número real</a></li>
  77. <li><a ng-click="varSetType(var, 'string')">Texto</a></li>
  78. <li><a ng-click="varSetType(var, 'boolean')">Verdadeiro/falso</a></li>
  79. </ul>
  80. </div>
  81. <button class="btn btn-xs btn-warning" title="remover esta variavel" ng-click="removeVar(var)"><i class="fa fa-minus"></i></button>
  82. </span>
  83. <span class="clearfix"></span>
  84. </div>
  85. <ul ui:sortable="sortableOptions" ng:model="program.functions[currentFunction].nodes" class="instrs">
  86. <li ng-repeat="node in program.functions[currentFunction].nodes" ng-include="getTemplate(node)">
  87. </li>
  88. </ul>
  89. <div class="addButtons">
  90. <div buttons="program.functions[currentFunction].nodes" id-parent="'root_'+currentFunction"></div>
  91. <!--div class="dropdown">
  92. <button class="btn dropdown-toggle btn-info btn-sm" type="button" id="dropdownMenu1" data-toggle="dropdown">
  93. <i class="glyphicon glyphicon-plus"></i> Instrução
  94. </button>
  95. <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
  96. <li role="presentation"><a role="menuitem" tabindex="-1" ng-click="add(program.functions[currentFunction].nodes, 'root_'+currentFunction, 'attr', 'attr')" href="javascript:;"><img src="img/att.png" width="20" height="20" /> Atribuição</a></li>
  97. <li role="presentation"><a role="menuitem" tabindex="-1" ng-click="add(program.functions[currentFunction].nodes, 'root_'+currentFunction, 'if', 'se')" href="javascript:;"><img src="img/if.png" width="20" height="20" /> Se verdadeiro então</a></li>
  98. <li role="presentation"><a role="menuitem" tabindex="-1" ng-click="add(program.functions[currentFunction].nodes, 'root_'+currentFunction, 'for', 'repetir')" href="javascript:;"><img src="img/loop-n.png" width="20" height="20" /> Repita N vezes</a></li>
  99. <li role="presentation"><a role="menuitem" tabindex="-1" ng-click="add(program.functions[currentFunction].nodes, 'root_'+currentFunction, 'read', 'ler')" href="javascript:;"><img src="img/download.png" /> Leitura de dados</a></li>
  100. <li role="presentation"><a role="menuitem" tabindex="-1" ng-click="add(program.functions[currentFunction].nodes, 'root_'+currentFunction, 'write', 'escrever')" href="javascript:;"><img src="img/upload.png" /> Escrita de dados</a></li>
  101. </ul>
  102. </div-->
  103. </div>
  104. </div>
  105. </div>
  106. <div class="span6">
  107. <h4>
  108. <span class="fa-stack">
  109. <i class="fa fa-square fa-stack-2x"></i>
  110. <i class="fa fa-terminal fa-stack-1x fa-inverse"></i>
  111. </span>
  112. Console</h4>
  113. <div class="btn-group">
  114. </div>
  115. <button class="btn" ng-click="run(false)" title="Rodar programa"><i class="fa fa-play"></i></button> &nbsp;
  116. <button class="btn" ng-click="run(true)" title="Testar solucao" ng-show="notSend"><i class="fa fa-play"></i></button> &nbsp;
  117. <button class="btn" ng-click="clearOutput()" title="{{'alt_button_create_clearoutputs' | i18n}}">{{'button_create_clearoutputs' | i18n}}</button> <!-- Clear console -->
  118. <div></div>
  119. <div class="output">
  120. </div>
  121. </div>
  122. </div>
  123. <div id="caseTests" ng-show="notSend">
  124. <h4>{{'msg_testcases' | i18n}}</h4><!-- Test cases -->
  125. <input type="button" ng-click="addTestCase()" title="{{'alt_button_create_testcases' | i18n}}"
  126. value="{{'button_create_testcases' | i18n}}" class="btn btn-info" /><!-- + Test cases -->
  127. <table class="table table-striped table-bordered" ng-show="testCases.length>0">
  128. <tr>
  129. <th>#</th>
  130. <th>Input</th>
  131. <th>Output</th>
  132. <th>#</th>
  133. </tr>
  134. <tr ng-repeat="testCase in testCases">
  135. <td>{{$index+1}}</td>
  136. <td>
  137. <textarea ng-model="testCase.input" style="width: 100%; height: 140px;"></textarea>
  138. </td>
  139. <td>
  140. <textarea ng-model="testCase.output" style="width: 100%; height: 140px;"></textarea>
  141. </td>
  142. <td><input type="button" value="-" ng-click="removeTestCase(testCase)" class="btn btn-warning" />
  143. </tr>
  144. </table>
  145. </div>
  146. </div>
  147. <div class="modal" id="readData">
  148. <div class="modal-dialog">
  149. <div class="modal-content">
  150. <div class="modal-header">
  151. <h4 class="modal-title">Entrada de dados</h4>
  152. </div>
  153. <div class="modal-body">
  154. <p id="msgRead"></p>
  155. <p><input type="text" id="valor" /></p>
  156. </div>
  157. <div class="modal-footer">
  158. <button type="button" class="btn btn-primary" id="btnOk">Confirmar</button>
  159. </div>
  160. </div><!-- /.modal-content -->
  161. </div><!-- /.modal-dialog -->
  162. </div><!-- /.modal -->