From 005e0e7fb39aeed5134c698b5b4cab8c0468d61b Mon Sep 17 00:00:00 2001 From: Sijmen Schoon Date: Fri, 26 Jan 2018 17:03:28 +0100 Subject: [PATCH] Convert line endings to Unix --- src/manifest.json | 28 +++++++------- src/project.css | 42 ++++++++++---------- src/project.js | 98 +++++++++++++++++++++++------------------------ 3 files changed, 84 insertions(+), 84 deletions(-) diff --git a/src/manifest.json b/src/manifest.json index 907c067..dcf2ea1 100755 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,14 +1,14 @@ -{ - "manifest_version": 2, - "name": "Pivotal Improvements", - "version": "1.0.2", - - "content_scripts": - [ - { - "matches": ["*://*.pivotaltracker.com/n/projects/*"], - "js": ["project.js"], - "css": ["project.css"] - } - ] -} +{ + "manifest_version": 2, + "name": "Pivotal Improvements", + "version": "1.0.3", + + "content_scripts": + [ + { + "matches": ["*://*.pivotaltracker.com/n/projects/*"], + "js": ["project.js"], + "css": ["project.css"] + } + ] +} diff --git a/src/project.css b/src/project.css index c4b2639..0b018e1 100755 --- a/src/project.css +++ b/src/project.css @@ -1,21 +1,21 @@ -.story.owned > .preview { - font-weight: bold; -} - -.story > .preview { - transition: background-color 0.2s; -} - -.story.highlighted.planned > .preview { - background-color: #dfdfdf; -} - -.story.highlighted.started > .preview, -.story.highlighted.finished > .preview, -.story.highlighted.delivered > .preview { - background-color: #e3e3c1; -} - -.story.highlighted.accepted > .preview { - background-color: #cadbbf; -} +.story.owned > .preview { + font-weight: bold; +} + +.story > .preview { + transition: background-color 0.2s; +} + +.story.highlighted.planned > .preview { + background-color: #dfdfdf; +} + +.story.highlighted.started > .preview, +.story.highlighted.finished > .preview, +.story.highlighted.delivered > .preview { + background-color: #e3e3c1; +} + +.story.highlighted.accepted > .preview { + background-color: #cadbbf; +} diff --git a/src/project.js b/src/project.js index e34213e..cc22eab 100755 --- a/src/project.js +++ b/src/project.js @@ -1,49 +1,49 @@ -const root = document.querySelector('#root'); - -let fullName = ''; - - -function updateFullName() { - const avatar = document.querySelector('[data-aid="Avatar__image"]'); - if (avatar) - fullName = avatar.getAttribute('alt'); -} - - -function setClassOnStoriesWithOwner(name, className) { - const owners = document.querySelectorAll('.owner'); - for (const owner of owners) { - const story = owner.parentElement.parentElement.parentElement.parentElement; - - if (owner.getAttribute('title') === name) - story.classList.add(className); - else - story.classList.remove(className); - } -} - - -function callback() { - if (!fullName) { - // Grab the full name from the avatar alt-text. - updateFullName(); - } - - setClassOnStoriesWithOwner(fullName, 'owned'); -} - -root.addEventListener('mouseover', event => { - if (event.target.className === 'owner') { - const name = event.target.getAttribute('title'); - setClassOnStoriesWithOwner(name, 'highlighted'); - } -}); - -root.addEventListener('mouseout', event => { - if (event.target.className === 'owner') - setClassOnStoriesWithOwner('', 'highlighted'); -}); - -const observer = new MutationObserver(callback); -const config = { childList: true, subtree: true }; -observer.observe(root, config); +const root = document.querySelector('#root'); + +let fullName = ''; + + +function updateFullName() { + const avatar = document.querySelector('[data-aid="Avatar__image"]'); + if (avatar) + fullName = avatar.getAttribute('alt'); +} + + +function setClassOnStoriesWithOwner(name, className) { + const owners = document.querySelectorAll('.owner'); + for (const owner of owners) { + const story = owner.parentElement.parentElement.parentElement.parentElement; + + if (owner.getAttribute('title') === name) + story.classList.add(className); + else + story.classList.remove(className); + } +} + + +function callback() { + if (!fullName) { + // Grab the full name from the avatar alt-text. + updateFullName(); + } + + setClassOnStoriesWithOwner(fullName, 'owned'); +} + +root.addEventListener('mouseover', event => { + if (event.target.className === 'owner') { + const name = event.target.getAttribute('title'); + setClassOnStoriesWithOwner(name, 'highlighted'); + } +}); + +root.addEventListener('mouseout', event => { + if (event.target.className === 'owner') + setClassOnStoriesWithOwner('', 'highlighted'); +}); + +const observer = new MutationObserver(callback); +const config = { childList: true, subtree: true }; +observer.observe(root, config);