Convert line endings to Unix

This commit is contained in:
Sijmen 2018-01-26 17:03:28 +01:00
parent e11f8a6121
commit 005e0e7fb3
3 changed files with 84 additions and 84 deletions

View file

@ -1,14 +1,14 @@
{ {
"manifest_version": 2, "manifest_version": 2,
"name": "Pivotal Improvements", "name": "Pivotal Improvements",
"version": "1.0.2", "version": "1.0.3",
"content_scripts": "content_scripts":
[ [
{ {
"matches": ["*://*.pivotaltracker.com/n/projects/*"], "matches": ["*://*.pivotaltracker.com/n/projects/*"],
"js": ["project.js"], "js": ["project.js"],
"css": ["project.css"] "css": ["project.css"]
} }
] ]
} }

View file

@ -1,21 +1,21 @@
.story.owned > .preview { .story.owned > .preview {
font-weight: bold; font-weight: bold;
} }
.story > .preview { .story > .preview {
transition: background-color 0.2s; transition: background-color 0.2s;
} }
.story.highlighted.planned > .preview { .story.highlighted.planned > .preview {
background-color: #dfdfdf; background-color: #dfdfdf;
} }
.story.highlighted.started > .preview, .story.highlighted.started > .preview,
.story.highlighted.finished > .preview, .story.highlighted.finished > .preview,
.story.highlighted.delivered > .preview { .story.highlighted.delivered > .preview {
background-color: #e3e3c1; background-color: #e3e3c1;
} }
.story.highlighted.accepted > .preview { .story.highlighted.accepted > .preview {
background-color: #cadbbf; background-color: #cadbbf;
} }

View file

@ -1,49 +1,49 @@
const root = document.querySelector('#root'); const root = document.querySelector('#root');
let fullName = ''; let fullName = '';
function updateFullName() { function updateFullName() {
const avatar = document.querySelector('[data-aid="Avatar__image"]'); const avatar = document.querySelector('[data-aid="Avatar__image"]');
if (avatar) if (avatar)
fullName = avatar.getAttribute('alt'); fullName = avatar.getAttribute('alt');
} }
function setClassOnStoriesWithOwner(name, className) { function setClassOnStoriesWithOwner(name, className) {
const owners = document.querySelectorAll('.owner'); const owners = document.querySelectorAll('.owner');
for (const owner of owners) { for (const owner of owners) {
const story = owner.parentElement.parentElement.parentElement.parentElement; const story = owner.parentElement.parentElement.parentElement.parentElement;
if (owner.getAttribute('title') === name) if (owner.getAttribute('title') === name)
story.classList.add(className); story.classList.add(className);
else else
story.classList.remove(className); story.classList.remove(className);
} }
} }
function callback() { function callback() {
if (!fullName) { if (!fullName) {
// Grab the full name from the avatar alt-text. // Grab the full name from the avatar alt-text.
updateFullName(); updateFullName();
} }
setClassOnStoriesWithOwner(fullName, 'owned'); setClassOnStoriesWithOwner(fullName, 'owned');
} }
root.addEventListener('mouseover', event => { root.addEventListener('mouseover', event => {
if (event.target.className === 'owner') { if (event.target.className === 'owner') {
const name = event.target.getAttribute('title'); const name = event.target.getAttribute('title');
setClassOnStoriesWithOwner(name, 'highlighted'); setClassOnStoriesWithOwner(name, 'highlighted');
} }
}); });
root.addEventListener('mouseout', event => { root.addEventListener('mouseout', event => {
if (event.target.className === 'owner') if (event.target.className === 'owner')
setClassOnStoriesWithOwner('', 'highlighted'); setClassOnStoriesWithOwner('', 'highlighted');
}); });
const observer = new MutationObserver(callback); const observer = new MutationObserver(callback);
const config = { childList: true, subtree: true }; const config = { childList: true, subtree: true };
observer.observe(root, config); observer.observe(root, config);