From 7c77486456b75e3269d882df958653ccf5c4aef1 Mon Sep 17 00:00:00 2001 From: delvedor Date: Tue, 18 Oct 2016 01:01:21 +0200 Subject: [PATCH] Added error-report button --- browser.js | 12 ++++++++++++ index.html | 2 ++ style.css | 1 + 3 files changed, 15 insertions(+) diff --git a/browser.js b/browser.js index 8b52afe..33914ef 100644 --- a/browser.js +++ b/browser.js @@ -7,6 +7,7 @@ const getInstalledVersion = require('./lib/check-node') const loadVersions = require('./lib/load.js') const installNode = require('./lib/install') const getExample = require('./lib/examples') +const { clipboard, shell } = require('electron') // utility const errIcon = '' @@ -103,3 +104,14 @@ getExample((title, code) => { }) domElement('#error-button').addEventListener('click', installErrorEvent) + +function copyErrorInClipboard (e) { + e.preventDefault() + clipboard.writeText(domElement('#error-text').innerText) +} + +domElement('#error-text').addEventListener('click', copyErrorInClipboard) +domElement('#error-report').addEventListener('click', function (e) { + copyErrorInClipboard(e) + shell.openExternal('https://github.com/nodejs/installer/issues/new') +}) diff --git a/index.html b/index.html index 2278076..89c589a 100644 --- a/index.html +++ b/index.html @@ -73,6 +73,8 @@

Installing Node.js

+

Report

+ Return to installer
diff --git a/style.css b/style.css index 15705d3..230d5c7 100644 --- a/style.css +++ b/style.css @@ -184,6 +184,7 @@ pre[class*="language-"] { font-size: 1.2em; margin: 0; padding: 0; + cursor: pointer; } #error-button {