From 015ac546f4beb444e33b1e0f4c51f216966d2d0b Mon Sep 17 00:00:00 2001
From: Danny Guo
Date: Sun, 15 Apr 2018 14:55:24 -0400
Subject: [PATCH] Delay turning off PawBlock from the popup
Suggested by #4.
---
CHANGELOG.md | 2 +
__tests__/.eslintrc.json | 3 +-
__tests__/popup-test.js | 14 ++++---
extension/images/happy-cat.svg | 1 +
extension/images/sad-pug.svg | 1 +
extension/options.html | 2 +-
extension/popup.html | 21 +++++++++-
extension/scripts/popup.js | 73 ++++++++++++++++++++++++++++++++--
extension/styles/popup.css | 18 ++++++++-
9 files changed, 122 insertions(+), 13 deletions(-)
create mode 100644 extension/images/happy-cat.svg
create mode 100644 extension/images/sad-pug.svg
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fd76a40..27db612 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
## [Unreleased]
+### Changed
+- Delay turning off PawBlock from the toolbar popup
## [0.4.0] - 2018-01-22
### Changed
diff --git a/__tests__/.eslintrc.json b/__tests__/.eslintrc.json
index 55f121d..91c3da4 100644
--- a/__tests__/.eslintrc.json
+++ b/__tests__/.eslintrc.json
@@ -1,5 +1,6 @@
{
"env": {
- "jest": true
+ "jest": true,
+ "node": true
}
}
diff --git a/__tests__/popup-test.js b/__tests__/popup-test.js
index 9407f7e..8cf9d4a 100644
--- a/__tests__/popup-test.js
+++ b/__tests__/popup-test.js
@@ -1,9 +1,13 @@
+const fs = require('fs');
+const path = require('path');
+
test('action popup', () => {
- document.body.innerHTML = `
-
-
-
- `;
+ const popup = fs.readFileSync(
+ path.join(__dirname, '../extension/popup.html'),
+ 'utf-8'
+ );
+
+ document.write(popup);
window.browser = {
storage: {
diff --git a/extension/images/happy-cat.svg b/extension/images/happy-cat.svg
new file mode 100644
index 0000000..27e51f6
--- /dev/null
+++ b/extension/images/happy-cat.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/extension/images/sad-pug.svg b/extension/images/sad-pug.svg
new file mode 100644
index 0000000..508f265
--- /dev/null
+++ b/extension/images/sad-pug.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/extension/options.html b/extension/options.html
index e201b93..c62d1bc 100644
--- a/extension/options.html
+++ b/extension/options.html
@@ -53,7 +53,7 @@
- This can also be quickly toggled using the toolbar button.
+ This can also be toggled using the toolbar button.
diff --git a/extension/popup.html b/extension/popup.html
index 786e448..14861bd 100644
--- a/extension/popup.html
+++ b/extension/popup.html
@@ -19,7 +19,7 @@
-