return text;
}
+function trim_keyword(word) {
+ if (!word) return word;
+
+ var oldword;
+ do {
+ oldword = word;
+
+ word = word.replace(/^\s+/, '');
+ word = word.replace(/\s+$/, '');
+ word = word.replace(/^#/, '');
+ word = word.replace(/[-:\/,]$/, '');
+ } while ( oldword != word );
+
+ return word;
+}
+
function lookup_bts(in_new) {
- var bug = getClipboardText();
+ var bug = trim_keyword(getClipboardText());
if (!bug) return null;
- bug = bug.replace(/^#/, '');
var uri="http://bugs.debian.org/" + bug;
if (in_new) {
}
function lookup_pts(in_new) {
- var pkg = getClipboardText();
+ var pkg = trim_keyword(getClipboardText());
if (!pkg) return null;
var uri="http://packages.qa.debian.org/" + pkg;
}
function lookup_deb(in_new) {
- var pkg = getClipboardText();
+ var pkg = trim_keyword(getClipboardText());
if (!pkg) return null;
var uri="http://packages.debian.org/" + pkg;