Very basic implementation for AFPercent_Keystroke

This is used to filter characters that don't make sense in a percent expression

This implementation is very rudimentary
remotes/origin/work/aacid/coreprivatesearch
Nicolas Fella 4 years ago committed by Albert Astals Cid
parent 80afe26873
commit 2911f7a885
  1. 14
      core/script/builtin.js

@ -335,4 +335,16 @@ function AFSpecial_Keystroke( psf )
return;
}
}
}
}
function AFPercent_Keystroke( nDec, sepStyle )
{
if (event.willCommit) {
event.rc = true
} else {
// Allow only numbers plus possible separators
// TODO disallow too many separators
// TODO Make separator locale-dependen/use sepStyle properly
event.rc = !isNaN(event.change) || event.change == "." || event.change == ","
}
}

Loading…
Cancel
Save