From 98982c6145abebe055861c1ce961f564d9b4c781 Mon Sep 17 00:00:00 2001 From: isqua Date: Wed, 28 Jan 2015 00:09:22 +0300 Subject: [PATCH] Fix codestyle in background.js --- chrome_point_plus/js/background.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/chrome_point_plus/js/background.js b/chrome_point_plus/js/background.js index c0874f1..e2f09cd 100644 --- a/chrome_point_plus/js/background.js +++ b/chrome_point_plus/js/background.js @@ -42,6 +42,7 @@ function injectFiles(files, injectOne, onAllInjected, results) { * @constructor Менеджер сообщений */ function MessageListener() { + /* jshint unused:false */ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) { if (this.isMethodAvailable(message)) { console.info('Call #%s() method for tab #%s', message.type, this.getTabId(sender)); @@ -54,6 +55,7 @@ function MessageListener() { return false; } }.bind(this)); + /* jshint unused:true */ } /** @@ -121,7 +123,7 @@ MessageListener.prototype.getManifestVersion = function(message, sender, sendRes MessageListener.prototype.getFiles = function(message, defaultRunAt) { var files; - if ( ! message.files) { + if (! message.files) { return false; } else { files = Array.isArray(message.files) ? message.files : [ message.files ]; @@ -147,7 +149,7 @@ MessageListener.prototype.executeJSFiles = function(message, sender, sendRespons injectFiles( this.getFiles(message, 'document_end'), function(file, callback) { - chrome.tabs.executeScript(tabId, file, callback) + chrome.tabs.executeScript(tabId, file, callback); }, sendResponse ); @@ -169,7 +171,6 @@ MessageListener.prototype.injectCSSFiles = function(message, sender, sendRespons }, sendResponse ); - }; new MessageListener(); @@ -185,6 +186,8 @@ chrome.storage.sync.get('options_version', function(data) { // Adding notification click event listener chrome.notifications.onClicked.addListener(function(notificationId) { + var tab_url; + // Detecting notification type if (notificationId.indexOf('comment_') === 0) { tab_url = 'https://point.im/' + notificationId.replace(/comment_/g, '');