for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
/* eslint-env browser, jquery, webextensions */
const $sendButton = $('<a id="send-to-omnifocus">Send to OmniFocus »</a>');
$(() => {
// creates an OF task using the supplied ticket info
function createTaskForTicket(ticket) {
createTaskForTicket
var createTaskForTicket ...nction() { /* ... */ };
const message = {
method: 'createTask',
params: {
name: `[${ticket.key}] ${ticket.summary}`,
note: `${window.location.href}\n\n${ticket.description}`,
},
};
chrome.runtime.sendMessage(message, (data) => {
chrome
/** global: chrome */
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.
$('<iframe style="display:none">')
.attr('src', data.url)
.appendTo('body');
});
}
$sendButton.prependTo('#viewissuesidebar');
$sendButton.on('click', (evt) => {
evt.preventDefault();
createTaskForTicket({
key: $('#key-val').text(),
summary: $('#summary-val').text().replace(/\s+/, ' ').replace(/^\s*(\S.+\S)\s*$/, '$1'),
description: $("#description-val").text().replace(/[ ]{2,}/g, '').trim()