Browse Source

Merge branch 'improveTerminal' of LInE/ivprog into master

version 4.3.1
Lucas de Souza 5 years ago
parent
commit
c878386abc

+ 108 - 6
css/ivprog-term.css

@@ -1,11 +1,11 @@
 .ivprog-term-div {
-  background-color: black;
+  /* background-color: black; */
   width: 100%;
   height: 12rem;
   overflow-y: scroll;
 }
 
-.ivprog-term-userText {
+.ivprog-term-userText, .ivprog-term-userInput {
   color: white;
 }
 
@@ -31,17 +31,17 @@
 }
 
 #ivprog-term {
-  border: 1px solid gray;
+  /* border: 1px solid gray;
   background: black;
   margin-top: -30px;
   position: relative;
   padding: 5px;
-  z-index: 999;
+  z-index: 999; */
 }
-#ivprog-term i {
+/* #ivprog-term i {
   margin-left: 5px;
   cursor: pointer;
-}
+} */
 .div_toggle_console {
   cursor: pointer;
 }
@@ -70,3 +70,105 @@
     background: green;
     -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); 
 }
+
+/**novas regras bash*/
+#ivprog-terminal-inputdiv {
+  padding-left: 12px;
+}
+#ivprog-console-clearbtn, #ivprog-console-showbtn, #ivprog-console-hidebtn {
+  cursor: pointer;
+}
+
+.bash {
+  box-shadow: 0 0 30px rgba(0,0,0,0.4);
+  border-radius: 3px;
+}
+
+.bash-title {
+  text-align: center;
+  color: #525252;
+  padding: 5px 0;
+  margin: 0;
+  text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
+  font-size: 0.85em;
+  border: 1px solid #CCCCCC;
+  border-bottom: none;
+
+  border-top-left-radius: 3px;
+  border-top-right-radius: 3px;
+
+  background: #f7f7f7; /* Old browsers */
+  background: linear-gradient(to bottom,  #f7f7f7 0%,#B8B8B8 100%); /* W3C */
+}
+
+.bash-body {
+  /* margin: 0;
+  padding: 5px; */
+  background: #141414;
+  /* list-style: none; */
+  color: #F8F8FF;
+  
+  font: 14px 'Andale Mono', Consolas, 'Courier New';
+  line-height: 1.6em;
+  border: 1px solid #CCCCCC;
+  border-bottom-right-radius: 3px;
+  border-bottom-left-radius: 3px;
+}
+
+.bash-text {
+  font: 14px 'Andale Mono', Consolas, 'Courier New';
+  line-height: 1.6em;
+}
+
+.bash-highlight {
+  color: #45D40C;
+}
+
+.bash-highlight a {
+  color: #45D40C;
+  text-decoration: underline;
+}
+
+.bash-body li:before {
+  content: '$';
+  color: #F8F8FF;
+  position: absolute;
+  left: 0;
+  top: 0;
+}
+
+.bash-body i {
+  cursor: text;
+}
+
+.bash-body li {
+  word-wrap: break-word;
+  position: relative;
+  padding: 0 0 0 15px;
+}
+
+#cmd {
+  font-family: courier;
+  font-size: 14px;
+  line-height: normal;
+  background:inherit;
+  color: #21f838;
+  padding: 5px;
+  overflow: hidden;
+}
+#cmd span {
+  float: left;
+  padding-left: 3px;
+  white-space: pre;
+}
+#cursor {
+  float: left;
+  width: 5px;
+  height: 14px;
+  background: #21f838;
+}
+#cmd ~ input {
+  width: 0;
+  height: 0;
+  opacity: 0;
+}

+ 0 - 2
css/ivprog-visual-1.0.css

@@ -654,7 +654,6 @@ div.function_name_div_updated:active,
 .global_var .circle.add_global_button,
 .ui.add_var_context .icon.plus.circle,
 .ui.rail .icon.plus.circle {
-	z-index: 10;
 	color: #bf80d4!important;
 	cursor: pointer;
 	font-style: 120%;
@@ -662,7 +661,6 @@ div.function_name_div_updated:active,
 .global_var i.back,
 .ui.add_var_context .icon.circle.back,
 .ui.rail .icon.circle.back {
-	z-index: 9;
 	color: white !important;
 }
 .ui.add_var_context{

+ 3 - 3
i18n/en/ui.json

@@ -21,9 +21,9 @@
   "false": "false",
   "variable": "Variable",
   "command": "Command",
-  "new_parameter": "new_parameter",
-  "new_variable": "new_variable",
-  "new_global": "new_global",
+  "new_parameter": "parameter",
+  "new_variable": "variable",
+  "new_global": "global",
   "new_function": "new_function",
   "vector": "vector",
   "text_comment_start": "Initial comment of function...",

+ 3 - 3
i18n/es/ui.json

@@ -21,9 +21,9 @@
   "false": "false",
   "variable": "Variable",
   "command": "Command",
-  "new_parameter": "new_parameter",
-  "new_variable": "new_variable",
-  "new_global": "new_global",
+  "new_parameter": "parameter",
+  "new_variable": "variable",
+  "new_global": "global",
   "new_function": "new_function",
   "vector": "vector",
   "text_comment_start": "Initial comment of function...",

+ 2 - 1
i18n/pt/message.json

@@ -1,5 +1,6 @@
 {
   "test_case_success": "Caso de teste $0: OK",
   "test_case_duration": "Levou $0ms",
-  "test_suite_grade": "A sua solução alcançou $0% da nota."
+  "test_suite_grade": "A sua solução alcançou $0% da nota.",
+  "awaiting_input_message": "O seu programa está em execução e aguardando uma entrada! Digite alguma coisa..."
 }

+ 6 - 3
i18n/pt/ui.json

@@ -24,9 +24,9 @@
   "false": "falso",
   "variable": "Variável",
   "command": "Comando",
-  "new_parameter": "novo_parametro",
-  "new_variable": "nova_variavel",
-  "new_global": "nova_global",
+  "new_parameter": "parametro",
+  "new_variable": "variavel",
+  "new_global": "global",
   "new_function": "nova_funcao",
   "vector": "vetor",
   "text_comment_start": "Comentário inicial da função...",
@@ -111,6 +111,9 @@
   "inform_valid_variable_duplicated" : "Já existe uma variável local com o nome informado.",
   "arrangement": "Arranjo",
   "conversion": "Conversao",
+  "terminal_clear":"Limpa o terminal removendo todos os textos",
+  "terminal_show":"Exibe o terminal caso esteja escondido",
+  "terminal_hide":"Esconde o terminal caso não esteja escondido",
   "$sin": "seno",
   "$cos": "cosseno",
   "$tan": "tangente",

+ 229 - 35
js/io/domConsole.js

@@ -1,5 +1,27 @@
+import { LocalizedStrings } from "./../services/localizedStringsService";
+import { Config } from "./../util/config";
+
 export class DOMConsole {
 
+  static get BASH_TEMPLATE () {
+    return `
+    <div class="bash-title">
+      <i id="ivprog-console-clearbtn" class="icon eraser" style="float:left;padding-left: 5px"></i>
+      <span>Terminal</span>
+      <i id="ivprog-console-showbtn" class="icon window maximize outline" style="float:right"></i>
+      <i id="ivprog-console-hidebtn" class="icon window minimize outline" style="float:right"></i>
+    </div>
+    <div id='ivprog-term' class="bash-body"></div>`;
+  }
+
+  static get INPUT_CARET_TEMPLATE () {
+    return `
+    <div id="cmd">
+      <span></span>
+      <div id="cursor"></div>
+    </div>`;
+  }
+
   static get USER () {
     return 0;
   }
@@ -12,14 +34,32 @@ export class DOMConsole {
     return 2;
   }
 
+  static get INPUT () {
+    return 3;
+  }
+
   constructor (elementID) {
     this.input = null;
+    this.cursorInterval = null;
+    this.idleInterval = null;
+    this.inputDiv = null;
+    this.inputCMD = null;
+    this.inputSpan = null;
+    this.cursorRef = null;
     this.needInput = false;
+    this.clearBtn = null;
+    this.hideBtn = null;
+    this.showBtn = null;
     this.termDiv = null;
     this.anyKey = false;
-    this.parent = $(elementID);
+    let actualID = elementID
+    if (elementID[0] === '#') {
+      actualID = elementID.substring(1);
+    }
+    this.parent = document.getElementById(actualID)
     this.setup();
     this.inputListeners = [];
+    this.hideInput();
   }
 
   setup () {
@@ -28,29 +68,95 @@ export class DOMConsole {
   }
 
   _setupEvents () {
-    this.input.on("keydown", (event) => {
-      if (!this.needInput) {
-        event.preventDefault();
-        return;
-      }
-      const keyCode = event.which;
-      if (keyCode === 13 || this.anyKey) {
-        let text = this.input.val();
-        text = text.replace('[\n\r]+', '');
-        this.notifyListeners(text);
-        this.write(text);
-        this.input.val("");
+    this.input.addEventListener('keydown', this.registerInput.bind(this));
+    this.clearBtn.addEventListener('click', this.clearBtnClick.bind(this));
+    this.hideBtn.addEventListener('click', this.hideBtnClick.bind(this));
+    this.showBtn.addEventListener('click', this.showBtnClick.bind(this));
+  }
+
+  registerInput (event) {
+    if (!this.needInput) {
+      return;
+    }
+    const keyCode = event.which;
+    if (keyCode === 13 || this.anyKey) {
+      if(this.idleInterval != null) {
+        clearInterval(this.idleInterval);
+        this.idleInterval = null;
       }
-    });
+      let text = this.input.value;
+      text = text.replace('[\n\r]+', '');
+      this.notifyListeners(text);
+      this._appendUserInput(text);
+      this.input.value = '';
+      this.inputSpan.innerHTML = '';
+    }
   }
 
   _setupDom () {
-    this.termDiv = $("<div></div>");
-    this.termDiv.addClass("ivprog-term-div");
-    this.input = $('<input text="type">')
-    this.input.addClass("ivprog-term-input");
-    this.termDiv.append(this.input);
-    this.parent.append(this.termDiv);
+    const bashNode = document.createElement('div');
+    bashNode.classList.add('bash');
+    bashNode.innerHTML = DOMConsole.BASH_TEMPLATE;
+    this.termDiv = bashNode.querySelector("#ivprog-term");
+    this.termDiv.classList.add("ivprog-term-div");
+    this.inputDiv = document.createElement("div");
+    this.inputDiv.id = "ivprog-terminal-inputdiv";
+    this.inputDiv.innerHTML = DOMConsole.INPUT_CARET_TEMPLATE;
+    this.input = document.createElement("input");
+    this.input.setAttribute("name", "command");
+    this.input.setAttribute("value", "");
+    this.input.setAttribute("type", "text");
+    this.inputDiv.append(this.input);
+    this.termDiv.append(this.inputDiv);
+    bashNode.append(this.termDiv);
+    this.parent.append(bashNode);
+    this.inputCMD = this.inputDiv.querySelector("#cmd");
+    this.cursorRef = this.inputCMD.querySelector("#cursor");
+    this.inputSpan = this.inputCMD.querySelector('span');
+    this.clearBtn = bashNode.querySelector('#ivprog-console-clearbtn');
+    this.hideBtn = bashNode.querySelector('#ivprog-console-hidebtn');
+    this.showBtn = bashNode.querySelector('#ivprog-console-showbtn');
+    this._setupCursor();
+    //Jquery tooltips....
+    $(this.clearBtn).popup({content:LocalizedStrings.getUI("terminal_clear")});
+    $(this.showBtn).popup({content:LocalizedStrings.getUI("terminal_show")});
+    $(this.hideBtn).popup({content:LocalizedStrings.getUI("terminal_hide")});
+  }
+
+  _setupCursor () {
+    this.inputCMD.addEventListener('click', this.blinkCaretAndFocus.bind(this));
+    this.inputCMD.click();
+    
+    this.input.addEventListener('keyup', this.updateSpanText.bind(this));
+    this.input.addEventListener('blur', this.stopBlinkCaret.bind(this));
+  }
+
+  blinkCaretAndFocus () {
+    if(this.cursorInterval != null) {
+      return;
+    }
+    this.input.focus();
+    const outerRef = this;
+    this.cursorInterval = window.setInterval(function() {
+      if (outerRef.cursorRef.style.visibility === 'visible') {
+        outerRef.cursorRef.style.visibility = 'hidden';
+      } else {
+        outerRef.cursorRef.style.visibility = 'visible';
+      }
+    }, 500);
+  }
+
+  updateSpanText () {
+    this.inputSpan.innerHTML = this.input.value;
+    if(this.idleInterval != null)
+      window.clearInterval(this.idleInterval);
+    this.scheduleNotify()
+  }
+
+  stopBlinkCaret () {
+    clearInterval(this.cursorInterval);
+    this.cursorInterval = null;
+    this.cursorRef.style.visibility = 'visible';
   }
 
   notifyListeners (text) {
@@ -74,21 +180,60 @@ export class DOMConsole {
 
   _appendText (text, type) {
     const divClass = this.getClassForType(type);
-    const textDiv = $("<div></div>");
-    textDiv.addClass(divClass);
-    textDiv.append(text);
-    textDiv.insertBefore(this.input);
+    const textDiv = document.createElement('div');
+    textDiv.classList.add(divClass);
+    textDiv.innerHTML = this.getOutputText(text);
+    this.termDiv.insertBefore(textDiv, this.inputDiv);
     this.scrollTerm();
   }
 
+  _appendUserInput (text) {
+    const divClass = this.getClassForType(DOMConsole.INPUT);
+    const textDiv = document.createElement('div');
+    textDiv.innerHTML = this.getUserInputText(text);
+    textDiv.classList.add(divClass);
+    this.termDiv.insertBefore(textDiv, this.inputDiv);
+    this.scrollTerm();
+  }
+
+  getOutputText (text) {
+    return `<span>${text}</span>`;
+  }
+
+  getUserInputText (text) {
+    return `<i class="icon keyboard outline" style="float:left"></i><span>${text}</span>`;
+  }
+
   scrollTerm () {
-    this.termDiv.animate({
-      scrollTop: this.termDiv.prop('scrollHeight')
-    }, 0);
+    //scrollIt(this.inputDiv.previousSibling,200);
+    this.inputDiv.previousSibling.scrollIntoView();
+  }
+
+  focus () {
+    this.termDiv.style.display = 'block';
+    // Is in draggable mode?
+    console.log(this.parent.style.top.length);
+    if(this.parent.style.top.length == 0) {
+      this.parent.style.marginTop = "-160px";
+    }
+    const prev = this.inputDiv.closest('div');
+    if(prev != null)
+      prev.scrollIntoView();
+  }
+
+  hide () {
+    // Is in draggable mode?
+    if(this.parent.style.top.length == 0) {
+      this.parent.style.marginTop = "0";
+    }
+    this.termDiv.style.display = 'none';
+    
   }
 
   getClassForType (type) {
     switch (type) {
+      case DOMConsole.INPUT:
+        return "ivprog-term-userInput";
       case DOMConsole.USER:
         return "ivprog-term-userText";
       case DOMConsole.INFO:
@@ -99,26 +244,51 @@ export class DOMConsole {
   }
 
   dispose () {
-    this.parent.off();
-    this.input.off();
+    this.input.removeEventListener('keyup', this.updateSpanText.bind(this));
+    this.input.removeEventListener('blur', this.stopBlinkCaret.bind(this));
+    this.input.removeEventListener('keydown', this.registerInput.bind(this));
+    this.inputCMD.removeEventListener('click', this.blinkCaretAndFocus.bind(this));
+    this.clearBtn.removeEventListener('click', this.clearBtnClick.bind(this));
+    this.hideBtn.removeEventListener('click', this.hideBtnClick.bind(this));
+    this.showBtn.removeEventListener('click', this.showBtnClick.bind(this));
     this.input = null;
-    this.parent.empty();
+    this.inputCMD =  null;
+    this.inputDiv = null;
+    this.termDiv = null;
+    this.inputSpan = null;
+    this.cursorRef = null;
+    this.clearBtn = null;
+    this.hideBtn = null;
+    this.showBtn = null;
+    const cNode = this.parent.cloneNode(false);
+    this.parent.parentNode.replaceChild(cNode, this.parent);
+    if(this.cursorInterval != null) {
+      clearInterval(this.cursorInterval);
+    }
+    if(this.idleInterval != null) {
+      clearInterval(this.idleInterval);
+    }
   }
 
   showInput () {
     this.needInput = true;
-    this.input.show();
-    this.input.focus();
+    this.inputDiv.style.display = 'block';
+    this.inputCMD.click();
+    this.inputCMD.scrollIntoView();
   }
 
   hideInput () {
     this.needInput = false;
-    this.input.hide();
+    this.inputDiv.style.display = ' none';
+    clearInterval(this.cursorInterval);
+    this.cursorInterval = null;
   }
 
   requestInput (callback, anyKey = false) {
     this.inputListeners.push(callback);
     this.anyKey = anyKey;
+    if(this.idleInterval == null)
+      this.scheduleNotify();
     this.showInput();
   }
 
@@ -131,7 +301,31 @@ export class DOMConsole {
   }
 
   clear () {
-    this.input.parent().children().not(this.input).remove();
-    this.input.val("");
+    while(this.inputDiv.parentElement.childNodes.length > 1) {
+      this.inputDiv.parentElement.removeChild(this.inputDiv.parentElement.firstChild);
+    }
+    this.input.value = "";
+    this.inputSpan.innerHTML = '';
+  }
+
+  clearBtnClick () {
+    this.clear();
+  }
+
+  showBtnClick () {
+    this.focus();
+  }
+
+  hideBtnClick () {
+    this.hide();
+  }
+
+  notifyIdle () {
+    this.info(LocalizedStrings.getMessage('awaiting_input_message'));
+    this.inputCMD.click();
+  }
+  
+  scheduleNotify () {
+    this.idleInterval = window.setInterval(this.notifyIdle.bind(this), Config.idle_input_interval);
   }
 }

+ 16 - 10
js/io/domInput.js

@@ -4,21 +4,27 @@ export class DOMInput extends Input{
 
   constructor (element) {
     super();
-    this.el = $(element);
+    let id = element
+    if(element[0] == '#') {
+      id = element.substring(1);
+    }
+    this.el = document.getElementById(id);
     this.listeners = [];
     this.setupEvents();
   }
 
   setupEvents () {
-    this.el.on('keydown', (e) => {
-      const code = e.keyCode || e.which;
-      if (code === 13) {
-        let text = this.el.val();
-        text = text.replace('[\n\r]+', '');
-        this.notifyInput(text);
-        this.el.val('');
-      }
-    });
+    this.el.addEventListener('keydown', this.captureInput.bind(this));
+  }
+
+  captureInput (event) {
+    const code = event.keyCode || event.which;
+    if (code === 13) {
+      let text = this.el.value;
+      text = text.replace('[\n\r]+', '');
+      this.notifyInput(text);
+      this.el.value = "";
+    }
   }
 
   requestInput (callback) {

+ 11 - 3
js/io/domOutput.js

@@ -4,17 +4,25 @@ export class DOMOutput extends Output {
 
   constructor (selector) {
     super();
-    this.el = $(selector);
+    let id = selector;
+    if (selector[0] == '#') {
+      id = selector.substring(1);
+    }
+    this.el = document.getElementById(id);
   }
 
   sendOutput (text) {
     text = text.replace("\n", '</br>');
     text = text.replace(/\t/g,'&#9;');
-    const span = $('<span />').addClass('ivprog-io-output-text').html(text);
+    const span = document.createElement('span');
+    span.classList.add('ivprog-io-output-text');
+    span.innerHTML = text;
     this.el.append(span);
   }
 
   clear () {
-    this.el.empty();
+    while(this.el.childNodes.length > 0) {
+      this.el.removeChild(this.el.firstChild);
+    }
   }
 }

+ 1 - 0
js/util/config.js

@@ -6,6 +6,7 @@ class ConfigObject {
     this.intConvertRoundMode = 2;
     this.default_lang = 'pt';
     this.enable_type_casting = true;
+    this.idle_input_interval = 5000;
   }
 
   setConfig (opts) {

File diff suppressed because it is too large
+ 1 - 1
js/visualUI/commands/generic_expression.js


+ 27 - 14
js/visualUI/functions.js

@@ -321,17 +321,21 @@ 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"> ');
 
-  appender += '<div class="ui add_var_context add_var_button_function" style="float: left;"><i class="icon plus circle purple"></i><i class="icon circle white back"></i><div class="ui icon button purple"><i class="icon superscript"></i></div></div>';
+  appender += '<div class="ui add_var_context add_var_button_function" style="float: left;">             <div class="ui icon button purple"> ';
 
-  appender += '<div class="ui top attached segment variables_list_div"></div>';
+  appender += '<i class="icons"><i class="icon superscript" style="margin-top: -2px;margin-bottom: 2px;margin-left: 1px;margin-right: 1px;"></i><i class="corner add icon inverted" style="font-size: 9px;padding-top: 6px;padding-left: 9px;"></i></i>';
 
-  
+  appender += '</div></div>';
+
+  appender += '<div class="ui top attached segment variables_list_div"></div>';
 
   appender += '<div class="ui bottom attached segment commands_list_div commands_cont_'+cont+'">'
         + '<div class="ui rail" style="width: 35px; margin-left: -36px;"><div class="ui sticky sticky_cont_'+cont+'" style="top: 50px !important;">';
 
 
-  appender += '<i class="icon plus circle purple"></i><i class="icon circle white back"></i><div class="ui icon button dropdown menu_commands orange" ><i class="icon code"></i> <div class="menu"> ';
+  appender += '<div class="ui icon button dropdown menu_commands orange" > '
+            + '<i class="icons"><i class="icon code" style="margin-top: -1px;margin-bottom: 1px;margin-right: 0px;"></i><i class="corner add icon inverted" style="font-size: 9px;padding-top: 6px;padding-left: 9px;"></i></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>'
@@ -712,6 +716,9 @@ export function initVisualUI () {
   // const mainDiv = $('#visual-main-div');
   // fill mainDiv with functions and globals...
   // renderAlgorithm()...
+  domConsole = new DOMConsole("ivprog-term-div");
+  domConsole.hide();
+  $(document.getElementById("ivprog-term-div")).draggable()
   $('.add_function_button').on('click', () => {
     addFunctionHandler();
   });
@@ -847,6 +854,7 @@ export function initVisualUI () {
        updateSequenceGlobals(evt.oldIndex, evt.newIndex);
     }
   });
+  
 }
 
 export function setTestCases (testCases) {
@@ -890,9 +898,9 @@ function runCodeAssessment () {
 
   toggleConsole(true);
 
-  if(domConsole == null)
-    domConsole = new DOMConsole("#ivprog-term");
-  $("#ivprog-term").slideDown(500);
+  // if(domConsole == null)
+  //   domConsole = new DOMConsole("#ivprog-term");
+  // $("#ivprog-term").slideDown(500);
   const runner = new IVProgAssessment(strCode, _testCases, domConsole);
   isRunning = true;
   runner.runTest().then(grade => {
@@ -920,9 +928,9 @@ function runCode () {
   
   toggleConsole(true);
 
-  if(domConsole == null)
-    domConsole = new DOMConsole("#ivprog-term");
-  $("#ivprog-term").slideDown(500);
+  // if(domConsole == null)
+  //   domConsole = new DOMConsole("#ivprog-term");
+  //$("#ivprog-term").slideDown(500);
   try {
     const data = SemanticAnalyser.analyseFromSource(strCode);
     const proc = new IVProgProcessor(data);
@@ -952,7 +960,12 @@ function toggleConsole (is_running) {
   if (is_running) {
     $('.ivprog-term-div').css('display', 'block');
     $('#ivprog-term').css('min-height', '160px');
-    $('#ivprog-term').css('margin-top', '-170px');
+    if(domConsole != null)
+      domConsole.focus();
+    //$('#ivprog-term').css('margin-top', '-170px');
+    return;
+  } else {
+    domConsole.hide();
     return;
   }
 
@@ -960,13 +973,13 @@ function toggleConsole (is_running) {
     // esconder
     $('.ivprog-term-div').css('display', 'none');
     $('#ivprog-term').css('min-height', '0');
-    $('#ivprog-term').css('margin-top', '-30px');
-    $('#ivprog-term').css('padding', '5px');
+    //$('#ivprog-term').css('margin-top', '-30px');
+    //$('#ivprog-term').css('padding', '5px');
   } else {
     // mostrar
     $('.ivprog-term-div').css('display', 'block');
     $('#ivprog-term').css('min-height', '160px');
-    $('#ivprog-term').css('margin-top', '-170px');
+    //$('#ivprog-term').css('margin-top', '-170px');
   }
 }
 

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "ivprog",
-  "version": "4.3.0",
+  "version": "4.3.1",
   "description": "IMA para o ensino de programação",
   "main": "js/main.js",
   "scripts": {

+ 11 - 6
templates/index.html

@@ -67,10 +67,16 @@
         <div class="ui one column container segment ivprog_visual_panel loading">
 
           <div class="global_var">
-            <i class="icon plus circle purple add_global_button"></i>
-            <i class="icon circle white back"></i>
 
-            <div class="ui icon button add-globalVar-button add_global_button purple"><i class="icon superscript"></i></div>
+
+            <div class="ui icon button add-globalVar-button add_global_button purple">
+
+              <i class="icons">
+                <i class="icon superscript" style="margin-top: -2px;margin-bottom: 2px;margin-left: 1px;margin-right: 1px; font-size: 18px;"></i>
+                <i class="corner add icon inverted" style="font-size: 10px;padding-top: 5px;padding-left: 7px;"></i>
+              </i>
+              
+            </div>
 
             <div class="list_globals" id="listGlobalsHandle"></div>
 
@@ -93,9 +99,8 @@
         <div class="ui one column container segment ivprog_textual_panel loading" style="display: none;">
           <textarea class="ivprog_textual_code" readonly></textarea>
         </div>
-
-        <div id='ivprog-term' class="six column wide">
-          <div class="div_toggle_console"><i class="inverted terminal icon green button_toggle_console"></i></div>
+        <div id='ivprog-term-div' class="six column wide">
+          
         </div>
       </div>