Skip to content

Commit

Permalink
Merge branch 'npm'
Browse files Browse the repository at this point in the history
  • Loading branch information
fent committed Oct 30, 2018
2 parents 4a22be2 + 0a6e348 commit 2d2f7f3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Option pages should be easy to make given a structure of your options, and look like Chrome's options.
Option pages should be simple to create given a structure of your options, ~and look like Chrome's options~.

![example](images/example.png)

Expand All @@ -19,8 +19,8 @@ Recommended that you create an options folder in your extension, keep things org

Download chrome-options

bower install chrome-options
ln bower_components/chrome-options/options.html .
npm install chrome-options
ln node_modules/chrome-options/options.html .
touch custom.css
touch options.js

Expand All @@ -40,10 +40,10 @@ Needs `storage` permission. Options are saved to [`chrome.storage.sync`](https:/
If you'll be using the [predefined_sound](#predefined_sound) fields, and want to play sounds from a content script, also add

"web_accessible_resources": [
"options/bower_components/chrome-options/sounds/*.wav"
"options/node_modules/chrome-options/sounds/*.wav"
]

If you're using git, consider adding `options/bower_components` to your `.gitignore`.
If you're using git, consider adding `options/node_modules` to your `.gitignore`.

Afterwards, you can start setting up your options page by editing `options.js`, and additionally, `custom.css` if you need to set any styles.

Expand Down
4 changes: 2 additions & 2 deletions options.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<meta charset="utf-8" />
<title>chrome options</title>
<link rel="stylesheet" type="text/css" href="custom.css" />
<script src="bower_components/chrome-options/dist/styles.min.js"></script>
<script src="bower_components/chrome-options/dist/main.min.js" defer></script>
<script src="node_modules/chrome-options/dist/styles.min.js"></script>
<script src="node_modules/chrome-options/dist/main.min.js" defer></script>
<script src="options.js" defer></script>
</head>
<body class="chrome-bootstrap">
Expand Down
2 changes: 1 addition & 1 deletion src/js/predefined-sound.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ chrome.options.fields.predefined_sound = (value, save, option) => {
}
$play.classList.remove('disabled');
const audio = new Audio();
audio.src = 'bower_components/chrome-options/sounds/' + value + '.wav';
audio.src = 'node_modules/chrome-options/sounds/' + value + '.wav';
audio.onerror = console.error;
audio.play();
};
Expand Down

0 comments on commit 2d2f7f3

Please sign in to comment.