import $ from 'jquery'; import { Types } from '../types'; import * as Models from '../ivprog_elements'; import { LocalizedStrings } from '../../services/localizedStringsService'; import * as GlobalsManagement from '../globals'; import * as VariablesManagement from '../variables'; import * as CommandsManagement from '../commands'; export function createFloatingCommand () { return $('
faça {
} enquanto(x < 10)
'); } export function renderCommand (command, function_obj) { var ret = ''; ret += '
faça { '; ret += '
'; ret += '
'; ret += ' } enquanto (x < 10); '; ret += '
'; var el = $(ret); el.data('command', command); addHandlers(command, function_obj, el); return el; } function addHandlers (command, function_obj, dowhiletrue_dom) { dowhiletrue_dom.find('.button_remove_command').on('click', function() { if (CommandsManagement.removeCommand(command, function_obj, dowhiletrue_dom)) { dowhiletrue_dom.remove(); } }); }