@cryptoscamdb/web
Advanced tools
Comparing version 0.4.0 to 0.5.0
{ | ||
"name": "@cryptoscamdb/web", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "Keeping track of all current cryptocurrency scams in an open-source database", | ||
@@ -31,3 +31,2 @@ "keywords": [ | ||
"test": "tsc --noEmit --project tsconfig.json", | ||
"clean": "rimraf cache.db node_modules data config.json", | ||
"prettier:diff": "prettier --write --config ./.prettierrc --list-different 'src/**/*.ts'", | ||
@@ -52,31 +51,30 @@ "tscheck": "tsc --noEmit --project tsconfig.json", | ||
"dependencies": { | ||
"compression": "^1.7.3", | ||
"cross-env": "^5.2.0", | ||
"dateformat": "^3.0.3", | ||
"debug": "^4.0.1", | ||
"ejs": "^2.6.1", | ||
"eth-phishing-detect": "^1.1.12", | ||
"express": "^4.16.3", | ||
"helmet": "^3.13.0", | ||
"private-ip": "^1.0.5", | ||
"request": "^2.87.0", | ||
"request-promise-native": "^1.0.5", | ||
"ts-node": "^7.0.1", | ||
"typescript": "^3.1.1" | ||
"compression": "1.7.3", | ||
"cross-env": "5.2.0", | ||
"dateformat": "3.0.3", | ||
"debug": "4.1.0", | ||
"ejs": "2.6.1", | ||
"eth-phishing-detect": "1.1.13", | ||
"express": "4.16.4", | ||
"helmet": "3.15.0", | ||
"private-ip": "1.0.5", | ||
"request": "2.88.0", | ||
"request-promise-native": "1.0.5", | ||
"ts-node": "7.0.1", | ||
"typescript": "3.1.6" | ||
}, | ||
"devDependencies": { | ||
"@types/debug": "0.0.31", | ||
"@types/express": "^4.16.0", | ||
"@types/express": "4.16.0", | ||
"@types/helmet": "0.0.42", | ||
"@types/node": "^10.11.2", | ||
"@types/request": "^2.47.1", | ||
"all-contributors-cli": "^5.4.0", | ||
"husky": "^1.0.1", | ||
"lint-staged": "^8.0.0", | ||
"nodemon": "^1.18.4", | ||
"prettier": "^1.14.3", | ||
"rimraf": "^2.6.2", | ||
"tslint": "^5.11.0", | ||
"tslint-config-prettier": "^1.15.0", | ||
"tslint-microsoft-contrib": "^5.2.1" | ||
"@types/node": "10.12.11", | ||
"@types/request": "2.48.1", | ||
"all-contributors-cli": "5.4.1", | ||
"husky": "1.2.0", | ||
"lint-staged": "8.1.0", | ||
"nodemon": "1.18.7", | ||
"prettier": "1.15.3", | ||
"tslint": "5.11.0", | ||
"tslint-config-prettier": "1.17.0", | ||
"tslint-microsoft-contrib": "6.0.0" | ||
}, | ||
@@ -83,0 +81,0 @@ "lint-staged": { |
@@ -26,3 +26,3 @@ const MAX_RESULTS_PER_PAGE = 30; | ||
scams = scams.filter(function(scam) { | ||
return scam.coin == query.coin; | ||
return scam.coin && scam.coin.toUpperCase() == query.coin.toUpperCase(); | ||
}); | ||
@@ -32,3 +32,3 @@ } | ||
scams = scams.filter(function(scam) { | ||
return scam.category == query.category; | ||
return scam.category && scam.category.toLowerCase() == query.category.toLowerCase(); | ||
}); | ||
@@ -38,3 +38,3 @@ } | ||
scams = scams.filter(function(scam) { | ||
return scam.subcategory == query.subcategory; | ||
return scam.subcategory && scam.subcategory.toLowerCase() == query.subcategory.toLowerCase(); | ||
}); | ||
@@ -44,3 +44,3 @@ } | ||
scams = scams.filter(function(scam) { | ||
return scam.status == query.status; | ||
return scam.status && scam.status.toLowerCase() == query.status.toLowerCase(); | ||
}); | ||
@@ -77,5 +77,5 @@ } | ||
if(sorting) { | ||
history.replaceState({},"",'/scams/' + page + '/' + sorting); | ||
history.replaceState({},"",'/scams/' + page + '/' + sorting + location.search); | ||
} else { | ||
history.replaceState({},"",'/scams/' + page); | ||
history.replaceState({},"",'/scams/' + page + location.search); | ||
} | ||
@@ -87,4 +87,5 @@ renderScams(); | ||
function changeSorting(newSorting) { | ||
page = 1; | ||
sorting = newSorting; | ||
history.replaceState({},"",'/scams/' + page + '/' + sorting); | ||
history.replaceState({},"",'/scams/1/' + sorting + location.search); | ||
sortScams(); | ||
@@ -98,43 +99,52 @@ renderScams(); | ||
let index = [((page-1) * MAX_RESULTS_PER_PAGE),(page * MAX_RESULTS_PER_PAGE)]; | ||
for (var i = index[0]; i < index[1]; i++) { | ||
const scam = scams[i]; | ||
const row = $("<tr onclick=\"location.href='/scam/" + scam.id + "'\">"); | ||
if(scam.name.length > 40) { | ||
row.append("<td>" + scam.name.substring(0, 40) + "...</td>"); | ||
} else { | ||
row.append("<td>" + scam.name + "</td>"); | ||
if(index[1] > scams.length) index[1] = scams.length; | ||
if(index[0] in scams) { | ||
$(".scams-no-query-results").hide(); | ||
$(".search-grid-frame").show(); | ||
$("#results-table").show(); | ||
$(".next-page").show(); | ||
for (var i = index[0]; i < index[1]; i++) { | ||
const scam = scams[i]; | ||
const row = $("<tr onclick=\"location.href='/scam/" + scam.id + "'\">"); | ||
if(scam.name.length > 40) { | ||
row.append("<td>" + scam.name.substring(0, 40) + "...</td>"); | ||
} else { | ||
row.append("<td>" + scam.name + "</td>"); | ||
} | ||
if(scam.coin) { | ||
row.append("<td><div class='cat-container'><img src='/assets/coins/" + scam.coin + "' alt='Icon - " + scam.coin + "' class='categoryicon cat-icon' style='height:24px; width:24px;' onerror='this.style.display=\"none\"' /> <span class='cat-text'>" + scam.coin + "</span></div></td>"); | ||
} else { | ||
row.append("<td>None</td>"); | ||
} | ||
if(scam.category) { | ||
row.append("<td><div class='cat-container'><img src='/assets/" + scam.category.toLowerCase().replace(/\s/g, "") + "' alt='Icon - " + scam.category + "' class='categoryicon cat-icon' style='height:24px; width:24px;' onerror='this.style.display=\"none\"' /> <span class='cat-text'>" + scam.category + "</span></div></td>"); | ||
} else { | ||
row.append("<td>None</td>"); | ||
} | ||
if(scam.subcategory) { | ||
row.append("<td><img src='/assets/" + scam.subcategory.toLowerCase().replace(/\s/g, "") + "' alt='Icon - " + scam.subcategory + "' class='subcategoryicon' style='height:24px; width:24px;' onerror='this.style.display=\"none\"' /> " + scam.subcategory + "</td>"); | ||
} else { | ||
row.append("<td>None</td>"); | ||
} | ||
if(scam.status && scam.status == "Active") { | ||
row.append("<td><div class='active status-container'><img src='/assets/symbols/exclamation.svg' alt='Icon - <%= scam.status %>' class='statusicon' style='height:11.5px; width:11.5px;' /> <span class='statustext'> Active </span></div></td>"); | ||
} else if(scam.status && scam.status == "Inactive") { | ||
row.append("<td><div class='suspended status-container'><img src='/assets/symbols/check.svg' alt='Icon - <%= scam.status %>' class='statusicon' style='height:11.5px; width:11.5px;' /> <span class='statustext'> Inactive </span></div></td>"); | ||
} else if(scam.status && scam.status == "Suspended") { | ||
row.append("<td><div class='suspended status-container'><img src='/assets/symbols/x.svg' alt='Icon - <%= scam.status %>' class='statusicon' style='height:11.5px; width:11.5px;' /> <span class='statustext'> Suspended </span></div></td>"); | ||
} else if(scam.status && scam.status == "Offline") { | ||
row.append("<td><div class='offline status-container'><img src='/assets/symbols/check.svg' alt='Icon - <%= scam.status %>' class='statusicon' style='height:11.5px; width:11.5px;' /> <span class='statustext'> Offline </span></div></td>"); | ||
} else { | ||
row.append("<td>Unknown</td>"); | ||
} | ||
row.appendTo("tbody"); | ||
} | ||
if(scam.coin) { | ||
row.append("<td><div class='cat-container'><img src='/assets/coins/" + scam.coin + "' alt='Icon - " + scam.coin + "' class='categoryicon cat-icon' style='height:24px; width:24px;' onerror='this.style.display=\"none\"' /> <span class='cat-text'>" + scam.coin + "</span></div></td>"); | ||
} else { | ||
row.append("<td>None</td>"); | ||
} | ||
if(scam.category) { | ||
row.append("<td><div class='cat-container'><img src='/assets/" + scam.category.toLowerCase().replace(/\s/g, "") + "' alt='Icon - " + scam.category + "' class='categoryicon cat-icon' style='height:24px; width:24px;' onerror='this.style.display=\"none\"' /> <span class='cat-text'>" + scam.category + "</span></div></td>"); | ||
} else { | ||
row.append("<td>None</td>"); | ||
} | ||
if(scam.subcategory) { | ||
row.append("<td><img src='/assets/" + scam.subcategory.toLowerCase().replace(/\s/g, "") + "' alt='Icon - " + scam.subcategory + "' class='subcategoryicon' style='height:24px; width:24px;' onerror='this.style.display=\"none\"' /> " + scam.subcategory + "</td>"); | ||
} else { | ||
row.append("<td>None</td>"); | ||
} | ||
if(scam.status && scam.status == "Active") { | ||
row.append("<td><div class='active status-container'><img src='/assets/symbols/exclamation.svg' alt='Icon - <%= scam.status %>' class='statusicon' style='height:11.5px; width:11.5px;' /> <span class='statustext'> Active </span></div></td>"); | ||
} else if(scam.status && scam.status == "Inactive") { | ||
row.append("<td><div class='suspended status-container'><img src='/assets/symbols/check.svg' alt='Icon - <%= scam.status %>' class='statusicon' style='height:11.5px; width:11.5px;' /> <span class='statustext'> Inactive </span></div></td>"); | ||
} else if(scam.status && scam.status == "Suspended") { | ||
row.append("<td><div class='suspended status-container'><img src='/assets/symbols/x.svg' alt='Icon - <%= scam.status %>' class='statusicon' style='height:11.5px; width:11.5px;' /> <span class='statustext'> Suspended </span></div></td>"); | ||
} else if(scam.status && scam.status == "Offline") { | ||
row.append("<td><div class='offline status-container'><img src='/assets/symbols/check.svg' alt='Icon - <%= scam.status %>' class='statusicon' style='height:11.5px; width:11.5px;' /> <span class='statustext'> Offline </span></div></td>"); | ||
} else { | ||
row.append("<td>Unknown</td>"); | ||
} | ||
row.appendTo("tbody"); | ||
} else { | ||
$(".scams-no-query-results").show(); | ||
} | ||
@@ -157,9 +167,9 @@ } | ||
const intPageNumber = page+i; | ||
let strItemClass = "scams-nav-item"; | ||
if ((intPageNumber > (scams.length) / MAX_RESULTS_PER_PAGE) || (intPageNumber < 1)) { | ||
strItemClass = "disabled scams-nav-item"; | ||
if ((intPageNumber > Math.ceil(scams.length / MAX_RESULTS_PER_PAGE)) || (intPageNumber < 1)) { | ||
strPagination += "<a class='disabled scams-nav-item'>" + intPageNumber + "</a>"; | ||
} else if (page == intPageNumber) { | ||
strItemClass = "active scams-nav-item"; | ||
strPagination += "<a onclick='changePage(" + intPageNumber + ")' class='btn-active scams-nav-item'>" + intPageNumber + "</a>"; | ||
} else { | ||
strPagination += "<a onclick='changePage(" + intPageNumber + ")' class='scams-nav-item'>" + intPageNumber + "</a>"; | ||
} | ||
strPagination += "<a onclick='changePage(" + intPageNumber + ")' class='" + strItemClass + "'>" + intPageNumber + "</a>"; | ||
} | ||
@@ -180,6 +190,13 @@ | ||
filterScams(); | ||
sortScams(); | ||
renderScams(); | ||
renderPagination(); | ||
$(".lds-dual-ring").hide(); | ||
if(scams.length > 0) { | ||
sortScams(); | ||
renderScams(); | ||
renderPagination(); | ||
} else if(Object.keys(query).length > 0) { | ||
$(".scams-no-query-results").show(); | ||
} else { | ||
$(".scams-zero-entries").show(); | ||
} | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17324737
13
3725
+ Addedbody-parser@1.18.3(transitive)
+ Addedcompression@1.7.3(transitive)
+ Addedcontent-disposition@0.5.2(transitive)
+ Addedcontent-security-policy-builder@2.0.0(transitive)
+ Addedcookie@0.3.1(transitive)
+ Addedcross-env@5.2.0(transitive)
+ Addeddebug@4.1.0(transitive)
+ Addeddepd@1.1.2(transitive)
+ Addeddestroy@1.0.4(transitive)
+ Addeddns-prefetch-control@0.1.0(transitive)
+ Addeddont-sniff-mimetype@1.0.0(transitive)
+ Addedejs@2.6.1(transitive)
+ Addedeth-phishing-detect@1.1.13(transitive)
+ Addedexpect-ct@0.1.1(transitive)
+ Addedexpress@4.16.4(transitive)
+ Addedfeature-policy@0.2.0(transitive)
+ Addedfinalhandler@1.1.1(transitive)
+ Addedframeguard@3.0.0(transitive)
+ Addedhelmet@3.15.0(transitive)
+ Addedhelmet-crossdomain@0.3.0(transitive)
+ Addedhelmet-csp@2.7.1(transitive)
+ Addedhide-powered-by@1.0.0(transitive)
+ Addedhsts@2.1.0(transitive)
+ Addedhttp-errors@1.6.3(transitive)
+ Addediconv-lite@0.4.23(transitive)
+ Addedienoopen@1.0.0(transitive)
+ Addedinherits@2.0.3(transitive)
+ Addedis-windows@1.0.2(transitive)
+ Addedmerge-descriptors@1.0.1(transitive)
+ Addedmime@1.4.1(transitive)
+ Addednocache@2.0.0(transitive)
+ Addedon-finished@2.3.0(transitive)
+ Addedpath-to-regexp@0.1.7(transitive)
+ Addedplatform@1.3.5(transitive)
+ Addedpunycode@1.4.1(transitive)
+ Addedqs@6.5.2(transitive)
+ Addedraw-body@2.3.3(transitive)
+ Addedreferrer-policy@1.1.0(transitive)
+ Addedrequest@2.88.0(transitive)
+ Addedrequest-promise-core@1.1.1(transitive)
+ Addedrequest-promise-native@1.0.5(transitive)
+ Addedsend@0.16.2(transitive)
+ Addedserve-static@1.13.2(transitive)
+ Addedsetprototypeof@1.1.0(transitive)
+ Addedstatuses@1.4.0(transitive)
+ Addedtough-cookie@2.4.3(transitive)
+ Addedtypescript@3.1.6(transitive)
+ Addedx-xss-protection@1.1.0(transitive)
- Removedbody-parser@1.20.3(transitive)
- Removedbowser@2.9.0(transitive)
- Removedbytes@3.1.2(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removedcompression@1.7.4(transitive)
- Removedcontent-disposition@0.5.4(transitive)
- Removedcontent-security-policy-builder@2.1.0(transitive)
- Removedcookie@0.6.0(transitive)
- Removedcross-env@5.2.1(transitive)
- Removeddebug@4.3.7(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddepd@2.0.0(transitive)
- Removeddestroy@1.2.0(transitive)
- Removeddont-sniff-mimetype@1.1.0(transitive)
- Removedejs@2.7.4(transitive)
- Removedencodeurl@2.0.0(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedeth-phishing-detect@1.2.0(transitive)
- Removedexpress@4.21.0(transitive)
- Removedfeature-policy@0.3.0(transitive)
- Removedfinalhandler@1.3.1(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedgopd@1.0.1(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhelmet@3.23.3(transitive)
- Removedhelmet-crossdomain@0.4.0(transitive)
- Removedhelmet-csp@2.10.0(transitive)
- Removedhide-powered-by@1.1.0(transitive)
- Removedhsts@2.2.0(transitive)
- Removedhttp-errors@2.0.0(transitive)
- Removediconv-lite@0.4.24(transitive)
- Removedinherits@2.0.4(transitive)
- Removedmerge-descriptors@1.0.3(transitive)
- Removedmime@1.6.0(transitive)
- Removednocache@2.1.0(transitive)
- Removedobject-inspect@1.13.2(transitive)
- Removedon-finished@2.4.1(transitive)
- Removedpath-to-regexp@0.1.10(transitive)
- Removedqs@6.13.06.5.3(transitive)
- Removedraw-body@2.5.2(transitive)
- Removedreferrer-policy@1.2.0(transitive)
- Removedrequest@2.88.2(transitive)
- Removedrequest-promise-core@1.1.4(transitive)
- Removedrequest-promise-native@1.0.9(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsend@0.19.0(transitive)
- Removedserve-static@1.16.2(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedsetprototypeof@1.2.0(transitive)
- Removedside-channel@1.0.6(transitive)
- Removedstatuses@2.0.1(transitive)
- Removedtoidentifier@1.0.1(transitive)
- Removedtough-cookie@2.5.0(transitive)
- Removedtypescript@3.9.10(transitive)
- Removedx-xss-protection@1.3.0(transitive)
Updatedcompression@1.7.3
Updatedcross-env@5.2.0
Updateddateformat@3.0.3
Updateddebug@4.1.0
Updatedejs@2.6.1
Updatedeth-phishing-detect@1.1.13
Updatedexpress@4.16.4
Updatedhelmet@3.15.0
Updatedprivate-ip@1.0.5
Updatedrequest@2.88.0
Updatedrequest-promise-native@1.0.5
Updatedts-node@7.0.1
Updatedtypescript@3.1.6