Index: block.js |
=================================================================== |
--- a/block.js |
+++ b/block.js |
@@ -29,21 +29,18 @@ |
// Apply jQuery UI styles |
$("button").button(); |
- chrome.extension.sendRequest( |
+ ext.backgroundPage.sendMessage({ |
Felix Dahlke
2013/11/10 01:07:00
I know the coding style put this differently, but
|
+ type: "forward", |
+ payload: |
{ |
- reqtype: "forward", |
- request: |
- { |
- reqtype: "clickhide-init", |
- width: Math.max(document.body.offsetWidth || document.body.scrollWidth), |
- height: Math.max(document.body.offsetHeight || document.body.scrollHeight) |
- } |
- }, |
- function(response) |
- { |
- document.getElementById("filters").value = response.filters.join("\n"); |
+ type: "clickhide-init", |
+ width: Math.max(document.body.offsetWidth || document.body.scrollWidth), |
+ height: Math.max(document.body.offsetHeight || document.body.scrollHeight) |
} |
- ); |
+ }, |
+ function(response) { |
Felix Dahlke
2013/11/10 01:07:00
Opening brace should go on its own line.
|
+ document.getElementById("filters").value = response.filters.join("\n"); |
+ }); |
document.getElementById("filters").focus(); |
} |
@@ -69,18 +66,18 @@ |
var filters = document.getElementById("filters").value.split(/[\r\n]+/) |
.map(function(f) {return f.replace(/^\s+/, "").replace(/\s+$/, "");}) |
.filter(function(f) {return f != "";}); |
- chrome.extension.sendRequest({reqtype: "add-filters", filters: filters}); |
+ ext.backgroundPage.sendMessage({type: "add-filters", filters: filters}); |
closeDialog(true); |
} |
function closeDialog(success) |
{ |
- chrome.extension.sendRequest( |
+ ext.backgroundPage.sendMessage( |
{ |
- reqtype: "forward", |
- request: |
+ type: "forward", |
+ payload: |
{ |
- reqtype: "clickhide-close", |
+ type: "clickhide-close", |
remove: (typeof success == "boolean" ? success : false) |
} |
} |
@@ -104,12 +101,12 @@ |
var diff = [event.screenX - dragCoords[0], event.screenY - dragCoords[1]]; |
if (diff[0] || diff[1]) |
{ |
- chrome.extension.sendRequest( |
+ ext.backgroundPage.sendMessage( |
{ |
- reqtype: "forward", |
- request: |
+ type: "forward", |
+ payload: |
{ |
- reqtype: "clickhide-move", |
+ type: "clickhide-move", |
x: diff[0], |
y: diff[1] |
} |