1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-28 15:27:43 +00:00

Replace all the process_value functions with a helper from utilities. Hide creative tags on the channel page.

This commit is contained in:
SirStendec 2016-10-01 14:11:49 -04:00
parent 7d35b5c8c3
commit 91051d2a11
15 changed files with 197 additions and 339 deletions

View file

@ -328,9 +328,13 @@ module.exports = FFZ.utils = {
// Other Stuff
process_int: function(default_value) {
process_int: function(default_value, false_value, true_value) {
return function(val) {
if ( typeof val === "string" ) {
if ( val === false && false_value !== undefined )
val = false_value;
else if ( val === true && true_value !== undefined )
val = true_value;
else if ( typeof val === "string" ) {
val = parseInt(val);
if ( isNaN(val) || ! isFinite(val) )
val = default_value;