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

Unified Diff: block.js

Issue 16067002: Added Safari Support (Closed)
Patch Set: Created Oct. 21, 2013, 8:11 p.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
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/10/24 16:30:34 Opening braces should go on their own line, likewi
Sebastian Noack 2013/10/25 09:55:03 I though except for object literals, as we have he
Felix Dahlke 2013/10/25 14:43:08 Um, yes, nevermind :)
+ 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 +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]
}

Powered by Google App Engine
This is Rietveld