repeatNtimes.js 829 B

1234567891011121314151617181920212223
  1. import $ from 'jquery';
  2. import { Types } from '../types';
  3. import * as Models from '../ivprog_elements';
  4. import { LocalizedStrings } from '../../services/localizedStringsService';
  5. import * as GlobalsManagement from '../globals';
  6. import * as VariablesManagement from '../variables';
  7. export function createFloatingCommand () {
  8. return $('<div class="ui repeatNtimes created_element"> <i class="ui icon small sync"></i> <span> para (x = 0; x < 10; x ++) { } </span></div>');
  9. }
  10. export function renderCommand (command) {
  11. var ret = '<div class="ui repeatNtimes"> <i class="ui icon small random command_drag"></i> <span> para (x = 0; x < 10; x ++) { </span>';
  12. ret += '<div class="ui block_commands">';
  13. ret += '</div>';
  14. ret += '<span> }</span>';
  15. ret += '</div>';
  16. var el = $(ret);
  17. $(el).data('command', command);
  18. return el;
  19. }