[#2855] [WebUI] Unable to add UDP trackers
This commit is contained in:
parent
5f92810f76
commit
d38b8fc45c
|
@ -31,6 +31,15 @@
|
||||||
*/
|
*/
|
||||||
Ext.ns('Deluge');
|
Ext.ns('Deluge');
|
||||||
|
|
||||||
|
// Custom VType validator for tracker urls
|
||||||
|
var trackerUrlTest = /(((^https?)|(^udp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;
|
||||||
|
Ext.apply(Ext.form.VTypes, {
|
||||||
|
trackerUrl: function(val, field) {
|
||||||
|
return trackerUrlTest.test(val);
|
||||||
|
},
|
||||||
|
trackerUrlText: 'Not a valid tracker url'
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class Deluge.AddTrackerWindow
|
* @class Deluge.AddTrackerWindow
|
||||||
* @extends Ext.Window
|
* @extends Ext.Window
|
||||||
|
@ -76,7 +85,7 @@ Deluge.AddTrackerWindow = Ext.extend(Ext.Window, {
|
||||||
|
|
||||||
var cleaned = [];
|
var cleaned = [];
|
||||||
Ext.each(trackers, function(tracker) {
|
Ext.each(trackers, function(tracker) {
|
||||||
if (Ext.form.VTypes.url(tracker)) {
|
if (Ext.form.VTypes.trackerUrl(tracker)) {
|
||||||
cleaned.push(tracker);
|
cleaned.push(tracker);
|
||||||
}
|
}
|
||||||
}, this);
|
}, this);
|
||||||
|
|
Loading…
Reference in New Issue