Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed button #133

Merged
merged 2 commits into from
Apr 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions media/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ while (!$) {
}
const vscode = acquireVsCodeApi();

const button = document.querySelector("button");
const link = document.getElementsByClassName("help-link");
const button = document.querySelector("button");

let errorTimeout;
function sendMessage(message) {
Expand All @@ -19,14 +19,13 @@ Sentry.init({
// We recommend adjusting this value in production
tracesSampleRate: 1.0,
});

link[0].addEventListener("click", (event) => {
sendMessage({ command: "open-link", link: "https://app.slack.com" });
});
button.addEventListener("click", (event) => {
sendMessage({ command: "run" });
});

link[0].addEventListener("click", (event) => {
sendMessage({ command: "open-link", link: "https://app.slack.com" });
});
$(document).ready(function () {
const replaceIssueLinks = (text, repo_url) => {
let repoLink = repo_url.replace("api.", "").replace("repos/", "");
Expand Down Expand Up @@ -131,9 +130,12 @@ $(document).ready(function () {
</div>
`);
$("#ghHolder").append("<button>Run Watermelon</button><br/>");
$("#ghHolder").append(
"<button class='help-link' >Get help on Slack</button>"
);
$("#ghHolder")
.append("<button class='help-link' >Get help on Slack</button>")
.on("click", (event) => {
sendMessage({ command: "open-link", link: "https://app.slack.com" });
});

$("#ghHolder").append(
"<p>Alternatively, you can <a href='https://github.com/watermelontools/wm-extension#commands'>run with our watermelon.start command</a></p>"
);
Expand Down