Skip to content

Commit

Permalink
Merge pull request #179 from neocotic/linux-bug
Browse files Browse the repository at this point in the history
Linux bug fix
  • Loading branch information
neocotic committed May 7, 2013
2 parents 38ab35d + 7449ff4 commit a6afcf3
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions chrome/bin/lib/background.js
Expand Up @@ -2220,8 +2220,8 @@
type: 'toolbar'
});
});
chrome.runtime.onMessage.addListener(onMessage);
chrome.runtime.onMessageExternal.addListener(onMessageExternal);
chrome.extension.onMessage.addListener(onMessage);
chrome.extension.onMessageExternal.addListener(onMessageExternal);
browser.version = getBrowserVersion();
operatingSystem = getOperatingSystem();
if (isNewInstall) {
Expand Down
6 changes: 3 additions & 3 deletions chrome/bin/lib/content.js
Expand Up @@ -108,7 +108,7 @@
return node.value = str;
};

chrome.runtime.sendMessage({
chrome.extension.sendMessage({
type: 'info'
}, function(data) {
var isMac;
Expand Down Expand Up @@ -137,7 +137,7 @@
key = String.fromCharCode(e.keyCode).toUpperCase();
if (__indexOf.call(hotkeys, key) >= 0) {
elements.field = (_ref = e.target.nodeName) === 'INPUT' || _ref === 'TEXTAREA' ? e.target : null;
chrome.runtime.sendMessage({
chrome.extension.sendMessage({
data: {
key: key
},
Expand All @@ -147,7 +147,7 @@
}
}
});
return chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
return chrome.extension.onMessage.addListener(function(message, sender, sendResponse) {
var callback, container, contents, href, images, info, key, link, links, node, nodes, result, selection, src, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3;

callback = function() {
Expand Down
2 changes: 1 addition & 1 deletion chrome/bin/lib/install.js
Expand Up @@ -4,7 +4,7 @@
// For all details and documentation:
// <http://neocotic.com/template>
(function() {
chrome.runtime.sendMessage({
chrome.extension.sendMessage({
type: 'info'
}, function(data) {
var cls, link, newClasses, oldClasses, _i, _j, _len, _len1, _ref, _results;
Expand Down
2 changes: 1 addition & 1 deletion chrome/bin/lib/popup.js
Expand Up @@ -21,7 +21,7 @@
type: this.getAttribute('data-type')
};
log.debug('Sending the following message to the extension controller', message);
return chrome.runtime.sendMessage(message);
return chrome.extension.sendMessage(message);
};

popup = window.popup = new (Popup = (function(_super) {
Expand Down
2 changes: 1 addition & 1 deletion chrome/bin/lib/utils.js
Expand Up @@ -163,7 +163,7 @@
Utils.prototype.url = function() {
var _ref1;

return (_ref1 = chrome.runtime).getURL.apply(_ref1, arguments);
return (_ref1 = chrome.extension).getURL.apply(_ref1, arguments);
};

return Utils;
Expand Down
4 changes: 2 additions & 2 deletions chrome/src/lib/background.coffee
Expand Up @@ -1859,8 +1859,8 @@ ext = window.ext = new class Extension extends utils.Class
data: key: store.get 'toolbar.key'
type: 'toolbar'
# Add listeners for internal and external messages.
chrome.runtime.onMessage.addListener onMessage
chrome.runtime.onMessageExternal.addListener onMessageExternal
chrome.extension.onMessage.addListener onMessage
chrome.extension.onMessageExternal.addListener onMessageExternal

# Derive the browser and OS information.
browser.version = do getBrowserVersion
Expand Down
6 changes: 3 additions & 3 deletions chrome/src/lib/content.coffee
Expand Up @@ -84,7 +84,7 @@ paste = (node, value) ->

# Wrap the function functionality in a message for Template's extension ID and current version so
# that it can be used to detect previous injections.
chrome.runtime.sendMessage type: 'info', (data) ->
chrome.extension.sendMessage type: 'info', (data) ->
hotkeys = data.hotkeys
isMac = navigator.userAgent.toLowerCase().indexOf('mac') isnt -1

Expand All @@ -108,14 +108,14 @@ chrome.runtime.sendMessage type: 'info', (data) ->
if key in hotkeys
elements.field = if e.target.nodeName in ['INPUT', 'TEXTAREA'] then e.target else null

chrome.runtime.sendMessage
chrome.extension.sendMessage
data: key: key
type: 'shortcut'
e.preventDefault()

# Add a listener to provide the background page with information that is extracted from the DOM
# or perform auto-paste functionality.
chrome.runtime.onMessage.addListener (message, sender, sendResponse) ->
chrome.extension.onMessage.addListener (message, sender, sendResponse) ->
# Safely handle callback functionality.
callback = (args...) ->
if typeof sendResponse is 'function'
Expand Down
2 changes: 1 addition & 1 deletion chrome/src/lib/install.coffee
Expand Up @@ -8,7 +8,7 @@
# -------------

# Wrap the functionality in a message for Template's details in order to get the ID in use.
chrome.runtime.sendMessage type: 'info', (data) ->
chrome.extension.sendMessage type: 'info', (data) ->
# Names of the classes to be added to the targeted elements.
newClasses = ['disabled']
# Names of the classes to be removed from the targeted elements.
Expand Down
2 changes: 1 addition & 1 deletion chrome/src/lib/popup.coffee
Expand Up @@ -22,7 +22,7 @@ sendMessage = ->
type: @getAttribute 'data-type'

log.debug 'Sending the following message to the extension controller', message
chrome.runtime.sendMessage message
chrome.extension.sendMessage message

# Popup page setup
# ----------------
Expand Down
4 changes: 2 additions & 2 deletions chrome/src/lib/utils.coffee
Expand Up @@ -108,9 +108,9 @@ utils = window.utils = new class Utils extends Class
trimToUpper: (str = '') ->
str.trim().toUpperCase()

# Convenient shorthand for `chrome.runtime.getURL`.
# Convenient shorthand for `chrome.extension.getURL`.
url: ->
chrome.runtime.getURL arguments...
chrome.extension.getURL arguments...

# Public classes
# --------------
Expand Down

0 comments on commit a6afcf3

Please sign in to comment.