From d23342b1714092716e368de01b3376e8c0e5af42 Mon Sep 17 00:00:00 2001 From: derv82 Date: Fri, 17 Nov 2017 00:17:23 -0800 Subject: [PATCH] 'Load styles' link below 'Find styles for this site' -- does nothing --- _locales/en/messages.json | 4 ++++ popup.html | 4 ++++ popup/popup.js | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index fb0236c7..0e109179 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -333,6 +333,10 @@ } } }, + "loadStylesForSite": { + "message": "Load Styles", + "description": "Text for a link that loads styles within the popup" + }, "findStylesForSite": { "message": "Find more styles for this site", "description": "Text for a link that gets a list of styles for the current site" diff --git a/popup.html b/popup.html index fb0899eb..0d0e959c 100644 --- a/popup.html +++ b/popup.html @@ -113,6 +113,10 @@
+
+ +
diff --git a/popup/popup.js b/popup/popup.js index eff7f6db..a70767ed 100644 --- a/popup/popup.js +++ b/popup/popup.js @@ -106,6 +106,8 @@ function initPopup(url) { installed); } + $('#load-styles-link').onclick = handleEvent.loadRemoteStyles; + $('#find-styles-link').onclick = handleEvent.openURLandHide; $('#find-styles-link').href += url.startsWith(location.protocol) ? @@ -389,6 +391,11 @@ Object.assign(handleEvent, { } }, + loadRemoteStyles(event) { + event.preventDefault(); + console.log("loadRemoteStyles event:", event); + }, + openURLandHide(event) { event.preventDefault(); openURL({url: this.href || this.dataset.href})