From 75b56a3214bcb62a9edb20d463e07a9e022431fa Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 26 Aug 2015 09:55:35 +0100 Subject: [PATCH] Added basic trello support --- chrome/manifest.json | 22 +++++++++--------- firefox/package.json | 18 +++++++-------- src/decoder.json | 3 ++- src/injections/trello.js | 49 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 71 insertions(+), 21 deletions(-) create mode 100644 src/injections/trello.js diff --git a/chrome/manifest.json b/chrome/manifest.json index d17b197..de1959c 100644 --- a/chrome/manifest.json +++ b/chrome/manifest.json @@ -2,27 +2,27 @@ "content_scripts": [ { "js": [ - "data/lib/jquery.js", - "data/injector.js", + "data/lib/jquery.js", + "data/injector.js", "data/injections/facebook.js" - ], + ], "matches": [ "*://facebook.com/*" ] - }, + }, { "js": [ - "data/lib/jquery.js", - "data/injector.js", + "data/lib/jquery.js", + "data/injector.js", "data/injections/github.js" - ], + ], "matches": [ "*://github.com/*" ] } - ], - "description": "Use hipchat emoticons on other websites. Some sites may require this plugin in order to see the emoticons.", - "manifest_version": 2, - "name": "Hipchat-Emoticons-for-all", + ], + "description": "Use hipchat emoticons on other websites. Some sites may require this plugin in order to see the emoticons.", + "manifest_version": 2, + "name": "Hipchat-Emoticons-for-all", "version": "0.0.0" } \ No newline at end of file diff --git a/firefox/package.json b/firefox/package.json index 23ed842..fb5172b 100644 --- a/firefox/package.json +++ b/firefox/package.json @@ -1,14 +1,14 @@ { - "author": "TheOrangeOne", - "description": "Use hipchat emoticons on other websites. Some sites may require this plugin in order to see the emoticons.", + "author": "TheOrangeOne", + "description": "Use hipchat emoticons on other websites. Some sites may require this plugin in order to see the emoticons.", "engines": { - "fennec": ">=38.0a1", + "fennec": ">=38.0a1", "firefox": ">=38.0a1" - }, - "id": "Hipchat-Emoticons-for-all@jetpack", - "license": "MIT", - "main": "index.js", - "name": "hipchat emoticons for all", - "title": "Hipchat-Emoticons-for-all", + }, + "id": "Hipchat-Emoticons-for-all@jetpack", + "license": "MIT", + "main": "index.js", + "name": "hipchat emoticons for all", + "title": "Hipchat-Emoticons-for-all", "version": "0.0.0" } \ No newline at end of file diff --git a/src/decoder.json b/src/decoder.json index 3638e8f..c50531a 100644 --- a/src/decoder.json +++ b/src/decoder.json @@ -1,6 +1,7 @@ { "sites": [ {"facebook.com":"facebook.js"}, - {"github.com":"github.js"} + {"github.com":"github.js"}, + {"trello.com":"trello.js"} ] } \ No newline at end of file diff --git a/src/injections/trello.js b/src/injections/trello.js new file mode 100644 index 0000000..15a8582 --- /dev/null +++ b/src/injections/trello.js @@ -0,0 +1,49 @@ +function change_card_title() { + inject_image('.list-card-title'); + inject_image('.window-title-text'); +} +function change_list_title() { + inject_image('.list-header-name'); + inject_image('.window-header-inline-content'); +} + +function change_comment() { + inject_image('.action-comment'); +} +$('.list-header-name').on('change load', function() { + change_list_title(); +}); +$('.active-card').on('click', function() { + change_list_title(); + change_card_title(); + change_comment(); +}); +$('.card-detail-edit textarea').on('change input', function() { + markdown_injector('.card-detail-edit textarea'); +}); +$('.phenom-action').on('DOMNodeInserted DOMNodeRemoved change load', function() { + change_card_title(); + change_list_title(); + change_comment(); +}); +$('.js-add-card').on('click', function() { + change_card_title(); +}); +$('.action-card').on('click', function() { + change_card_title(); + change_list_title(); + change_comment(); +}); +$('.action-comment').on('click', function() { + change_comment(); +}); +$('.js-save-edit').on('click', function() { + change_card_title(); + change_list_title(); + change_comment(); +}); +$(document).on('ready', function() { + change_comment(); + change_card_title(); + change_card_list(); +});