Links and input validation refactor, use config JSON object

This commit is contained in:
Amrit Panesar committed 2017-03-27 14:09:31 -07:00
1 parent ff2ce99a19
commit 5354db236d
3 files changed
+86 -116

No files matched your search

+2 -2
View File
@@ -491,7 +491,7 @@
"lint-neo-yt/src/index.js"
],
"names": [],
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC/NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ALine truncated
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC/NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ALine truncated
"file": "generated.js",
"sourceRoot": "../",
"sourcesContent": [
@@ -982,6 +982,6 @@
"'use strict';\n\nvar repeat = require('repeat-string');\n\nvar splitOnTags = function splitOnTags(str) {\n return str.split(/(<\\/?[^>]+>)/g).filter(function (line) {\n return line.trim() !== '';\n });\n};\nvar isTag = function isTag(str) {\n return (/<[^>!]+>/.test(str)\n );\n};\nvar isClosingTag = function isClosingTag(str) {\n return (/<\\/+[^>]+>/.test(str)\n );\n};\nvar isSelfClosingTag = function isSelfClosingTag(str) {\n return (/<[^>]+\\/>/.test(str)\n );\n};\nvar isOpeningTag = function isOpeningTag(str) {\n return isTag(str) && !isClosingTag(str) && !isSelfClosingTag(str);\n};\n\nmodule.exports = function (xml, indent) {\n var depth = 0;\n indent = indent || ' ';\n\n return splitOnTags(xml).map(function (item) {\n if (isClosingTag(item)) {\n depth--;\n }\n\n var line = repeat(indent, depth) + item;\n\n if (isOpeningTag(item)) {\n depth++;\n }\n\n return line;\n }).join('\\n');\n};",
"/**\n * Created by apanesar on 3/17/17.\n */\n\n// debugging code\n(function () {\n if (typeof window.debug !== 'object') {\n window.debug = {\n log: window.console.log.bind(window.console, '%s'),\n type: window.console.log.bind(window.console, '%s: %s'),\n error: window.console.error.bind(window.console, 'error: %s'),\n info: window.console.info.bind(window.console, 'info: %s'),\n warn: window.console.warn.bind(window.console, 'warn: %s')\n };\n }\n})();",
"var css = \"@import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic);/*!\\n * Bootstrap v3.3.7 (http://getbootstrap.com)\\n * Copyright 2011-2016 Twitter, Inc.\\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\\n *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css *//*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:\\\" (\\\" attr(href) \\\")\\\"}abbr[title]:after{content:\\\" (\\\" attr(title) \\\")\\\"}a[href^=\\\"javascript:\\\"]:after,a[href^=\\\"#\\\"]:after{content:\\\"\\\"}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.eot);src:url(node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2) format('woff2'),url(node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.woff) format('woff'),url(node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}@media (min-width:768px){.lead{font-size:21px}}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:Line truncated
"/**\n * Created by neo on 3/6/17.\n */\n\n// debug shim\n(function () {\n if (typeof window.debug !== 'object') {\n window.debug = {\n log: function () {\n },\n type: function () {\n },\n error: function () {\n },\n warn: function () {\n },\n info: function () {\n }\n };\n }\n})();\n\n// can't get browserify-shim to work right\n// let's just make it work here\nwindow.$ = window.jQuery = require('jquery');\n\n// include bootstrap css and javascript\nrequire('./index.css');\nrequire('bootstrap');\n\n// use hasher for application page management\nvar hasher = require('hasher');\nhasher.prependHash = '!';\nhasher.separator = '/';\n\n// include/configure highlight.js\nvar hljs = require('highlight.js');\nhljs.configure({\n tabReplace: ' '.repeat(4)\n});\n\n// use HTML Lint (will display later)\nvar htmlLint = require('htmllint');\n\n// js-beautify libraries\nvar beautify_js = require('js-beautify').js;\nvar beautify_css = require('js-beautify').css;\nvar beautify_html = require('js-beautify').html;\n\n// xml-beautify library\nvar beautify_xml = require('xml-beautifier');\n\n// sql-formatter library\nvar beautify_sql = require('sql-formatter');\n\n// bcrypt-js library\nvar bcrypt = require('bcryptjs');\n\n// forge library\nvar forge = require('forge');\n\n// gencryption\nvar gencryption = require(\"gencryption\");\n\nvar cryptoShim = {\n shim: {\n out: function (md) {\n return md.digest().toHex();\n }\n },\n MD5: function () {\n var type = 'md5';\n cryptoShim.shim[type] = typeof cryptoShim.shim[type] === 'undefined' ? forge.md[type].create() : cryptoShim.shim[type];\n cryptoShim.shim[type].update.apply(this, arguments);\n return cryptoShim.shim.out(cryptoShim.shim[type]);\n },\n SHA1: function () {\n var type = 'sha1';\n cryptoShim.shim[type] = typeof cryptoShim.shim[type] === 'undefined' ? forge.md[type].create() : cryptoShim.shim[type];\n cryptoShim.shim[type].update.apply(this, arguments);\n return cryptoShim.shim.out(cryptoShim.shim[type]);\n },\n SHA2_256: function () {\n var type = 'sha256';\n cryptoShim.shim[type] = typeof cryptoShim.shim[type] === 'undefined' ? forge.md[type].create() : cryptoShim.shim[type];\n cryptoShim.shim[type].update.apply(this, arguments);\n return cryptoShim.shim.out(cryptoShim.shim[type]);\n },\n SHA2_224: function () {\n var type = 'sha224';\n cryptoShim.shim[type] = typeof cryptoShim.shim[type] === 'undefined' ? forge.md[type].create() : cryptoShim.shim[type];\n cryptoShim.shim[type].update.apply(this, arguments);\n return cryptoShim.shim.out(cryptoShim.shim[type]);\n },\n SHA2_384: function () {\n var type = 'sha384';\n cryptoShim.shim[type] = typeof cryptoShim.shim[type] === 'undefined' ? forge.md[type].create() : cryptoShim.shim[type];\n cryptoShim.shim[type].update.apply(this, arguments);\n return cryptoShim.shim.out(cryptoShim.shim[type]);\n },\n SHA2_512: function () {\n var type = 'sha512';\n cryptoShim.shim[type] = typeof cryptoShim.shim[type] === 'undefined' ? forge.md[type].create() : cryptoShim.shim[type];\n cryptoShim.shim[type].update.apply(this, arguments);\n return cryptoShim.shim.out(cryptoShim.shim[type]);\n },\n RIPEMD160: function () {\n return CryptoJS.RIPEMD160.apply(this, arguments).toString(CryptoJS.enc.Hex);\n },\n bcrypt: function (stringIn) {\n return bcrypt.hashSync(stringIn, 10);\n }\n};\n\n/**\n * JSON linting!\n * @param json\n */\nvar jsonLint = function (json) {\n return typeof json !== 'string' ? JSON.stringify(json, undefined, 4) : jsonLint(JSON.parse(json));\n};\n\nvar hashShim = {\n /**\n * Returns hash, code, and type based on hashIn and separator\n * @param hashIn\n * @param separator\n * @return {{type: string, code: string, hash: string}}\n */\n getHash: function (hashIn, separator) {\n hashIn = typeof hashIn !== 'string' ? hasher.getHash() : hashIn;\n separator = typeof separator !== 'string' ? hasher.separator : separator;\n\n var split = hashIn.split(separator, 3);\n\n return {\n 'type': typeof split[0] === 'string' ? split[0] : '',\n 'code': typeof split[1] === 'string' ? atob(split[1]) : '',\n 'hash': typeof split[2] === 'string' ? atob(split[2]) : ''\n };\n },\n\n /**\n * Compares the first substring of separator with one and two\n * @param one\n * @param two\n * @param separator\n * @returns {boolean}\n */\n hashTypeCompare: function (one, two, separator) {\n separator = typeof separator !== 'string' ? hasher.separator : separator;\n\n var oneS = one.split(separator, 1)[0];\n var twoS = two.Line truncated
"/**\n * Created by neo on 3/6/17.\n */\n\n// debug shim\n(function () {\n if (typeof window.debug !== 'object') {\n window.debug = {\n log: function () {\n },\n type: function () {\n },\n error: function () {\n },\n warn: function () {\n },\n info: function () {\n }\n };\n }\n})();\n\n// can't get browserify-shim to work right\n// let's just make it work here\nwindow.$ = window.jQuery = require('jquery');\n\n// include bootstrap css and javascript\nrequire('./index.css');\nrequire('bootstrap');\n\n// use hasher for application page management\nvar hasher = require('hasher');\nhasher.prependHash = '!';\nhasher.separator = '/';\n\n// include/configure highlight.js\nvar hljs = require('highlight.js');\nhljs.configure({\n tabReplace: ' '.repeat(4)\n});\n\n// use HTML Lint (will display later)\nvar htmlLint = require('htmllint');\n\n// js-beautify libraries\nvar beautify_js = require('js-beautify').js;\nvar beautify_css = require('js-beautify').css;\nvar beautify_html = require('js-beautify').html;\n\n// xml-beautify library\nvar beautify_xml = require('xml-beautifier');\n\n// sql-formatter library\nvar beautify_sql = require('sql-formatter');\n\n// bcrypt-js library\nvar bcrypt = require('bcryptjs');\n\n// forge library\nvar forge = require('forge');\n\n// gencryption\nvar gencryption = require(\"gencryption\");\n\nvar cryptoShim = {\n shim: {\n out: function (md) {\n return md.digest().toHex();\n }\n },\n MD5: function () {\n var type = 'md5';\n cryptoShim.shim[type] = typeof cryptoShim.shim[type] === 'undefined' ? forge.md[type].create() : cryptoShim.shim[type];\n cryptoShim.shim[type].update.apply(this, arguments);\n return cryptoShim.shim.out(cryptoShim.shim[type]);\n },\n SHA1: function () {\n var type = 'sha1';\n cryptoShim.shim[type] = typeof cryptoShim.shim[type] === 'undefined' ? forge.md[type].create() : cryptoShim.shim[type];\n cryptoShim.shim[type].update.apply(this, arguments);\n return cryptoShim.shim.out(cryptoShim.shim[type]);\n },\n RIPEMD160: function () {\n return CryptoJS.RIPEMD160.apply(this, arguments).toString(CryptoJS.enc.Hex);\n },\n bcrypt: function (stringIn) {\n return bcrypt.hashSync(stringIn, 10);\n }\n};\n\n/**\n * JSON linting!\n * @param json\n */\nvar jsonLint = function (json) {\n return typeof json !== 'string' ? JSON.stringify(json, undefined, 4) : jsonLint(JSON.parse(json));\n};\n\nvar hashShim = {\n /**\n * Returns hash, code, and type based on hashIn and separator\n * @param hashIn\n * @param separator\n * @return {{type: string, code: string, hash: string}}\n */\n getHash: function (hashIn, separator) {\n hashIn = typeof hashIn !== 'string' ? hasher.getHash() : hashIn;\n separator = typeof separator !== 'string' ? hasher.separator : separator;\n\n var split = hashIn.split(separator, 3);\n\n return {\n 'type': typeof split[0] === 'string' ? split[0] : '',\n 'code': typeof split[1] === 'string' ? atob(split[1]) : '',\n 'hash': typeof split[2] === 'string' ? atob(split[2]) : ''\n };\n },\n\n /**\n * Compares the first substring of separator with one and two\n * @param one\n * @param two\n * @param separator\n * @returns {boolean}\n */\n hashTypeCompare: function (one, two, separator) {\n separator = typeof separator !== 'string' ? hasher.separator : separator;\n\n var oneS = one.split(separator, 1)[0];\n var twoS = two.split(separator, 1)[0];\n\n debug.type(\"hashTypeCompare\", \"one: {\" + oneS + \"} two: {\" + twoS + \"} === \" + (oneS === twoS ? 'true' : 'false'));\n\n return oneS === twoS;\n },\n\n /**\n * Calls hasher.setHash()\n */\n setHash: function (path) {\n debug.type(\"setHash() in\", JSON.stringify(arguments));\n\n // arguments[0]; // = type\n arguments[1] = btoa(arguments[1]); // = code\n arguments[2] = typeof arguments[2] !== 'undefined' ? btoa(arguments[2]) : arguments[2]; // hash\n\n debug.type(\"setHash() out\", JSON.stringify(arguments));\n\n hasher.setHash.apply(this, arguments);\n },\n\n /**\n * Calls hasher.replaceHash()\n */\n replaceHash: function (path) {\n debug.type(\"replaceHash() in\", JSON.stringify(arguments));\n\n // arguments[0]; // = type\n arguments[1] = btoa(arguments[1]); // = code\n arguments[2] = typeof arguments[2] !== 'undefined' ? btoa(arguments[2]) : arguments[2]; // hash\n\n debug.type(\"replaceHash() out\", JSON.stringify(arguments));\n\n hasher.replaceHash.apply(this, arguments);\n }\n\n};\n\nvar config = {\n _valid_tabs: [],\n html: {\n name: \"HTML Linter\",\n text: \Line truncated
]
}
+1 -12
View File
@@ -18,18 +18,7 @@
<a class="navbar-brand" href="#">Linter</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li id="encryption_tools_tab" class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="true">Encryption <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li id="aes_enc_tab" data-extra-highlight="encryption_tools_tab" data-name="AES Encryption"><a href="#">AES</a></li>
<li id="tripledes_enc_tab" data-extra-highlight="encryption_tools_tab" data-name="Triple DES Encryption"><a href="#">3-DES</a></li>
<li id="rc4_enc_tab" data-extra-highlight="encryption_tools_tab" data-name="RC4 Encryption"><a href="#">RC4</a></li>
<li id="rabbit_enc_tab" data-extra-highlight="encryption_tools_tab" data-name="Rabbit Encryption"><a href="#">Rabbit</a></li>
<li id="evpkdf_enc_tab" data-extra-highlight="encryption_tools_tab" data-name="Evpkdf Encryption"><a href="#">Evpkdf</a></li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav"></ul>
</div><!-- /.nav-collapse -->
</div><!-- /.container -->
</nav>
+83 -102
View File
@@ -80,30 +80,6 @@ var cryptoShim = {
cryptoShim.shim[type].update.apply(this, arguments);
return cryptoShim.shim.out(cryptoShim.shim[type]);
},
SHA2_256: function () {
var type = 'sha256';
cryptoShim.shim[type] = typeof cryptoShim.shim[type] === 'undefined' ? forge.md[type].create() : cryptoShim.shim[type];
cryptoShim.shim[type].update.apply(this, arguments);
return cryptoShim.shim.out(cryptoShim.shim[type]);
},
SHA2_224: function () {
var type = 'sha224';
cryptoShim.shim[type] = typeof cryptoShim.shim[type] === 'undefined' ? forge.md[type].create() : cryptoShim.shim[type];
cryptoShim.shim[type].update.apply(this, arguments);
return cryptoShim.shim.out(cryptoShim.shim[type]);
},
SHA2_384: function () {
var type = 'sha384';
cryptoShim.shim[type] = typeof cryptoShim.shim[type] === 'undefined' ? forge.md[type].create() : cryptoShim.shim[type];
cryptoShim.shim[type].update.apply(this, arguments);
return cryptoShim.shim.out(cryptoShim.shim[type]);
},
SHA2_512: function () {
var type = 'sha512';
cryptoShim.shim[type] = typeof cryptoShim.shim[type] === 'undefined' ? forge.md[type].create() : cryptoShim.shim[type];
cryptoShim.shim[type].update.apply(this, arguments);
return cryptoShim.shim.out(cryptoShim.shim[type]);
},
RIPEMD160: function () {
return CryptoJS.RIPEMD160.apply(this, arguments).toString(CryptoJS.enc.Hex);
},
@@ -162,13 +138,13 @@ var hashShim = {
* Calls hasher.setHash()
*/
setHash: function (path) {
debug.type("setHash() in", arguments);
debug.type("setHash() in", JSON.stringify(arguments));
// arguments[0]; // = type
arguments[1] = btoa(arguments[1]); // = code
arguments[2] = typeof arguments[2] !== 'undefined' ? btoa(arguments[2]) : arguments[2]; // hash
debug.type("setHash() out", arguments);
debug.type("setHash() out", JSON.stringify(arguments));
hasher.setHash.apply(this, arguments);
},
@@ -177,13 +153,13 @@ var hashShim = {
* Calls hasher.replaceHash()
*/
replaceHash: function (path) {
debug.type("replaceHash() in", arguments);
debug.type("replaceHash() in", JSON.stringify(arguments));
// arguments[0]; // = type
arguments[1] = btoa(arguments[1]); // = code
arguments[2] = typeof arguments[2] !== 'undefined' ? btoa(arguments[2]) : arguments[2]; // hash
debug.type("replaceHash() out", arguments);
debug.type("replaceHash() out", JSON.stringify(arguments));
hasher.replaceHash.apply(this, arguments);
}
@@ -242,35 +218,61 @@ var config = {
name: "Hash Tools",
text: "Hash Tools",
tabs: {
md: {
md_hash: {
name: "MD Hasher",
text: "MD"
},
sha: {
sha_hash: {
name: "SHA Hasher",
text: "SHA"
},
ripemd: {
ripemd_hash: {
name: "RIPEMD Hasher",
text: "RIPEMD"
},
bcrypt: {
bcrypt_hash: {
name: "BCrypt Hasher",
text: "BCrypt"
},
keccak: {
keccak_hash: {
name: "Keccak Hasher",
text: "Keccak"
},
whirlpool: {
whirlpool_hash: {
name: "Whirlpool Hasher",
text: "Whirlpool"
},
dss1: {
dss1_hash: {
name: "DSS1 Hasher",
text: "DSS1"
}
}
},
encryption_tools: {
name: "Encryption Tools",
text: "Encryption",
tabs: {
aes_enc: {
name: "AES Encryption",
text: "AES"
},
"3des_enc": {
name: "Triple DES Encryption",
text: "3-DES"
},
rc4_enc: {
name: "RC-4 Encryption",
text: "RC4"
},
rabbit_enc: {
name: "Rabbit Encryption",
text: "Rabbit"
},
evpkdf_enc: {
name: "Evpkdf Encryption",
text: "Evpkdf"
}
}
}
};
@@ -279,7 +281,7 @@ $('window').ready(function () {
// main I/O
var input = $('#input');
var output = $('#output');
var navbar = $('#navbar');
var navbar = $('#navbar').find('.nav');
Object.keys(config).forEach(function (key) {
if (key[0] === '_') {
@@ -290,7 +292,8 @@ $('window').ready(function () {
var listItem = $('<li />')
.attr('id', id)
.attr('data-name', config[key].name);
.attr('data-name', config[key].name)
.attr('data-function', key);
var link = $('<a />')
.attr('href', '#')
@@ -316,13 +319,13 @@ $('window').ready(function () {
.attr('role', 'menu');
Object.keys(tabs).forEach(function (k2) {
debugger;
var id2 = k2 + '_tab';
var li = $('<li />')
.attr('id', id2)
.attr('data-extra-highlight', id)
.attr('data-name', tabs[k2].name)
.attr('data-function', k2)
.appendTo(ul);
$('<a />')
@@ -335,7 +338,7 @@ $('window').ready(function () {
listItem.append(ul);
}
navbar.find('ul').append(listItem);
navbar.append(listItem);
});
/**
@@ -345,55 +348,37 @@ $('window').ready(function () {
*/
var changeType = function (type, setHash) {
setHash = typeof setHash !== 'boolean' ? true : setHash;
debug.type('changeType()', 'setHash: ' + (setHash ? 'true' : 'false'));
debug.type('changeType()', 'Start: ' + type + ' | setHash: ' + (setHash ? 'true' : 'false'));
var hash = hashShim.getHash();
switch (type) {
case 'html':
case 'xml':
case 'json':
case 'js':
case 'css':
case 'sql':
case 'urlencode':
case 'urldecode':
case 'base64encode':
case 'base64decode':
case 'md5_hash':
case 'sha1_hash':
case 'sha2_224_hash':
case 'sha2_256_hash':
case 'sha2_384_hash':
case 'sha2_512_hash':
case 'sha3_hash':
case 'ripemd160_hash':
case 'bcrypt_hash':
debug.type('changeType()', 'type: ' + type);
navbar.find('.active').removeClass('active');
var tab = $('#' + type + '_tab');
tab.addClass('active');
if (tab.data('extra-highlight') !== '') {
$('#' + tab.data('extra-highlight')).addClass('active');
}
$('#header').text(tab.data('name'));
if (setHash) {
debug.type('changeType()', 'Calling hasher.sethash with {' + type + '} : {' + hash.code + '}');
hashShim.setHash(type, hash.code);
} else {
debug.type('changeType()', 'Not calling hasher.sethash');
}
break;
default:
debug.type('changeType()', 'Default Case: Calling hasher.sethash with {html} : {' + hash.code + '}');
hashShim.setHash('html', hash.code);
if (!(type in config)) {
debug.type('changeType()', 'Default Case: Calling hasher.sethash with {html} : {' + hash.code + '}');
hashShim.setHash('html', hash.code);
debug.type('changeType()', '----------End----------');
return;
}
debug.type('changeType()', 'type: ' + type);
navbar.find('.active').removeClass('active');
var tab = $('#' + type + '_tab');
tab.addClass('active');
if (tab.data('extra-highlight') !== '') {
$('#' + tab.data('extra-highlight')).addClass('active');
}
$('#header').text(tab.data('name'));
if (setHash) {
debug.type('changeType()', 'Calling hasher.sethash with {' + type + '} : {' + hash.code + '}');
hashShim.setHash(type, hash.code);
} else {
debug.type('changeType()', 'Not calling hasher.sethash');
}
debug.type('changeType()', '----------End----------');
};
/**
@@ -443,25 +428,13 @@ $('window').ready(function () {
case 'base64decode':
stringOut = hljs.highlight('yaml', atob(code), true).value;
break;
case 'md5_hash':
case 'md_hash':
stringOut = hljs.highlight('yaml', cryptoShim.MD5(code), true).value;
break;
case 'sha1_hash':
case 'sha_hash':
stringOut = hljs.highlight('yaml', cryptoShim.SHA1(code), true).value;
break;
case 'sha2_224_hash':
stringOut = hljs.highlight('yaml', cryptoShim.SHA2_224(code), true).value;
break;
case 'sha2_256_hash':
stringOut = hljs.highlight('yaml', cryptoShim.SHA2_256(code), true).value;
break;
case 'sha2_384_hash':
stringOut = hljs.highlight('yaml', cryptoShim.SHA2_384(code), true).value;
break;
case 'sha2_512_hash':
stringOut = hljs.highlight('yaml', cryptoShim.SHA2_512(code), true).value;
break;
case 'ripemd160_hash':
case 'ripemd_hash':
stringOut = hljs.highlight('yaml', cryptoShim.RIPEMD160(code), true).value;
break;
case 'bcrypt_hash':
@@ -504,13 +477,21 @@ $('window').ready(function () {
hasher.init();
// hook into the navbar tabs and use hasher for them
navbar.find('>ul>li:not(.dropdown)').click(function (e) {
navbar.find('li:not(.dropdown)').click(function (e) {
e.preventDefault();
changeType(this.id.replace('_tab', ''));
var t = $(this);
var func = t.data('function');
var dbinfo = {
id: t.attr('id'),
func: t.data('function')
};
debug.type('navbar.find()', 'fired! ' + JSON.stringify(dbinfo));
changeType(func);
});
navbar.find('.dropdown>ul>li').click(function (e) {
$(".navbar-brand").click(function (e) {
e.preventDefault();
changeType(this.id.replace('_tab', ''));
changeType('html');
});
// function main ()