prometheas /
jira-2-omnifocus
| 1 | /* eslint-env webextensions */ |
||
| 2 | |||
| 3 | function encodeTaskProperties(omnifocusTask) { |
||
| 4 | return { |
||
| 5 | name: encodeURIComponent(omnifocusTask.name), |
||
| 6 | note: encodeURIComponent(omnifocusTask.note) |
||
| 7 | }; |
||
| 8 | } |
||
| 9 | |||
| 10 | var senders = { |
||
| 11 | app: function (config, encodedTask) { |
||
| 12 | return 'omnifocus:///add?name=' + encodedTask.name + '¬e=' + encodedTask.note; |
||
| 13 | }, |
||
| 14 | maildrop: function (config, encodedTask) { |
||
| 15 | return "mailto:" + config.address + "@sync.omnigroup.com?subject=" + encodedTask.name + "&body=" + encodedTask.note; |
||
| 16 | } |
||
| 17 | }; |
||
| 18 | |||
| 19 | var actions = { |
||
| 20 | createTask: function (taskInfo) { |
||
| 21 | var sender = localStorage.sender || "app"; |
||
|
0 ignored issues
–
show
|
|||
| 22 | var encodedTask = encodeTaskProperties(taskInfo); |
||
| 23 | |||
| 24 | return { |
||
| 25 | url: senders[sender](localStorage, encodedTask) |
||
| 26 | }; |
||
| 27 | } |
||
| 28 | }; |
||
| 29 | |||
| 30 | chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) { |
||
|
0 ignored issues
–
show
The variable
chrome seems to be never declared. If this is a global, consider adding a /** global: chrome */ comment.
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. Loading history...
|
|||
| 31 | var responseData = false; |
||
| 32 | |||
| 33 | if (actions[request.method]) { |
||
| 34 | responseData = actions[request.method](request.params); |
||
| 35 | } |
||
| 36 | |||
| 37 | sendResponse(responseData); |
||
| 38 | }); |
||
| 39 |
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.