From eeed6f3216fbcee2723225c3d4b23857c33a0647 Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 17 Sep 2012 08:00:04 +0000 Subject: [PATCH] files view: allow for pasting anything that contains 7 consecutive digits into id field in 'move files' (fixes #941) --- static/js/pandora/filesView.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/static/js/pandora/filesView.js b/static/js/pandora/filesView.js index efd61f5d..f01990ac 100644 --- a/static/js/pandora/filesView.js +++ b/static/js/pandora/filesView.js @@ -311,7 +311,12 @@ pandora.ui.filesView = function(options, self) { }) .bindEvent({ change: function(data) { - var conditions; + var conditions, matches; + if (key == 'id' && data.value.substr(0, 2) != '0x') { + matches = data.value.match(/\d{7}/); + data.value = matches ? matches[0] : ''; + self.$idInput.value(data.value); + } if (data.value.length) { conditions = {}; ['id', 'title', 'director', 'year'].map(function(key) {