-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
tonybaroneee
committed
Sep 23, 2015
1 parent
d5415d5
commit 033cbc4
Showing
8 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { | ||
if (tab.url.toLowerCase().indexOf("blossom.io") > -1){ | ||
chrome.pageAction.show(tabId); | ||
chrome.pageAction.setTitle({ | ||
tabId: tab.id, | ||
title: 'Flourish - A Better Blossom' | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
var s = document.createElement('script'); | ||
s.src = chrome.extension.getURL('flourish.js'); | ||
s.onload = function() { | ||
this.parentNode.removeChild(this); | ||
}; | ||
(document.head||document.documentElement).appendChild(s); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.x-collaborator-select-active-tick { | ||
left: 2px; | ||
right: auto; | ||
} | ||
|
||
.b-hover-tooltip-tooltip-wrapper { | ||
display: none !important; | ||
} | ||
|
||
.x-collaborator-select-active-image, | ||
.x-collaborator-select-inactive-image { | ||
width: 30px; | ||
height: 30px; | ||
} | ||
|
||
.x-card-collaborators-select:hover, | ||
.x-collaborator-select-inactive { | ||
filter: none !important; | ||
} | ||
|
||
.x-card-collaborators-editor .x-card-collaborators-select { | ||
display: block; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
window.addEventListener("load", runFlourish, false); | ||
// chrome.pageAction.show(); | ||
function runFlourish(evt) { | ||
var jsInitChecktimer = setInterval(checkForQuery, 111); | ||
|
||
function checkForQuery() { | ||
if (typeof window.jQuery !== "undefined") { | ||
clearInterval(jsInitChecktimer); | ||
var $ = window.jQuery; | ||
|
||
// Helper function for adding visible names besides pictures | ||
var addNames = function(peopleitems) { | ||
peopleitems.each(function(i, el) { | ||
var $el = $(el), | ||
$newNameSpot = $el.find('.x-collaborator-select-hover-area').children('div'), | ||
nameTextSpan = $('<span />'); | ||
if ($newNameSpot.children('.name-text').length) return; | ||
nameTextSpan.text($el.find('.x-collaborator-select-tooltip-content').text()).addClass('name-text'); | ||
$newNameSpot.append(nameTextSpan); | ||
}); | ||
}; | ||
|
||
// On people picker open, fix up people items. | ||
$(document).on('click', '.x-card-collaborators-launch-area', function(e) { | ||
var $people = $('.x-card-collaborators-editor'), | ||
$peopleli = $people.children('.x-card-collaborators-select'); | ||
if ($people.is(':visible') && !$people.data('fixed-up')) { | ||
addNames($peopleli); | ||
$peopleli.sort(function(a, b) { | ||
var an = $(a).find('.x-collaborator-select-tooltip-content').text().toUpperCase(), | ||
bn = $(b).find('.x-collaborator-select-tooltip-content').text().toUpperCase(); | ||
|
||
if (an > bn) { | ||
return 1; | ||
} | ||
if (an < bn) { | ||
return -1; | ||
} | ||
return 0; | ||
}); | ||
|
||
$peopleli.detach().appendTo($people); | ||
$people.data('fixed-up', true); | ||
} | ||
}); | ||
|
||
// Hack to fix people names upon selection/de-selection (since we can't use click listeners) | ||
setInterval(function() { | ||
if ($('.x-card-collaborators-editor').is(':hidden')) return; | ||
addNames($('.x-card-collaborators-select')); | ||
}, 111); | ||
} | ||
} | ||
} |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"manifest_version": 2, | ||
"name": "Flourish", | ||
"version": "1.0.0", | ||
"description": "Simple usability improvements for Blossom.", | ||
"icons": { | ||
"128": "images/flourish128.png" | ||
}, | ||
"page_action": { | ||
"default_icon": "images/flourish38.png" | ||
}, | ||
"permissions" : [ | ||
"tabs" | ||
], | ||
"background": { | ||
"scripts": ["background.js"] | ||
}, | ||
"content_scripts": [ | ||
{ | ||
"matches": ["https://www.blossom.io/*", "https://blossom.io/*"], | ||
"css": ["flourish.css"], | ||
"js": ["extension.js"], | ||
"run_at": "document_start" | ||
} | ||
], | ||
"web_accessible_resources": ["flourish.js"] | ||
} |