|
@@ -106,7 +106,8 @@ window.runCodeAssessment = runCodeAssessment;
|
|
|
window.renderAlgorithm = AlgorithmManagement.renderAlgorithm;
|
|
|
|
|
|
WatchJS.watch(program.globals, function(){
|
|
|
- AlgorithmManagement.renderAlgorithm();
|
|
|
+ //
|
|
|
+ setTimeout(function(){ AlgorithmManagement.renderAlgorithm(); }, 300);
|
|
|
}, 1);
|
|
|
|
|
|
function addFunctionHandler () {
|
|
@@ -259,22 +260,6 @@ export function renderFunction (function_obj) {
|
|
|
appender += (function_obj.is_main ? '<div class="div_start_minimize_v"> </div>' : '<button class="ui icon button large remove_function_button"><i class="red icon times"></i></button>')
|
|
|
+ '<button class="ui icon button tiny minimize_function_button"><i class="icon window minimize"></i></button>';
|
|
|
|
|
|
- appender += '<div class="ui small icon buttons add_var_top_button"><div class="ui icon button add_var_button_function"><i class="icon superscript"></i></div>';
|
|
|
-
|
|
|
- appender += '<div class="ui icon button dropdown menu_commands" ><i class="icon code"></i> <div class="menu"> ';
|
|
|
- appender += '<a class="item" data-command="'+Models.COMMAND_TYPES.reader+'"><i class="download icon"></i> ' +LocalizedStrings.getUI('text_read_var')+ '</a>'
|
|
|
- + '<a class="item" data-command="'+Models.COMMAND_TYPES.writer+'"><i class="upload icon"></i> '+LocalizedStrings.getUI('text_write_var')+'</a>'
|
|
|
- + '<a class="item" data-command="'+Models.COMMAND_TYPES.comment+'"><i class="quote left icon"></i> '+LocalizedStrings.getUI('text_comment')+'</a>'
|
|
|
- + '<a class="item" data-command="'+Models.COMMAND_TYPES.attribution+'"><i class="arrow left icon"></i> '+LocalizedStrings.getUI('text_attribution')+'</a>'
|
|
|
- + '<a class="item" data-command="'+Models.COMMAND_TYPES.functioncall+'"><i class="hand point right icon"></i> '+LocalizedStrings.getUI('text_functioncall')+'</a>'
|
|
|
- + '<a class="item" data-command="'+Models.COMMAND_TYPES.iftrue+'" ><i class="random icon"></i> '+LocalizedStrings.getUI('text_iftrue')+'</a>'
|
|
|
- + '<a class="item" data-command="'+Models.COMMAND_TYPES.repeatNtimes+'"><i class="sync icon"></i> '+LocalizedStrings.getUI('text_repeatNtimes')+'</a>'
|
|
|
- + '<a class="item" data-command="'+Models.COMMAND_TYPES.whiletrue+'"><i class="sync icon"></i> '+LocalizedStrings.getUI('text_whiletrue')+'</a>'
|
|
|
- + '<a class="item" data-command="'+Models.COMMAND_TYPES.dowhiletrue+'"><i class="sync icon"></i> '+LocalizedStrings.getUI('text_dowhiletrue')+'</a>'
|
|
|
- + '<a class="item" data-command="'+Models.COMMAND_TYPES.switch+'"><i class="list icon"></i> '+LocalizedStrings.getUI('text_switch')+'</a>'
|
|
|
- + '<a class="item" data-command="'+Models.COMMAND_TYPES.return+'"><i class="reply icon"></i> '+LocalizedStrings.getUI('text_btn_return')+'</a>'
|
|
|
- + '</div></div></div>';
|
|
|
-
|
|
|
appender += '<div class="function_signature_div">'+LocalizedStrings.getUI("function")+' ';
|
|
|
|
|
|
if (function_obj.is_main) {
|
|
@@ -288,18 +273,29 @@ export function renderFunction (function_obj) {
|
|
|
}
|
|
|
|
|
|
appender += '</div> <span class="parethesis_function"> ) </span> </div>'
|
|
|
- + (function_obj.is_hidden ? ' <div class="function_area" style="display: none;"> ' : ' <div class="function_area"> ')
|
|
|
+ + (function_obj.is_hidden ? ' <div class="function_area" style="display: none;"> ' : ' <div class="function_area"> ');
|
|
|
|
|
|
- + '<div class="ui top attached segment variables_list_div">'
|
|
|
- + '</div>'
|
|
|
+ appender += '<div class="ui icon button add_var_button_function" style="float: left;"><i class="icon superscript"></i></div>';
|
|
|
|
|
|
- + '<div class="ui bottom attached segment commands_list_div" id="function_drag_cmd_">';
|
|
|
+ appender += '<div class="ui top attached segment variables_list_div"></div>';
|
|
|
+
|
|
|
+ appender += '<div class="ui icon button dropdown menu_commands" style="float: left;" ><i class="icon code"></i> <div class="menu"> ';
|
|
|
+ appender += '<a class="item" data-command="'+Models.COMMAND_TYPES.reader+'"><i class="download icon"></i> ' +LocalizedStrings.getUI('text_read_var')+ '</a>'
|
|
|
+ + '<a class="item" data-command="'+Models.COMMAND_TYPES.writer+'"><i class="upload icon"></i> '+LocalizedStrings.getUI('text_write_var')+'</a>'
|
|
|
+ + '<a class="item" data-command="'+Models.COMMAND_TYPES.comment+'"><i class="quote left icon"></i> '+LocalizedStrings.getUI('text_comment')+'</a>'
|
|
|
+ + '<a class="item" data-command="'+Models.COMMAND_TYPES.attribution+'"><i class="arrow left icon"></i> '+LocalizedStrings.getUI('text_attribution')+'</a>'
|
|
|
+ + '<a class="item" data-command="'+Models.COMMAND_TYPES.functioncall+'"><i class="hand point right icon"></i> '+LocalizedStrings.getUI('text_functioncall')+'</a>'
|
|
|
+ + '<a class="item" data-command="'+Models.COMMAND_TYPES.iftrue+'" ><i class="random icon"></i> '+LocalizedStrings.getUI('text_iftrue')+'</a>'
|
|
|
+ + '<a class="item" data-command="'+Models.COMMAND_TYPES.repeatNtimes+'"><i class="sync icon"></i> '+LocalizedStrings.getUI('text_repeatNtimes')+'</a>'
|
|
|
+ + '<a class="item" data-command="'+Models.COMMAND_TYPES.whiletrue+'"><i class="sync icon"></i> '+LocalizedStrings.getUI('text_whiletrue')+'</a>'
|
|
|
+ + '<a class="item" data-command="'+Models.COMMAND_TYPES.dowhiletrue+'"><i class="sync icon"></i> '+LocalizedStrings.getUI('text_dowhiletrue')+'</a>'
|
|
|
+ + '<a class="item" data-command="'+Models.COMMAND_TYPES.switch+'"><i class="list icon"></i> '+LocalizedStrings.getUI('text_switch')+'</a>'
|
|
|
+ + '<a class="item" data-command="'+Models.COMMAND_TYPES.return+'"><i class="reply icon"></i> '+LocalizedStrings.getUI('text_btn_return')+'</a>'
|
|
|
+ + '</div></div>';
|
|
|
|
|
|
- appender += '</div>';
|
|
|
+ appender += '<div class="ui bottom attached segment commands_list_div" id="function_drag_cmd_"></div>';
|
|
|
|
|
|
- appender += '<div class="function_close_div"></div>'
|
|
|
- + '</div>'
|
|
|
- + '</div>';
|
|
|
+ appender += '</div></div>';
|
|
|
|
|
|
appender = $(appender);
|
|
|
|
|
@@ -348,7 +344,7 @@ export function initVisualUI () {
|
|
|
addFunctionHandler();
|
|
|
});
|
|
|
$('.add_global_button').on('click', () => {
|
|
|
- GlobalsManagement.addGlobal(program);
|
|
|
+ GlobalsManagement.addGlobal(program, true);
|
|
|
});
|
|
|
|
|
|
$('.run_button').on('click', () => {
|