Skip to content

Commit

Permalink
Merge pull request #5 from discoveryjs/settings-discovery
Browse files Browse the repository at this point in the history
Rewrited settings page using discovery
  • Loading branch information
exdis authored Mar 11, 2019
2 parents e5c6413 + 0186821 commit e078ca8
Show file tree
Hide file tree
Showing 10 changed files with 248 additions and 86 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.4.0 (09-03-2019)

* Settings page is now using `discovery` under hood
* Some pages with CSP-header may brake extension functionality ([Crome bug](https://bugs.chromium.org/p/chromium/issues/detail?id=816121)). For such cases added fallback
* Extension now check if content is HTML before trying to parse JSON

## 1.3.1 (13-02-2019)

* Updated `discovery` and `jora`
Expand Down
2 changes: 1 addition & 1 deletion core/page.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<title><%= htmlWebpackPlugin.options.title %></title>
<title><%= htmlWebpackPlugin.options.title %></title>
<link href='https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons' rel="stylesheet" type="text/css">
</head>
<body>
Expand Down
19 changes: 1 addition & 18 deletions core/settings.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,8 @@
<head>
<meta charset="utf-8">
<title><%= htmlWebpackPlugin.options.title %></title>
<link href='https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons' rel="stylesheet" type="text/css">
<style>
.row {
margin-bottom: 10px;
}
</style>
</head>
<body>
<div id="root">
<h1>Settings</h1>
<form id="settings-form">
<div class="row">
<input type="number" min="0" id="expand" required> Expand level
</div>
<div class="row">
<input type="submit" id="save" value="Save">
<span id="status"></span>
</div>
</form>
</div>
<div id="root"></div>
</body>
</html>
65 changes: 42 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jsondiscovery",
"version": "1.3.1",
"version": "1.4.0",
"description": "DiscoveryJson",
"author": "[email protected]",
"license": "MIT",
Expand Down
24 changes: 24 additions & 0 deletions src/content/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,27 @@
.user-select {
user-select: text;
}

.view-fieldset {
width: 400px;
display: flex;
margin: 8px 0;
}

.view-fieldset > * + * {
margin-left: 6px;
}

.view-fieldset .view-input {
flex: 1;
}

.view-label {
line-height: 34px;
}

.view-flash-message {
position: fixed;
top: 20px;
right: 20px;
}
8 changes: 2 additions & 6 deletions src/content/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ function initDiscovery(settings) {
}, '*');
};

parent.postMessage({ scriptLoaded: true }, '*');

return discovery;
}

Expand All @@ -128,9 +130,3 @@ window.addEventListener('message', function(event) {
);
}
}, false);

// window.addEventListener('hashchange', () => {
// parent.postMessage({
// hash: window.location.hash
// }, '*');
// });
Loading

0 comments on commit e078ca8

Please sign in to comment.