algorithm_sidebar.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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_sidebar';
  6. import * as VariablesManagement from './variables';
  7. import * as CommandsManagement from './commands';
  8. import * as CodeManagement from './code_generator';
  9. import * as VariableValueMenu from './commands/variable_value_menu';
  10. import * as FunctionsManagement from './functions_sidebar';
  11. import { DOMConsole } from './../io/domConsole';
  12. import { IVProgParser } from './../ast/ivprogParser';
  13. import { IVProgProcessor } from './../processor/ivprogProcessor';
  14. import { LanguageService } from '../services/languageService';
  15. var block_render = false;
  16. export function renderAlgorithm () {
  17. if (block_render) {
  18. return;
  19. }
  20. block_render = true;
  21. $('.all_functions').children().off();
  22. $('.all_functions').empty();
  23. $('.functions_labels').children().off();
  24. $('.functions_labels').empty();
  25. $('.list_globals').children().off();
  26. $('.list_globals').empty();
  27. for (var i = 0; i < window.program_obj.functions.length; i++) {
  28. FunctionsManagement.renderFunction(window.program_obj.functions[i]);
  29. }
  30. for (var i = 0; i < window.program_obj.globals.length; i++) {
  31. GlobalsManagement.renderGlobal(window.program_obj.globals[i]);
  32. }
  33. setTimeout(function(){ block_render = false; }, 500);
  34. }