Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: block.js

Issue 16067002: Added Safari Support (Closed)
Patch Set: Bugfixes Created Nov. 15, 2013, 8:58 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « background.js ('k') | chrome/background.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: block.js
===================================================================
--- a/block.js
+++ b/block.js
@@ -29,21 +29,20 @@
// Apply jQuery UI styles
$("button").button();
- chrome.extension.sendRequest(
+ ext.backgroundPage.sendMessage(
+ {
+ 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)
+ {
+ document.getElementById("filters").value = response.filters.join("\n");
+ });
document.getElementById("filters").focus();
}
@@ -69,18 +68,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 +103,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]
}
« no previous file with comments | « background.js ('k') | chrome/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld