Skip to content

Commit

Permalink
Added src
Browse files Browse the repository at this point in the history
  • Loading branch information
tonybaroneee committed Sep 23, 2015
1 parent d5415d5 commit 033cbc4
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 0 deletions.
9 changes: 9 additions & 0 deletions background.js
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'
});
}
});
6 changes: 6 additions & 0 deletions extension.js
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);
23 changes: 23 additions & 0 deletions flourish.css
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;
}
54 changes: 54 additions & 0 deletions flourish.js
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 added images/.DS_Store
Binary file not shown.
Binary file added images/flourish128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/flourish38.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions manifest.json
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"]
}

0 comments on commit 033cbc4

Please sign in to comment.