Added options with blacklist and theme. Created a function for changing the extension icon color.

This commit is contained in:
Mario Basic
2015-05-27 23:03:32 +02:00
parent 5b966014c4
commit fe62decf07
15 changed files with 12049 additions and 217 deletions

View File

@@ -7,11 +7,22 @@ class MainList extends React.Component
}
_openOptionsPage()
{
if (chrome.runtime.openOptionsPage) {
// New way to open options pages, if supported (Chrome 42+).
chrome.runtime.openOptionsPage();
} else {
// Reasonable fallback.
window.open(chrome.runtime.getURL('options.html'));
}
}
render()
{
return(
<div className="list-group">
<a href="#" className="list-group-item">
<a href="#" className="list-group-item" onClick={this._openOptionsPage}>
Options
</a>
<a href="#" className="list-group-item">

View File

@@ -3,11 +3,22 @@ var React = require("react");
var NavBar = require('./NavBar.react');
var MainList = require('./MainList.react');
var changeExtensionIcon = require('../helpers/changeExtensionIcon');
class WakaTime extends React.Component
{
componentDidMount()
{
chrome.storage.sync.get({
theme: 'light'
}, function(items) {
if(items.theme == 'light') {
changeExtensionIcon();
}
else {
changeExtensionIcon('white');
}
});
}
render()