Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • matefun/Frontend
  • felipe.parodi/Frontend
2 results
Show changes
Commits on Source (141)
Showing
with 8996 additions and 9346 deletions
File added
File mode changed from 100644 to 100755
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "cli-stable"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico",
".htaccess"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"../node_modules/font-awesome/css/font-awesome.css",
"styles/app.scss",
"styles/console.css",
"styles/hints.css",
"../node_modules/tippy.js/dist/tippy.css",
"../node_modules/codemirror/lib/codemirror.css",
"../node_modules/codemirror/addon/hint/show-hint.css",
"../node_modules/codemirror/addon/dialog/dialog.css",
"../node_modules/codemirror/addon/search/matchesonscrollbar.css"
],
"scripts": [
"../node_modules/jquery/dist/jquery.min.js",
"../node_modules/jq-console/lib/jqconsole.js"
],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json"
},
{
"project": "src/tsconfig.spec.json"
},
{
"project": "e2e/tsconfig.e2e.json"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "scss",
"component": {}
}
}
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# You can see what browsers were selected by your queries by running:
# npx browserslist
> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
\ No newline at end of file
......@@ -4,7 +4,7 @@ root = true
[*]
charset = utf-8
indent_style = space
indent_size = 4
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
......
/.angular/cache
.vscode
node_modules
\ No newline at end of file
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"cli-stable": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"allowedCommonJsDependencies": [
"codemirror",
"function-plot",
"nextafter"
],
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"tsConfig": "src/tsconfig.app.json",
"polyfills": "src/polyfills.ts",
"assets": ["src/assets", "src/favicon.ico", "src/.htaccess"],
"styles": [
"node_modules/font-awesome/css/font-awesome.css",
"node_modules/flag-icon-css/css/flag-icon.min.css",
"src/styles/app.scss",
"src/styles/console.css",
"src/styles/hints.css",
"node_modules/tippy.js/dist/tippy.css",
"node_modules/codemirror/lib/codemirror.css",
"node_modules/codemirror/addon/hint/show-hint.css",
"node_modules/codemirror/addon/dialog/dialog.css",
"node_modules/codemirror/addon/search/matchesonscrollbar.css"
],
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/jq-console/lib/jqconsole.js"
],
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
},
"configurations": {
"production": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
}
},
"defaultConfiguration": ""
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "cli-stable:build",
"proxyConfig": "proxy.conf.json"
},
"configurations": {
"production": {
"browserTarget": "cli-stable:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "cli-stable:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "src/src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/jq-console/lib/jqconsole.js"
],
"styles": [
"node_modules/font-awesome/css/font-awesome.css",
"node_modules/flag-icon-css/css/flag-icon.min.css",
"src/styles/app.scss",
"src/styles/console.css",
"src/styles/hints.css",
"node_modules/tippy.js/dist/tippy.css",
"node_modules/lt-codemirror/lib/lt-codemirror.css",
"node_modules/lt-codemirror/addon/hint/show-hint.css",
"node_modules/lt-codemirror/addon/dialog/dialog.css",
"node_modules/lt-codemirror/addon/search/matchesonscrollbar.css"
],
"assets": ["src/assets", "src/favicon.ico", "src/.htaccess"]
}
}
}
},
"cli-stable-e2e": {
"root": "e2e",
"sourceRoot": "e2e",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "cli-stable:serve"
}
}
}
}
},
"defaultProject": "cli-stable",
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"style": "scss"
},
"@schematics/angular:directive": {
"prefix": "app"
}
}
}
......@@ -3,46 +3,55 @@
// Defines jumpToLine command. Uses dialog.js if present.
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
(function (mod) {
if (typeof exports == "object" && typeof module == "object")
// CommonJS
mod(require("../../lib/codemirror"), require("../dialog/dialog"));
else if (typeof define == "function" && define.amd) // AMD
else if (typeof define == "function" && define.amd)
// AMD
define(["../../lib/codemirror", "../dialog/dialog"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
// Plain browser env
else mod(CodeMirror);
})(function (CodeMirror) {
"use strict";
function dialog(cm, text, shortText, deflt, f) {
if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true});
if (cm.openDialog)
cm.openDialog(text, f, { value: deflt, selectValueOnOpen: true });
else f(prompt(shortText, deflt));
}
var jumpDialog =
'Ir a la línea: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint"></span>';
'Ir a la línea: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint"></span>';
function interpretLine(cm, string) {
var num = Number(string)
if (/^[-+]/.test(string)) return cm.getCursor().line + num
else return num - 1
var num = Number(string);
if (/^[-+]/.test(string)) return cm.getCursor().line + num;
else return num - 1;
}
CodeMirror.commands.jumpToLine = function(cm) {
CodeMirror.commands.jumpToLine = function (cm) {
var cur = cm.getCursor();
dialog(cm, jumpDialog, "Jump to line:", (cur.line + 1) + ":" + cur.ch, function(posStr) {
if (!posStr) return;
var match;
if (match = /^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(posStr)) {
cm.setCursor(interpretLine(cm, match[1]), Number(match[2]))
} else if (match = /^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(posStr)) {
var line = Math.round(cm.lineCount() * Number(match[1]) / 100);
if (/^[-+]/.test(match[1])) line = cur.line + line + 1;
cm.setCursor(line - 1, cur.ch);
} else if (match = /^\s*\:?\s*([\+\-]?\d+)\s*/.exec(posStr)) {
cm.setCursor(interpretLine(cm, match[1]), cur.ch);
dialog(
cm,
jumpDialog,
"Jump to line:",
cur.line + 1 + ":" + cur.ch,
function (posStr) {
if (!posStr) return;
var match;
if ((match = /^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(posStr))) {
cm.setCursor(interpretLine(cm, match[1]), Number(match[2]));
} else if ((match = /^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(posStr))) {
var line = Math.round((cm.lineCount() * Number(match[1])) / 100);
if (/^[-+]/.test(match[1])) line = cur.line + line + 1;
cm.setCursor(line - 1, cur.ch);
} else if ((match = /^\s*\:?\s*([\+\-]?\d+)\s*/.exec(posStr))) {
cm.setCursor(interpretLine(cm, match[1]), cur.ch);
}
}
});
);
};
CodeMirror.keyMap["default"]["Alt-G"] = "jumpToLine";
......
......@@ -9,34 +9,45 @@
// replace by making sure the match is no longer selected when hitting
// Ctrl-G.
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"), require("./searchcursor"), require("../dialog/dialog"));
else if (typeof define == "function" && define.amd) // AMD
(function (mod) {
if (typeof exports == "object" && typeof module == "object")
// CommonJS
mod(
require("../../lib/codemirror"),
require("./searchcursor"),
require("../dialog/dialog")
);
else if (typeof define == "function" && define.amd)
// AMD
define(["../../lib/codemirror", "./searchcursor", "../dialog/dialog"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
// Plain browser env
else mod(CodeMirror);
})(function (CodeMirror) {
"use strict";
function searchOverlay(query, caseInsensitive) {
if (typeof query == "string")
query = new RegExp(query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), caseInsensitive ? "gi" : "g");
query = new RegExp(
query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"),
caseInsensitive ? "gi" : "g"
);
else if (!query.global)
query = new RegExp(query.source, query.ignoreCase ? "gi" : "g");
return {token: function(stream) {
query.lastIndex = stream.pos;
var match = query.exec(stream.string);
if (match && match.index == stream.pos) {
stream.pos += match[0].length || 1;
return "searching";
} else if (match) {
stream.pos = match.index;
} else {
stream.skipToEnd();
}
}};
return {
token: function (stream) {
query.lastIndex = stream.pos;
var match = query.exec(stream.string);
if (match && match.index == stream.pos) {
stream.pos += match[0].length || 1;
return "searching";
} else if (match) {
stream.pos = match.index;
} else {
stream.skipToEnd();
}
},
};
}
function SearchState() {
......@@ -54,7 +65,10 @@
function getSearchCursor(cm, query, pos) {
// Heuristic: if the query string is all lowercase, do a case insensitive search.
return cm.getSearchCursor(query, pos, {caseFold: queryCaseInsensitive(query), multiline: true});
return cm.getSearchCursor(query, pos, {
caseFold: queryCaseInsensitive(query),
multiline: true,
});
}
function persistentDialog(cm, text, deflt, onEnter, onKeyDown) {
......@@ -62,13 +76,16 @@
value: deflt,
selectValueOnOpen: true,
closeOnEnter: false,
onClose: function() { clearSearch(cm); },
onKeyDown: onKeyDown
onClose: function () {
clearSearch(cm);
},
onKeyDown: onKeyDown,
});
}
function dialog(cm, text, shortText, deflt, f) {
if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true});
if (cm.openDialog)
cm.openDialog(text, f, { value: deflt, selectValueOnOpen: true });
else f(prompt(shortText, deflt));
}
......@@ -78,23 +95,23 @@
}
function parseString(string) {
return string.replace(/\\(.)/g, function(_, ch) {
if (ch == "n") return "\n"
if (ch == "r") return "\r"
return ch
})
return string.replace(/\\(.)/g, function (_, ch) {
if (ch == "n") return "\n";
if (ch == "r") return "\r";
return ch;
});
}
function parseQuery(query) {
var isRE = query.match(/^\/(.*)\/([a-z]*)$/);
if (isRE) {
try { query = new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i"); }
catch(e) {} // Not a regular expression after all, do a string search
try {
query = new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i");
} catch (e) {} // Not a regular expression after all, do a string search
} else {
query = parseString(query)
query = parseString(query);
}
if (typeof query == "string" ? query == "" : query.test(""))
query = /x^/;
if (typeof query == "string" ? query == "" : query.test("")) query = /x^/;
return query;
}
......@@ -105,11 +122,20 @@
state.queryText = query;
state.query = parseQuery(query);
cm.removeOverlay(state.overlay, queryCaseInsensitive(state.query));
state.overlay = searchOverlay(state.query, queryCaseInsensitive(state.query));
state.overlay = searchOverlay(
state.query,
queryCaseInsensitive(state.query)
);
cm.addOverlay(state.overlay);
if (cm.showMatchesOnScrollbar) {
if (state.annotate) { state.annotate.clear(); state.annotate = null; }
state.annotate = cm.showMatchesOnScrollbar(state.query, queryCaseInsensitive(state.query));
if (state.annotate) {
state.annotate.clear();
state.annotate = null;
}
state.annotate = cm.showMatchesOnScrollbar(
state.query,
queryCaseInsensitive(state.query)
);
}
}
......@@ -118,29 +144,37 @@
if (state.query) return findNext(cm, rev);
var q = cm.getSelection() || state.lastQuery;
if (persistent && cm.openDialog) {
var hiding = null
var searchNext = function(query, event) {
var hiding = null;
var searchNext = function (query, event) {
CodeMirror.e_stop(event);
if (!query) return;
if (query != state.queryText) {
startSearch(cm, state, query);
state.posFrom = state.posTo = cm.getCursor();
}
if (hiding) hiding.style.opacity = 1
findNext(cm, event.shiftKey, function(_, to) {
var dialog
if (to.line < 3 && document.querySelector &&
(dialog = cm.display.wrapper.querySelector(".CodeMirror-dialog")) &&
dialog.getBoundingClientRect().bottom - 4 > cm.cursorCoords(to, "window").top)
(hiding = dialog).style.opacity = .4
})
if (hiding) hiding.style.opacity = 1;
findNext(cm, event.shiftKey, function (_, to) {
var dialog;
if (
to.line < 3 &&
document.querySelector &&
(dialog = cm.display.wrapper.querySelector(".CodeMirror-dialog")) &&
dialog.getBoundingClientRect().bottom - 4 >
cm.cursorCoords(to, "window").top
)
(hiding = dialog).style.opacity = 0.4;
});
};
persistentDialog(cm, queryDialog, q, searchNext, function(event, query) {
var keyName = CodeMirror.keyName(event)
var cmd = CodeMirror.keyMap[cm.getOption("keyMap")][keyName]
if (!cmd) cmd = cm.getOption('extraKeys')[keyName]
if (cmd == "findNext" || cmd == "findPrev" ||
cmd == "findPersistentNext" || cmd == "findPersistentPrev") {
persistentDialog(cm, queryDialog, q, searchNext, function (event, query) {
var keyName = CodeMirror.keyName(event);
var cmd = CodeMirror.keyMap[cm.getOption("keyMap")][keyName];
if (!cmd) cmd = cm.getOption("extraKeys")[keyName];
if (
cmd == "findNext" ||
cmd == "findPrev" ||
cmd == "findPersistentNext" ||
cmd == "findPersistentPrev"
) {
CodeMirror.e_stop(event);
startSearch(cm, getSearchState(cm), query);
cm.execCommand(cmd);
......@@ -154,49 +188,74 @@
findNext(cm, rev);
}
} else {
dialog(cm, queryDialog, "Buscar por:", q, function(query) {
if (query && !state.query) cm.operation(function() {
startSearch(cm, state, query);
state.posFrom = state.posTo = cm.getCursor();
findNext(cm, rev);
});
dialog(cm, queryDialog, "Buscar por:", q, function (query) {
if (query && !state.query)
cm.operation(function () {
startSearch(cm, state, query);
state.posFrom = state.posTo = cm.getCursor();
findNext(cm, rev);
});
});
}
}
function findNext(cm, rev, callback) {cm.operation(function() {
var state = getSearchState(cm);
var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo);
if (!cursor.find(rev)) {
cursor = getSearchCursor(cm, state.query, rev ? CodeMirror.Pos(cm.lastLine()) : CodeMirror.Pos(cm.firstLine(), 0));
if (!cursor.find(rev)) return;
}
cm.setSelection(cursor.from(), cursor.to());
cm.scrollIntoView({from: cursor.from(), to: cursor.to()}, 20);
state.posFrom = cursor.from(); state.posTo = cursor.to();
if (callback) callback(cursor.from(), cursor.to())
});}
function findNext(cm, rev, callback) {
cm.operation(function () {
var state = getSearchState(cm);
var cursor = getSearchCursor(
cm,
state.query,
rev ? state.posFrom : state.posTo
);
if (!cursor.find(rev)) {
cursor = getSearchCursor(
cm,
state.query,
rev
? CodeMirror.Pos(cm.lastLine())
: CodeMirror.Pos(cm.firstLine(), 0)
);
if (!cursor.find(rev)) return;
}
cm.setSelection(cursor.from(), cursor.to());
cm.scrollIntoView({ from: cursor.from(), to: cursor.to() }, 20);
state.posFrom = cursor.from();
state.posTo = cursor.to();
if (callback) callback(cursor.from(), cursor.to());
});
}
function clearSearch(cm) {cm.operation(function() {
var state = getSearchState(cm);
state.lastQuery = state.query;
if (!state.query) return;
state.query = state.queryText = null;
cm.removeOverlay(state.overlay);
if (state.annotate) { state.annotate.clear(); state.annotate = null; }
});}
function clearSearch(cm) {
cm.operation(function () {
var state = getSearchState(cm);
state.lastQuery = state.query;
if (!state.query) return;
state.query = state.queryText = null;
cm.removeOverlay(state.overlay);
if (state.annotate) {
state.annotate.clear();
state.annotate = null;
}
});
}
var replaceQueryDialog =
' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint"></span>';
var replacementQueryDialog = '<span class="CodeMirror-search-label">Con:</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/>';
var doReplaceConfirm = '<span class="CodeMirror-search-label">Reemplazar?</span> <button>Si</button> <button>No</button> <button>Todos</button> <button>Cancelar</button>';
var replacementQueryDialog =
'<span class="CodeMirror-search-label">Con:</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/>';
var doReplaceConfirm =
'<span class="CodeMirror-search-label">Reemplazar?</span> <button>Si</button> <button>No</button> <button>Todos</button> <button>Cancelar</button>';
function replaceAll(cm, query, text) {
cm.operation(function() {
for (var cursor = getSearchCursor(cm, query); cursor.findNext();) {
cm.operation(function () {
for (var cursor = getSearchCursor(cm, query); cursor.findNext(); ) {
if (typeof query != "string") {
var match = cm.getRange(cursor.from(), cursor.to()).match(query);
cursor.replace(text.replace(/\$(\d)/g, function(_, i) {return match[i];}));
cursor.replace(
text.replace(/\$(\d)/g, function (_, i) {
return match[i];
})
);
} else cursor.replace(text);
}
});
......@@ -205,48 +264,94 @@
function replace(cm, all) {
if (cm.getOption("readOnly")) return;
var query = cm.getSelection() || getSearchState(cm).lastQuery;
var dialogText = '<span class="CodeMirror-search-label">' + (all ? 'Reemplazar todo:' : 'Reemplazar:') + '</span>';
dialog(cm, dialogText + replaceQueryDialog, dialogText, query, function(query) {
if (!query) return;
query = parseQuery(query);
dialog(cm, replacementQueryDialog, "Reemplazar con:", "", function(text) {
text = parseString(text)
if (all) {
replaceAll(cm, query, text)
} else {
clearSearch(cm);
var cursor = getSearchCursor(cm, query, cm.getCursor("from"));
var advance = function() {
var start = cursor.from(), match;
if (!(match = cursor.findNext())) {
cursor = getSearchCursor(cm, query);
if (!(match = cursor.findNext()) ||
(start && cursor.from().line == start.line && cursor.from().ch == start.ch)) return;
var dialogText =
'<span class="CodeMirror-search-label">' +
(all ? "Reemplazar todo:" : "Reemplazar:") +
"</span>";
dialog(
cm,
dialogText + replaceQueryDialog,
dialogText,
query,
function (query) {
if (!query) return;
query = parseQuery(query);
dialog(
cm,
replacementQueryDialog,
"Reemplazar con:",
"",
function (text) {
text = parseString(text);
if (all) {
replaceAll(cm, query, text);
} else {
clearSearch(cm);
var cursor = getSearchCursor(cm, query, cm.getCursor("from"));
var advance = function () {
var start = cursor.from(),
match;
if (!(match = cursor.findNext())) {
cursor = getSearchCursor(cm, query);
if (
!(match = cursor.findNext()) ||
(start &&
cursor.from().line == start.line &&
cursor.from().ch == start.ch)
)
return;
}
cm.setSelection(cursor.from(), cursor.to());
cm.scrollIntoView({ from: cursor.from(), to: cursor.to() });
confirmDialog(cm, doReplaceConfirm, "Reemplazar?", [
function () {
doReplace(match);
},
advance,
function () {
replaceAll(cm, query, text);
},
]);
};
var doReplace = function (match) {
cursor.replace(
typeof query == "string"
? text
: text.replace(/\$(\d)/g, function (_, i) {
return match[i];
})
);
advance();
};
advance();
}
cm.setSelection(cursor.from(), cursor.to());
cm.scrollIntoView({from: cursor.from(), to: cursor.to()});
confirmDialog(cm, doReplaceConfirm, "Reemplazar?",
[function() {doReplace(match);}, advance,
function() {replaceAll(cm, query, text)}]);
};
var doReplace = function(match) {
cursor.replace(typeof query == "string" ? text :
text.replace(/\$(\d)/g, function(_, i) {return match[i];}));
advance();
};
advance();
}
});
});
}
);
}
);
}
CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);};
CodeMirror.commands.findPersistent = function(cm) {clearSearch(cm); doSearch(cm, false, true);};
CodeMirror.commands.findPersistentNext = function(cm) {doSearch(cm, false, true, true);};
CodeMirror.commands.findPersistentPrev = function(cm) {doSearch(cm, true, true, true);};
CodeMirror.commands.find = function (cm) {
clearSearch(cm);
doSearch(cm);
};
CodeMirror.commands.findPersistent = function (cm) {
clearSearch(cm);
doSearch(cm, false, true);
};
CodeMirror.commands.findPersistentNext = function (cm) {
doSearch(cm, false, true, true);
};
CodeMirror.commands.findPersistentPrev = function (cm) {
doSearch(cm, true, true, true);
};
CodeMirror.commands.findNext = doSearch;
CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);};
CodeMirror.commands.findPrev = function (cm) {
doSearch(cm, true);
};
CodeMirror.commands.clearSearch = clearSearch;
CodeMirror.commands.replace = replace;
CodeMirror.commands.replaceAll = function(cm) {replace(cm, true);};
CodeMirror.commands.replaceAll = function (cm) {
replace(cm, true);
};
});
This diff is collapsed.
import { CliStablePage } from './app.po';
import { CliStablePage } from "./app.po";
describe('cli-stable App', () => {
describe("cli-stable App", () => {
let page: CliStablePage;
beforeEach(() => {
page = new CliStablePage();
});
it('should display message saying app works', () => {
it("should display message saying app works", () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('app works!');
expect(page.getParagraphText()).toEqual("app works!");
});
});
import { browser, element, by } from 'protractor';
import { browser, element, by } from "protractor";
export class CliStablePage {
navigateTo() {
return browser.get('/');
return browser.get("/");
}
getParagraphText() {
return element(by.css('app-root h1')).getText();
return element(by.css("app-root h1")).getText();
}
}
......@@ -4,9 +4,6 @@
"outDir": "../out-tsc/e2e",
"module": "commonjs",
"target": "es5",
"types":[
"jasmine",
"node"
]
"types": ["jasmine", "node"]
}
}
......@@ -4,33 +4,31 @@
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma')
require('@angular-devkit/build-angular/plugins/karma')
],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
files: [
{ pattern: './src/test.ts', watched: false }
],
preprocessors: {
'./src/test.ts': ['@angular/cli']
},
mime: {
'text/x-typescript': ['ts','tsx']
},
coverageIstanbulReporter: {
reports: [ 'html', 'lcovonly' ],
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
},
angularCli: {
environment: 'dev'
},
reporters: config.angularCli && config.angularCli.codeCoverage
? ['progress', 'coverage-istanbul']
: ['progress', 'kjhtml'],
......
This diff is collapsed.
......@@ -4,59 +4,64 @@
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"start": "ng serve -o --port 0",
"build": "ng build --configuration production",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.1.3",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"@ng-bootstrap/ng-bootstrap": "1.0.0-alpha.26",
"@ngx-translate/core": "^7.2.2",
"@ngx-translate/http-loader": "^0.1.0",
"@angular/common": "^13.3.11",
"@angular/compiler": "^13.3.11",
"@angular/core": "^13.3.11",
"@angular/forms": "^13.3.11",
"@angular/localize": "^13.3.11",
"@angular/platform-browser": "^13.3.11",
"@angular/platform-browser-dynamic": "^13.3.11",
"@angular/router": "^13.3.11",
"@ng-bootstrap/ng-bootstrap": "^11.0.0",
"@ngx-translate/core": "^13.0.0",
"@ngx-translate/http-loader": "^6.0.0",
"codemirror": "^5.65.9",
"core-js": "^2.4.1",
"d3": "^4.12.2",
"d3": "^7.6.1",
"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",
"function-plot": "https://github.com/ncamera/function-plot",
"graph3D": "https://github.com/ncamera/graph3D",
"ionicons": "^3.0.0",
"jq-console": "^2.13.2",
"jquery": "^3.2.1",
"mathjs": "1.6.0",
"ng2-bootstrap-modal": "^1.0.1",
"ng2-codemirror": "^1.1.1",
"lt-codemirror": "^10.0.0",
"matefun-components": "^0.3.0",
"mathjs": "^11.3.3",
"ng2-slider-component": "^1.0.9",
"rxjs": "^5.1.0",
"rxjs": "6.6.7",
"tippy.js": "^1.2.0",
"zone.js": "^0.8.4"
"tslib": "^2.0.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular/cli": "1.2.6",
"@angular/compiler-cli": "^4.0.0",
"@types/jasmine": "2.5.38",
"@angular-devkit/build-angular": "~13.3.9",
"@angular/cli": "^13.3.9",
"@angular/compiler-cli": "^13.3.11",
"@types/jasmine": "~3.6.0",
"@types/jquery": "^2.0.45",
"@types/node": "~6.0.60",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^0.2.0",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.0",
"@types/node": "^12.20.55",
"codelyzer": "^6.0.2",
"jasmine-core": "~3.8.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.4.1",
"karma-chrome-launcher": "~3.1.0",
"karma-cli": "~2.0.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"sass": "^1.55.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "~2.2.0"
"tslint": "~6.1.0",
"typescript": "~4.6.4"
}
}
{
"/servicios/": {
"target": "http://localhost:8080/matefun",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
},
"/servicios/*": {
"target": "http://localhost:8080/matefun",
"secure": false,
"changeOrigin": true,
"logLevel": "debug",
"ws": true
}
}
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { NgModule } from "@angular/core";
import { Routes, RouterModule } from "@angular/router";
import { AuthGuard } from './shared/guards/auth.guard';
import { AuthGuard } from "./shared/guards/auth.guard";
const routes: Routes = [
{ path: '', loadChildren: './layout/layout.module#LayoutModule', canActivate: [AuthGuard] },
{ path: 'login', loadChildren: './login/login.module#LoginModule' },
{ path: 'not-found', loadChildren: './not-found/not-found.module#NotFoundModule' },
{ path: '**', redirectTo: 'not-found' }
{
path: "",
loadChildren: () =>
import("./layout/layout.module").then((m) => m.LayoutModule),
canActivate: [AuthGuard],
},
{
path: "login",
loadChildren: () =>
import("./login/login.module").then((m) => m.LoginModule),
data: {
language:
navigator.language &&
(navigator.language.split("-")[0] == "es" ||
navigator.language.split("-")[0] == "en")
? navigator.language.split("-")[0]
: "es",
},
},
{
path: "es/login",
loadChildren: () =>
import("./login/login.module").then((m) => m.LoginModule),
data: { language: "es" },
},
{
path: "en/login",
loadChildren: () =>
import("./login/login.module").then((m) => m.LoginModule),
data: { language: "en" },
},
{
path: "not-found",
loadChildren: () =>
import("./not-found/not-found.module").then((m) => m.NotFoundModule),
},
{ path: "**", redirectTo: "not-found" },
];
@NgModule({
imports: [RouterModule.forRoot(routes, { useHash: true })],
exports: [RouterModule]
imports: [
RouterModule.forRoot(routes, {
useHash: true,
relativeLinkResolution: "legacy",
}),
],
exports: [RouterModule],
})
export class AppRoutingModule { }
export class AppRoutingModule {}
<div>
<router-outlet></router-outlet>
<span class="translate">{{ "HELLO" | translate }}</span>
</div>
<router-outlet></router-outlet>
import { TestBed, async } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { TestBed, waitForAsync } from "@angular/core/testing";
import { RouterTestingModule } from "@angular/router/testing";
import { AppComponent } from './app.component';
import { AppComponent } from "./app.component";
describe('AppComponent', () => {
beforeEach(async(() => {
describe("AppComponent", () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule
],
declarations: [
AppComponent
],
imports: [RouterTestingModule],
declarations: [AppComponent],
}).compileComponents();
}));
it('should create the app', async(() => {
it("should create the app", waitForAsync(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app works!'`, async(() => {
it(`should have as title 'app works!'`, waitForAsync(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('app works!');
expect(app.title).toEqual("app works!");
}));
it('should render title in a h1 tag', async(() => {
it("should render title in a h1 tag", waitForAsync(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('app works!');
expect(compiled.querySelector("h1").textContent).toContain("app works!");
}));
});