files view: allow for pasting anything that contains 7 consecutive digits into id field in 'move files' (fixes #941)

This commit is contained in:
rolux 2012-09-17 08:00:04 +00:00
parent 9a3a90e666
commit eeed6f3216

View file

@ -311,7 +311,12 @@ pandora.ui.filesView = function(options, self) {
}) })
.bindEvent({ .bindEvent({
change: function(data) { 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) { if (data.value.length) {
conditions = {}; conditions = {};
['id', 'title', 'director', 'year'].map(function(key) { ['id', 'title', 'director', 'year'].map(function(key) {