From 0dae3f86614f27f9e45cd3cc403a7a98b2169901 Mon Sep 17 00:00:00 2001 From: Alexey Skobkin Date: Wed, 7 Jan 2015 08:43:17 +0400 Subject: [PATCH] Moar fixes. --- chrome_point_plus/js/background.js | 23 +++++++++++++++-------- chrome_point_plus/js/point-plus.js | 4 ++++ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/chrome_point_plus/js/background.js b/chrome_point_plus/js/background.js index 9df711e..d4fe28d 100644 --- a/chrome_point_plus/js/background.js +++ b/chrome_point_plus/js/background.js @@ -94,7 +94,7 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) { sendResponse(true); - // Fuck You, Chrome API documentation!!11 + // Fuck You, Chrome API documentation! return true; break; @@ -110,9 +110,10 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) { sendResponse(true); console.info('JS file executed: "%s"', message.file); + return true; }); - // Fuck You, Chrome API documentation!!11 + // Fuck You, Chrome API documentation! return true; break; @@ -126,7 +127,6 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) { console.info('All scripts executed'); sendResponse(true); - return true; }); } else { @@ -139,7 +139,7 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) { console.warn('No scripts executed (empty script array)'); } - // Fuck You, Chrome API documentation!!11 + // Fuck You, Chrome API documentation! return true; break; @@ -151,12 +151,13 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) { chrome.tabs.insertCSS(sender.tab.id ? sender.tab.id : null, { file: message.file }, function() { - sendResponse(true); + // @todo message response callback processing + //sendResponse(true); console.info('CSS file "%s" injected', message.file); }); - // Fuck You, Chrome API documentation!!11 + // Fuck You, Chrome API documentation! return true; break; @@ -165,13 +166,19 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) { chrome.tabs.insertCSS(sender.tab.id ? sender.tab.id : null, { code: message.code }, function() { - sendResponse(true); + // @todo message response callback processing + //sendResponse(true); console.info('CSS code injected: \n%s', message.file); }); } - // Fuck You, Chrome API documentation!!11 + // Fuck You, Chrome API documentation! + return true; + break; + + default: + sendResponse(false); return true; break; } diff --git a/chrome_point_plus/js/point-plus.js b/chrome_point_plus/js/point-plus.js index f13a0b0..5012006 100644 --- a/chrome_point_plus/js/point-plus.js +++ b/chrome_point_plus/js/point-plus.js @@ -151,6 +151,7 @@ $(document).ready(function() { if (options.is('option_fancybox')) { // Injecting Fancybox to the page // CSS + // @todo message response callback processing chrome.runtime.sendMessage({ type: 'injectCSSFile', file: 'vendor/fancybox/source/jquery.fancybox.css' @@ -305,10 +306,12 @@ $(document).ready(function() { $('#new-post-form #text-input, .post-content #text-input').addClass('markitup').css('height', '20em'); // CSS + // @todo message response callback processing chrome.runtime.sendMessage({ type: 'injectCSSFile', file: 'vendor/markitup/markitup/skins/markitup/style.css' }); + // @todo message response callback processing chrome.runtime.sendMessage({ type: 'injectCSSFile', file: 'css/markitup/sets/markdown/style.css' @@ -575,6 +578,7 @@ $(document).ready(function() { } // @ before username if (options.is('option_at_before_username')) { + // @todo message response callback processing chrome.runtime.sendMessage({ type: 'injectCSSFile', file: 'css/modules/at_before_username.css'