X-Git-Url: https://git.ktnx.net/?p=icedeb.git;a=blobdiff_plain;f=chrome%2Fcontent%2Ficedeb.js;h=a6d00da93020599b903f7f0d38e7359d6c595cbc;hp=a8f2e9c095ce3ea569c2aa2f0d7525bcc36d7b84;hb=0acd8e09107de436334c888c9b5f3d1a2f76dbd6;hpb=d87756e03abd9f0418f78c8cea63d53706e1c501 diff --git a/chrome/content/icedeb.js b/chrome/content/icedeb.js index a8f2e9c..a6d00da 100644 --- a/chrome/content/icedeb.js +++ b/chrome/content/icedeb.js @@ -8,6 +8,9 @@ IceDeb = { .createInstance(Components.interfaces.nsITransferable); if (!trans) return null; + if (typeof(trans.init) === 'function') + trans.init(null); + trans.addDataFlavor("text/unicode"); clip.getData(trans, clip.supportsSelectionClipboard() @@ -39,6 +42,7 @@ IceDeb = { word = word.replace(/^[^a-zA-Z0-9]+/, ''); word = word.replace(/[^a-zA-Z0-9]+$/, ''); + word = word.replace(/^Bug#/i, ''); } while ( oldword != word ); return word; @@ -85,6 +89,65 @@ IceDeb = { loadURI(uri); } }, + lookup_ml: function(in_new) { + var msg_id = IceDeb.trim_keyword(IceDeb.getClipboardText()); + if (!msg_id) msg_id = ''; + var uri="http://lists.debian.org/msgid-search/" + msg_id; + + if (in_new) { + var b = getBrowser(); + var new_tab = b.addTab(uri); + b.selectedTab = new_tab; + } + else { + loadURI(uri); + } + }, + lookup_ddpo: function(in_new) { + var keyword = IceDeb.trim_keyword(IceDeb.getClipboardText()); + var uri="http://qa.debian.org/developer.php"; + + if (keyword) uri += "?login=" + keyword; + + if (in_new) { + var b = getBrowser(); + var new_tab = b.addTab(uri); + b.selectedTab = new_tab; + } + else { + loadURI(uri); + } + }, + lookup_buildd: function(in_new) { + var keyword = IceDeb.trim_keyword(IceDeb.getClipboardText()); + var uri="https://buildd.debian.org/"; + + if (keyword) uri += keyword; + + if (in_new) { + var b = getBrowser(); + var new_tab = b.addTab(uri); + b.selectedTab = new_tab; + } + else { + loadURI(uri); + } + }, + lookup_security: function(in_new) { + var keyword = IceDeb.trim_keyword(IceDeb.getClipboardText()); + var uri="http://security-tracker.debian.org/"; + + if (keyword) uri += "tracker/" + keyword; + + if (in_new) { + var b = getBrowser(); + var new_tab = b.addTab(uri); + b.selectedTab = new_tab; + } + else { + loadURI(uri); + } + }, btsButton: function (e) { if ( e.button == 0 ) @@ -103,6 +166,30 @@ IceDeb = { IceDeb.lookup_deb(false) else if ( e.button == 1 ) IceDeb.lookup_deb(true); + }, + mlButton: function (e) { + if ( e.button == 0 ) + IceDeb.lookup_ml(false) + else if ( e.button == 1 ) + IceDeb.lookup_ml(true); + }, + ddpoButton: function (e) { + if ( e.button == 0 ) + IceDeb.lookup_ddpo(false) + else if ( e.button == 1 ) + IceDeb.lookup_ddpo(true); + }, + builddButton: function (e) { + if ( e.button == 0 ) + IceDeb.lookup_buildd(false) + else if ( e.button == 1 ) + IceDeb.lookup_buildd(true); + }, + securityButton: function (e) { + if ( e.button == 0 ) + IceDeb.lookup_security(false) + else if ( e.button == 1 ) + IceDeb.lookup_security(true); } }