var variavel = "
  • " + " " + " " + " " + " " + "" + "
  • "; var tipo_atr = " "; var tipo_atr2 = " "; var atribuir = "
  • " + " " + " " + tipo_atr + "" + "
  • "; var variaveis = " "; var variaveis2 = " "; var operadores = " "; var operadores2 = " "; var operacoes = "
  • " + " " + " " + "" + "
  • "; escreva = "
  • " + "" + " " + "" + "
  • "; ""; $(document).ready(function () { $("#bt_cria_var").click(function () { $("#comandos").append(variavel) $("#var_tipo").focus(); $("#bt_excluir_var").click(function () { $("#li_var").remove(); }); }); }); $(document).ready(function () { $("#atribuir").click(function () { $("#comandos").append(atribuir) $("#var_atr").focus(); $('#tipo_atr').change(function () { if ($(this).val() === 'valor') { $('#menu_variaveis').remove(); $('#menu_operadores').remove(); $("#tipo_atr").after(" "); $("#campo_de_atribuicao").focus(); $("#campo_de_atribuicao").after(operadores); } if ($(this).val() === 'var') { $('#campo_de_atribuicao').remove(); $('#menu_operadores').remove(); $("#tipo_atr").after(variaveis); $("#menu_variaveis").focus(); $('#operadores').remove(); $("#menu_variaveis").after(operadores); } $('#menu_operadores').change(function () { $("#menu_operadores").after(tipo_atr2); $("#tipo_atr2").focus(); $('#tipo_atr2').change(function () { if ($(this).val() === 'valor') { $('#menu_variaveis2').remove(); $('#menu_operadores2').remove(); $("#tipo_atr2").after(" "); $("#campo_de_atribuicao2").focus(); $("#campo_de_atribuicao2").after(operadores); } if ($(this).val() === 'var') { $('#campo_de_atribuicao2').remove(); $('#menu_operadores2').remove(); $("#tipo_atr2").after(variaveis); $("#menu_variaveis2").focus(); $('#operadores2').remove(); $("#menu_variaveis2").after(operadores); } }); }); }); $("#bt_excluir_comand").click(function () { $("#li_comando").remove(); }); }); }); $(document).ready(function () { $("#escreva").click(function () { $("#comandos").append(escreva); $("#menu_escreva").focus(); $('#menu_escreva').change(function () { if ($(this).val() === 'valor') { $('#valor_num').remove(); $('#menu_variaveis').remove(); $('#valor_text').remove(); $("#menu_escreva").after(" "); $("#valor_num").focus(); } if ($(this).val() === 'var') { $('#valor_num').remove(); $('#menu_variaveis').remove(); $('#valor_text').remove(); $("#menu_escreva").after(variaveis); $("#menu_variaveis").focus(); } if ($(this).val() === 'texto') { $('#valor_num').remove(); $('#menu_variaveis').remove(); $('#valor_text').remove(); $("#menu_escreva").after(" "); $("#menu_variaveis").focus(); } }); $("#bt_excluir_escreva").click(function () { $("#li_escreva").remove(); }); }); }); $(document).ready(function () { $("#bt_executar").click(function () { $("#terminal").append("

    resultado aqui

    "); $("#resultado").focus(); }); }); /* $(function() { $("#opr").click(function() { $("#comandos").append(operacoes); $("#opr_variaveis").focus(); $('#opr_variaveis').change(function() { $("#label_igual").after(opr_select_var_val); $('#opr_select_var_val').change(function() { if ($(this).val() === 'valor') { $('#menu_variaveis').remove(); $("#opr_select_var_val").after(" ") .after(operadores); $("#campo_de_valor").focus(); } if ($(this).val() === 'var') { $('#campo_de_valor').remove(); $("#opr_select_var_val").after(variaveis).after(operadores);; $("#menu_variaveis").focus(); } }); }); }); }); */ /* if ($(this).val() === 'valor') { $('#menu_variaveis').remove(); $("#valor_opr1").after(" "); $("#campo_de_atribuicao").focus(); } if ($(this).val() === 'var') { $('#campo_de_atribuicao').remove(); $("#valor_opr1").after(variaveis); $("#menu_variaveis").focus(); } */ /* }); $('#valor_opr2').change(function() { if ($(this).val() === 'valor') { $('#menu_variaveis').remove(); $("#valor_opr2").after(" "); $("#campo_de_atribuicao").focus(); } if ($(this).val() === 'var') { $('#campo_de_atribuicao').remove(); $("#valor_opr2").after(variaveis); $("#menu_variaveis").focus(); } }); $("#bt_excluir_opr").click(function() { $("#li_opr").remove(); }); }); */