From 409331987a2c00e9d7b7b79d7a93768d9e3a388c Mon Sep 17 00:00:00 2001 From: Ignacio Fagian <nachofagian@gmail.com> Date: Mon, 8 Jul 2019 19:53:47 -0300 Subject: [PATCH] Soporte para firefox, tooltips warnings --- Frontend Angular 4/package.json | 5 ++-- .../plotter/graph3D/graph3D.component.ts | 9 +++--- .../src/app/shared/services/ghci.service.ts | 15 ++++++---- Frontend Angular 4/src/assets/i18n/en.json | 3 +- Frontend Angular 4/src/assets/i18n/es.json | 5 ++-- Frontend Angular 4/src/polyfills.ts | 28 +++++++++---------- 6 files changed, 37 insertions(+), 28 deletions(-) diff --git a/Frontend Angular 4/package.json b/Frontend Angular 4/package.json index b2605e19..aedf167b 100755 --- a/Frontend Angular 4/package.json +++ b/Frontend Angular 4/package.json @@ -23,12 +23,12 @@ "@ng-bootstrap/ng-bootstrap": "1.0.0-alpha.26", "@ngx-translate/core": "^7.2.2", "@ngx-translate/http-loader": "^0.1.0", + "function-plot": "git://github.com/diego-rey/function-plot.git#feature/discontinuidades", + "graph3D": "git://github.com/ifagian/graph3D#master", "core-js": "^2.4.1", "d3": "^4.12.2", "flag-icon-css": "^3.2.1", "font-awesome": "^4.7.0", - "function-plot": "git://github.com/diego-rey/function-plot.git#feature/integration-multigraf-shape", - "graph3D": "git://github.com/ifagian/graph3D#master", "ionicons": "^3.0.0", "jq-console": "^2.13.2", "jquery": "^3.2.1", @@ -38,6 +38,7 @@ "ng2-slider-component": "^1.0.9", "rxjs": "^5.1.0", "tippy.js": "^1.2.0", + "web-animations-js": "^2.3.1", "zone.js": "^0.8.4" }, "devDependencies": { diff --git a/Frontend Angular 4/src/app/layout/plotter/graph3D/graph3D.component.ts b/Frontend Angular 4/src/app/layout/plotter/graph3D/graph3D.component.ts index 1497584f..3ea6aabb 100644 --- a/Frontend Angular 4/src/app/layout/plotter/graph3D/graph3D.component.ts +++ b/Frontend Angular 4/src/app/layout/plotter/graph3D/graph3D.component.ts @@ -84,10 +84,11 @@ export class Graph3DComponent implements AfterViewInit { } onResize(event){ - const {width, height} = this.graph3DRef.nativeElement.getBoundingClientRect(); - - if (width > 0 && height > 0) - graph3DLib.changeSize({width, height}); + const {width, height} = this.graph3DRef.nativeElement.getBoundingClientRect(); + + if (width > 0 && height > 0) { + graph3DLib.changeSize({width, height}); + } } onAnimationChangeSpeed = (value) => { diff --git a/Frontend Angular 4/src/app/shared/services/ghci.service.ts b/Frontend Angular 4/src/app/shared/services/ghci.service.ts index 86c757f0..c8f7e0e1 100755 --- a/Frontend Angular 4/src/app/shared/services/ghci.service.ts +++ b/Frontend Angular 4/src/app/shared/services/ghci.service.ts @@ -186,10 +186,10 @@ export class GHCIService { var line = this.lastWarning; var title = this.warningText; - var columna = title.split("columna:")[1].split("}")[0]; + var columna = title.split(`${this.translateService.get('i18n.codemirror.command.column').value}:`)[1].split("}")[0]; var warningTextToShow = title.split("}")[1]; - var warningFinalText = "En columna " + columna + ": " + warningTextToShow; + var warningFinalText = `${this.translateService.get('i18n.codemirror.command.inColumn').value}` + columna + ": " + warningTextToShow; if(this.codemirrorRef!==null){ var makeMarker = function() { @@ -215,16 +215,21 @@ export class GHCIService { if(this.warningStepReaded===0){ try{ + // retrive line of warning + var line = m.resultado + .split(`${this.translateService.get('i18n.codemirror.command.outWarning').value}:`)[1] + .trim() + .split(`${this.translateService.get('i18n.codemirror.command.line').value}:`)[1] + .split(" ")[1]-1; - var line = m.resultado.split("OUTAdvertencia:")[1].trim().split("lÃnea:")[1].split(" ")[1]-1; this.lastWarning = line; this.warnings.push(line); - var warningText = m.resultado.split("OUTAdvertencia:")[1].trim(); + var warningText = m.resultado.split(`${this.translateService.get('i18n.codemirror.command.outWarning').value}:`)[1].trim(); this.warningStepReaded = 1; this.warningText = warningText; if(this.waitingForWarning){ - this.outputConsole('El programa contiene advertencias\n'); + this.outputConsole(`${this.translateService.get('i18n.msg.codemirror.consoleWarnings').value}\n`); this.waitingForWarning = false; } diff --git a/Frontend Angular 4/src/assets/i18n/en.json b/Frontend Angular 4/src/assets/i18n/en.json index 87fb427e..e3a3cdcb 100644 --- a/Frontend Angular 4/src/assets/i18n/en.json +++ b/Frontend Angular 4/src/assets/i18n/en.json @@ -80,7 +80,8 @@ "infixOperatorsWarnings" : "Show warnings of use of infix operators", "cursorPosition" : "Cursor position", "showHints" : "Show autocomplete hints", - "functionTyping" : "Show functions typing" + "functionTyping" : "Show functions typing", + "consoleWarnings": "Program contains warnings" }, "figure" : { "multiPlot" : "Multi graph", diff --git a/Frontend Angular 4/src/assets/i18n/es.json b/Frontend Angular 4/src/assets/i18n/es.json index 3365760b..e0013a7c 100644 --- a/Frontend Angular 4/src/assets/i18n/es.json +++ b/Frontend Angular 4/src/assets/i18n/es.json @@ -64,7 +64,7 @@ "inLine" : "en lÃnea", "column" : "columna", "inColumn" : "En columna", - "line" : "lÃnea", + "line" : "linea", "outWarning" : "OUTAdvertencia" } }, @@ -80,7 +80,8 @@ "infixOperatorsWarnings" : "Mostrar advertencias de uso de operadores infijos", "cursorPosition" : "Posición del cursor", "showHints" : "Mostrar sugerencias de autocompletar", - "functionTyping" : "Mostrar tipado de funciones" + "functionTyping" : "Mostrar tipado de funciones", + "consoleWarnings": "El programa contiene advertencias" }, "figure" : { "multiPlot" : "Multi gráfica", diff --git a/Frontend Angular 4/src/polyfills.ts b/Frontend Angular 4/src/polyfills.ts index 53bdaf1b..f989042f 100755 --- a/Frontend Angular 4/src/polyfills.ts +++ b/Frontend Angular 4/src/polyfills.ts @@ -19,19 +19,19 @@ */ /** IE9, IE10 and IE11 requires all of the following polyfills. **/ -// import 'core-js/es6/symbol'; -// import 'core-js/es6/object'; -// import 'core-js/es6/function'; -// import 'core-js/es6/parse-int'; -// import 'core-js/es6/parse-float'; -// import 'core-js/es6/number'; -// import 'core-js/es6/math'; -// import 'core-js/es6/string'; -// import 'core-js/es6/date'; -// import 'core-js/es6/array'; -// import 'core-js/es6/regexp'; -// import 'core-js/es6/map'; -// import 'core-js/es6/set'; +import 'core-js/es6/symbol'; +import 'core-js/es6/object'; +import 'core-js/es6/function'; +import 'core-js/es6/parse-int'; +import 'core-js/es6/parse-float'; +import 'core-js/es6/number'; +import 'core-js/es6/math'; +import 'core-js/es6/string'; +import 'core-js/es6/date'; +import 'core-js/es6/array'; +import 'core-js/es6/regexp'; +import 'core-js/es6/map'; +import 'core-js/es6/set'; /** IE10 and IE11 requires the following for NgClass support on SVG elements */ // import 'classlist.js'; // Run `npm install --save classlist.js`. @@ -46,7 +46,7 @@ import 'core-js/es7/reflect'; /** ALL Firefox browsers require the following to support `@angular/animation`. **/ -// import 'web-animations-js'; // Run `npm install --save web-animations-js`. +import 'web-animations-js'; // Run `npm install --save web-animations-js`. -- GitLab