prometheas /
jira-2-omnifocus
| 1 | /* eslint-env browser, jquery, webextensions */ |
||
| 2 | |||
| 3 | var $sendButton = $("<a id=\"send-to-omnifocus\">Send to OmniFocus »</a>"); |
||
| 4 | |||
| 5 | $(function () { |
||
| 6 | // creates an OF task using the supplied ticket info |
||
| 7 | function createTaskForTicket(ticket) { |
||
| 8 | var message = { |
||
| 9 | method: "createTask", |
||
| 10 | params: { |
||
| 11 | name: "[" + ticket.key + '] ' + ticket.summary, |
||
| 12 | note: window.location.href + "\n\n" + ticket.description |
||
| 13 | } |
||
| 14 | }; |
||
| 15 | |||
| 16 | chrome.runtime.sendMessage(message, function (data) { |
||
|
0 ignored issues
–
show
|
|||
| 17 | $('<iframe style="display:none">') |
||
| 18 | .attr('src', data.url) |
||
| 19 | .appendTo('body'); |
||
| 20 | }); |
||
| 21 | } |
||
| 22 | |||
| 23 | $sendButton.prependTo("#viewissuesidebar"); |
||
| 24 | |||
| 25 | $sendButton.on('click', function (evt) { |
||
| 26 | evt.preventDefault(); |
||
| 27 | |||
| 28 | createTaskForTicket({ |
||
| 29 | key: $("#key-val").text(), |
||
| 30 | summary: $("#summary-val").text().replace(/\s+/, ' ').replace(/^\s*(\S.+\S)\s*$/, '$1'), |
||
| 31 | description: $("#description-val").html() |
||
| 32 | }); |
||
| 33 | }); |
||
| 34 | }); |
||
| 35 |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.