Browse Source

Merge branch 'fixSeparator' of LInE/iVProg into master

GitAdmin 4 years ago
parent
commit
bbdd143d02
3 changed files with 26 additions and 13 deletions
  1. 3 2
      i18n/ui.csv
  2. 17 5
      js/visualUI/commands/generic_expression.js
  3. 6 6
      package-lock.json

+ 3 - 2
i18n/ui.csv

@@ -119,7 +119,7 @@ text_ivprog_version,Versão,Version,Version
 text_teacher_filter,Filtro,Filter,Filter
 text_teacher_filter_active,Ativado,Activated,Activated
 text_teacher_filter_help,"Ao ativar o filtro, as modificações do iVProg estarão bloqueadas.",By activating the filter modifications in iVProg will be blocked,"Al activar el filtro, las modificaciones en iVProg serán bloqueadas"
-text_join_assessment_outputs, ; , ; , ; 
+text_join_assessment_outputs, ; , ; , ;
 assessment-detail-time-label,Duração,Duration,Duration
 assessment-detail-grade-label,Nota,Grade,Grade
 assessment-detail-input-label,Entradas,Inputs,Inputs
@@ -139,7 +139,8 @@ text_for_pass,passo,pass,pass
 text_relational_expression,Relacionais,Relational,Relational
 write_command_newline_on,Quebra de linha ativada, Line break is on,El salto de línea está activado
 write_command_newline_off, Quebra de linha desativada, Line break is off,El salto de línea está desactivado
-write_seprator_menu_text,Vírgula,Comma,Comma
+write_seprator_menu_text,Espaço,Spacer,Spacer
 initial_program_code,programa {\n\n\t\tfuncao vazio inicio () {\n\t\t\t// Inicie seu codigo aqui!\n\t\t}\n},program {\n\n\t\tfunction void main () {\n\t\t\t// Start your code here!\n\t\t}\n},program {\n\n\t\tfunction void main () {\n\t\t\t// Start your code here!\n\t\t}\n}
 type_char,caractere,char,char
 charvar_default_value,A,A,A
+write_seprator_menu_tooltip,Separador para imprimir mais valores/variáveis,Separator used to print more values/variables,Separator used to print more values/variables

+ 17 - 5
js/visualUI/commands/generic_expression.js

@@ -1116,6 +1116,9 @@ function renderOperatorMenu (
 ) {
   let menu_final =
     '<div class="ui dropdown"><div class="text"> + </div><i class="dropdown icon"></i><div class="menu">';
+  if (types_included.indexOf(Models.EXPRESSION_TYPES.write_sep) >= 0) {
+    menu_final += getSeparator();
+  }
   if (types_included.indexOf(Models.EXPRESSION_TYPES.exp_arithmetic) >= 0) {
     if (types_included.length > 1) {
       menu_final +=
@@ -1128,9 +1131,7 @@ function renderOperatorMenu (
       menu_final += getArithmeticOperators();
     }
   }
-  if (types_included.indexOf(Models.EXPRESSION_TYPES.write_sep) >= 0) {
-    menu_final += getSeparator();
-  }
+
   if (types_included.indexOf(Models.EXPRESSION_TYPES.exp_logic) >= 0) {
     if (types_included.length > 1) {
       menu_final +=
@@ -1158,6 +1159,14 @@ function renderOperatorMenu (
   menu_final += "</div></div>";
 
   menu_final = $(menu_final);
+  menu_final.find(".ivprog-write-sep").popup({
+    content: LocalizedStrings.getUI("write_seprator_menu_tooltip"),
+    delay: {
+      show: 500,
+      hide: 0,
+    },
+  });
+
   const div_temp = $(
     '<div class="single_element_expression not_allowed" data-index="' +
       position +
@@ -1293,6 +1302,9 @@ function getRelationalOperators () {
 }
 
 function getSeparator () {
-  return `<div class="item" data-type="${Models.EXPRESSION_TYPES.write_sep}" data-value="${Models.EXPRESSION_TYPES.write_sep}">,</div>`;
+  return `<div class="item ivprog-write-sep" data-type="${
+    Models.EXPRESSION_TYPES.write_sep
+  }" data-value="${Models.EXPRESSION_TYPES.write_sep}">${LocalizedStrings.getUI(
+    "write_seprator_menu_text"
+  )}</div>`;
 }
-

+ 6 - 6
package-lock.json

@@ -3847,9 +3847,9 @@
       "dev": true
     },
     "elliptic": {
-      "version": "6.5.2",
-      "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz",
-      "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==",
+      "version": "6.5.3",
+      "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz",
+      "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==",
       "requires": {
         "bn.js": "^4.4.0",
         "brorand": "^1.0.1",
@@ -5872,9 +5872,9 @@
       }
     },
     "lodash": {
-      "version": "4.17.15",
-      "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
-      "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
+      "version": "4.17.19",
+      "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
+      "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
       "dev": true
     },
     "log": {