Commit a503c396 authored by Peter Walter's avatar Peter Walter
Browse files

Merge branch 'feature-report-spam' into 'master'

modify spam button to forward original message to is-spam@labs.sophos.com, and delete ticket

Closes #7

See merge request !1
parents a56ae157 3d2eca1f
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
// @match https://helpdesk.ebi.ac.uk/* // @match https://helpdesk.ebi.ac.uk/*
// @include https://helpdesk.ebi.ac.uk/* // @include https://helpdesk.ebi.ac.uk/*
// @grant GM_xmlhttpRequest // @grant GM_xmlhttpRequest
// @version 2.6.1 // @version 2.7.0
// @updateURL https://gitlab.ebi.ac.uk/ebiwd/rthelper/raw/stable/rthelper.user.js // @updateURL https://gitlab.ebi.ac.uk/ebiwd/rthelper/raw/stable/rthelper.user.js
// @downloadURL https://gitlab.ebi.ac.uk/ebiwd/rthelper/raw/stable/rthelper.user.js // @downloadURL https://gitlab.ebi.ac.uk/ebiwd/rthelper/raw/stable/rthelper.user.js
// @supportURL https://gitlab.ebi.ac.uk/ebiwd/rthelper/issues // @supportURL https://gitlab.ebi.ac.uk/ebiwd/rthelper/issues
...@@ -424,6 +424,21 @@ function init() { ...@@ -424,6 +424,21 @@ function init() {
element.focus(); element.focus();
})(); })();
// click on element named in Click query string
(function doClick() {
var clickElement = getParameterByName('Click');
if (!clickElement) {
return;
}
var element = document.querySelector('[name="' + clickElement + '"]');
if (!element) {
return;
}
element.click();
})();
// apply login and password to login box // apply login and password to login box
(function autoLogin() { (function autoLogin() {
if (!document.querySelector('form#login') || document.querySelector('ul.action-results li') || document.referrer.indexOf(info.path + '/NoAuth/Logout.html') !== -1) { if (!document.querySelector('form#login') || document.querySelector('ul.action-results li') || document.referrer.indexOf(info.path + '/NoAuth/Logout.html') !== -1) {
...@@ -443,7 +458,7 @@ function init() { ...@@ -443,7 +458,7 @@ function init() {
} }
} }
else { else {
document.querySelector('input[name="user"]').focus(); document.querySelector('input[name="user"]').focus();
} }
})(); })();
...@@ -753,11 +768,13 @@ function init() { ...@@ -753,11 +768,13 @@ function init() {
} }
insertLink( insertLink(
container, container,
'SPAM', 'Report Spam',
buildLink( "javascript:(function(){" +
getModifyLink({'Queue':'spam','Status':'deleted'}), "links=document.querySelectorAll('.actions .forward-link');fw=window.open(links[links.length-1].href+'&To=is-spam@labs.sophos.com&Content=Reporting+as+spam&Click=Forward','_blank');wait=setInterval(function(){if(fw.document.location.pathname=='/Ticket/Forward.html'&&fw.document.location.search==''){" +
refreshElement('#body') "clearInterval(wait);fw.close();" +
) "mod=document.querySelector('a#page-basics').href;jQuery.ajax({url:mod+'&Status=deleted',cache:false,complete:function(){location.reload();}})" +
"}},1000);" +
"})()"
); );
})(); })();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment