Hello together,
I could use your advice, i already googled my Problem, and some answeres on 
StackOverflow were helpful, but I'm stuck here.
In my Screenshot you can see the Problem and the Code is down below.
I would be pleased if you would help me because I need that thing for Work.
Thx in Advance.

*The Problem:*
The Button shows, and when I Click this happens->Screenshot

<https://lh5.googleusercontent.com/-6KvfIeD4arA/VG3U7lONFUI/AAAAAAAAAGY/aVIcHiZ4V2M/s1600/GM.PNG>


Code:
// @name        Jira Next Button
// @namespace   http://mypage.com
// @include     *//jira.blank.at/browse/*
// @version     0.01a
// ==/UserScript==

var input=document.createElement("input");
input.type="button";
input.value="Weiter";
input.onclick = bumpJira;
input.setAttribute("style", 
"font-size:18px;position:absolute;top:100px;right:20px;z-index: 100;");
document.body.appendChild(input); 
 
function bumpJira() {
    var url = window.location;
    var jiraId = 
url.substring(unsafeWindow.getJiraIdStartPosition(url),url.length);  
    jiraId++;
    newLink(unsafeWindows.projectname(url), jiraId);
}

unsafeWindow.getJiraIdStartPosition = function(url) {
    switch (url.substring(33,35)) {
        case 'WH' :
            return 39;
        case 'SF' :
            return 37;
    }    
};

unsafeWindow.projectname = function(url) {    
    switch (url.substring(33,35))  {
        case 'WH':
            return 'WHIAD-';
        case 'SF':
            return 'SFS-';
    }
};

unsafeWindow.newLink = function(projectName, jiraId) {
    var newURL = 'https://jira.blank.at/browse/' + projectName + jiraId;
    //window.location.replace (newURL);
    alert(window.location);
};   




-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/greasemonkey-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to