avoid using exceptions; was annoying when debugging
This commit is contained in:
parent
25a3c3aeed
commit
13283aac62
@ -442,15 +442,12 @@ QR =
|
|||||||
setNode 'fileInput', '[type=file]'
|
setNode 'fileInput', '[type=file]'
|
||||||
|
|
||||||
rules = $('ul.rules').textContent.trim()
|
rules = $('ul.rules').textContent.trim()
|
||||||
QR.min_width = QR.min_height = 1
|
match_min = rules.match(/.+smaller than (\d+)x(\d+).+/)
|
||||||
QR.max_width = QR.max_height = 10000
|
match_max = rules.match(/.+greater than (\d+)x(\d+).+/)
|
||||||
try
|
QR.min_width = +match_min?[1] or 1
|
||||||
[_, QR.min_width, QR.min_height] = rules.match(/.+smaller than (\d+)x(\d+).+/)
|
QR.min_height = +match_min?[2] or 1
|
||||||
[_, QR.max_width, QR.max_height] = rules.match(/.+greater than (\d+)x(\d+).+/)
|
QR.max_width = +match_max?[1] or 10000
|
||||||
for prop in ['min_width', 'min_height', 'max_width', 'max_height']
|
QR.max_height = +match_max?[2] or 10000
|
||||||
QR[prop] = parseInt QR[prop], 10
|
|
||||||
catch
|
|
||||||
null
|
|
||||||
|
|
||||||
nodes.fileInput.max = $('input[name=MAX_FILE_SIZE]').value
|
nodes.fileInput.max = $('input[name=MAX_FILE_SIZE]').value
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user