Skip to content

Commit

Permalink
add styles, delete comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mdmen committed Feb 10, 2018
1 parent fda2d33 commit 975dbcd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 30 deletions.
19 changes: 15 additions & 4 deletions css/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ body {
padding: 3px;
box-sizing: border-box;
font: 14px/1.15 Helvetica, Arial, sans-serif;
clear: both;
}

.ext-list {
Expand All @@ -19,25 +20,35 @@ body {

.ext-list__item {
width: 100%;
padding: 3px;
padding: 4px 3px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
cursor: pointer;
box-sizing: border-box;
color: #222;
}

.ext-list__item--active {
color: lightgreen;
color: #4F8A10;
}

.ext-list__icon {
max-width: 16px;
width: 100%;
height: auto;
vertical-align: middle;
border: 0;
float: left;
margin-right: 5px;
filter: grayscale(1);
transition: filter .3s;
}

.ext-note {
.ext-list__item--active .ext-list__icon,
.ext-list__item:hover .ext-list__icon {
filter: grayscale(0);
}

.ext-note {
padding: 10px;
}
25 changes: 0 additions & 25 deletions js/popup.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@

; (function () {

/**
* Get all extensions and then start callback
*/
function getExtensions() {
chrome.management.getAll(renderExtensions);
}

/**
* Render the list of extensions
* @param {object} extensions - List of all available extensions
*/
function renderExtensions(extensions) {
extensions = getFilteredExtensions(extensions) || [];

Expand All @@ -28,20 +21,10 @@
app.appendChild(getExtensionsNodeList(extensions));
}

/**
* Filter the extensions
* @param {array} extensions - List of all available extensions
* @returns {array} - Filtered array of extensions
*/
function getFilteredExtensions(extensions) {
return extensions.filter((item) => item.type === 'extension');
}

/**
* Build the DOM Nodes
* @param {array} extensions - Filtered array of extensions
* @returns {object} - DOM Nodes
*/
function getExtensionsNodeList(extensions) {
let list = document.createElement('ul');
list.className = 'ext-list';
Expand Down Expand Up @@ -69,10 +52,6 @@
return list;
}

/**
* Set the extension enable/disable
* @param {object} event - Mouse click event
*/
function toggleExtension(event) {
const item = event.target;

Expand All @@ -86,10 +65,6 @@
item.classList.toggle('ext-list__item--active');
}

/**
* Show the note
* @param {string} text - Message text
*/
function showNote(text) {
let note = document.createElement('div');
note.className = 'ext-note';
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,

"name": "Simple extension manager",
"description": "This addon allows you to manage your extensions.",
"description": "Just allows you to on/off your extensions.",
"version": "0.1",

"icons": {
Expand Down

0 comments on commit 975dbcd

Please sign in to comment.