Moar fixes.

This commit is contained in:
Alexey Skobkin 2015-01-07 08:43:17 +04:00
parent 93a24c57d4
commit 0dae3f8661
2 changed files with 19 additions and 8 deletions

View file

@ -94,7 +94,7 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
sendResponse(true); sendResponse(true);
// Fuck You, Chrome API documentation!!11 // Fuck You, Chrome API documentation!
return true; return true;
break; break;
@ -110,9 +110,10 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
sendResponse(true); sendResponse(true);
console.info('JS file executed: "%s"', message.file); console.info('JS file executed: "%s"', message.file);
return true;
}); });
// Fuck You, Chrome API documentation!!11 // Fuck You, Chrome API documentation!
return true; return true;
break; break;
@ -126,7 +127,6 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
console.info('All scripts executed'); console.info('All scripts executed');
sendResponse(true); sendResponse(true);
return true; return true;
}); });
} else { } else {
@ -139,7 +139,7 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
console.warn('No scripts executed (empty script array)'); console.warn('No scripts executed (empty script array)');
} }
// Fuck You, Chrome API documentation!!11 // Fuck You, Chrome API documentation!
return true; return true;
break; break;
@ -151,12 +151,13 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
chrome.tabs.insertCSS(sender.tab.id ? sender.tab.id : null, { chrome.tabs.insertCSS(sender.tab.id ? sender.tab.id : null, {
file: message.file file: message.file
}, function() { }, function() {
sendResponse(true); // @todo message response callback processing
//sendResponse(true);
console.info('CSS file "%s" injected', message.file); console.info('CSS file "%s" injected', message.file);
}); });
// Fuck You, Chrome API documentation!!11 // Fuck You, Chrome API documentation!
return true; return true;
break; break;
@ -165,13 +166,19 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
chrome.tabs.insertCSS(sender.tab.id ? sender.tab.id : null, { chrome.tabs.insertCSS(sender.tab.id ? sender.tab.id : null, {
code: message.code code: message.code
}, function() { }, function() {
sendResponse(true); // @todo message response callback processing
//sendResponse(true);
console.info('CSS code injected: \n%s', message.file); 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; return true;
break; break;
} }

View file

@ -151,6 +151,7 @@ $(document).ready(function() {
if (options.is('option_fancybox')) { if (options.is('option_fancybox')) {
// Injecting Fancybox to the page // Injecting Fancybox to the page
// CSS // CSS
// @todo message response callback processing
chrome.runtime.sendMessage({ chrome.runtime.sendMessage({
type: 'injectCSSFile', type: 'injectCSSFile',
file: 'vendor/fancybox/source/jquery.fancybox.css' 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'); $('#new-post-form #text-input, .post-content #text-input').addClass('markitup').css('height', '20em');
// CSS // CSS
// @todo message response callback processing
chrome.runtime.sendMessage({ chrome.runtime.sendMessage({
type: 'injectCSSFile', type: 'injectCSSFile',
file: 'vendor/markitup/markitup/skins/markitup/style.css' file: 'vendor/markitup/markitup/skins/markitup/style.css'
}); });
// @todo message response callback processing
chrome.runtime.sendMessage({ chrome.runtime.sendMessage({
type: 'injectCSSFile', type: 'injectCSSFile',
file: 'css/markitup/sets/markdown/style.css' file: 'css/markitup/sets/markdown/style.css'
@ -575,6 +578,7 @@ $(document).ready(function() {
} }
// @ before username // @ before username
if (options.is('option_at_before_username')) { if (options.is('option_at_before_username')) {
// @todo message response callback processing
chrome.runtime.sendMessage({ chrome.runtime.sendMessage({
type: 'injectCSSFile', type: 'injectCSSFile',
file: 'css/modules/at_before_username.css' file: 'css/modules/at_before_username.css'