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

Unified Diff: block.js

Issue 16067002: Added Safari Support (Closed)
Patch Set: Rebased and changed icon to 16px (for Safari) and 19px again (for Chrome) Created Nov. 2, 2013, 5:50 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
« no previous file with comments | « background.js ('k') | chrome/background.js » ('j') | chrome/background.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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]
}
« no previous file with comments | « background.js ('k') | chrome/background.js » ('j') | chrome/background.js » ('J')

Powered by Google App Engine
This is Rietveld